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

messageviewer

  • sources
  • kde-4.12
  • 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 
29 
30 #include "invitationsettings.h"
31 #include "invitationsettings.moc"
32 #include "ui_invitationsettings.h"
33 #include "settings/globalsettings.h"
34 
35 #include <KLocale>
36 #include <KMessageBox>
37 
38 using namespace MessageViewer;
39 
40 InvitationSettings::InvitationSettings( QWidget *parent )
41  : QWidget( parent ), mInvitationUi( new Ui_InvitationSettings )
42 {
43  mInvitationUi->setupUi( this );
44 
45  mInvitationUi->mDeleteInvitations->setText(
46  i18n( GlobalSettings::self()->
47  deleteInvitationEmailsAfterSendingReplyItem()->label().toUtf8() ) );
48  mInvitationUi->mDeleteInvitations->setWhatsThis(
49  i18n( GlobalSettings::self()->
50  deleteInvitationEmailsAfterSendingReplyItem()->whatsThis().toUtf8() ) );
51  connect( mInvitationUi->mDeleteInvitations, SIGNAL(toggled(bool)),
52  SIGNAL(changed()) );
53 
54  mInvitationUi->mLegacyMangleFromTo->setWhatsThis(
55  i18n( GlobalSettings::self()->legacyMangleFromToHeadersItem()->whatsThis().toUtf8() ) );
56  connect( mInvitationUi->mLegacyMangleFromTo, SIGNAL(stateChanged(int)),
57  this, SIGNAL(changed()) );
58 
59  mInvitationUi->mLegacyBodyInvites->setWhatsThis(
60  i18n( GlobalSettings::self()->legacyBodyInvitesItem()->whatsThis().toUtf8() ) );
61  connect( mInvitationUi->mLegacyBodyInvites, SIGNAL(toggled(bool)),
62  this, SLOT(slotLegacyBodyInvitesToggled(bool)) );
63  connect( mInvitationUi->mLegacyBodyInvites, SIGNAL(stateChanged(int)),
64  this, SIGNAL(changed()) );
65 
66  mInvitationUi->mExchangeCompatibleInvitations->setWhatsThis(
67  i18n( GlobalSettings::self()->exchangeCompatibleInvitationsItem()->whatsThis().toUtf8() ) );
68  connect( mInvitationUi->mExchangeCompatibleInvitations, SIGNAL(stateChanged(int)),
69  this, SIGNAL(changed()) );
70 
71  mInvitationUi->mOutlookCompatibleInvitationComments->setWhatsThis(
72  i18n( GlobalSettings::self()->
73  outlookCompatibleInvitationReplyCommentsItem()->whatsThis().toUtf8() ) );
74  connect( mInvitationUi->mOutlookCompatibleInvitationComments, SIGNAL(stateChanged(int)),
75  this, SIGNAL(changed()) );
76 
77  mInvitationUi->mOutlookCompatibleInvitationComparisons->setWhatsThis(
78  i18n( GlobalSettings::self()->
79  outlookCompatibleInvitationComparisonsItem()->whatsThis().toUtf8() ) );
80  connect( mInvitationUi->mOutlookCompatibleInvitationComparisons, SIGNAL(stateChanged(int)),
81  this, SIGNAL(changed()) );
82 
83  //Laurent BUG:257723: in kmail2 it's not possible to not send automatically.
84  mInvitationUi->mAutomaticSending->hide();
85  mInvitationUi->mAutomaticSending->setWhatsThis(
86  i18n( GlobalSettings::self()->automaticSendingItem()->whatsThis().toUtf8() ) );
87  connect( mInvitationUi->mAutomaticSending, SIGNAL(stateChanged(int)),
88  this, SIGNAL(changed()) );
89 }
90 
91 InvitationSettings::~InvitationSettings()
92 {
93  delete mInvitationUi;
94  mInvitationUi = 0;
95 }
96 
97 void InvitationSettings::slotLegacyBodyInvitesToggled( bool on )
98 {
99  if ( on ) {
100  const QString txt = i18n( "<qt>Invitations are normally sent as attachments to "
101  "a mail. This switch changes the invitation mails to "
102  "be sent in the text of the mail instead; this is "
103  "necessary to send invitations and replies to "
104  "Microsoft Outlook.<br />But, when you do this, you no "
105  "longer get descriptive text that mail programs "
106  "can read; so, to people who have email programs "
107  "that do not understand the invitations, the "
108  "resulting messages look very odd.<br />People that have email "
109  "programs that do understand invitations will still "
110  "be able to work with this.</qt>" );
111  KMessageBox::information( this, txt, QString(), QLatin1String("LegacyBodyInvitesWarning") );
112  }
113  // Invitations in the body are autosent in any case (no point in editing raw ICAL)
114  // So the autosend option is only available if invitations are sent as attachment.
115  mInvitationUi->mAutomaticSending->setEnabled( !mInvitationUi->mLegacyBodyInvites->isChecked() );
116 }
117 
118 void InvitationSettings::doLoadFromGlobalSettings()
119 {
120  mInvitationUi->mLegacyMangleFromTo->setChecked(
121  GlobalSettings::self()->legacyMangleFromToHeaders() );
122 
123  mInvitationUi->mExchangeCompatibleInvitations->setChecked(
124  GlobalSettings::self()->exchangeCompatibleInvitations() );
125 
126  mInvitationUi->mLegacyBodyInvites->blockSignals( true );
127  mInvitationUi->mLegacyBodyInvites->setChecked( GlobalSettings::self()->legacyBodyInvites() );
128  mInvitationUi->mLegacyBodyInvites->blockSignals( false );
129 
130  mInvitationUi->mOutlookCompatibleInvitationComments->setChecked(
131  GlobalSettings::self()->outlookCompatibleInvitationReplyComments() );
132 
133  mInvitationUi->mOutlookCompatibleInvitationComparisons->setChecked(
134  GlobalSettings::self()->outlookCompatibleInvitationComparisons() );
135 
136  mInvitationUi->mAutomaticSending->setChecked( GlobalSettings::self()->automaticSending() );
137  mInvitationUi->mAutomaticSending->setEnabled( !mInvitationUi->mLegacyBodyInvites->isChecked() );
138 
139  mInvitationUi->mDeleteInvitations->setChecked(
140  GlobalSettings::self()->deleteInvitationEmailsAfterSendingReply() );
141 }
142 
143 void InvitationSettings::save()
144 {
145  GlobalSettings::self()->setLegacyMangleFromToHeaders(
146  mInvitationUi->mLegacyMangleFromTo->isChecked() );
147 
148  GlobalSettings::self()->setLegacyBodyInvites( mInvitationUi->mLegacyBodyInvites->isChecked() );
149 
150  GlobalSettings::self()->setExchangeCompatibleInvitations(
151  mInvitationUi->mExchangeCompatibleInvitations->isChecked() );
152 
153  GlobalSettings::self()->setOutlookCompatibleInvitationReplyComments(
154  mInvitationUi->mOutlookCompatibleInvitationComments->isChecked() );
155 
156  GlobalSettings::self()->setOutlookCompatibleInvitationComparisons(
157  mInvitationUi->mOutlookCompatibleInvitationComparisons->isChecked() );
158 
159  GlobalSettings::self()->setAutomaticSending( mInvitationUi->mAutomaticSending->isChecked() );
160 
161  GlobalSettings::self()->setDeleteInvitationEmailsAfterSendingReply(
162  mInvitationUi->mDeleteInvitations->isChecked() );
163 }
164 
165 QString InvitationSettings::helpAnchor() const
166 {
167  return QString::fromLatin1( "configure-misc-invites" );
168 }
169 
170 void InvitationSettings::doResetToDefaultsOther()
171 {
172  const bool bUseDefaults = GlobalSettings::self()->useDefaults( true );
173 
174  mInvitationUi->mLegacyMangleFromTo->setChecked(
175  GlobalSettings::self()->legacyMangleFromToHeaders() );
176 
177  mInvitationUi->mExchangeCompatibleInvitations->setChecked(
178  GlobalSettings::self()->exchangeCompatibleInvitations() );
179 
180  mInvitationUi->mLegacyBodyInvites->blockSignals( true );
181  mInvitationUi->mLegacyBodyInvites->setChecked( GlobalSettings::self()->legacyBodyInvites() );
182  mInvitationUi->mLegacyBodyInvites->blockSignals( false );
183 
184  mInvitationUi->mOutlookCompatibleInvitationComments->setChecked(
185  GlobalSettings::self()->outlookCompatibleInvitationReplyComments() );
186 
187  mInvitationUi->mOutlookCompatibleInvitationComparisons->setChecked(
188  GlobalSettings::self()->outlookCompatibleInvitationComparisons() );
189 
190  mInvitationUi->mAutomaticSending->setChecked( GlobalSettings::self()->automaticSending() );
191  mInvitationUi->mAutomaticSending->setEnabled( !mInvitationUi->mLegacyBodyInvites->isChecked() );
192 
193  mInvitationUi->mDeleteInvitations->setChecked(
194  GlobalSettings::self()->deleteInvitationEmailsAfterSendingReply() );
195 
196  GlobalSettings::self()->useDefaults( bUseDefaults );
197 
198 
199 }
globalsettings.h
invitationsettings.h
MessageViewer::InvitationSettings::~InvitationSettings
~InvitationSettings()
Definition: invitationsettings.cpp:91
QWidget
MessageViewer::InvitationSettings::doResetToDefaultsOther
void doResetToDefaultsOther()
Definition: invitationsettings.cpp:170
MessageViewer::InvitationSettings::helpAnchor
QString helpAnchor() const
Definition: invitationsettings.cpp:165
MessageViewer::InvitationSettings::InvitationSettings
InvitationSettings(QWidget *parent=0)
Definition: invitationsettings.cpp:40
MessageViewer::GlobalSettings::self
static GlobalSettings * self()
Definition: globalsettings.cpp:34
MessageViewer::InvitationSettings::save
void save()
Definition: invitationsettings.cpp:143
MessageViewer::InvitationSettings::doLoadFromGlobalSettings
void doLoadFromGlobalSettings()
Definition: invitationsettings.cpp:118
MessageViewer::InvitationSettings::changed
void changed()
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:57 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

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