Move invitation handling settings (and dialog) to the messageviewer.

svn path=/trunk/KDE/kdepim/kmail/; revision=1123929
wilder-work
Andras Mantia 16 years ago
parent 8282f2ece1
commit 5fb6df55f9
  1. 1
      CMakeLists.txt
  2. 88
      configuredialog.cpp
  3. 1
      configuredialog_p.cpp
  4. 7
      configuredialog_p.h
  5. 49
      kmail.kcfg.cmake
  6. 8
      kmkernel.cpp
  7. 1
      kmmainwin.cpp
  8. 108
      ui/miscpageinvitetab.ui

@ -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

@ -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( "<qt>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.<br />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.<br />People that have email "
"programs that do understand invitations will still "
"be able to work with this.</qt>" );
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();
}

@ -12,6 +12,7 @@
#include "globalsettings.h"
#include "configuredialoglistview.h"
#include "kmkernel.h"
#include <messageviewer/invitationsettings.h>
// other kdenetwork headers: (none)

@ -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 {

@ -135,55 +135,6 @@
</group>
<!-- General -->
<group name="Groupware">
<entry name="LegacyMangleFromToHeaders" type="Bool">
<label>Mangle From:/To: headers in replies to replies</label>
<whatsthis>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.</whatsthis>
<default>false</default>
</entry>
<entry name="LegacyBodyInvites" type="Bool">
<label>Send groupware invitations in the mail body</label>
<whatsthis>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.</whatsthis>
<default>false</default>
</entry>
<entry name="ExchangeCompatibleInvitations" type="Bool">
<label>Exchange-compatible invitation naming</label>
<whatsthis>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.</whatsthis>
<default>false</default>
</entry>
<entry name="OutlookCompatibleInvitationReplyComments" type="Bool">
<label>Outlook compatible invitation reply comments</label>
<whatsthis>When replying to invitations, send the reply comment in way that Microsoft Outlook understands.</whatsthis>
<default>false</default>
</entry>
<entry name="AutomaticSending" type="Bool">
<label>Automatic invitation sending</label>
<whatsthis>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.</whatsthis>
<default>true</default>
</entry>
<entry name="DeleteInvitationEmailsAfterSendingReply" type="Bool">
<label>Delete invitation emails after the reply to them has been sent</label>
<whatsthis>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.</whatsthis>
<default>${DELETE_INVITATIONS_AFTER_REPLY_DEFAULT}</default>
</entry>
<entry name="AskForCommentWhenReactingToInvitation" type="Enum">
<label></label>
<whatsthis></whatsthis>
<choices>
<choice name="NeverAsk"/>
<choice name="AskForAllButAcceptance"/>
<choice name="AlwaysAsk"/>
</choices>
<default>AskForAllButAcceptance</default>
</entry>
</group>
<group name="Internal">
<entry name="MsgDictSizeHint" type="Int" hidden="true">

@ -632,7 +632,7 @@ int KMKernel::openComposer (const QString &to, const QString &cc,
if ( isICalInvitation && bcc.isEmpty() )
msg->bcc()->clear();
if ( isICalInvitation &&
GlobalSettings::self()->legacyBodyInvites() ) {
MessageViewer::GlobalSettings::self()->legacyBodyInvites() ) {
// KOrganizer invitation caught and to be sent as body instead
msg->setBody( attachData );
context = KMail::Composer::NoTemplate;
@ -651,7 +651,7 @@ int KMKernel::openComposer (const QString &to, const QString &cc,
msgPart->setBody( attachData ); //TODO: check if was setBodyEncoded
msgPart->contentType()->setMimeType( attachType + "/" + attachSubType );
msgPart->contentDisposition()->setParameter( attachParamAttr, attachParamValue ); //TODO: Check if the content disposition parameter needs to be set!
if( ! GlobalSettings::self()->exchangeCompatibleInvitations() ) {
if( ! MessageViewer::GlobalSettings::self()->exchangeCompatibleInvitations() ) {
msgPart->contentDisposition()->fromUnicodeString(attachContDisp, "utf-8" );
}
if( !attachCharset.isEmpty() ) {
@ -659,14 +659,14 @@ int KMKernel::openComposer (const QString &to, const QString &cc,
msgPart->contentType()->setCharset( attachCharset );
}
// Don't show the composer window if the automatic sending is checked
iCalAutoSend = GlobalSettings::self()->automaticSending();
iCalAutoSend = MessageViewer::GlobalSettings::self()->automaticSending();
}
}
KMail::Composer * cWin = KMail::makeComposer( KMime::Message::Ptr(), context );
cWin->setMsg( msg, !isICalInvitation /* mayAutoSign */ );
cWin->setSigningAndEncryptionDisabled( isICalInvitation
&& GlobalSettings::self()->legacyBodyInvites() );
&& MessageViewer::GlobalSettings::self()->legacyBodyInvites() );
if ( noWordWrap )
cWin->disableWordWrap();
if ( msgPart )

@ -248,4 +248,3 @@ void KMMainWin::slotShowTipOnStart()
KTipDialog::showTip( this );
}

@ -1,108 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MiscInviteTab</class>
<widget class="QWidget" name="MiscInviteTab">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>572</width>
<height>266</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Groupware Compatibility &amp;&amp; Legacy Options</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="mLegacyMangleFromTo">
<property name="toolTip">
<string>Turn this option on in order to make Outlook(tm) understand your answers to invitation replies</string>
</property>
<property name="text">
<string>&amp;Mangle From:/To: headers in replies to invitations</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="mLegacyBodyInvites">
<property name="toolTip">
<string>Turn this option on in order to make Outlook(tm) understand your answers to invitations</string>
</property>
<property name="text">
<string>Send &amp;invitations in the mail body</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="mExchangeCompatibleInvitations">
<property name="toolTip">
<string>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.</string>
</property>
<property name="text">
<string>Exchange-compatible invitation &amp;naming</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="mOutlookCompatibleInvitationComments">
<property name="toolTip">
<string>Send invitation reply comments in a way that Microsoft Outlook(tm) understands.</string>
</property>
<property name="text">
<string>Outlook compatible invitation reply comments</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="mAutomaticSending">
<property name="toolTip">
<string>When this is on, the user will not see the mail composer window. Invitation mails are sent automatically.</string>
</property>
<property name="text">
<string>&amp;Automatic invitation sending</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Options</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QCheckBox" name="mDeleteInvitations">
<property name="text">
<string>Delete invitation emails after the reply to them has been sent</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
Loading…
Cancel
Save