From 5fb6df55f90c8f8a26ae5adf51010e07cd5eb525 Mon Sep 17 00:00:00 2001 From: Andras Mantia Date: Fri, 7 May 2010 11:39:47 +0000 Subject: [PATCH] Move invitation handling settings (and dialog) to the messageviewer. svn path=/trunk/KDE/kdepim/kmail/; revision=1123929 --- CMakeLists.txt | 1 - configuredialog.cpp | 88 +++----------------------------- configuredialog_p.cpp | 1 + configuredialog_p.h | 7 +-- kmail.kcfg.cmake | 49 ------------------ kmkernel.cpp | 8 +-- kmmainwin.cpp | 1 - ui/miscpageinvitetab.ui | 108 ---------------------------------------- 8 files changed, 15 insertions(+), 248 deletions(-) delete mode 100644 ui/miscpageinvitetab.ui diff --git a/CMakeLists.txt b/CMakeLists.txt index b76825d62..a60ef419f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -191,7 +191,6 @@ kde4_add_ui_files(kmailprivate_LIB_SRCS ui/smimeconfiguration.ui ui/snippetdlgbase.ui ui/miscpagemaintab.ui - ui/miscpageinvitetab.ui ui/securitypagegeneraltab.ui ui/identitypage.ui ui/accountspagereceivingtab.ui diff --git a/configuredialog.cpp b/configuredialog.cpp index c57207769..8bd8a3bfb 100644 --- a/configuredialog.cpp +++ b/configuredialog.cpp @@ -60,6 +60,7 @@ using KPIM::RecentAddresses; #include "messageviewer/nodehelper.h" #include "messageviewer/configurewidget.h" #include "messageviewer/globalsettings.h" +#include "messageviewer/invitationsettings.h" #include "messagelist/core/settings.h" #include "messagecore/globalsettings.h" @@ -3855,98 +3856,25 @@ void MiscPage::FolderTab::save() mMMTab.mExcludeImportantFromExpiry->isChecked() ); } -QString MiscPage::InviteTab::helpAnchor() const -{ - return QString::fromLatin1("configure-misc-invites"); -} MiscPageInviteTab::MiscPageInviteTab( QWidget* parent ) : ConfigModuleTab( parent ) { - mMITab.setupUi( this ); - - mMITab.mDeleteInvitations->setText( - i18n( GlobalSettings::self()->deleteInvitationEmailsAfterSendingReplyItem()->label().toUtf8() ) ); - mMITab.mDeleteInvitations->setWhatsThis( i18n( GlobalSettings::self() - ->deleteInvitationEmailsAfterSendingReplyItem()->whatsThis().toUtf8() ) ); - connect( mMITab.mDeleteInvitations, SIGNAL( toggled(bool) ), - SLOT( slotEmitChanged() ) ); - - mMITab.mLegacyMangleFromTo->setWhatsThis( i18n( GlobalSettings::self()-> - legacyMangleFromToHeadersItem()->whatsThis().toUtf8() ) ); - connect( mMITab.mLegacyMangleFromTo, SIGNAL( stateChanged( int ) ), - this, SLOT( slotEmitChanged( void ) ) ); - mMITab.mLegacyMangleFromTo->setWhatsThis( i18n( GlobalSettings::self()-> - legacyBodyInvitesItem()->whatsThis().toUtf8() ) ); - connect( mMITab.mLegacyBodyInvites, SIGNAL( toggled( bool ) ), - this, SLOT( slotLegacyBodyInvitesToggled( bool ) ) ); - connect( mMITab.mLegacyBodyInvites, SIGNAL( stateChanged( int ) ), - this, SLOT( slotEmitChanged( void ) ) ); - - mMITab.mExchangeCompatibleInvitations->setWhatsThis( i18n( GlobalSettings::self()-> - exchangeCompatibleInvitationsItem()->whatsThis().toUtf8() ) ); - connect( mMITab.mExchangeCompatibleInvitations, SIGNAL( stateChanged( int ) ), - this, SLOT( slotEmitChanged( void ) ) ); - - mMITab.mOutlookCompatibleInvitationComments->setWhatsThis( i18n( GlobalSettings::self()-> - outlookCompatibleInvitationReplyCommentsItem()->whatsThis().toUtf8() ) ); - connect( mMITab.mOutlookCompatibleInvitationComments, SIGNAL( stateChanged( int ) ), - this, SLOT( slotEmitChanged( void ) ) ); - - mMITab.mAutomaticSending->setWhatsThis( i18n( GlobalSettings::self()-> - automaticSendingItem()->whatsThis().toUtf8() ) ); - connect( mMITab.mAutomaticSending, SIGNAL( stateChanged( int ) ), - this, SLOT( slotEmitChanged( void ) ) ); -} - -void MiscPageInviteTab::slotLegacyBodyInvitesToggled( bool on ) -{ - if ( on ) { - QString txt = i18n( "Invitations are normally sent as attachments to " - "a mail. This switch changes the invitation mails to " - "be sent in the text of the mail instead; this is " - "necessary to send invitations and replies to " - "Microsoft Outlook.
But, when you do this, you no " - "longer get descriptive text that mail programs " - "can read; so, to people who have email programs " - "that do not understand the invitations, the " - "resulting messages look very odd.
People that have email " - "programs that do understand invitations will still " - "be able to work with this.
" ); - KMessageBox::information( this, txt, QString(), "LegacyBodyInvitesWarning" ); - } - // Invitations in the body are autosent in any case (no point in editing raw ICAL) - // So the autosend option is only available if invitations are sent as attachment. - mMITab.mAutomaticSending->setEnabled( !mMITab.mLegacyBodyInvites->isChecked() ); + mInvitationUi = new MessageViewer::InvitationSettings( this ); + QHBoxLayout *l = new QHBoxLayout( this ); + l->setContentsMargins( 0 , 0, 0, 0 ); + l->addWidget( mInvitationUi ); + connect( mInvitationUi, SIGNAL( changed() ), this, SLOT( slotEmitChanged() ) ); } void MiscPage::InviteTab::doLoadFromGlobalSettings() { - mMITab.mLegacyMangleFromTo->setChecked( GlobalSettings::self()->legacyMangleFromToHeaders() ); - mMITab.mExchangeCompatibleInvitations->setChecked( GlobalSettings::self()->exchangeCompatibleInvitations() ); - - mMITab.mLegacyBodyInvites->blockSignals( true ); - mMITab.mLegacyBodyInvites->setChecked( GlobalSettings::self()->legacyBodyInvites() ); - mMITab.mLegacyBodyInvites->blockSignals( false ); - - mMITab.mOutlookCompatibleInvitationComments->setChecked( GlobalSettings::self()->outlookCompatibleInvitationReplyComments() ); - - mMITab.mAutomaticSending->setChecked( GlobalSettings::self()->automaticSending() ); - mMITab.mAutomaticSending->setEnabled( !mMITab.mLegacyBodyInvites->isChecked() ); - mMITab.mDeleteInvitations->setChecked( GlobalSettings::self()->deleteInvitationEmailsAfterSendingReply() ); + mInvitationUi->doLoadFromGlobalSettings(); } void MiscPage::InviteTab::save() { - KConfigGroup groupware( KMKernel::config(), "Groupware" ); - - // Write the groupware config - GlobalSettings::self()->setLegacyMangleFromToHeaders( mMITab.mLegacyMangleFromTo->isChecked() ); - GlobalSettings::self()->setLegacyBodyInvites( mMITab.mLegacyBodyInvites->isChecked() ); - GlobalSettings::self()->setExchangeCompatibleInvitations( mMITab.mExchangeCompatibleInvitations->isChecked() ); - GlobalSettings::self()->setOutlookCompatibleInvitationReplyComments( mMITab.mOutlookCompatibleInvitationComments->isChecked() ); - GlobalSettings::self()->setAutomaticSending( mMITab.mAutomaticSending->isChecked() ); - GlobalSettings::self()->setDeleteInvitationEmailsAfterSendingReply( mMITab.mDeleteInvitations->isChecked() ); + mInvitationUi->save(); } diff --git a/configuredialog_p.cpp b/configuredialog_p.cpp index 8c3f0f514..2d4b533d0 100644 --- a/configuredialog_p.cpp +++ b/configuredialog_p.cpp @@ -12,6 +12,7 @@ #include "globalsettings.h" #include "configuredialoglistview.h" #include "kmkernel.h" +#include // other kdenetwork headers: (none) diff --git a/configuredialog_p.h b/configuredialog_p.h index 79439ad7f..056b55dce 100644 --- a/configuredialog_p.h +++ b/configuredialog_p.h @@ -78,6 +78,7 @@ namespace MessageList { namespace MessageViewer { class ConfigureWidget; +class InvitationSettings; } namespace KMail { @@ -915,16 +916,12 @@ class MiscPageInviteTab : public ConfigModuleTab { public: MiscPageInviteTab( QWidget * parent=0 ); void save(); - QString helpAnchor() const; - -private slots: - void slotLegacyBodyInvitesToggled( bool on ); private: virtual void doLoadFromGlobalSettings(); private: - Ui_MiscInviteTab mMITab; + MessageViewer::InvitationSettings *mInvitationUi; }; class KMAIL_EXPORT MiscPage : public ConfigModuleWithTabs { diff --git a/kmail.kcfg.cmake b/kmail.kcfg.cmake index 903572954..ccc2a32bd 100644 --- a/kmail.kcfg.cmake +++ b/kmail.kcfg.cmake @@ -135,55 +135,6 @@ - - - - Microsoft Outlook has a number of shortcomings in its implementation of the iCalendar standard; this option works around one of them. If you have problems with Outlook users not being able to get your replies, try setting this option. - false - - - - - Microsoft Outlook has a number of shortcomings in its implementation of the iCalendar standard; this option works around one of them. If you have problems with Outlook users not being able to get your invitations, try setting this option. - false - - - - - Microsoft Outlook, when used in combination with a Microsoft Exchange server, has a problem understanding standards-compliant groupware email. Turn this option on to send groupware invitations in a way that Microsoft Exchange understands. - false - - - - - When replying to invitations, send the reply comment in way that Microsoft Outlook understands. - false - - - - - When this is checked, you will not see the mail composer window. Instead, all invitation mails are sent automatically. If you want to see the mail before sending it, you can uncheck this option. However, be aware that the text in the composer window is in iCalendar syntax, and you should not try modifying it by hand. - true - - - - - When this is checked, received invitation emails that have been replied to will be moved to the Trash folder, once the reply has been successfully sent. - ${DELETE_INVITATIONS_AFTER_REPLY_DEFAULT} - - - - - - - - - - - AskForAllButAcceptance - - -