From 2d690680d4357f3545345fd85163362e52e7a675 Mon Sep 17 00:00:00 2001 From: Thomas McGuire Date: Sun, 18 Jan 2009 14:39:03 +0000 Subject: [PATCH] Move more actions to kmcomposereditor: paste as quotation and add/remove quote chars. svn path=/trunk/KDE/kdepim/; revision=912956 --- kmcomposereditor.cpp | 12 ++++++++++++ kmcomposereditor.h | 5 ++++- kmcomposewin.cpp | 12 ------------ kmcomposewin.h | 9 ++++----- 4 files changed, 20 insertions(+), 18 deletions(-) diff --git a/kmcomposereditor.cpp b/kmcomposereditor.cpp index 7a7057039..7880a82a4 100644 --- a/kmcomposereditor.cpp +++ b/kmcomposereditor.cpp @@ -57,6 +57,18 @@ void KMComposerEditor::createActions( KActionCollection *actionCollection ) actionAddImage = new KAction( KIcon( "insert-image" ), i18n("Add Image"), this ); actionCollection->addAction( "add_image", actionAddImage ); connect( actionAddImage, SIGNAL(triggered(bool) ), SLOT( slotAddImage() ) ); + + mPasteQuotation = new KAction( i18n("Pa&ste as Quotation"), this ); + actionCollection->addAction("paste_quoted", mPasteQuotation ); + connect( mPasteQuotation, SIGNAL(triggered(bool) ), this, SLOT( slotPasteAsQuotation()) ); + + mAddQuoteChars = new KAction( i18n("Add &Quote Characters"), this ); + actionCollection->addAction( "tools_quote", mAddQuoteChars ); + connect( mAddQuoteChars, SIGNAL(triggered(bool) ), this, SLOT(slotAddQuotes()) ); + + mRemQuoteChars = new KAction( i18n("Re&move Quote Characters"), this ); + actionCollection->addAction( "tools_unquote", mRemQuoteChars ); + connect (mRemQuoteChars, SIGNAL(triggered(bool) ), this, SLOT(slotRemoveQuotes()) ); } void KMComposerEditor::changeHighlighterColors(KPIM::KEMailQuotingHighlighter * highlighter) diff --git a/kmcomposereditor.h b/kmcomposereditor.h index 8e5f33c37..cecf91cf4 100644 --- a/kmcomposereditor.h +++ b/kmcomposereditor.h @@ -61,6 +61,9 @@ class KMComposerEditor : public KMeditor * * The additional action XML names are: * - add_image + * - paste_quoted + * - tools_quote + * - tools_unquote */ virtual void createActions( KActionCollection *actionCollection ); @@ -144,7 +147,7 @@ class KMComposerEditor : public KMeditor KMComposeWin *m_composerWin; QString m_quotePrefix; - KAction *actionAddImage; + KAction *actionAddImage, *mPasteQuotation, *mAddQuoteChars, *mRemQuoteChars; /** * The names of embedded images. diff --git a/kmcomposewin.cpp b/kmcomposewin.cpp index 911aaa09c..58f187475 100644 --- a/kmcomposewin.cpp +++ b/kmcomposewin.cpp @@ -1104,22 +1104,10 @@ void KMComposeWin::setupActions( void ) actionCollection()->addAction( KStandardAction::Spelling, "spellcheck", mEditor, SLOT( checkSpelling() ) ); - mPasteQuotation = new KAction( i18n("Pa&ste as Quotation"), this ); - actionCollection()->addAction("paste_quoted", mPasteQuotation ); - connect( mPasteQuotation, SIGNAL(triggered(bool) ), mEditor, SLOT( slotPasteAsQuotation()) ); - action = new KAction( i18n("Paste as Attac&hment"), this ); actionCollection()->addAction( "paste_att", action ); connect( action, SIGNAL(triggered(bool) ), SLOT( slotPasteAsAttachment()) ); - mAddQuoteChars = new KAction( i18n("Add &Quote Characters"), this ); - actionCollection()->addAction( "tools_quote", mAddQuoteChars ); - connect( mAddQuoteChars, SIGNAL(triggered(bool) ), mEditor, SLOT(slotAddQuotes()) ); - - mRemQuoteChars = new KAction( i18n("Re&move Quote Characters"), this ); - actionCollection()->addAction( "tools_unquote", mRemQuoteChars ); - connect (mRemQuoteChars, SIGNAL(triggered(bool) ),mEditor, SLOT(slotRemoveQuotes()) ); - mCleanSpace = new KAction( i18n("Cl&ean Spaces"), this ); actionCollection()->addAction( "clean_spaces", mCleanSpace ); connect( mCleanSpace, SIGNAL(triggered(bool) ), SLOT(slotCleanSpace()) ); diff --git a/kmcomposewin.h b/kmcomposewin.h index 298f99509..2a491732c 100644 --- a/kmcomposewin.h +++ b/kmcomposewin.h @@ -711,8 +711,8 @@ class KMComposeWin : public KMail::Composer QList mAtmItemList; QList mAtmList; QMenu *mAttachMenu; - QAction *mOpenId, *mViewId, *mRemoveId, *mSaveAsId, *mPropertiesId, *mEditAction, *mEditWithAction; - QAction *mCleanSpace; + QAction *mOpenId, *mViewId, *mRemoveId, *mSaveAsId, *mPropertiesId, + *mEditAction, *mEditWithAction; bool mAutoDeleteMsg; bool mSigningAndEncryptionExplicitlyDisabled; bool mLastSignActionState, mLastEncryptActionState; @@ -729,9 +729,8 @@ class KMComposeWin : public KMail::Composer QPalette mPalette; uint mId; - KAction *mAttachPK, *mAttachMPK, - *mAttachRemoveAction, *mAttachSaveAction, *mAttachPropertiesAction, - *mPasteQuotation, *mAddQuoteChars, *mRemQuoteChars; + KAction *mAttachPK, *mAttachMPK, *mAttachRemoveAction, *mAttachSaveAction, + *mAttachPropertiesAction, *mCleanSpace; KRecentFilesAction *mRecentAction; KToggleAction *mSignAction, *mEncryptAction, *mRequestMDNAction;