Move sonnect::dictionary to composerviewbase. Start to create autotest

wilder-work
Montel Laurent 11 years ago
parent 71c56a0900
commit 758bad95b7
  1. 23
      editor/kmcomposewin.cpp
  2. 5
      editor/kmcomposewin.h

@ -285,8 +285,9 @@ KMComposeWin::KMComposeWin( const KMime::Message::Ptr &aMsg, bool lastSignState,
sigController->setIdentityCombo( identity );
sigController->suspend(); // we have to do identity change tracking ourselves due to the template code
mDictionaryCombo = new DictionaryComboBox( mHeadersArea );
mDictionaryCombo->setToolTip( i18n( "Select the dictionary to use when spell-checking this message" ) );
Sonnet::DictionaryComboBox *dictionaryCombo = new DictionaryComboBox( mHeadersArea );
dictionaryCombo->setToolTip( i18n( "Select the dictionary to use when spell-checking this message" ) );
mComposerBase->setDictionary(dictionaryCombo);
mFccFolder = new MailCommon::FolderRequester( mHeadersArea );
mFccFolder->setNotAllowToCreateNewFolder( true );
@ -376,7 +377,7 @@ KMComposeWin::KMComposeWin( const KMime::Message::Ptr &aMsg, bool lastSignState,
editor->setAcceptDrops( true );
connect(sigController, SIGNAL(signatureAdded()), mComposerBase->editor(), SLOT(startExternalEditor()));
connect( mDictionaryCombo, SIGNAL(dictionaryChanged(QString)),
connect( mComposerBase->dictionary(), SIGNAL(dictionaryChanged(QString)),
this, SLOT(slotSpellCheckingLanguage(QString)) );
connect( editor, SIGNAL(languageChanged(QString)),
@ -637,9 +638,9 @@ void KMComposeWin::readConfig( bool reload /* = false */ )
if ( mBtnDictionary->isChecked() ) {
mDictionaryCombo->setCurrentByDictionaryName( GlobalSettings::self()->previousDictionary() );
mComposerBase->dictionary()->setCurrentByDictionaryName( GlobalSettings::self()->previousDictionary() );
} else {
mDictionaryCombo->setCurrentByDictionaryName( ident.dictionary() );
mComposerBase->dictionary()->setCurrentByDictionaryName( ident.dictionary() );
}
QString fccName;
@ -664,7 +665,7 @@ void KMComposeWin::writeConfig( void )
GlobalSettings::self()->setPreviousIdentity( mComposerBase->identityCombo()->currentIdentity() );
}
GlobalSettings::self()->setPreviousFcc( QString::number(mFccFolder->collection().id()) );
GlobalSettings::self()->setPreviousDictionary( mDictionaryCombo->currentDictionaryName() );
GlobalSettings::self()->setPreviousDictionary( mComposerBase->dictionary()->currentDictionaryName() );
GlobalSettings::self()->setAutoSpellChecking(
mAutoSpellCheckingAction->isChecked() );
MessageViewer::GlobalSettings::self()->setUseFixedFont( mFixedFontAction->isChecked() );
@ -841,7 +842,7 @@ void KMComposeWin::rethinkFields( bool fromSlot )
mDictionaryAction->setChecked( abs( mShowHeaders )&HDR_DICTIONARY );
}
rethinkHeaderLine( showHeaders,HDR_DICTIONARY, row, mDictionaryLabel,
mDictionaryCombo, mBtnDictionary );
mComposerBase->dictionary(), mBtnDictionary );
if ( !fromSlot ) {
mFccAction->setChecked( abs( mShowHeaders )&HDR_FCC );
@ -1726,7 +1727,7 @@ void KMComposeWin::setMessage( const KMime::Message::Ptr &newMsg, bool lastSignS
dictionary = ident.dictionary();
}
mDictionaryCombo->setCurrentByDictionaryName( dictionary );
mComposerBase->dictionary()->setCurrentByDictionaryName( dictionary );
}
mEdtReplyTo->setText( mMsg->replyTo()->asUnicodeString() );
@ -3229,9 +3230,9 @@ void KMComposeWin::slotIdentityChanged( uint uoid, bool initalChange )
if ( !mBtnDictionary->isChecked() && !mIgnoreStickyFields ) {
mDictionaryCombo->setCurrentByDictionaryName( ident.dictionary() );
mComposerBase->dictionary()->setCurrentByDictionaryName( ident.dictionary() );
}
slotSpellCheckingLanguage( mDictionaryCombo->currentDictionary() );
slotSpellCheckingLanguage( mComposerBase->dictionary()->currentDictionary() );
if ( !mBtnFcc->isChecked() && !mPreventFccOverwrite ) {
setFcc( ident.fcc() );
}
@ -3409,7 +3410,7 @@ void KMComposeWin::updateSignatureAndEncryptionStateIndicators()
void KMComposeWin::slotLanguageChanged( const QString &language )
{
mDictionaryCombo->setCurrentByDictionary( language );
mComposerBase->dictionary()->setCurrentByDictionary( language );
}

@ -75,10 +75,6 @@ namespace boost {
template <typename T> class shared_ptr;
}
namespace Sonnet {
class DictionaryComboBox;
}
namespace KPIMIdentities {
class Identity;
}
@ -607,7 +603,6 @@ private:
private:
int validateLineWrapWidth();
QWidget *mMainWidget;
Sonnet::DictionaryComboBox *mDictionaryCombo;
MessageComposer::ComposerLineEdit *mEdtFrom, *mEdtReplyTo;
PimCommon::LineEditWithAutoCorrection *mEdtSubject;
QLabel *mLblIdentity, *mLblTransport, *mLblFcc;

Loading…
Cancel
Save