• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

messageviewer

  • sources
  • kde-4.14
  • kdepim
  • messageviewer
  • widgets
invitationsettings.cpp
Go to the documentation of this file.
1 /*
2  Boost Software License - Version 1.0 - August 17th, 2003
3 
4  Permission is hereby granted, free of charge, to any person or organization
5  obtaining a copy of the software and accompanying documentation covered by
6  this license (the "Software") to use, reproduce, display, distribute,
7  execute, and transmit the Software, and to prepare derivative works of the
8  Software, and to permit third-parties to whom the Software is furnished to
9  do so, all subject to the following:
10 
11  The copyright notices in the Software and this entire statement, including
12  the above license grant, this restriction and the following disclaimer,
13  must be included in all copies of the Software, in whole or in part, and
14  all derivative works of the Software, unless such copies or derivative
15  works are solely in the form of machine-executable object code generated by
16  a source language processor.
17 
18  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20  FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
21  SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
22  FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
23  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24  DEALINGS IN THE SOFTWARE.
25 
26 */
27 
28 #include "invitationsettings.h"
29 #include "ui_invitationsettings.h"
30 #include "settings/globalsettings.h"
31 #include "pimcommon/widgets/configureimmutablewidgetutils.h"
32 using namespace PimCommon::ConfigureImmutableWidgetUtils;
33 
34 #include <KLocalizedString>
35 #include <KMessageBox>
36 
37 using namespace MessageViewer;
38 
39 InvitationSettings::InvitationSettings( QWidget *parent )
40  : QWidget( parent ), mInvitationUi( new Ui_InvitationSettings )
41 {
42  mInvitationUi->setupUi( this );
43 
44  mInvitationUi->mDeleteInvitations->setText(
45  i18n( GlobalSettings::self()->
46  deleteInvitationEmailsAfterSendingReplyItem()->label().toUtf8() ) );
47  mInvitationUi->mDeleteInvitations->setWhatsThis(
48  i18n( GlobalSettings::self()->
49  deleteInvitationEmailsAfterSendingReplyItem()->whatsThis().toUtf8() ) );
50  connect( mInvitationUi->mDeleteInvitations, SIGNAL(toggled(bool)),
51  SIGNAL(changed()) );
52 
53  mInvitationUi->mLegacyMangleFromTo->setWhatsThis(
54  i18n( GlobalSettings::self()->legacyMangleFromToHeadersItem()->whatsThis().toUtf8() ) );
55  connect( mInvitationUi->mLegacyMangleFromTo, SIGNAL(stateChanged(int)),
56  this, SIGNAL(changed()) );
57 
58  mInvitationUi->mLegacyBodyInvites->setWhatsThis(
59  i18n( GlobalSettings::self()->legacyBodyInvitesItem()->whatsThis().toUtf8() ) );
60  connect( mInvitationUi->mLegacyBodyInvites, SIGNAL(toggled(bool)),
61  this, SLOT(slotLegacyBodyInvitesToggled(bool)) );
62  connect( mInvitationUi->mLegacyBodyInvites, SIGNAL(stateChanged(int)),
63  this, SIGNAL(changed()) );
64 
65  mInvitationUi->mExchangeCompatibleInvitations->setWhatsThis(
66  i18n( GlobalSettings::self()->exchangeCompatibleInvitationsItem()->whatsThis().toUtf8() ) );
67  connect( mInvitationUi->mExchangeCompatibleInvitations, SIGNAL(stateChanged(int)),
68  this, SIGNAL(changed()) );
69 
70  mInvitationUi->mOutlookCompatibleInvitationComments->setWhatsThis(
71  i18n( GlobalSettings::self()->
72  outlookCompatibleInvitationReplyCommentsItem()->whatsThis().toUtf8() ) );
73  connect( mInvitationUi->mOutlookCompatibleInvitationComments, SIGNAL(stateChanged(int)),
74  this, SIGNAL(changed()) );
75 
76  mInvitationUi->mOutlookCompatibleInvitationComparisons->setWhatsThis(
77  i18n( GlobalSettings::self()->
78  outlookCompatibleInvitationComparisonsItem()->whatsThis().toUtf8() ) );
79  connect( mInvitationUi->mOutlookCompatibleInvitationComparisons, SIGNAL(stateChanged(int)),
80  this, SIGNAL(changed()) );
81 
82  //Laurent BUG:257723: in kmail2 it's not possible to not send automatically.
83  mInvitationUi->mAutomaticSending->hide();
84  mInvitationUi->mAutomaticSending->setWhatsThis(
85  i18n( GlobalSettings::self()->automaticSendingItem()->whatsThis().toUtf8() ) );
86  connect( mInvitationUi->mAutomaticSending, SIGNAL(stateChanged(int)),
87  this, SIGNAL(changed()) );
88 }
89 
90 InvitationSettings::~InvitationSettings()
91 {
92  delete mInvitationUi;
93  mInvitationUi = 0;
94 }
95 
96 void InvitationSettings::slotLegacyBodyInvitesToggled( bool on )
97 {
98  if ( on ) {
99  const QString txt = i18n( "<qt>Invitations are normally sent as attachments to "
100  "a mail. This switch changes the invitation mails to "
101  "be sent in the text of the mail instead; this is "
102  "necessary to send invitations and replies to "
103  "Microsoft Outlook.<br />But, when you do this, you no "
104  "longer get descriptive text that mail programs "
105  "can read; so, to people who have email programs "
106  "that do not understand the invitations, the "
107  "resulting messages look very odd.<br />People that have email "
108  "programs that do understand invitations will still "
109  "be able to work with this.</qt>" );
110  KMessageBox::information( this, txt, QString(), QLatin1String("LegacyBodyInvitesWarning") );
111  }
112  // Invitations in the body are autosent in any case (no point in editing raw ICAL)
113  // So the autosend option is only available if invitations are sent as attachment.
114  mInvitationUi->mAutomaticSending->setEnabled( !mInvitationUi->mLegacyBodyInvites->isChecked() );
115 }
116 
117 void InvitationSettings::doLoadFromGlobalSettings()
118 {
119  loadWidget(mInvitationUi->mLegacyMangleFromTo, GlobalSettings::self()->legacyMangleFromToHeadersItem());
120  mInvitationUi->mLegacyBodyInvites->blockSignals( true );
121  loadWidget(mInvitationUi->mLegacyBodyInvites, GlobalSettings::self()->legacyBodyInvitesItem());
122  mInvitationUi->mLegacyBodyInvites->blockSignals( false );
123  loadWidget(mInvitationUi->mExchangeCompatibleInvitations, GlobalSettings::self()->exchangeCompatibleInvitationsItem());
124  loadWidget(mInvitationUi->mOutlookCompatibleInvitationComments, GlobalSettings::self()->outlookCompatibleInvitationReplyCommentsItem());
125  loadWidget(mInvitationUi->mOutlookCompatibleInvitationComparisons, GlobalSettings::self()->outlookCompatibleInvitationComparisonsItem());
126  loadWidget(mInvitationUi->mAutomaticSending, GlobalSettings::self()->automaticSendingItem());
127  //TODO verify it
128  mInvitationUi->mAutomaticSending->setEnabled( !mInvitationUi->mLegacyBodyInvites->isChecked() );
129  loadWidget(mInvitationUi->mDeleteInvitations, GlobalSettings::self()->deleteInvitationEmailsAfterSendingReplyItem());
130 }
131 
132 void InvitationSettings::save()
133 {
134  saveCheckBox(mInvitationUi->mLegacyMangleFromTo, GlobalSettings::self()->legacyMangleFromToHeadersItem());
135  saveCheckBox(mInvitationUi->mLegacyBodyInvites, GlobalSettings::self()->legacyBodyInvitesItem());
136  saveCheckBox(mInvitationUi->mExchangeCompatibleInvitations, GlobalSettings::self()->exchangeCompatibleInvitationsItem());
137  saveCheckBox(mInvitationUi->mOutlookCompatibleInvitationComments, GlobalSettings::self()->outlookCompatibleInvitationReplyCommentsItem());
138  saveCheckBox(mInvitationUi->mOutlookCompatibleInvitationComparisons, GlobalSettings::self()->outlookCompatibleInvitationComparisonsItem());
139  saveCheckBox(mInvitationUi->mAutomaticSending, GlobalSettings::self()->automaticSendingItem());
140  saveCheckBox(mInvitationUi->mDeleteInvitations, GlobalSettings::self()->deleteInvitationEmailsAfterSendingReplyItem());
141 }
142 
143 QString InvitationSettings::helpAnchor() const
144 {
145  return QString::fromLatin1( "configure-misc-invites" );
146 }
147 
148 void InvitationSettings::doResetToDefaultsOther()
149 {
150  const bool bUseDefaults = GlobalSettings::self()->useDefaults( true );
151  loadWidget(mInvitationUi->mLegacyMangleFromTo, GlobalSettings::self()->legacyMangleFromToHeadersItem());
152  mInvitationUi->mLegacyBodyInvites->blockSignals( true );
153  loadWidget(mInvitationUi->mLegacyBodyInvites, GlobalSettings::self()->legacyBodyInvitesItem());
154  mInvitationUi->mLegacyBodyInvites->blockSignals( false );
155  loadWidget(mInvitationUi->mExchangeCompatibleInvitations, GlobalSettings::self()->exchangeCompatibleInvitationsItem());
156  loadWidget(mInvitationUi->mOutlookCompatibleInvitationComments, GlobalSettings::self()->outlookCompatibleInvitationReplyCommentsItem());
157  loadWidget(mInvitationUi->mOutlookCompatibleInvitationComparisons, GlobalSettings::self()->outlookCompatibleInvitationComparisonsItem());
158  loadWidget(mInvitationUi->mAutomaticSending, GlobalSettings::self()->automaticSendingItem());
159  //TODO verify it
160  mInvitationUi->mAutomaticSending->setEnabled( !mInvitationUi->mLegacyBodyInvites->isChecked() );
161  loadWidget(mInvitationUi->mDeleteInvitations, GlobalSettings::self()->deleteInvitationEmailsAfterSendingReplyItem());
162  GlobalSettings::self()->useDefaults( bUseDefaults );
163 }
globalsettings.h
QWidget
invitationsettings.h
MessageViewer::InvitationSettings::~InvitationSettings
~InvitationSettings()
Definition: invitationsettings.cpp:90
MessageViewer::InvitationSettings::doResetToDefaultsOther
void doResetToDefaultsOther()
Definition: invitationsettings.cpp:148
MessageViewer::InvitationSettings::helpAnchor
QString helpAnchor() const
Definition: invitationsettings.cpp:143
MessageViewer::GlobalSettings::self
static GlobalSettings * self()
Definition: globalsettings.cpp:34
MessageViewer::InvitationSettings::save
void save()
Definition: invitationsettings.cpp:132
QString
QWidget::whatsThis
QString whatsThis() const
MessageViewer::InvitationSettings::doLoadFromGlobalSettings
void doLoadFromGlobalSettings()
Definition: invitationsettings.cpp:117
QLatin1String
MessageViewer::InvitationSettings::changed
void changed()
QString::fromLatin1
QString fromLatin1(const char *str, int size)
QObject::connect
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:32:45 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

messageviewer

Skip menu "messageviewer"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer
  • pimprint

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal