Merged revisions 1075177 via svnmerge from 
https://svn.kde.org/home/kde/trunk/KDE/kdepim

........
  r1075177 | mlaurent | 2010-01-15 11:21:12 -0500 (Fri, 15 Jan 2010) | 3 lines
  
  Enable/disable find/findnext/replace action when we can launch function.
  MERGE: akonadi-ports
........

svn path=/branches/work/akonadi-ports/kdepim/; revision=1075823
wilder-work
Allen Winter 16 years ago
parent 79633533e2
commit 11d2b5a297
  1. 19
      kmcomposewin.cpp
  2. 4
      kmcomposewin.h

@ -310,7 +310,8 @@ KMComposeWin::KMComposeWin( const KMime::Message::Ptr &aMsg, Composer::TemplateC
}
mEditor = new KMComposerEditor( this, editorAndCryptoStateIndicators );
connect( mEditor, SIGNAL(textChanged()),
this, SLOT(slotEditorTextChanged()) );
vbox->addLayout( hbox );
vbox->addWidget( mEditor );
mSnippetSplitter->insertWidget( 0, editorAndCryptoStateIndicators );
@ -439,6 +440,14 @@ QString KMComposeWin::dbusObjectPath() const
return mdbusObjectPath;
}
void KMComposeWin::slotEditorTextChanged()
{
const bool textIsNotEmpty = !mEditor->document()->isEmpty();
mFindText->setEnabled( textIsNotEmpty );
mFindNextText->setEnabled( textIsNotEmpty );
mReplaceText->setEnabled( textIsNotEmpty );
}
//-----------------------------------------------------------------------------
void KMComposeWin::send( int how )
{
@ -1207,12 +1216,12 @@ void KMComposeWin::setupActions( void )
KStandardAction::pasteText( this, SLOT(slotPaste()), actionCollection() );
KStandardAction::selectAll( this, SLOT(slotMarkAll()), actionCollection() );
KStandardAction::find( mEditor, SLOT(slotFind()), actionCollection() );
KStandardAction::findNext( mEditor, SLOT(slotFindNext()), actionCollection() );
mFindText = KStandardAction::find( mEditor, SLOT(slotFind()), actionCollection() );
mFindNextText = KStandardAction::findNext( mEditor, SLOT(slotFindNext()), actionCollection() );
KStandardAction::replace( mEditor, SLOT(slotReplace()), actionCollection() );
mReplaceText = KStandardAction::replace( mEditor, SLOT(slotReplace()), actionCollection() );
actionCollection()->addAction( KStandardAction::Spelling, "spellcheck",
mEditor, SLOT( checkSpelling() ) );
mEditor, SLOT(checkSpelling()) );
action = new KAction( i18n("Paste as Attac&hment"), this );
actionCollection()->addAction( "paste_att", action );

@ -327,6 +327,8 @@ class KMComposeWin : public KMail::Composer
//void slotEditDone( KMail::EditorWatcher* watcher );
void slotLanguageChanged( const QString &language );
void slotEditorTextChanged();
public slots: // kmkernel
/**
Tell the composer to always send the message, even if the user
@ -699,6 +701,8 @@ class KMComposeWin : public KMail::Composer
CodecAction *mCodecAction;
KSelectAction *mCryptoModuleAction;
KAction *mFindText, *mFindNextText, *mReplaceText;
bool mAlwaysSend;
QStringList mFolderNames;

Loading…
Cancel
Save