From d19df875558486f868c3b7017a501807b8564943 Mon Sep 17 00:00:00 2001 From: Andras Mantia Date: Tue, 24 Feb 2009 14:24:45 +0000 Subject: [PATCH 01/11] Deprecated-- svn path=/branches/kdepim/enterprise4/kdepim/; revision=930937 --- configuredialog.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/configuredialog.cpp b/configuredialog.cpp index 90a62b45e..2e3a3ef90 100644 --- a/configuredialog.cpp +++ b/configuredialog.cpp @@ -2924,10 +2924,9 @@ ComposerPageGeneralTab::ComposerPageGeneralTab( QWidget * parent ) this, SLOT( slotEmitChanged( void ) ) ); QString recipientCheckWhatsthis = - i18n( GlobalSettings::self()->tooManyRecipientsItem()->whatsThis().utf8() ); - QWhatsThis::add( mRecipientCheck, recipientCheckWhatsthis ); - QToolTip::add( mRecipientCheck, - i18n( "Warn if too many recipients are specified" ) ); + i18n( GlobalSettings::self()->tooManyRecipientsItem()->whatsThis().toUtf8() ); + mRecipientCheck->setWhatsThis( recipientCheckWhatsthis ); + mRecipientCheck->setToolTip( i18n( "Warn if too many recipients are specified" ) ); mRecipientSpin = new KIntSpinBox( 1/*min*/, 255/*max*/, 1/*step*/, 5/*init*/, this ); @@ -2937,10 +2936,9 @@ ComposerPageGeneralTab::ComposerPageGeneralTab( QWidget * parent ) this, SLOT( slotEmitChanged( void ) ) ); QString recipientWhatsthis = - i18n( GlobalSettings::self()->recipientThresholdItem()->whatsThis().utf8() ); - QWhatsThis::add( mRecipientSpin, recipientWhatsthis ); - QToolTip::add( mRecipientSpin, - i18n( "Warn if more than this many recipients are specified" ) ); + i18n( GlobalSettings::self()->recipientThresholdItem()->whatsThis().toUtf8() ); + mRecipientSpin->setWhatsThis( recipientWhatsthis ); + mRecipientSpin->setToolTip( i18n( "Warn if more than this many recipients are specified" ) ); hlay->addWidget( mRecipientSpin ); From 35e62b6fc5fd43faa8142da169ce0d7076626776 Mon Sep 17 00:00:00 2001 From: Thomas McGuire Date: Wed, 25 Feb 2009 15:07:08 +0000 Subject: [PATCH 02/11] Merged revisions 931309 via svnmerge from svn+ssh://tmcguire@svn.kde.org/home/kde/branches/KDE/4.2/kdepim ........ r931309 | tmcguire | 2009-02-25 09:13:25 +0100 (Wed, 25 Feb 2009) | 5 lines Backport r930563 by bettio from trunk to the 4.2 branch: Fixing crash: we musn't delete mValidator. ........ svn path=/branches/kdepim/enterprise4/kdepim/; revision=931608 --- accountdialog.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/accountdialog.cpp b/accountdialog.cpp index e864c2406..ee48d41e9 100644 --- a/accountdialog.cpp +++ b/accountdialog.cpp @@ -290,7 +290,7 @@ AccountDialog::AccountDialog( const QString & caption, KMAccount *account, { setCaption( caption ); setButtons( Ok|Cancel|Help ); - mValidator = new QRegExpValidator( QRegExp( "[A-Za-z0-9-_:.]*" ), 0 ); + mValidator = new QRegExpValidator( QRegExp( "[A-Za-z0-9-_:.]*" ), this ); setHelp("receiving-mail"); KAccount::Type accountType = mAccount->type(); @@ -328,8 +328,6 @@ AccountDialog::AccountDialog( const QString & caption, KMAccount *account, AccountDialog::~AccountDialog() { - delete mValidator; - mValidator = 0; delete mServerTest; mServerTest = 0; } From a4b918ad533d67ffdc529e46b2669ed4555bfd31 Mon Sep 17 00:00:00 2001 From: Thomas McGuire Date: Wed, 25 Feb 2009 15:08:40 +0000 Subject: [PATCH 03/11] Merged revisions 931333 via svnmerge from svn+ssh://tmcguire@svn.kde.org/home/kde/branches/KDE/4.2/kdepim ........ r931333 | tmcguire | 2009-02-25 09:26:40 +0100 (Wed, 25 Feb 2009) | 17 lines Backport r929169 by tilladam from trunk to the 4.2 branch: Revert 928247 which forward ported a fix from enterprise35 via enterprise4 which I believe is wrong in all branches, but doesn't crash in e35, probably. Kleo jobs auto-delete, and thus do not need to be deleted again from KMail. The commit to e35 put the jobs in to auto_ptrs in KMail, which in e35 probably delete the jobs before the event loop is next reached (and thus before the job's deleteLater()) resulting in no crash. In e4 and trunk, because of the newly added event loop wrapping KleoJobExectuor, the deleteLater happens before the auto_ptr dtor resulting in a crash in that. Marc, am I missing something or does this need to be reverted in e35 and e4 as well? CCMAIL: mutz@kde.org ........ svn path=/branches/kdepim/enterprise4/kdepim/; revision=931609 --- objecttreeparser.cpp | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/objecttreeparser.cpp b/objecttreeparser.cpp index 34e158fec..098017236 100644 --- a/objecttreeparser.cpp +++ b/objecttreeparser.cpp @@ -449,20 +449,18 @@ namespace KMail { if ( doCheck && cryptProto ) { GpgME::VerificationResult result; if ( data ) { // detached - const std::auto_ptr job( cryptProto->verifyDetachedJob() ); - if ( job.get() ) { + if ( Kleo::VerifyDetachedJob * const job = cryptProto->verifyDetachedJob() ) { KleoJobExecutor executor; - result = executor.exec( job.get(), signaturetext, cleartext ); + result = executor.exec( job, signaturetext, cleartext ); messagePart.auditLogError = executor.auditLogError(); messagePart.auditLog = executor.auditLogAsHtml(); } else { cryptPlugError = CANT_VERIFY_SIGNATURES; } } else { // opaque - const std::auto_ptr job( cryptProto->verifyOpaqueJob() ); - if ( job.get() ) { + if ( Kleo::VerifyOpaqueJob * const job = cryptProto->verifyOpaqueJob() ) { KleoJobExecutor executor; - result = executor.exec( job.get(), signaturetext, cleartext ); + result = executor.exec( job, signaturetext, cleartext ); messagePart.auditLogError = executor.auditLogError(); messagePart.auditLog = executor.auditLogAsHtml(); } else { @@ -494,7 +492,7 @@ namespace KMail { messagePart.isGoodSignature = true; // get key for this signature - const std::auto_ptr job( cryptProto->keyListJob() ); + Kleo::KeyListJob *job = cryptProto->keyListJob(); std::vector keys; if ( signature.fingerprint() ) // if the fingerprint is empty, the keylisting would return all available keys GpgME::KeyListResult keyListRes = job->exec( QStringList( QString::fromLatin1( signature.fingerprint() ) ), @@ -706,14 +704,14 @@ bool ObjectTreeParser::okDecryptMIME( partNode& data, if ( mReader ) emit mReader->noDrag(); // in case pineentry pops up, don't let kmheaders start a drag afterwards - const std::auto_ptr job( cryptProto->decryptVerifyJob() ); - if ( !job.get() ) { + Kleo::DecryptVerifyJob* job = cryptProto->decryptVerifyJob(); + if ( !job ) { cryptPlugError = CANT_DECRYPT; cryptProto = 0; } else { QByteArray plainText; KleoJobExecutor executor; - const std::pair res = executor.exec( job.get(), ciphertext, plainText ); + const std::pair res = executor.exec( job, ciphertext, plainText ); const GpgME::DecryptionResult decryptResult = res.first; const GpgME::VerificationResult verifyResult = res.second; signatureFound = verifyResult.signatures().size() > 0; @@ -1492,9 +1490,9 @@ namespace KMail { const QByteArray certData = node->msgPart().bodyDecodedBinary(); - const std::auto_ptr import( smimeCrypto->importJob() ); + Kleo::ImportJob *import = smimeCrypto->importJob(); KleoJobExecutor executor; - const GpgME::ImportResult res = executor.exec( import.get(), certData ); + const GpgME::ImportResult res = executor.exec( import, certData ); if ( res.error() ) { htmlWriter()->queue( i18n( "Sorry, certificate could not be imported.
" "Reason: %1", QString::fromLocal8Bit( res.error().asString() ) ) ); @@ -1714,8 +1712,8 @@ bool ObjectTreeParser::decryptChiasmus( const QByteArray& data, QByteArray& body GlobalSettings::setChiasmusDecryptionKey( selectorDlg.key() ); assert( !GlobalSettings::chiasmusDecryptionKey().isEmpty() ); - const std::auto_ptr job( chiasmus->specialJob( "x-decrypt", QMap() ) ); - if ( !job.get() ) { + Kleo::SpecialJob * job = chiasmus->specialJob( "x-decrypt", QMap() ); + if ( !job ) { errorText = i18n( "Chiasmus backend does not offer the " "\"x-decrypt\" function. Please report this bug." ); return false; From 829abdcb17c6721c3bd3bae0a8232a67719e7f56 Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Thu, 26 Feb 2009 13:51:34 +0000 Subject: [PATCH 04/11] change the max recipient warning from 255 to 100, per Ingo. svn path=/branches/kdepim/enterprise4/kdepim/; revision=932375 --- configuredialog.cpp | 2 +- kmail.kcfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configuredialog.cpp b/configuredialog.cpp index 2e3a3ef90..bc52d4f28 100644 --- a/configuredialog.cpp +++ b/configuredialog.cpp @@ -2928,7 +2928,7 @@ ComposerPageGeneralTab::ComposerPageGeneralTab( QWidget * parent ) mRecipientCheck->setWhatsThis( recipientCheckWhatsthis ); mRecipientCheck->setToolTip( i18n( "Warn if too many recipients are specified" ) ); - mRecipientSpin = new KIntSpinBox( 1/*min*/, 255/*max*/, 1/*step*/, + mRecipientSpin = new KIntSpinBox( 1/*min*/, 100/*max*/, 1/*step*/, 5/*init*/, this ); mRecipientSpin->setObjectName( "kcfg_RecipientThreshold" ); mRecipientSpin->setEnabled( false ); diff --git a/kmail.kcfg b/kmail.kcfg index 0caebc35f..33d1125da 100644 --- a/kmail.kcfg +++ b/kmail.kcfg @@ -343,7 +343,7 @@ 5 1 - 255 + 100 If the number of recipients is larger than this value, KMail will warn and ask for a confirmation before sending the mail. The warning can be turned off. From f310af8292685026e19f79bcad51af97c90e975f Mon Sep 17 00:00:00 2001 From: Thomas McGuire Date: Fri, 27 Feb 2009 12:51:02 +0000 Subject: [PATCH 05/11] SVN_SILENT warning-- svn path=/branches/kdepim/enterprise4/kdepim/; revision=932773 --- kmfolderimap.cpp | 2 +- kmfolderimap.h | 4 ++-- kmmessagetag.h | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/kmfolderimap.cpp b/kmfolderimap.cpp index 2c3eb33aa..440e56d03 100644 --- a/kmfolderimap.cpp +++ b/kmfolderimap.cpp @@ -2458,7 +2458,7 @@ bool KMFolderImap::isMoveable() const } //----------------------------------------------------------------------------- -const ulong KMFolderImap::serNumForUID( ulong uid ) +ulong KMFolderImap::serNumForUID( ulong uid ) { if ( mUidMetaDataMap.find( uid ) ) { KMMsgMetaData *md = mUidMetaDataMap[uid]; diff --git a/kmfolderimap.h b/kmfolderimap.h index 67f8735b6..bd5c116a3 100644 --- a/kmfolderimap.h +++ b/kmfolderimap.h @@ -68,7 +68,7 @@ public: ~KMMsgMetaData() {} const MessageStatus& status() const { return mStatus; } const MessageStatus& messageStatus() const { return mStatus; } - const quint32 serNum() const { return mSerNum; } + quint32 serNum() const { return mSerNum; } private: MessageStatus mStatus; quint32 mSerNum; @@ -246,7 +246,7 @@ return encodeFileName( KMFolderMbox::fileName() ); } /** * Get the serial number for the given UID (if available) */ -const ulong serNumForUID( ulong uid ); +ulong serNumForUID( ulong uid ); /** * Save the metadata for the UID diff --git a/kmmessagetag.h b/kmmessagetag.h index 4cf2ee8fc..bdb12b79a 100644 --- a/kmmessagetag.h +++ b/kmmessagetag.h @@ -78,13 +78,13 @@ class KMMessageTagDescription /** Accessor functions */ const QString label() const { return mLabel; } const QString name() const { return mName; } - const int priority() const { return mPriority; } + int priority() const { return mPriority; } const QColor textColor() const { return mTextColor; } const QColor backgroundColor() const { return mBackgroundColor; } const QFont textFont() const { return mTextFont; } - const bool inToolbar() const { return mInToolbar; } + bool inToolbar() const { return mInToolbar; } const QString toolbarIconName() const { return mIconName; } - const bool isEmpty() const { return mEmpty; } + bool isEmpty() const { return mEmpty; } const KShortcut shortcut() { return mShortcut; } void setLabel( const QString & ); From 678c5598135cdfa305d54ddf37c25cb451880137 Mon Sep 17 00:00:00 2001 From: Thomas McGuire Date: Fri, 27 Feb 2009 15:03:37 +0000 Subject: [PATCH 06/11] Merge the option for changing the default forward type, both the hidden option (which was never merged) and the GUI option. kolab/issue1530 Kolab/issue3376 svn path=/branches/kdepim/enterprise4/kdepim/; revision=932882 --- configuredialog.cpp | 22 +++++++++++++- configuredialog_p.h | 2 ++ kmail.kcfg | 4 +++ kmail_part.cpp | 1 + kmail_part.rc | 6 ++-- kmmainwidget.cpp | 71 +++++++++++++++++++++++++++++++++------------ kmmainwidget.h | 18 +++++++++--- kmmainwin.cpp | 2 ++ kmmainwin.rc | 6 ++-- kmreadermainwin.cpp | 60 ++++++++++++++++++++++++++++++++------ kmreadermainwin.h | 14 +++++++-- kmreadermainwin.rc | 6 ++-- searchwindow.cpp | 21 ++++++++++---- searchwindow.h | 2 +- 14 files changed, 183 insertions(+), 52 deletions(-) diff --git a/configuredialog.cpp b/configuredialog.cpp index bc52d4f28..ec0d35fbe 100644 --- a/configuredialog.cpp +++ b/configuredialog.cpp @@ -104,6 +104,7 @@ using MailTransport::TransportManagementWidget; #include #include #include +#include // Qt headers: #include @@ -2918,7 +2919,7 @@ ComposerPageGeneralTab::ComposerPageGeneralTab( QWidget * parent ) vlay->addLayout( hlay ); mRecipientCheck = new QCheckBox( GlobalSettings::self()->tooManyRecipientsItem()->label(), this); - mRecipientCheck->setObjectName( "kcfg_TooManyReceipients" ); + mRecipientCheck->setObjectName( "kcfg_TooManyRecipients" ); hlay->addWidget( mRecipientCheck ); connect( mRecipientCheck, SIGNAL( stateChanged(int) ), this, SLOT( slotEmitChanged( void ) ) ); @@ -2961,6 +2962,20 @@ ComposerPageGeneralTab::ComposerPageGeneralTab( QWidget * parent ) connect( mAutoSave, SIGNAL( valueChanged(int) ), this, SLOT( slotEmitChanged( void ) ) ); + hlay = new QHBoxLayout(); // inherits spacing + vlay->addLayout( hlay ); + mForwardTypeCombo = new KComboBox( false, this ); + label = new QLabel( i18n( "Default Forwarding Type:" ), + this ); + label->setBuddy( mForwardTypeCombo ); + mForwardTypeCombo->addItems( QStringList() << i18n( "Inline" ) + << i18n( "As Attachment" ) ); + hlay->addWidget( label ); + hlay->addWidget( mForwardTypeCombo ); + hlay->addStretch( 1 ); + connect( mForwardTypeCombo, SIGNAL( activated( int ) ), + this, SLOT( slotEmitChanged() ) ); + hlay = new QHBoxLayout(); // inherits spacing vlay->addLayout( hlay ); QPushButton *completionOrderBtn = new QPushButton( i18n( "Configure Completion Order..." ), this ); @@ -3040,6 +3055,10 @@ void ComposerPage::GeneralTab::doLoadFromGlobalSettings() { mRecipientCheck->setChecked( GlobalSettings::self()->tooManyRecipients() ); mRecipientSpin->setValue( GlobalSettings::self()->recipientThreshold() ); mAutoSave->setValue( GlobalSettings::self()->autosaveInterval() ); + if ( GlobalSettings::self()->forwardingInlineByDefault() ) + mForwardTypeCombo->setCurrentIndex( 0 ); + else + mForwardTypeCombo->setCurrentIndex( 1 ); // editor group: mExternalEditorCheck->setChecked( GlobalSettings::self()->useExternalEditor() ); @@ -3093,6 +3112,7 @@ void ComposerPage::GeneralTab::save() { GlobalSettings::self()->setTooManyRecipients( mRecipientCheck->isChecked() ); GlobalSettings::self()->setRecipientThreshold( mRecipientSpin->value() ); GlobalSettings::self()->setAutosaveInterval( mAutoSave->value() ); + GlobalSettings::self()->setForwardingInlineByDefault( mForwardTypeCombo->currentIndex() == 0 ); // editor group: GlobalSettings::self()->setUseExternalEditor( mExternalEditorCheck->isChecked() ); diff --git a/configuredialog_p.h b/configuredialog_p.h index 19e3842da..0be678375 100644 --- a/configuredialog_p.h +++ b/configuredialog_p.h @@ -59,6 +59,7 @@ class KColorCombo; class KFontRequester; class KIconButton; class KKeySequenceWidget; +class KComboBox; namespace KMail { class IdentityDialog; @@ -717,6 +718,7 @@ private: KIntSpinBox *mAutoSave; QCheckBox *mExternalEditorCheck; KUrlRequester *mEditorRequester; + KComboBox *mForwardTypeCombo; }; class ComposerPagePhrasesTab : public ConfigModuleTab { diff --git a/kmail.kcfg b/kmail.kcfg index 33d1125da..22ba05ded 100644 --- a/kmail.kcfg +++ b/kmail.kcfg @@ -299,6 +299,10 @@ + + false + + false diff --git a/kmail_part.cpp b/kmail_part.cpp index bb10fc37d..d244f0cf1 100644 --- a/kmail_part.cpp +++ b/kmail_part.cpp @@ -179,6 +179,7 @@ void KMailPart::guiActivateEvent(KParts::GUIActivateEvent *e) mainWidget->initializeMessageTagActions(); mainWidget->initializeFolderShortcutActions(); mainWidget->updateVactionScriptStatus(); + mainWidget->setupForwardingActionsList(); } void KMailPart::exit() diff --git a/kmail_part.rc b/kmail_part.rc index 3b5b16c87..8d290b944 100644 --- a/kmail_part.rc +++ b/kmail_part.rc @@ -2,7 +2,7 @@ the same menu entries at the same place in KMail and Kontact --> - + &File @@ -130,9 +130,7 @@ &Forward - - - + diff --git a/kmmainwidget.cpp b/kmmainwidget.cpp index 7689ccdca..121a8bb72 100644 --- a/kmmainwidget.cpp +++ b/kmmainwidget.cpp @@ -17,8 +17,6 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ - - #include #include @@ -1587,7 +1585,7 @@ void KMMainWidget::slotMessageQueuedOrDrafted() //----------------------------------------------------------------------------- -void KMMainWidget::slotForwardMsg() +void KMMainWidget::slotForwardInlineMsg() { KMMessageList* selected = mHeaders->selectedMsgs(); KMCommand *command = 0L; @@ -1946,10 +1944,35 @@ void KMMainWidget::slotPrintMsg() command->start(); } +//----------------------------------------------------------------------------- +void KMMainWidget::setupForwardActions() +{ + disconnect( mForwardActionMenu, SIGNAL( triggered(bool) ), 0, 0 ); + mForwardActionMenu->removeAction( mForwardInlineAction ); + mForwardActionMenu->removeAction( mForwardAttachedAction ); + + if ( GlobalSettings::self()->forwardingInlineByDefault() ) { + mForwardActionMenu->insertAction( mRedirectAction, mForwardInlineAction ); + mForwardActionMenu->insertAction( mRedirectAction, mForwardAttachedAction ); + mForwardInlineAction->setShortcut(QKeySequence(Qt::Key_F)); + mForwardAttachedAction->setShortcut(QKeySequence(Qt::SHIFT+Qt::Key_F)); + connect( mForwardActionMenu, SIGNAL(triggered(bool)), this, SLOT(slotForwardInlineMsg()) ); + } + else { + mForwardActionMenu->insertAction( mRedirectAction, mForwardAttachedAction ); + mForwardActionMenu->insertAction( mRedirectAction, mForwardInlineAction ); + mForwardInlineAction->setShortcut(QKeySequence(Qt::SHIFT+Qt::Key_F)); + mForwardAttachedAction->setShortcut(QKeySequence(Qt::Key_F)); + connect( mForwardActionMenu, SIGNAL(triggered(bool)), this, SLOT(slotForwardAttachedMsg()) ); + } +} + //----------------------------------------------------------------------------- void KMMainWidget::slotConfigChanged() { readConfig(); + setupForwardActions(); + setupForwardingActionsList(); } //----------------------------------------------------------------------------- @@ -2961,30 +2984,26 @@ void KMMainWidget::setupActions() mForwardActionMenu = new KActionMenu(KIcon("mail-forward"), i18nc("Message->","&Forward"), this); actionCollection()->addAction("message_forward", mForwardActionMenu ); - connect( mForwardActionMenu, SIGNAL(triggered(bool)), this, - SLOT(slotForwardMsg()) ); mForwardAttachedAction = new KAction(KIcon("mail-forward"), i18nc("Message->Forward->","As &Attachment..."), this); actionCollection()->addAction("message_forward_as_attachment", mForwardAttachedAction ); - mForwardAttachedAction->setShortcut(QKeySequence(Qt::Key_F)); connect(mForwardAttachedAction, SIGNAL(triggered(bool) ), SLOT(slotForwardAttachedMsg())); - mForwardActionMenu->addAction( forwardAttachedAction() ); - mForwardAction = new KAction(KIcon("mail-forward"), i18n("&Inline..."), this); - actionCollection()->addAction("message_forward_inline", mForwardAction ); - connect(mForwardAction, SIGNAL(triggered(bool) ), SLOT(slotForwardMsg())); - mForwardAction->setShortcut(QKeySequence(Qt::SHIFT+Qt::Key_F)); - mForwardActionMenu->addAction( forwardAction() ); - - mSendAgainAction = new KAction(i18n("Send A&gain..."), this); - actionCollection()->addAction("send_again", mSendAgainAction ); - connect(mSendAgainAction, SIGNAL(triggered(bool) ), SLOT(slotResendMsg())); + mForwardInlineAction = new KAction(KIcon("mail-forward"), i18n("&Inline..."), this); + actionCollection()->addAction("message_forward_inline", mForwardInlineAction ); + connect(mForwardInlineAction, SIGNAL(triggered(bool) ), SLOT(slotForwardInlineMsg())); mRedirectAction = new KAction(KIcon("mail-forward"), i18nc("Message->Forward->","&Redirect..."), this); actionCollection()->addAction("message_forward_redirect", mRedirectAction ); mRedirectAction->setShortcut(QKeySequence(Qt::Key_E)); connect(mRedirectAction, SIGNAL(triggered(bool) ), SLOT(slotRedirectMsg())); - mForwardActionMenu->addAction( redirectAction() ); + + setupForwardActions(); + mForwardActionMenu->addAction( mRedirectAction ); + + mSendAgainAction = new KAction(i18n("Send A&gain..."), this); + actionCollection()->addAction("send_again", mSendAgainAction ); + connect(mSendAgainAction, SIGNAL(triggered(bool) ), SLOT(slotResendMsg())); //----- Create filter actions mFilterMenu = new KActionMenu(KIcon("view-filter"), i18n("&Create Filter"), this); @@ -3298,6 +3317,22 @@ void KMMainWidget::setupActions() updateFolderMenu(); } +void KMMainWidget::setupForwardingActionsList() +{ + QList mForwardActionList; + mGUIClient->unplugActionList( "forward_action_list" ); + if ( GlobalSettings::self()->forwardingInlineByDefault() ) { + mForwardActionList.append( mForwardInlineAction ); + mForwardActionList.append( mForwardAttachedAction ); + } + else { + mForwardActionList.append( mForwardAttachedAction ); + mForwardActionList.append( mForwardInlineAction ); + } + mForwardActionList.append( mRedirectAction ); + mGUIClient->plugActionList( "forward_action_list", mForwardActionList ); +} + //----------------------------------------------------------------------------- void KMMainWidget::slotEditNotifications() { @@ -3479,7 +3514,7 @@ void KMMainWidget::updateMessageActions() mTrashAction->setEnabled( mass_actions && mFolder->canDeleteMessages() ); mDeleteAction->setEnabled( mass_actions && mFolder->canDeleteMessages() ); mFindInMessageAction->setEnabled( mass_actions ); - mForwardAction->setEnabled( mass_actions ); + mForwardInlineAction->setEnabled( mass_actions ); mForwardAttachedAction->setEnabled( mass_actions ); forwardMenu()->setEnabled( mass_actions ); diff --git a/kmmainwidget.h b/kmmainwidget.h index 3b7e1d691..8b3b85d5d 100644 --- a/kmmainwidget.h +++ b/kmmainwidget.h @@ -120,8 +120,6 @@ class KMAIL_EXPORT KMMainWidget : public QWidget QAction *action( const char *name ) { return mActionCollection->action( name ); } KActionMenu *forwardMenu() const { return mForwardActionMenu; } - KAction *forwardAction() const { return mForwardAction; } - KAction *forwardAttachedAction() const { return mForwardAttachedAction; } KAction *redirectAction() const { return mRedirectAction; } KActionMenu *filterMenu() const { return mFilterMenu; } KAction *printAction() const { return mPrintAction; } @@ -171,6 +169,11 @@ class KMAIL_EXPORT KMMainWidget : public QWidget QLabel* vacationScriptIndicator() const; void updateVactionScriptStatus() { updateVactionScriptStatus( mVacationIndicatorActive ); } + /** + * Sets up action list for forward menu. + */ + void setupForwardingActionsList(); + public slots: void slotMoveMsgToFolder( KMFolder *dest); void slotTrashMsg(); // move to trash @@ -418,6 +421,13 @@ class KMAIL_EXPORT KMMainWidget : public QWidget void slotEditNotifications(); void slotEditKeys(); + /** + * This function adds or updates the actions of the forward action menu, taking the + * preference whether to forward inline or as attachment by default into account. + * This has to be called when that preference config has been changed. + */ + void setupForwardActions(); + /** changes the caption and displays the foldername */ void slotChangeCaption(Q3ListViewItem*); void removeDuplicates(); @@ -425,7 +435,7 @@ class KMAIL_EXPORT KMMainWidget : public QWidget /** Slot to reply to a message */ void slotCustomReplyToMsg( const QString &tmpl ); void slotCustomReplyAllToMsg( const QString &tmpl ); - void slotForwardMsg(); + void slotForwardInlineMsg(); void slotForwardAttachedMsg(); void slotRedirectMsg(); void slotCustomForwardMsg( const QString &tmpl ); @@ -494,7 +504,7 @@ class KMAIL_EXPORT KMMainWidget : public QWidget *mMoveMsgToFolderAction; // Composition actions KAction *mPrintAction, - *mForwardAction, *mForwardAttachedAction, + *mForwardInlineAction, *mForwardAttachedAction, *mRedirectAction; KActionMenu *mForwardActionMenu; // Filter actions diff --git a/kmmainwin.cpp b/kmmainwin.cpp index d76667d47..df089b5ee 100644 --- a/kmmainwin.cpp +++ b/kmmainwin.cpp @@ -64,6 +64,8 @@ KMMainWin::KMMainWin(QWidget *) // Don't use conserveMemory() because this renders dynamic plugging // of actions unusable! + mKMMainWidget->setupForwardingActionsList(); + //must be after createGUI, otherwise e.g toolbar settings are not loaded applyMainWindowSettings( KMKernel::config()->group( "Main Window") ); diff --git a/kmmainwin.rc b/kmmainwin.rc index e002eab8f..dadc38843 100644 --- a/kmmainwin.rc +++ b/kmmainwin.rc @@ -2,7 +2,7 @@ the same menu entries at the same place in KMail and Kontact --> - + &File @@ -133,9 +133,7 @@ &Forward - - - + diff --git a/kmreadermainwin.cpp b/kmreadermainwin.cpp index c65c19480..d8c503f94 100644 --- a/kmreadermainwin.cpp +++ b/kmreadermainwin.cpp @@ -100,6 +100,7 @@ void KMReaderMainWin::initKMReaderMainWin() { setCentralWidget( mReaderWin ); setupAccel(); setupGUI( Keys | StatusBar | Create, "kmreadermainwin.rc" ); + setupForwardingActionsList(); applyMainWindowSettings( KMKernel::config()->group( "Separate Reader Window" ) ); if( ! mReaderWin->message() ) { menuBar()->hide(); @@ -110,6 +111,22 @@ void KMReaderMainWin::initKMReaderMainWin() { this, SLOT( slotConfigChanged() ) ); } +void KMReaderMainWin::setupForwardingActionsList() +{ + QList mForwardActionList; + unplugActionList( "forward_action_list" ); + if ( GlobalSettings::self()->forwardingInlineByDefault() ) { + mForwardActionList.append( mForwardInlineAction ); + mForwardActionList.append( mForwardAttachedAction ); + } + else { + mForwardActionList.append( mForwardAttachedAction ); + mForwardActionList.append( mForwardInlineAction ); + } + mForwardActionList.append( mRedirectAction ); + plugActionList( "forward_action_list", mForwardActionList ); +} + //----------------------------------------------------------------------------- KMReaderMainWin::~KMReaderMainWin() { @@ -178,7 +195,7 @@ void KMReaderMainWin::slotPrintMsg() } //----------------------------------------------------------------------------- -void KMReaderMainWin::slotForwardMsg() +void KMReaderMainWin::slotForwardInlineMsg() { KMCommand *command = 0; if ( mReaderWin->message() && mReaderWin->message()->parent() ) { @@ -253,10 +270,37 @@ void KMReaderMainWin::slotShowMsgSrc() command->start(); } +//----------------------------------------------------------------------------- +void KMReaderMainWin::setupForwardActions() +{ + disconnect( mForwardActionMenu, SIGNAL(triggered(bool)), 0, 0 ); + mForwardActionMenu->removeAction( mForwardInlineAction ); + mForwardActionMenu->removeAction( mForwardAttachedAction ); + + if ( GlobalSettings::self()->forwardingInlineByDefault() ) { + mForwardActionMenu->insertAction( mRedirectAction, mForwardInlineAction ); + mForwardActionMenu->insertAction( mRedirectAction, mForwardAttachedAction ); + mForwardInlineAction->setShortcut(QKeySequence(Qt::Key_F)); + mForwardAttachedAction->setShortcut(QKeySequence(Qt::SHIFT+Qt::Key_F)); + connect( mForwardActionMenu, SIGNAL(triggered(bool)), this, + SLOT( slotForwardInlineMsg() ) ); + } + else { + mForwardActionMenu->insertAction( mRedirectAction, mForwardAttachedAction ); + mForwardActionMenu->insertAction( mRedirectAction, mForwardInlineAction ); + mForwardInlineAction->setShortcut(QKeySequence(Qt::SHIFT+Qt::Key_F)); + mForwardAttachedAction->setShortcut(QKeySequence(Qt::Key_F)); + connect( mForwardActionMenu, SIGNAL(triggered(bool)), this, + SLOT( slotForwardAttachedMsg() ) ); + } +} + //----------------------------------------------------------------------------- void KMReaderMainWin::slotConfigChanged() { //readConfig(); + setupForwardActions(); + setupForwardingActionsList(); } void KMReaderMainWin::setupAccel() @@ -297,20 +341,18 @@ void KMReaderMainWin::setupAccel() //----- Message Menu mForwardActionMenu = new KActionMenu(KIcon("mail-forward"), i18nc("Message->","&Forward"), this); actionCollection()->addAction("message_forward", mForwardActionMenu ); - connect( mForwardActionMenu, SIGNAL(triggered(bool)), this, - SLOT( slotForwardMsg() ) ); mForwardAttachedAction = new KAction(KIcon("mail-forward"), i18nc("Message->Forward->","As &Attachment..."), this); actionCollection()->addAction("message_forward_as_attachment", mForwardAttachedAction ); mForwardAttachedAction->setShortcut(QKeySequence(Qt::Key_F)); connect(mForwardAttachedAction, SIGNAL(triggered(bool) ), SLOT(slotForwardAttachedMsg())); - mForwardActionMenu->addAction( mForwardAttachedAction ); - mForwardAction = new KAction(KIcon("mail-forward"), i18n("&Inline..."), this); - actionCollection()->addAction("message_forward_inline", mForwardAction ); - connect(mForwardAction, SIGNAL(triggered(bool) ), SLOT(slotForwardMsg())); - mForwardAction->setShortcut(QKeySequence(Qt::SHIFT+Qt::Key_F)); - mForwardActionMenu->addAction( mForwardAction ); + mForwardInlineAction = new KAction(KIcon("mail-forward"), i18n("&Inline..."), this); + actionCollection()->addAction("message_forward_inline", mForwardInlineAction ); + connect(mForwardInlineAction, SIGNAL(triggered(bool) ), SLOT(slotForwardInlineMsg())); + mForwardInlineAction->setShortcut(QKeySequence(Qt::SHIFT+Qt::Key_F)); + + setupForwardActions(); mRedirectAction = new KAction(i18nc("Message->Forward->", "&Redirect..."), this); actionCollection()->addAction("message_forward_redirect", mRedirectAction ); diff --git a/kmreadermainwin.h b/kmreadermainwin.h index b84f80ace..0e28fa0f9 100644 --- a/kmreadermainwin.h +++ b/kmreadermainwin.h @@ -41,6 +41,11 @@ public: // take ownership of and show @param msg void showMsg( const QString & encoding, KMMessage *msg ); + /** + * Sets up action list for forward menu. + */ + void setupForwardingActionsList(); + private slots: void slotMsgPopup(KMMessage &aMsg, const KUrl &aUrl, const QPoint& aPoint); @@ -48,7 +53,7 @@ private slots: void copySelectedToFolder( QAction* ); void slotTrashMsg(); void slotPrintMsg(); - void slotForwardMsg(); + void slotForwardInlineMsg(); void slotForwardAttachedMsg(); void slotRedirectMsg(); void slotShowMsgSrc(); @@ -71,13 +76,18 @@ private: void updateMessageMenu(); void updateCustomTemplateMenus(); + /** + * @see the KMMainWidget function with the same name. + */ + void setupForwardActions(); + KMReaderWin *mReaderWin; KMMessage *mMsg; KUrl mUrl; QMap mMenuToFolder; // a few actions duplicated from kmmainwidget KAction *mTrashAction, *mPrintAction, *mSaveAsAction, *mSaveAtmAction, - *mForwardAction, *mForwardAttachedAction, *mRedirectAction, + *mForwardInlineAction, *mForwardAttachedAction, *mRedirectAction, *mViewSourceAction, *mCopyTextAction; KActionMenu *mForwardActionMenu; KActionMenu *mCopyActionMenu; diff --git a/kmreadermainwin.rc b/kmreadermainwin.rc index 5d350a420..a67e0da71 100644 --- a/kmreadermainwin.rc +++ b/kmreadermainwin.rc @@ -1,5 +1,5 @@ - + &File @@ -39,9 +39,7 @@ &Forward - - - + diff --git a/searchwindow.cpp b/searchwindow.cpp index 4e53b0952..8ac294343 100644 --- a/searchwindow.cpp +++ b/searchwindow.cpp @@ -320,18 +320,29 @@ SearchWindow::SearchWindow(KMMainWidget* w, KMFolder *curFolder): mReplyListAction = new KAction(KIcon("mail-reply-list"), i18n("Reply to Mailing-&List..."), this); actionCollection()->addAction("search_reply_list", mReplyListAction ); connect(mReplyListAction, SIGNAL(triggered(bool) ), SLOT(slotReplyListToMsg())); + mForwardActionMenu = new KActionMenu(KIcon("mail-forward"), i18nc("Message->","&Forward"), this); actionCollection()->addAction("search_message_forward", mForwardActionMenu ); connect( mForwardActionMenu, SIGNAL(triggered(bool)), this, SLOT(slotForwardMsg()) ); - mForwardAction = new KAction(KIcon("mail-forward"), i18n("&Inline..."), this); - actionCollection()->addAction("search_message_forward_inline", mForwardAction ); - connect(mForwardAction, SIGNAL(triggered(bool) ), SLOT(slotForwardMsg())); - mForwardActionMenu->addAction( mForwardAction ); + + mForwardInlineAction = new KAction(KIcon("mail-forward"), i18n("&Inline..."), this); + actionCollection()->addAction("search_message_forward_inline", mForwardInlineAction ); + connect(mForwardInlineAction, SIGNAL(triggered(bool) ), SLOT(slotForwardMsg())); + mForwardAttachedAction = new KAction(KIcon("mail-forward"), i18nc("Message->Forward->","As &Attachment..."), this); actionCollection()->addAction("search_message_forward_as_attachment", mForwardAttachedAction ); connect(mForwardAttachedAction, SIGNAL(triggered(bool)), SLOT(slotForwardAttachedMsg())); - mForwardActionMenu->addAction( mForwardAttachedAction ); + + if ( GlobalSettings::self()->forwardingInlineByDefault() ) { + mForwardActionMenu->addAction( mForwardInlineAction ); + mForwardActionMenu->addAction( mForwardAttachedAction ); + } + else { + mForwardActionMenu->addAction( mForwardAttachedAction ); + mForwardActionMenu->addAction( mForwardInlineAction ); + } + mSaveAsAction = actionCollection()->addAction(KStandardAction::SaveAs, "search_file_save_as", this, SLOT(slotSaveMsg())); mSaveAtchAction = new KAction(KIcon("mail-attachment"), i18n("Save Attachments..."), this); actionCollection()->addAction("search_save_attachments", mSaveAtchAction ); diff --git a/searchwindow.h b/searchwindow.h index b63f91df4..a8e617bcf 100644 --- a/searchwindow.h +++ b/searchwindow.h @@ -164,7 +164,7 @@ protected: QWidget* mLastFocus; // to remember the position of the focus QMap mMenuToFolder; QAction *mReplyAction, *mReplyAllAction, *mReplyListAction, *mSaveAsAction, - *mForwardAction, *mForwardAttachedAction, *mPrintAction, *mClearAction, + *mForwardInlineAction, *mForwardAttachedAction, *mPrintAction, *mClearAction, *mSaveAtchAction, *mCopyAction, *mCutAction; KActionMenu *mForwardActionMenu; QList > mFolders; From 8bc7a51d7c9fa0c4ca50e4297ed0ec64950922ff Mon Sep 17 00:00:00 2001 From: Thomas McGuire Date: Fri, 27 Feb 2009 15:53:40 +0000 Subject: [PATCH 07/11] SVN_SILENT Update version numbers for today's release. svn path=/branches/kdepim/enterprise4/kdepim/; revision=932945 --- kmversion.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kmversion.h b/kmversion.h index a00c4a139..6d370ccce 100644 --- a/kmversion.h +++ b/kmversion.h @@ -3,6 +3,6 @@ #ifndef kmversion_h #define kmversion_h -#define KMAIL_VERSION "1.10.1 (enterprise4 0.20090220.928360)" +#define KMAIL_VERSION "1.10.1 (enterprise4 0.20090227.932884)" #endif /*kmversion_h*/ From 4c637d16e74145d71f39bf8f2f0378bf460193ab Mon Sep 17 00:00:00 2001 From: Thomas McGuire Date: Wed, 4 Mar 2009 09:10:15 +0000 Subject: [PATCH 08/11] Move the forward actions to MessageActions, to reduce code duplication. svn path=/branches/kdepim/enterprise4/kdepim/; revision=934932 --- kmail_part.cpp | 1 - kmheaders.cpp | 2 +- kmmainwidget.cpp | 78 +++++++------------------------------------ kmmainwidget.h | 19 +---------- kmmainwin.cpp | 2 -- kmreadermainwin.cpp | 72 ++++------------------------------------ kmreadermainwin.h | 12 ------- messageactions.cpp | 80 +++++++++++++++++++++++++++++++++++++++++---- messageactions.h | 21 +++++++++++- 9 files changed, 112 insertions(+), 175 deletions(-) diff --git a/kmail_part.cpp b/kmail_part.cpp index d244f0cf1..bb10fc37d 100644 --- a/kmail_part.cpp +++ b/kmail_part.cpp @@ -179,7 +179,6 @@ void KMailPart::guiActivateEvent(KParts::GUIActivateEvent *e) mainWidget->initializeMessageTagActions(); mainWidget->initializeFolderShortcutActions(); mainWidget->updateVactionScriptStatus(); - mainWidget->setupForwardingActionsList(); } void KMailPart::exit() diff --git a/kmheaders.cpp b/kmheaders.cpp index 58e154c05..c652200f4 100644 --- a/kmheaders.cpp +++ b/kmheaders.cpp @@ -2514,7 +2514,7 @@ void KMHeaders::slotRMB() // show most used actions if( !mFolder->isSent() ) menu->addAction( mOwner->messageActions()->replyMenu() ); - menu->addAction( mOwner->forwardMenu() ); + menu->addAction( mOwner->messageActions()->forwardMenu() ); if(mOwner->sendAgainAction()->isEnabled()) { menu->addAction( mOwner->sendAgainAction() ); } else { diff --git a/kmmainwidget.cpp b/kmmainwidget.cpp index 121a8bb72..13637a8d1 100644 --- a/kmmainwidget.cpp +++ b/kmmainwidget.cpp @@ -1944,35 +1944,12 @@ void KMMainWidget::slotPrintMsg() command->start(); } -//----------------------------------------------------------------------------- -void KMMainWidget::setupForwardActions() -{ - disconnect( mForwardActionMenu, SIGNAL( triggered(bool) ), 0, 0 ); - mForwardActionMenu->removeAction( mForwardInlineAction ); - mForwardActionMenu->removeAction( mForwardAttachedAction ); - - if ( GlobalSettings::self()->forwardingInlineByDefault() ) { - mForwardActionMenu->insertAction( mRedirectAction, mForwardInlineAction ); - mForwardActionMenu->insertAction( mRedirectAction, mForwardAttachedAction ); - mForwardInlineAction->setShortcut(QKeySequence(Qt::Key_F)); - mForwardAttachedAction->setShortcut(QKeySequence(Qt::SHIFT+Qt::Key_F)); - connect( mForwardActionMenu, SIGNAL(triggered(bool)), this, SLOT(slotForwardInlineMsg()) ); - } - else { - mForwardActionMenu->insertAction( mRedirectAction, mForwardAttachedAction ); - mForwardActionMenu->insertAction( mRedirectAction, mForwardInlineAction ); - mForwardInlineAction->setShortcut(QKeySequence(Qt::SHIFT+Qt::Key_F)); - mForwardAttachedAction->setShortcut(QKeySequence(Qt::Key_F)); - connect( mForwardActionMenu, SIGNAL(triggered(bool)), this, SLOT(slotForwardAttachedMsg()) ); - } -} - //----------------------------------------------------------------------------- void KMMainWidget::slotConfigChanged() { readConfig(); - setupForwardActions(); - setupForwardingActionsList(); + mMsgActions->setupForwardActions(); + mMsgActions->setupForwardingActionsList( mGUIClient ); } //----------------------------------------------------------------------------- @@ -2566,7 +2543,7 @@ void KMMainWidget::slotMsgPopup(KMMessage&, const KUrl &aUrl, const QPoint& aPoi if ( !mFolder->isSent() ) { menu->addAction( mMsgActions->replyMenu() ); } - menu->addAction( mForwardActionMenu ); + menu->addAction( mMsgActions->forwardMenu() ); } menu->addAction(editAction()); menu->addSeparator(); @@ -2645,8 +2622,8 @@ void KMMainWidget::updateCustomTemplateMenus() this, SLOT(slotCustomForwardMsg( const QString& )) ); } - mForwardActionMenu->addSeparator(); - mForwardActionMenu->addAction( mCustomTemplateMenus->forwardActionMenu() ); + mMsgActions->forwardMenu()->addSeparator(); + mMsgActions->forwardMenu()->addAction( mCustomTemplateMenus->forwardActionMenu() ); mMsgActions->replyMenu()->addSeparator(); mMsgActions->replyMenu()->addAction( mCustomTemplateMenus->replyActionMenu() ); @@ -2659,6 +2636,7 @@ void KMMainWidget::setupActions() { mMsgActions = new KMail::MessageActions( actionCollection(), this ); mMsgActions->setMessageView( mMsgView ); + mMsgActions->setupForwardingActionsList( mGUIClient ); //----- File Menu mSaveAsAction = new KAction(KIcon("document-save"), i18n("Save &As..."), this); @@ -2982,25 +2960,6 @@ void KMMainWidget::setupActions() action->setShortcut(QKeySequence(Qt::CTRL+Qt::SHIFT+Qt::Key_N)); } - mForwardActionMenu = new KActionMenu(KIcon("mail-forward"), i18nc("Message->","&Forward"), this); - actionCollection()->addAction("message_forward", mForwardActionMenu ); - - mForwardAttachedAction = new KAction(KIcon("mail-forward"), i18nc("Message->Forward->","As &Attachment..."), this); - actionCollection()->addAction("message_forward_as_attachment", mForwardAttachedAction ); - connect(mForwardAttachedAction, SIGNAL(triggered(bool) ), SLOT(slotForwardAttachedMsg())); - - mForwardInlineAction = new KAction(KIcon("mail-forward"), i18n("&Inline..."), this); - actionCollection()->addAction("message_forward_inline", mForwardInlineAction ); - connect(mForwardInlineAction, SIGNAL(triggered(bool) ), SLOT(slotForwardInlineMsg())); - - mRedirectAction = new KAction(KIcon("mail-forward"), i18nc("Message->Forward->","&Redirect..."), this); - actionCollection()->addAction("message_forward_redirect", mRedirectAction ); - mRedirectAction->setShortcut(QKeySequence(Qt::Key_E)); - connect(mRedirectAction, SIGNAL(triggered(bool) ), SLOT(slotRedirectMsg())); - - setupForwardActions(); - mForwardActionMenu->addAction( mRedirectAction ); - mSendAgainAction = new KAction(i18n("Send A&gain..."), this); actionCollection()->addAction("send_again", mSendAgainAction ); connect(mSendAgainAction, SIGNAL(triggered(bool) ), SLOT(slotResendMsg())); @@ -3317,22 +3276,6 @@ void KMMainWidget::setupActions() updateFolderMenu(); } -void KMMainWidget::setupForwardingActionsList() -{ - QList mForwardActionList; - mGUIClient->unplugActionList( "forward_action_list" ); - if ( GlobalSettings::self()->forwardingInlineByDefault() ) { - mForwardActionList.append( mForwardInlineAction ); - mForwardActionList.append( mForwardAttachedAction ); - } - else { - mForwardActionList.append( mForwardAttachedAction ); - mForwardActionList.append( mForwardInlineAction ); - } - mForwardActionList.append( mRedirectAction ); - mGUIClient->plugActionList( "forward_action_list", mForwardActionList ); -} - //----------------------------------------------------------------------------- void KMMainWidget::slotEditNotifications() { @@ -3514,17 +3457,18 @@ void KMMainWidget::updateMessageActions() mTrashAction->setEnabled( mass_actions && mFolder->canDeleteMessages() ); mDeleteAction->setEnabled( mass_actions && mFolder->canDeleteMessages() ); mFindInMessageAction->setEnabled( mass_actions ); - mForwardInlineAction->setEnabled( mass_actions ); - mForwardAttachedAction->setEnabled( mass_actions ); - forwardMenu()->setEnabled( mass_actions ); + mMsgActions->forwardInlineAction()->setEnabled( mass_actions ); + mMsgActions->forwardAttachedAction()->setEnabled( mass_actions ); + + mMsgActions->forwardMenu()->setEnabled( mass_actions ); bool single_actions = count == 1; mMsgActions->editAction()->setEnabled( single_actions ); mUseAction->setEnabled( single_actions && kmkernel->folderIsTemplates( mFolder ) ); filterMenu()->setEnabled( single_actions ); - redirectAction()->setEnabled( single_actions ); + mMsgActions->redirectAction()->setEnabled( single_actions ); if ( mCustomTemplateMenus ) { diff --git a/kmmainwidget.h b/kmmainwidget.h index 8b3b85d5d..92b2952e0 100644 --- a/kmmainwidget.h +++ b/kmmainwidget.h @@ -119,8 +119,6 @@ class KMAIL_EXPORT KMMainWidget : public QWidget static void cleanup(); QAction *action( const char *name ) { return mActionCollection->action( name ); } - KActionMenu *forwardMenu() const { return mForwardActionMenu; } - KAction *redirectAction() const { return mRedirectAction; } KActionMenu *filterMenu() const { return mFilterMenu; } KAction *printAction() const { return mPrintAction; } KAction *trashAction() const { return mTrashAction; } @@ -169,11 +167,6 @@ class KMAIL_EXPORT KMMainWidget : public QWidget QLabel* vacationScriptIndicator() const; void updateVactionScriptStatus() { updateVactionScriptStatus( mVacationIndicatorActive ); } - /** - * Sets up action list for forward menu. - */ - void setupForwardingActionsList(); - public slots: void slotMoveMsgToFolder( KMFolder *dest); void slotTrashMsg(); // move to trash @@ -421,13 +414,6 @@ class KMAIL_EXPORT KMMainWidget : public QWidget void slotEditNotifications(); void slotEditKeys(); - /** - * This function adds or updates the actions of the forward action menu, taking the - * preference whether to forward inline or as attachment by default into account. - * This has to be called when that preference config has been changed. - */ - void setupForwardActions(); - /** changes the caption and displays the foldername */ void slotChangeCaption(Q3ListViewItem*); void removeDuplicates(); @@ -503,10 +489,7 @@ class KMAIL_EXPORT KMMainWidget : public QWidget *mFavoritesCheckMailAction, *mMoveMsgToFolderAction; // Composition actions - KAction *mPrintAction, - *mForwardInlineAction, *mForwardAttachedAction, - *mRedirectAction; - KActionMenu *mForwardActionMenu; + KAction *mPrintAction; // Filter actions KActionMenu *mFilterMenu; KAction *mSubjectFilterAction, *mFromFilterAction, *mToFilterAction, diff --git a/kmmainwin.cpp b/kmmainwin.cpp index df089b5ee..d76667d47 100644 --- a/kmmainwin.cpp +++ b/kmmainwin.cpp @@ -64,8 +64,6 @@ KMMainWin::KMMainWin(QWidget *) // Don't use conserveMemory() because this renders dynamic plugging // of actions unusable! - mKMMainWidget->setupForwardingActionsList(); - //must be after createGUI, otherwise e.g toolbar settings are not loaded applyMainWindowSettings( KMKernel::config()->group( "Main Window") ); diff --git a/kmreadermainwin.cpp b/kmreadermainwin.cpp index d8c503f94..f87a7a869 100644 --- a/kmreadermainwin.cpp +++ b/kmreadermainwin.cpp @@ -100,7 +100,7 @@ void KMReaderMainWin::initKMReaderMainWin() { setCentralWidget( mReaderWin ); setupAccel(); setupGUI( Keys | StatusBar | Create, "kmreadermainwin.rc" ); - setupForwardingActionsList(); + mMsgActions->setupForwardingActionsList( this ); applyMainWindowSettings( KMKernel::config()->group( "Separate Reader Window" ) ); if( ! mReaderWin->message() ) { menuBar()->hide(); @@ -111,22 +111,6 @@ void KMReaderMainWin::initKMReaderMainWin() { this, SLOT( slotConfigChanged() ) ); } -void KMReaderMainWin::setupForwardingActionsList() -{ - QList mForwardActionList; - unplugActionList( "forward_action_list" ); - if ( GlobalSettings::self()->forwardingInlineByDefault() ) { - mForwardActionList.append( mForwardInlineAction ); - mForwardActionList.append( mForwardAttachedAction ); - } - else { - mForwardActionList.append( mForwardAttachedAction ); - mForwardActionList.append( mForwardInlineAction ); - } - mForwardActionList.append( mRedirectAction ); - plugActionList( "forward_action_list", mForwardActionList ); -} - //----------------------------------------------------------------------------- KMReaderMainWin::~KMReaderMainWin() { @@ -270,37 +254,12 @@ void KMReaderMainWin::slotShowMsgSrc() command->start(); } -//----------------------------------------------------------------------------- -void KMReaderMainWin::setupForwardActions() -{ - disconnect( mForwardActionMenu, SIGNAL(triggered(bool)), 0, 0 ); - mForwardActionMenu->removeAction( mForwardInlineAction ); - mForwardActionMenu->removeAction( mForwardAttachedAction ); - - if ( GlobalSettings::self()->forwardingInlineByDefault() ) { - mForwardActionMenu->insertAction( mRedirectAction, mForwardInlineAction ); - mForwardActionMenu->insertAction( mRedirectAction, mForwardAttachedAction ); - mForwardInlineAction->setShortcut(QKeySequence(Qt::Key_F)); - mForwardAttachedAction->setShortcut(QKeySequence(Qt::SHIFT+Qt::Key_F)); - connect( mForwardActionMenu, SIGNAL(triggered(bool)), this, - SLOT( slotForwardInlineMsg() ) ); - } - else { - mForwardActionMenu->insertAction( mRedirectAction, mForwardAttachedAction ); - mForwardActionMenu->insertAction( mRedirectAction, mForwardInlineAction ); - mForwardInlineAction->setShortcut(QKeySequence(Qt::SHIFT+Qt::Key_F)); - mForwardAttachedAction->setShortcut(QKeySequence(Qt::Key_F)); - connect( mForwardActionMenu, SIGNAL(triggered(bool)), this, - SLOT( slotForwardAttachedMsg() ) ); - } -} - //----------------------------------------------------------------------------- void KMReaderMainWin::slotConfigChanged() { //readConfig(); - setupForwardActions(); - setupForwardingActionsList(); + mMsgActions->setupForwardActions(); + mMsgActions->setupForwardingActionsList( this ); } void KMReaderMainWin::setupAccel() @@ -339,26 +298,7 @@ void KMReaderMainWin::setupAccel() mViewSourceAction->setShortcut(QKeySequence(Qt::Key_V)); //----- Message Menu - mForwardActionMenu = new KActionMenu(KIcon("mail-forward"), i18nc("Message->","&Forward"), this); - actionCollection()->addAction("message_forward", mForwardActionMenu ); - - mForwardAttachedAction = new KAction(KIcon("mail-forward"), i18nc("Message->Forward->","As &Attachment..."), this); - actionCollection()->addAction("message_forward_as_attachment", mForwardAttachedAction ); - mForwardAttachedAction->setShortcut(QKeySequence(Qt::Key_F)); - connect(mForwardAttachedAction, SIGNAL(triggered(bool) ), SLOT(slotForwardAttachedMsg())); - - mForwardInlineAction = new KAction(KIcon("mail-forward"), i18n("&Inline..."), this); - actionCollection()->addAction("message_forward_inline", mForwardInlineAction ); - connect(mForwardInlineAction, SIGNAL(triggered(bool) ), SLOT(slotForwardInlineMsg())); - mForwardInlineAction->setShortcut(QKeySequence(Qt::SHIFT+Qt::Key_F)); - - setupForwardActions(); - mRedirectAction = new KAction(i18nc("Message->Forward->", "&Redirect..."), this); - actionCollection()->addAction("message_forward_redirect", mRedirectAction ); - connect(mRedirectAction, SIGNAL(triggered(bool)), SLOT(slotRedirectMsg())); - mRedirectAction->setShortcut(QKeySequence(Qt::Key_E)); - mForwardActionMenu->addAction( mRedirectAction ); fontAction = new KFontAction( i18n("Select Font"), this ); actionCollection()->addAction( "text_font", fontAction ); @@ -403,8 +343,8 @@ void KMReaderMainWin::updateCustomTemplateMenus() this, SLOT(slotCustomForwardMsg( const QString& )) ); } - mForwardActionMenu->addSeparator(); - mForwardActionMenu->addAction( mCustomTemplateMenus->forwardActionMenu() ); + mMsgActions->forwardMenu()->addSeparator(); + mMsgActions->forwardMenu()->addAction( mCustomTemplateMenus->forwardActionMenu() ); mMsgActions->replyMenu()->addSeparator(); mMsgActions->replyMenu()->addAction( mCustomTemplateMenus->replyActionMenu() ); @@ -487,7 +427,7 @@ void KMReaderMainWin::slotMsgPopup( KMMessage &aMsg, const KUrl &aUrl, const QPo // FIXME: needs custom templates added to menu // (see KMMainWidget::updateCustomTemplateMenus) menu->addAction( mMsgActions->replyMenu() ); - menu->addAction( mForwardActionMenu ); + menu->addAction( mMsgActions->forwardMenu() ); menu->addSeparator(); } diff --git a/kmreadermainwin.h b/kmreadermainwin.h index 0e28fa0f9..b1ee7644f 100644 --- a/kmreadermainwin.h +++ b/kmreadermainwin.h @@ -41,11 +41,6 @@ public: // take ownership of and show @param msg void showMsg( const QString & encoding, KMMessage *msg ); - /** - * Sets up action list for forward menu. - */ - void setupForwardingActionsList(); - private slots: void slotMsgPopup(KMMessage &aMsg, const KUrl &aUrl, const QPoint& aPoint); @@ -76,20 +71,13 @@ private: void updateMessageMenu(); void updateCustomTemplateMenus(); - /** - * @see the KMMainWidget function with the same name. - */ - void setupForwardActions(); - KMReaderWin *mReaderWin; KMMessage *mMsg; KUrl mUrl; QMap mMenuToFolder; // a few actions duplicated from kmmainwidget KAction *mTrashAction, *mPrintAction, *mSaveAsAction, *mSaveAtmAction, - *mForwardInlineAction, *mForwardAttachedAction, *mRedirectAction, *mViewSourceAction, *mCopyTextAction; - KActionMenu *mForwardActionMenu; KActionMenu *mCopyActionMenu; KFontAction *fontAction; KFontSizeAction *fontSizeAction; diff --git a/messageactions.cpp b/messageactions.cpp index fca90c9bf..cbccbb5fb 100644 --- a/messageactions.cpp +++ b/messageactions.cpp @@ -23,18 +23,19 @@ #include "kmmessage.h" #include "kmreaderwin.h" -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include using namespace KMail; -MessageActions::MessageActions( KActionCollection *ac, QWidget * parent ) : +MessageActions::MessageActions( KActionCollection *ac, QWidget* parent ) : QObject( parent ), mParent( parent ), mActionCollection( ac ), @@ -139,6 +140,30 @@ MessageActions::MessageActions( KActionCollection *ac, QWidget * parent ) : this, SLOT(editCurrentMessage()) ); mEditAction->setShortcut( Qt::Key_T ); + mForwardActionMenu = new KActionMenu(KIcon("mail-forward"), i18nc("Message->","&Forward"), this); + mActionCollection->addAction("message_forward", mForwardActionMenu ); + + mForwardAttachedAction = new KAction(KIcon("mail-forward"), i18nc("Message->Forward->","As &Attachment..."), this); + mActionCollection->addAction("message_forward_as_attachment", mForwardAttachedAction ); + mForwardAttachedAction->setShortcut(QKeySequence(Qt::Key_F)); + connect( mForwardAttachedAction, SIGNAL(triggered(bool) ), + parent, SLOT(slotForwardAttachedMsg()) ); + + mForwardInlineAction = new KAction(KIcon("mail-forward"), i18n("&Inline..."), this); + mActionCollection->addAction("message_forward_inline", mForwardInlineAction ); + mForwardInlineAction->setShortcut(QKeySequence(Qt::SHIFT+Qt::Key_F)); + connect( mForwardInlineAction, SIGNAL(triggered(bool) ), + parent, SLOT(slotForwardInlineMsg()) ); + + setupForwardActions(); + + mRedirectAction = new KAction(i18nc("Message->Forward->", "&Redirect..."), this); + mActionCollection->addAction("message_forward_redirect", mRedirectAction ); + connect( mRedirectAction, SIGNAL(triggered(bool)), + parent, SLOT(slotRedirectMsg())); + mRedirectAction->setShortcut(QKeySequence(Qt::Key_E)); + mForwardActionMenu->addAction( mRedirectAction ); + updateActions(); } @@ -205,6 +230,47 @@ void MessageActions::setMessageView(KMReaderWin * msgView) mMessageView = msgView; } +void MessageActions::setupForwardActions() +{ + disconnect( mForwardActionMenu, SIGNAL( triggered(bool) ), 0, 0 ); + mForwardActionMenu->removeAction( mForwardInlineAction ); + mForwardActionMenu->removeAction( mForwardAttachedAction ); + + if ( GlobalSettings::self()->forwardingInlineByDefault() ) { + mForwardActionMenu->insertAction( mRedirectAction, mForwardInlineAction ); + mForwardActionMenu->insertAction( mRedirectAction, mForwardAttachedAction ); + mForwardInlineAction->setShortcut(QKeySequence(Qt::Key_F)); + mForwardAttachedAction->setShortcut(QKeySequence(Qt::SHIFT+Qt::Key_F)); + QObject::connect( mForwardActionMenu, SIGNAL(triggered(bool)), + mParent, SLOT(slotForwardInlineMsg()) ); + } + else { + mForwardActionMenu->insertAction( mRedirectAction, mForwardAttachedAction ); + mForwardActionMenu->insertAction( mRedirectAction, mForwardInlineAction ); + mForwardInlineAction->setShortcut(QKeySequence(Qt::SHIFT+Qt::Key_F)); + mForwardAttachedAction->setShortcut(QKeySequence(Qt::Key_F)); + QObject::connect( mForwardActionMenu, SIGNAL(triggered(bool)), + mParent, SLOT(slotForwardAttachedMsg()) ); + } +} + +void MessageActions::setupForwardingActionsList( KXMLGUIClient *guiClient ) +{ + QList mForwardActionList; + guiClient->unplugActionList( "forward_action_list" ); + if ( GlobalSettings::self()->forwardingInlineByDefault() ) { + mForwardActionList.append( mForwardInlineAction ); + mForwardActionList.append( mForwardAttachedAction ); + } + else { + mForwardActionList.append( mForwardAttachedAction ); + mForwardActionList.append( mForwardInlineAction ); + } + mForwardActionList.append( mRedirectAction ); + guiClient->plugActionList( "forward_action_list", mForwardActionList ); +} + + void MessageActions::slotReplyToMsg() { replyCommand(); diff --git a/messageactions.h b/messageactions.h index 28a0c5fde..d24425a02 100644 --- a/messageactions.h +++ b/messageactions.h @@ -30,6 +30,7 @@ class KAction; class KActionMenu; class KActionCollection; class KMMessage; +class KXMLGUIClient; namespace KMail { @@ -43,6 +44,18 @@ class MessageActions : public QObject MessageActions( KActionCollection* ac, QWidget *parent ); void setMessageView( KMReaderWin *msgView ); + /** + * This function adds or updates the actions of the forward action menu, taking the + * preference whether to forward inline or as attachment by default into account. + * This has to be called when that preference config has been changed. + */ + void setupForwardActions(); + + /** + * Sets up action list for forward menu. + */ + void setupForwardingActionsList( KXMLGUIClient *guiClient ); + void setCurrentMessage( KMMessage *msg ); void setSelectedSernums( const QList &sernums ); void setSelectedVisibleSernums( const QList &sernums ); @@ -50,8 +63,12 @@ class MessageActions : public QObject KActionMenu* replyMenu() const { return mReplyActionMenu; } KAction* replyListAction() const { return mReplyListAction; } KAction* createTodoAction() const { return mCreateTodoAction; } + KAction* forwardInlineAction() const { return mForwardInlineAction; } + KAction* forwardAttachedAction() const { return mForwardAttachedAction; } + KAction* redirectAction() const { return mRedirectAction; } KActionMenu* messageStatusMenu() const { return mStatusMenu; } + KActionMenu *forwardMenu() const { return mForwardActionMenu; } KAction* editAction() const { return mEditAction; } @@ -93,9 +110,11 @@ class MessageActions : public QObject KActionMenu *mReplyActionMenu; KAction *mReplyAction, *mReplyAllAction, *mReplyAuthorAction, - *mReplyListAction, *mNoQuoteReplyAction; + *mReplyListAction, *mNoQuoteReplyAction, + *mForwardInlineAction, *mForwardAttachedAction, *mRedirectAction; KAction *mCreateTodoAction; KActionMenu *mStatusMenu; + KActionMenu *mForwardActionMenu; KToggleAction *mToggleFlagAction, *mToggleTodoAction; KAction *mEditAction; }; From 584591c3e5e4d0af354da7aa0aeb3f82e8465d8e Mon Sep 17 00:00:00 2001 From: Thomas McGuire Date: Wed, 4 Mar 2009 09:22:41 +0000 Subject: [PATCH 09/11] Merged revisions 931706 via svnmerge from svn+ssh://tmcguire@svn.kde.org/home/kde/branches/kdepim/enterprise/kdepim MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ........ r931706 | winterz | 2009-02-25 18:37:46 +0100 (Wed, 25 Feb 2009) | 3 lines believe it or not, there's a character in the KDAB copyright line that kills xemacs 21.4. So I replaced that char with 'ä' and now xemacs is happy. ........ svn path=/branches/kdepim/enterprise4/kdepim/; revision=934940 --- urlhandlermanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/urlhandlermanager.cpp b/urlhandlermanager.cpp index c2481c83d..8f692d797 100644 --- a/urlhandlermanager.cpp +++ b/urlhandlermanager.cpp @@ -2,7 +2,7 @@ urlhandlermanager.cpp This file is part of KMail, the KDE mail client. - Copyright (c) 2002-2003 Klar�vdalens Datakonsult AB + Copyright (c) 2002-2003 Klarälvdalens Datakonsult AB Copyright (c) 2003 Marc Mutz KMail is free software; you can redistribute it and/or modify it From a759591838f73088845d32866d599535ce167d08 Mon Sep 17 00:00:00 2001 From: Thomas McGuire Date: Wed, 4 Mar 2009 09:27:01 +0000 Subject: [PATCH 10/11] Merged revisions 931708 via svnmerge from svn+ssh://tmcguire@svn.kde.org/home/kde/branches/kdepim/enterprise/kdepim ........ r931708 | winterz | 2009-02-25 18:39:48 +0100 (Wed, 25 Feb 2009) | 5 lines in makeShowAuditLogLink, return empty QString if the auditLog is empty. fixes kolab/issue3436 Should be merged into all branches. ........ svn path=/branches/kdepim/enterprise4/kdepim/; revision=934942 --- objecttreeparser.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/objecttreeparser.cpp b/objecttreeparser.cpp index 098017236..0563ac716 100644 --- a/objecttreeparser.cpp +++ b/objecttreeparser.cpp @@ -2139,12 +2139,16 @@ static QString makeShowAuditLogLink( const GpgME::Error & err, const QString & a } } - KUrl url; - url.setProtocol( "kmail" ); - url.setPath( "showAuditLog" ); - url.addQueryItem( "log", auditLog ); + if ( !auditLog.isEmpty() ) { + KUrl url; + url.setProtocol( "kmail" ); + url.setPath( "showAuditLog" ); + url.addQueryItem( "log", auditLog ); - return "" + i18nc("The Audit Log is a detailed error log from the gnupg backend", "Show Audit Log") + ""; + return "" + i18nc("The Audit Log is a detailed error log from the gnupg backend", "Show Audit Log") + ""; + } + + return QString(); } static QString endVerboseSigstatHeader( const PartMetaData & pmd ) From e68ca3a0c47d8f146524dd4c1a4bf04da3261c8e Mon Sep 17 00:00:00 2001 From: Thomas McGuire Date: Wed, 4 Mar 2009 17:00:41 +0000 Subject: [PATCH 11/11] You'll need an up-to-date e4-kdelibs for this! Introduce the CMake variable ENTERPRISE_BUILD. Now, a config-enterprise.h is created, which you can #include to have enterprise-specifc behavior. This is used in KMail for the "too many recipients" warning and the default forward type combobox, which I don't really want in trunk. The GUI option is disabled here. The default too-many-recipients warning is disabled by default for non-enterprise builds, with some cmake magic. svn path=/branches/kdepim/enterprise4/kdepim/; revision=935217 --- CMakeLists.txt | 19 +++++++++++++++---- configuredialog.cpp | 20 ++++++++++++++++++-- configuredialog_p.h | 8 ++++++-- kmail.kcfg => kmail.kcfg.cmake | 2 +- 4 files changed, 40 insertions(+), 9 deletions(-) rename kmail.kcfg => kmail.kcfg.cmake (99%) diff --git a/CMakeLists.txt b/CMakeLists.txt index a1e5baec3..d65fac25e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -246,11 +246,22 @@ qt4_add_dbus_interfaces(kmailprivate_LIB_SRCS qt4_add_dbus_adaptor( kmailprivate_LIB_SRCS ${CMAKE_SOURCE_DIR}/libkdepim/interfaces/org.kde.mailtransport.service.xml mailserviceimpl.h KMail::MailServiceImpl) - - kde4_add_ui_files(kmailprivate_LIB_SRCS composercryptoconfiguration.ui warningconfiguration.ui smimeconfiguration.ui templatesconfiguration_base.ui customtemplates_base.ui snippetdlgbase.ui imapsettings.ui localsettings.ui maildirsettings.ui popsettings.ui) -kde4_add_kcfg_files(kmailprivate_LIB_SRCS globalsettings_base.kcfgc replyphrases.kcfgc custommimeheader.kcfgc templatesconfiguration_kfg.kcfgc customtemplates_kfg.kcfgc ) +if(ENTERPRISE_BUILD) + set(WARN_TOOMANY_RECIPIENTS_DEFAULT true) +else(ENTERPRISE_BUILD) + set(WARN_TOOMANY_RECIPIENTS_DEFAULT false) +endif(ENTERPRISE_BUILD) +configure_file(kmail.kcfg.cmake ${CMAKE_CURRENT_BINARY_DIR}/kmail.kcfg) + +kde4_add_kcfg_files(kmailprivate_LIB_SRCS + globalsettings_base.kcfgc + replyphrases.kcfgc + custommimeheader.kcfgc + templatesconfiguration_kfg.kcfgc + customtemplates_kfg.kcfgc +) set(KMAIL_SQLITE_INDEX false CACHE BOOL "Use sqlite instead of mmap backend for KMail's folder indexes") mark_as_advanced(KMAIL_SQLITE_INDEX) @@ -341,7 +352,7 @@ install(TARGETS kmail ${INSTALL_TARGETS_DEFAULT_ARGS} ) ########### install files ############### install( FILES KMail.desktop kmail_view.desktop DESTINATION ${XDG_APPS_INSTALL_DIR}) -install( FILES kmail.kcfg replyphrases.kcfg custommimeheader.kcfg customtemplates_kfg.kcfg templatesconfiguration_kfg.kcfg DESTINATION ${KCFG_INSTALL_DIR}) +install( FILES ${CMAKE_CURRENT_BINARY_DIR}/kmail.kcfg replyphrases.kcfg custommimeheader.kcfg customtemplates_kfg.kcfg templatesconfiguration_kfg.kcfg DESTINATION ${KCFG_INSTALL_DIR}) install( FILES kmail.antispamrc kmail.antivirusrc DESTINATION ${CONFIG_INSTALL_DIR}) install( FILES tips DESTINATION ${DATA_INSTALL_DIR}/kmail) install( FILES kmail_config_misc.desktop kmail_config_appearance.desktop kmail_config_identity.desktop kmail_config_accounts.desktop kmail_config_composer.desktop kmail_config_security.desktop DESTINATION ${SERVICES_INSTALL_DIR}) diff --git a/configuredialog.cpp b/configuredialog.cpp index ec0d35fbe..1dcf696e4 100644 --- a/configuredialog.cpp +++ b/configuredialog.cpp @@ -22,6 +22,8 @@ // This must be first #include +#include + // my headers: #include "configuredialog.h" #include "configuredialog_p.h" @@ -2914,6 +2916,7 @@ ComposerPageGeneralTab::ComposerPageGeneralTab( QWidget * parent ) connect( mWordWrapCheck, SIGNAL(toggled(bool)), mWrapColumnSpin, SLOT(setEnabled(bool)) ); +#ifdef ENTERPRISE_BUILD // a checkbox for "too many recipient warning" and a spinbox for the recipient threshold hlay = new QHBoxLayout(); // inherits spacing vlay->addLayout( hlay ); @@ -2947,6 +2950,7 @@ ComposerPageGeneralTab::ComposerPageGeneralTab( QWidget * parent ) // only enable the spinbox if the checkbox is checked: connect( mRecipientCheck, SIGNAL(toggled(bool)), mRecipientSpin, SLOT(setEnabled(bool)) ); +#endif hlay = new QHBoxLayout(); // inherits spacing vlay->addLayout( hlay ); @@ -2962,6 +2966,7 @@ ComposerPageGeneralTab::ComposerPageGeneralTab( QWidget * parent ) connect( mAutoSave, SIGNAL( valueChanged(int) ), this, SLOT( slotEmitChanged( void ) ) ); +#ifdef ENTERPRISE_BUILD hlay = new QHBoxLayout(); // inherits spacing vlay->addLayout( hlay ); mForwardTypeCombo = new KComboBox( false, this ); @@ -2975,6 +2980,7 @@ ComposerPageGeneralTab::ComposerPageGeneralTab( QWidget * parent ) hlay->addStretch( 1 ); connect( mForwardTypeCombo, SIGNAL( activated( int ) ), this, SLOT( slotEmitChanged() ) ); +#endif hlay = new QHBoxLayout(); // inherits spacing vlay->addLayout( hlay ); @@ -3052,13 +3058,16 @@ void ComposerPage::GeneralTab::doLoadFromGlobalSettings() { mAutoRequestMDNCheck->setChecked( GlobalSettings::self()->requestMDN() ); mWordWrapCheck->setChecked( GlobalSettings::self()->wordWrap() ); mWrapColumnSpin->setValue( GlobalSettings::self()->lineWrapWidth() ); + mAutoSave->setValue( GlobalSettings::self()->autosaveInterval() ); + +#ifdef ENTERPRISE_BUILD mRecipientCheck->setChecked( GlobalSettings::self()->tooManyRecipients() ); mRecipientSpin->setValue( GlobalSettings::self()->recipientThreshold() ); - mAutoSave->setValue( GlobalSettings::self()->autosaveInterval() ); if ( GlobalSettings::self()->forwardingInlineByDefault() ) mForwardTypeCombo->setCurrentIndex( 0 ); else mForwardTypeCombo->setCurrentIndex( 1 ); +#endif // editor group: mExternalEditorCheck->setChecked( GlobalSettings::self()->useExternalEditor() ); @@ -3085,10 +3094,14 @@ void ComposerPage::GeneralTab::installProfile( KConfig * profile ) { mWordWrapCheck->setChecked( composer.readEntry( "word-wrap", false ) ); if ( composer.hasKey( "break-at" ) ) mWrapColumnSpin->setValue( composer.readEntry( "break-at", 0 ) ); + +#ifdef ENTERPRISE_BUILD if ( composer.hasKey( "too-many-recipients" ) ) mRecipientCheck->setChecked( composer.readEntry( "too-many-recipients", false ) ); if ( composer.hasKey( "recipient-threshold" ) ) mRecipientSpin->setValue( composer.readEntry( "recipient-threshold", 5 ) ); +#endif + if ( composer.hasKey( "autosave" ) ) mAutoSave->setValue( composer.readEntry( "autosave", 0 ) ); @@ -3109,10 +3122,13 @@ void ComposerPage::GeneralTab::save() { GlobalSettings::self()->setRequestMDN( mAutoRequestMDNCheck->isChecked() ); GlobalSettings::self()->setWordWrap( mWordWrapCheck->isChecked() ); GlobalSettings::self()->setLineWrapWidth( mWrapColumnSpin->value() ); + GlobalSettings::self()->setAutosaveInterval( mAutoSave->value() ); + +#ifdef ENTERPRISE_BUILD GlobalSettings::self()->setTooManyRecipients( mRecipientCheck->isChecked() ); GlobalSettings::self()->setRecipientThreshold( mRecipientSpin->value() ); - GlobalSettings::self()->setAutosaveInterval( mAutoSave->value() ); GlobalSettings::self()->setForwardingInlineByDefault( mForwardTypeCombo->currentIndex() == 0 ); +#endif // editor group: GlobalSettings::self()->setUseExternalEditor( mExternalEditorCheck->isChecked() ); diff --git a/configuredialog_p.h b/configuredialog_p.h index 0be678375..c40516984 100644 --- a/configuredialog_p.h +++ b/configuredialog_p.h @@ -5,6 +5,8 @@ #ifndef _CONFIGURE_DIALOG_PRIVATE_H_ #define _CONFIGURE_DIALOG_PRIVATE_H_ +#include + #include "kmail_export.h" #include @@ -713,12 +715,14 @@ private: QCheckBox *mShowRecentAddressesInComposer; QCheckBox *mWordWrapCheck; KIntSpinBox *mWrapColumnSpin; - QCheckBox *mRecipientCheck; - KIntSpinBox *mRecipientSpin; KIntSpinBox *mAutoSave; QCheckBox *mExternalEditorCheck; KUrlRequester *mEditorRequester; +#ifdef ENTERPRISE_BUILD KComboBox *mForwardTypeCombo; + QCheckBox *mRecipientCheck; + KIntSpinBox *mRecipientSpin; +#endif }; class ComposerPagePhrasesTab : public ConfigModuleTab { diff --git a/kmail.kcfg b/kmail.kcfg.cmake similarity index 99% rename from kmail.kcfg rename to kmail.kcfg.cmake index 22ba05ded..ffbc3f5ee 100644 --- a/kmail.kcfg +++ b/kmail.kcfg.cmake @@ -340,7 +340,7 @@ - true + ${WARN_TOOMANY_RECIPIENTS_DEFAULT} If the number of recipients is larger than this value, KMail will warn and ask for a confirmation before sending the mail. The warning can be turned off.