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

kmail

  • sources
  • kde-4.14
  • kdepim
  • kmail
  • identity
identitydialog.cpp
Go to the documentation of this file.
1 /* -*- mode: C++; c-file-style: "gnu" -*-
2  identitydialog.cpp
3 
4  This file is part of KMail, the KDE mail client.
5  Copyright (c) 2002 Marc Mutz <mutz@kde.org>
6  Copyright (c) 2014-2015 Laurent Montel <montel@kde.org>
7 
8  KMail is free software; you can redistribute it and/or modify it
9  under the terms of the GNU General Public License, version 2, as
10  published by the Free Software Foundation.
11 
12  KMail is distributed in the hope that it will be useful, but
13  WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 
21  In addition, as a special exception, the copyright holders give
22  permission to link the code of this program with any edition of
23  the Qt library by Trolltech AS, Norway (or with modified versions
24  of Qt that use the same license as Qt), and distribute linked
25  combinations including the two. You must obey the GNU General
26  Public License in all respects for all of the code used other than
27  Qt. If you modify this file, you may extend this exception to
28  your version of the file, but you are not obligated to do so. If
29  you do not wish to do so, delete this exception statement from
30  your version.
31 */
32 
33 #include "identitydialog.h"
34 #include "identityeditvcarddialog.h"
35 #include "identityaddvcarddialog.h"
36 
37 #include "messagecomposer/settings/messagecomposersettings.h"
38 
39 #include <kpimidentities/identitymanager.h>
40 
41 // other KMail headers:
42 #ifndef KDEPIM_MOBILE_UI
43 #include "xfaceconfigurator.h"
44 #endif
45 #include "pimcommon/widgets/simplestringlisteditor.h"
46 #include "folderrequester.h"
47 #ifndef KCM_KPIMIDENTITIES_STANDALONE
48 #include "settings/globalsettings.h"
49 #include "kmkernel.h"
50 #endif
51 
52 #include "kernel/mailkernel.h"
53 
54 #include "job/addressvalidationjob.h"
55 #include "kleo_util.h"
56 #include "utils/stringutil.h"
57 #ifndef KDEPIM_MOBILE_UI
58 #include "templatesconfiguration.h"
59 #endif
60 #include "templatesconfiguration_kfg.h"
61 // other kdepim headers:
62 #include <kpimidentities/identity.h>
63 #include <kpimidentities/signatureconfigurator.h>
64 
65 #include "pimcommon/autocorrection/autocorrectionlanguage.h"
66 
67 #include <libkdepim/addressline/addresslineedit/addresseelineedit.h>
68 // libkleopatra:
69 #include "libkleo/ui/keyrequester.h"
70 #include "kleo/cryptobackendfactory.h"
71 
72 #include <kpimutils/email.h>
73 #include <kpimutils/emailvalidator.h>
74 #include <mailtransport/transport.h>
75 #include <mailtransport/transportmanager.h>
76 #include <mailtransport/transportcombobox.h>
77 using MailTransport::TransportManager;
78 
79 // other KDE headers:
80 #include <klocale.h>
81 #include <kmessagebox.h>
82 #include <kfileitem.h>
83 #include <kurl.h>
84 #include <kdebug.h>
85 #include <kpushbutton.h>
86 #include <kcombobox.h>
87 #include <ktabwidget.h>
88 #include <KStandardDirs>
89 #include <KIcon>
90 #include <sonnet/dictionarycombobox.h>
91 
92 // Qt headers:
93 #include <QLabel>
94 #include <QCheckBox>
95 #include <QVBoxLayout>
96 #include <QGridLayout>
97 #include <QFile>
98 #include <QHostInfo>
99 #include <QToolButton>
100 
101 // other headers:
102 #include <gpgme++/key.h>
103 #include <iterator>
104 #include <algorithm>
105 
106 #include <akonadi/entitydisplayattribute.h>
107 #include <akonadi/collectionmodifyjob.h>
108 
109 
110 using namespace KPIM;
111 using namespace MailTransport;
112 using namespace MailCommon;
113 
114 namespace KMail {
115 
116 IdentityDialog::IdentityDialog( QWidget * parent )
117  : KDialog( parent )
118 {
119  setCaption( i18n("Edit Identity") );
120 #ifndef KDEPIM_MOBILE_UI
121  setButtons( Ok|Cancel|Help );
122 #else
123  setButtons( Ok|Cancel );
124 #endif
125  setDefaultButton( Ok );
126 
127  // tmp. vars:
128  QWidget * tab;
129  QLabel * label;
130  int row;
131  QGridLayout * glay;
132  QString msg;
133 
134  //
135  // Tab Widget: General
136  //
137  row = -1;
138  QWidget *page = new QWidget( this );
139  setMainWidget( page );
140  QVBoxLayout * vlay = new QVBoxLayout( page );
141  vlay->setSpacing( spacingHint() );
142  vlay->setMargin( 0 );
143  mTabWidget = new KTabWidget( page );
144  mTabWidget->setObjectName( QLatin1String("config-identity-tab") );
145  vlay->addWidget( mTabWidget );
146 
147  tab = new QWidget( mTabWidget );
148  mTabWidget->addTab( tab, i18nc("@title:tab General identity settings.","General") );
149  glay = new QGridLayout( tab );
150  glay->setSpacing( spacingHint() );
151  glay->setMargin( marginHint() );
152  glay->setRowStretch( 3, 1 );
153  glay->setColumnStretch( 1, 1 );
154 
155  // "Name" line edit and label:
156  ++row;
157  mNameEdit = new KLineEdit( tab );
158  glay->addWidget( mNameEdit, row, 1 );
159  label = new QLabel( i18n("&Your name:"), tab );
160  label->setBuddy( mNameEdit );
161  glay->addWidget( label, row, 0 );
162  msg = i18n("<qt><h3>Your name</h3>"
163  "<p>This field should contain your name as you would like "
164  "it to appear in the email header that is sent out;</p>"
165  "<p>if you leave this blank your real name will not "
166  "appear, only the email address.</p></qt>");
167  label->setWhatsThis( msg );
168  mNameEdit->setWhatsThis( msg );
169 
170  // "Organization" line edit and label:
171  ++row;
172  mOrganizationEdit = new KLineEdit( tab );
173  glay->addWidget( mOrganizationEdit, row, 1 );
174  label = new QLabel( i18n("Organi&zation:"), tab );
175  label->setBuddy( mOrganizationEdit );
176  glay->addWidget( label, row, 0 );
177  msg = i18n("<qt><h3>Organization</h3>"
178  "<p>This field should have the name of your organization "
179  "if you would like it to be shown in the email header that "
180  "is sent out.</p>"
181  "<p>It is safe (and normal) to leave this blank.</p></qt>");
182  label->setWhatsThis( msg );
183  mOrganizationEdit->setWhatsThis( msg );
184 
185  // "Email Address" line edit and label:
186  // (row 3: spacer)
187  ++row;
188  mEmailEdit = new KLineEdit( tab );
189  glay->addWidget( mEmailEdit, row, 1 );
190  label = new QLabel( i18n("&Email address:"), tab );
191  label->setBuddy( mEmailEdit );
192  glay->addWidget( label, row, 0 );
193  msg = i18n("<qt><h3>Email address</h3>"
194  "<p>This field should have your full email address.</p>"
195  "<p>This address is the primary one, used for all outgoing mail. "
196  "If you have more than one address, either create a new identity, "
197  "or add additional alias addresses in the field below.</p>"
198  "<p>If you leave this blank, or get it wrong, people "
199  "will have trouble replying to you.</p></qt>");
200  label->setWhatsThis( msg );
201  mEmailEdit->setWhatsThis( msg );
202 
203  KPIMUtils::EmailValidator* emailValidator = new KPIMUtils::EmailValidator( this );
204  mEmailEdit->setValidator( emailValidator );
205 
206  // "Email Aliases" string text edit and label:
207  ++row;
208  mAliasEdit = new PimCommon::SimpleStringListEditor( tab );
209  glay->addWidget( mAliasEdit, row, 1 );
210  label = new QLabel( i18n("Email a&liases:"), tab );
211  label->setBuddy( mAliasEdit );
212  glay->addWidget( label, row, 0, Qt::AlignTop );
213  msg = i18n("<qt><h3>Email aliases</h3>"
214  "<p>This field contains alias addresses that should also "
215  "be considered as belonging to this identity (as opposed "
216  "to representing a different identity).</p>"
217  "<p>Example:</p>"
218  "<table>"
219  "<tr><th>Primary address:</th><td>first.last@example.org</td></tr>"
220  "<tr><th>Aliases:</th><td>first@example.org<br>last@example.org</td></tr>"
221  "</table>"
222  "<p>Type one alias address per line.</p></qt>");
223  label->setToolTip( msg );
224  mAliasEdit->setWhatsThis( msg );
225 
226  //
227  // Tab Widget: Cryptography
228  //
229  row = -1;
230  mCryptographyTab = tab = new QWidget( mTabWidget );
231  mTabWidget->addTab( tab, i18n("Cryptography") );
232  glay = new QGridLayout( tab );
233  glay->setSpacing( spacingHint() );
234  glay->setMargin( marginHint() );
235  glay->setColumnStretch( 1, 1 );
236 
237  // "OpenPGP Signature Key" requester and label:
238  ++row;
239  mPGPSigningKeyRequester = new Kleo::SigningKeyRequester( false, Kleo::SigningKeyRequester::OpenPGP, tab );
240  mPGPSigningKeyRequester->dialogButton()->setText( i18n("Chang&e...") );
241  mPGPSigningKeyRequester->setDialogCaption( i18n("Your OpenPGP Signature Key") );
242  msg = i18n("Select the OpenPGP key which should be used to "
243  "digitally sign your messages.");
244  mPGPSigningKeyRequester->setDialogMessage( msg );
245 
246  msg = i18n("<qt><p>The OpenPGP key you choose here will be used "
247  "to digitally sign messages. You can also use GnuPG keys.</p>"
248  "<p>You can leave this blank, but KMail will not be able "
249  "to digitally sign emails using OpenPGP; "
250  "normal mail functions will not be affected.</p>"
251  "<p>You can find out more about keys at <a>http://www.gnupg.org</a></p></qt>");
252 
253  label = new QLabel( i18n("OpenPGP signing key:"), tab );
254  label->setBuddy( mPGPSigningKeyRequester );
255  mPGPSigningKeyRequester->setWhatsThis( msg );
256  label->setWhatsThis( msg );
257 
258  glay->addWidget( label, row, 0 );
259  glay->addWidget( mPGPSigningKeyRequester, row, 1 );
260 
261 
262  // "OpenPGP Encryption Key" requester and label:
263  ++row;
264  mPGPEncryptionKeyRequester = new Kleo::EncryptionKeyRequester( false, Kleo::EncryptionKeyRequester::OpenPGP, tab );
265  mPGPEncryptionKeyRequester->dialogButton()->setText( i18n("Chang&e...") );
266  mPGPEncryptionKeyRequester->setDialogCaption( i18n("Your OpenPGP Encryption Key") );
267  msg = i18n("Select the OpenPGP key which should be used when encrypting "
268  "to yourself and for the \"Attach My Public Key\" "
269  "feature in the composer.");
270  mPGPEncryptionKeyRequester->setDialogMessage( msg );
271 
272  msg = i18n("<qt><p>The OpenPGP key you choose here will be used "
273  "to encrypt messages to yourself and for the \"Attach My Public Key\" "
274  "feature in the composer. You can also use GnuPG keys.</p>"
275  "<p>You can leave this blank, but KMail will not be able "
276  "to encrypt copies of outgoing messages to you using OpenPGP; "
277  "normal mail functions will not be affected.</p>"
278  "<p>You can find out more about keys at <a>http://www.gnupg.org</a></p></qt>");
279  label = new QLabel( i18n("OpenPGP encryption key:"), tab );
280  label->setBuddy( mPGPEncryptionKeyRequester );
281  mPGPEncryptionKeyRequester->setWhatsThis( msg );
282  label->setWhatsThis( msg );
283 
284  glay->addWidget( label, row, 0 );
285  glay->addWidget( mPGPEncryptionKeyRequester, row, 1 );
286 
287 
288  // "S/MIME Signature Key" requester and label:
289  ++row;
290  mSMIMESigningKeyRequester = new Kleo::SigningKeyRequester( false, Kleo::SigningKeyRequester::SMIME, tab );
291  mSMIMESigningKeyRequester->dialogButton()->setText( i18n("Chang&e...") );
292  mSMIMESigningKeyRequester->setDialogCaption( i18n("Your S/MIME Signature Certificate") );
293  msg = i18n("Select the S/MIME certificate which should be used to "
294  "digitally sign your messages.");
295  mSMIMESigningKeyRequester->setDialogMessage( msg );
296 
297  msg = i18n("<qt><p>The S/MIME (X.509) certificate you choose here will be used "
298  "to digitally sign messages.</p>"
299  "<p>You can leave this blank, but KMail will not be able "
300  "to digitally sign emails using S/MIME; "
301  "normal mail functions will not be affected.</p></qt>");
302  label = new QLabel( i18n("S/MIME signing certificate:"), tab );
303  label->setBuddy( mSMIMESigningKeyRequester );
304  mSMIMESigningKeyRequester->setWhatsThis( msg );
305  label->setWhatsThis( msg );
306  glay->addWidget( label, row, 0 );
307  glay->addWidget( mSMIMESigningKeyRequester, row, 1 );
308 
309  const Kleo::CryptoBackend::Protocol * smimeProtocol
310  = Kleo::CryptoBackendFactory::instance()->smime();
311 
312  label->setEnabled( smimeProtocol );
313  mSMIMESigningKeyRequester->setEnabled( smimeProtocol );
314 
315  // "S/MIME Encryption Key" requester and label:
316  ++row;
317  mSMIMEEncryptionKeyRequester = new Kleo::EncryptionKeyRequester( false, Kleo::EncryptionKeyRequester::SMIME, tab );
318  mSMIMEEncryptionKeyRequester->dialogButton()->setText( i18n("Chang&e...") );
319  mSMIMEEncryptionKeyRequester->setDialogCaption( i18n("Your S/MIME Encryption Certificate") );
320  msg = i18n("Select the S/MIME certificate which should be used when encrypting "
321  "to yourself and for the \"Attach My Certificate\" "
322  "feature in the composer.");
323  mSMIMEEncryptionKeyRequester->setDialogMessage( msg );
324 
325  msg = i18n("<qt><p>The S/MIME certificate you choose here will be used "
326  "to encrypt messages to yourself and for the \"Attach My Certificate\" "
327  "feature in the composer.</p>"
328  "<p>You can leave this blank, but KMail will not be able "
329  "to encrypt copies of outgoing messages to you using S/MIME; "
330  "normal mail functions will not be affected.</p></qt>");
331  label = new QLabel( i18n("S/MIME encryption certificate:"), tab );
332  label->setBuddy( mSMIMEEncryptionKeyRequester );
333  mSMIMEEncryptionKeyRequester->setWhatsThis( msg );
334  label->setWhatsThis( msg );
335 
336  glay->addWidget( label, row, 0 );
337  glay->addWidget( mSMIMEEncryptionKeyRequester, row, 1 );
338 
339  label->setEnabled( smimeProtocol );
340  mSMIMEEncryptionKeyRequester->setEnabled( smimeProtocol );
341 
342  // "Preferred Crypto Message Format" combobox and label:
343  ++row;
344  mPreferredCryptoMessageFormat = new KComboBox( tab );
345  mPreferredCryptoMessageFormat->setEditable( false );
346  QStringList l;
347  l << Kleo::cryptoMessageFormatToLabel( Kleo::AutoFormat )
348  << Kleo::cryptoMessageFormatToLabel( Kleo::InlineOpenPGPFormat )
349  << Kleo::cryptoMessageFormatToLabel( Kleo::OpenPGPMIMEFormat )
350  << Kleo::cryptoMessageFormatToLabel( Kleo::SMIMEFormat )
351  << Kleo::cryptoMessageFormatToLabel( Kleo::SMIMEOpaqueFormat );
352  mPreferredCryptoMessageFormat->addItems( l );
353  label = new QLabel( i18nc("preferred format of encrypted messages", "Preferred format:"), tab );
354  label->setBuddy( mPreferredCryptoMessageFormat );
355 
356  glay->addWidget( label, row, 0 );
357  glay->addWidget( mPreferredCryptoMessageFormat, row, 1 );
358 
359 
360  ++row;
361  mAutoSign = new QCheckBox(i18n("Automatically sign messages"));
362  glay->addWidget( mAutoSign, row, 0 );
363 
364  ++row;
365  glay->setRowStretch( row, 1 );
366 
367  //
368  // Tab Widget: Advanced
369  //
370  row = -1;
371  tab = new QWidget( mTabWidget );
372  mTabWidget->addTab( tab, i18nc("@title:tab Advanced identity settings.","Advanced") );
373  glay = new QGridLayout( tab );
374  glay->setSpacing( spacingHint() );
375  glay->setMargin( marginHint() );
376  // the last (empty) row takes all the remaining space
377  glay->setColumnStretch( 1, 1 );
378 
379  // "Reply-To Address" line edit and label:
380  ++row;
381  mReplyToEdit = new KPIM::AddresseeLineEdit( tab, true );
382  mReplyToEdit->setClearButtonShown(true);
383  mReplyToEdit->setObjectName( QLatin1String("mReplyToEdit") );
384  glay->addWidget( mReplyToEdit, row, 1 );
385  label = new QLabel ( i18n("&Reply-To address:"), tab );
386  label->setBuddy( mReplyToEdit );
387  glay->addWidget( label, row, 0 );
388  msg = i18n("<qt><h3>Reply-To addresses</h3>"
389  "<p>This sets the <tt>Reply-to:</tt> header to contain a "
390  "different email address to the normal <tt>From:</tt> "
391  "address.</p>"
392  "<p>This can be useful when you have a group of people "
393  "working together in similar roles. For example, you "
394  "might want any emails sent to have your email in the "
395  "<tt>From:</tt> field, but any responses to go to "
396  "a group address.</p>"
397  "<p>If in doubt, leave this field blank.</p></qt>");
398  label->setWhatsThis( msg );
399  mReplyToEdit->setWhatsThis( msg );
400 
401 
402 
403  // "CC addresses" line edit and label:
404  ++row;
405  mCcEdit = new KPIM::AddresseeLineEdit( tab, true );
406  mCcEdit->setClearButtonShown(true);
407  mCcEdit->setObjectName( QLatin1String("mCcEdit") );
408  glay->addWidget( mCcEdit, row, 1 );
409  label = new QLabel( i18n("&CC addresses:"), tab );
410  label->setBuddy( mCcEdit );
411  glay->addWidget( label, row, 0 );
412  msg = i18n("<qt><h3>CC (Carbon Copy) addresses</h3>"
413  "<p>The addresses that you enter here will be added to each "
414  "outgoing mail that is sent with this identity.</p>"
415  "<p>This is commonly used to send a copy of each sent message to "
416  "another account of yours.</p>"
417  "<p>To specify more than one address, use commas to separate "
418  "the list of CC recipients.</p>"
419  "<p>If in doubt, leave this field blank.</p></qt>");
420  label->setWhatsThis( msg );
421  mCcEdit->setWhatsThis( msg );
422 
423 
424  // "BCC addresses" line edit and label:
425  ++row;
426  mBccEdit = new KPIM::AddresseeLineEdit( tab, true );
427  mBccEdit->setClearButtonShown(true);
428  mBccEdit->setObjectName( QLatin1String("mBccEdit") );
429  glay->addWidget( mBccEdit, row, 1 );
430  label = new QLabel( i18n("&BCC addresses:"), tab );
431  label->setBuddy( mBccEdit );
432  glay->addWidget( label, row, 0 );
433  msg = i18n("<qt><h3>BCC (Blind Carbon Copy) addresses</h3>"
434  "<p>The addresses that you enter here will be added to each "
435  "outgoing mail that is sent with this identity. They will not "
436  "be visible to other recipients.</p>"
437  "<p>This is commonly used to send a copy of each sent message to "
438  "another account of yours.</p>"
439  "<p>To specify more than one address, use commas to separate "
440  "the list of BCC recipients.</p>"
441  "<p>If in doubt, leave this field blank.</p></qt>");
442  label->setWhatsThis( msg );
443  mBccEdit->setWhatsThis( msg );
444 
445  // "Dictionary" combo box and label:
446  ++row;
447  mDictionaryCombo = new Sonnet::DictionaryComboBox( tab );
448  glay->addWidget( mDictionaryCombo, row, 1 );
449  label = new QLabel( i18n("D&ictionary:"), tab );
450  label->setBuddy( mDictionaryCombo );
451  glay->addWidget( label, row, 0 );
452 
453  // "Sent-mail Folder" combo box and label:
454  ++row;
455  mFccCombo = new FolderRequester( tab );
456  mFccCombo->setShowOutbox( false );
457  glay->addWidget( mFccCombo, row, 1 );
458  mSentMailFolderCheck = new QCheckBox( i18n("Sent-mail &folder:"), tab );
459  glay->addWidget( mSentMailFolderCheck, row, 0 );
460  connect(mSentMailFolderCheck,SIGNAL(toggled(bool)),mFccCombo,SLOT(setEnabled(bool)));
461 
462  // "Drafts Folder" combo box and label:
463  ++row;
464  mDraftsCombo = new FolderRequester( tab );
465  mDraftsCombo->setShowOutbox( false );
466  glay->addWidget( mDraftsCombo, row, 1 );
467  label = new QLabel( i18n("&Drafts folder:"), tab );
468  label->setBuddy( mDraftsCombo );
469  glay->addWidget( label, row, 0 );
470 
471  // "Templates Folder" combo box and label:
472  ++row;
473  mTemplatesCombo = new FolderRequester( tab );
474  mTemplatesCombo->setShowOutbox( false );
475  glay->addWidget( mTemplatesCombo, row, 1 );
476  label = new QLabel( i18n("&Templates folder:"), tab );
477  label->setBuddy( mTemplatesCombo );
478  glay->addWidget( label, row, 0 );
479 
480  // "Special transport" combobox and label:
481  ++row;
482  mTransportCheck = new QCheckBox( i18n("Outgoing Account:"), tab );
483  glay->addWidget( mTransportCheck, row, 0 );
484  mTransportCombo = new TransportComboBox( tab );
485  mTransportCombo->setEnabled( false ); // since !mTransportCheck->isChecked()
486  glay->addWidget( mTransportCombo, row, 1 );
487  connect( mTransportCheck, SIGNAL(toggled(bool)),
488  mTransportCombo, SLOT(setEnabled(bool)) );
489 
490  ++row;
491  mAttachMyVCard = new QCheckBox(i18n("Attach my vCard to message"), tab);
492  glay->addWidget( mAttachMyVCard, row, 0 );
493  mEditVCard = new KPushButton(i18n("Create..."),tab);
494  connect(mEditVCard,SIGNAL(clicked()),SLOT(slotEditVcard()));
495  glay->addWidget( mEditVCard, row, 1 );
496 
497 
498  ++row;
499  mAutoCorrectionLanguage = new PimCommon::AutoCorrectionLanguage(tab);
500  glay->addWidget( mAutoCorrectionLanguage, row, 1 );
501  label = new QLabel( i18n("Autocorrection language:"), tab );
502  label->setBuddy( mAutoCorrectionLanguage );
503  glay->addWidget( label, row, 0 );
504 
505  // "default domain" input field:
506  ++row;
507  QHBoxLayout *hbox = new QHBoxLayout;
508  mDefaultDomainEdit = new KLineEdit( tab );
509  mDefaultDomainEdit->setClearButtonShown(true);
510  hbox->addWidget(mDefaultDomainEdit);
511  QToolButton *restoreDefaultDomainName = new QToolButton;
512  restoreDefaultDomainName->setIcon(KIcon(QLatin1String("view-refresh")));
513  restoreDefaultDomainName->setToolTip(i18n("Restore default domain name"));
514  hbox->addWidget(restoreDefaultDomainName);
515  connect(restoreDefaultDomainName, SIGNAL(clicked()), this, SLOT(slotRefreshDefaultDomainName()));
516  glay->addLayout(hbox, row, 1 );
517  label = new QLabel( i18n("Defaul&t domain:"), tab );
518  label->setBuddy( mDefaultDomainEdit );
519  glay->addWidget( label, row, 0 );
520 
521  // and now: add QWhatsThis:
522  msg = i18n( "<qt><p>The default domain is used to complete email "
523  "addresses that only consist of the user's name."
524  "</p></qt>" );
525  label->setWhatsThis( msg );
526  mDefaultDomainEdit->setWhatsThis( msg );
527 
528 
529  ++row;
530  glay->setRowStretch( row, 1 );
531 
532  // the last row is a spacer
533 
534  //
535  // Tab Widget: Templates
536  //
537  tab = new QWidget( mTabWidget );
538  vlay = new QVBoxLayout( tab );
539  vlay->setMargin( marginHint() );
540  vlay->setSpacing( spacingHint() );
541 
542  QHBoxLayout *tlay = new QHBoxLayout();
543  vlay->addLayout( tlay );
544 
545  mCustom = new QCheckBox( i18n("&Use custom message templates for this identity"), tab );
546  tlay->addWidget( mCustom, Qt::AlignLeft );
547 
548 #ifndef KDEPIM_MOBILE_UI
549  mWidget = new TemplateParser::TemplatesConfiguration( tab, QLatin1String("identity-templates") );
550  mWidget->setEnabled( false );
551 
552  // Move the help label outside of the templates configuration widget,
553  // so that the help can be read even if the widget is not enabled.
554  tlay->addStretch( 9 );
555  tlay->addWidget( mWidget->helpLabel(), Qt::AlignRight );
556 
557  vlay->addWidget( mWidget );
558 #endif
559 
560  QHBoxLayout *btns = new QHBoxLayout();
561  btns->setSpacing( spacingHint() );
562  mCopyGlobal = new KPushButton( i18n("&Copy Global Templates"), tab );
563  mCopyGlobal->setEnabled( false );
564  btns->addWidget( mCopyGlobal );
565  vlay->addLayout( btns );
566 #ifndef KDEPIM_MOBILE_UI
567  connect( mCustom, SIGNAL(toggled(bool)),
568  mWidget, SLOT(setEnabled(bool)) );
569 #endif
570  connect( mCustom, SIGNAL(toggled(bool)),
571  mCopyGlobal, SLOT(setEnabled(bool)) );
572  connect( mCopyGlobal, SIGNAL(clicked()),
573  this, SLOT(slotCopyGlobal()) );
574 #ifdef KDEPIM_MOBILE_UI
575  tab->hide(); // not yet mobile ready
576 #else
577  mTabWidget->addTab( tab, i18n("Templates") );
578 #endif
579 
580  //
581  // Tab Widget: Signature
582  //
583  mSignatureConfigurator = new KPIMIdentities::SignatureConfigurator( mTabWidget );
584  mSignatureConfigurator->layout()->setMargin( KDialog::marginHint() );
585  mTabWidget->addTab( mSignatureConfigurator, i18n("Signature") );
586 
587  //
588  // Tab Widget: Picture
589  //
590 
591 #ifndef KDEPIM_MOBILE_UI
592  mXFaceConfigurator = new XFaceConfigurator( mTabWidget );
593  mXFaceConfigurator->layout()->setMargin( KDialog::marginHint() );
594  mTabWidget->addTab( mXFaceConfigurator, i18n("Picture") );
595 #endif
596 
597 #ifndef KCM_KPIMIDENTITIES_STANDALONE
598  resize( GlobalSettings::self()->identityDialogSize() );
599 #endif
600  mNameEdit->setFocus();
601 
602  connect( mTabWidget, SIGNAL(currentChanged(int)),
603  SLOT(slotAboutToShow(int)) );
604  setHelp( QLatin1String("configure-identity"), QLatin1String("kmail") );
605 }
606 
607 IdentityDialog::~IdentityDialog() {
608 #ifndef KCM_KPIMIDENTITIES_STANDALONE
609  GlobalSettings::self()->setIdentityDialogSize( size() );
610 #endif
611 }
612 
613 void IdentityDialog::slotAboutToShow( int index ) {
614  QWidget *w = mTabWidget->widget( index );
615  if ( w == mCryptographyTab ) {
616  // set the configured email address as initial query of the key
617  // requesters:
618  const QString email = mEmailEdit->text().trimmed();
619  mPGPEncryptionKeyRequester->setInitialQuery( email );
620  mPGPSigningKeyRequester->setInitialQuery( email );
621  mSMIMEEncryptionKeyRequester->setInitialQuery( email );
622  mSMIMESigningKeyRequester->setInitialQuery( email );
623  }
624 }
625 
626 void IdentityDialog::slotCopyGlobal() {
627 #ifndef KDEPIM_MOBILE_UI
628  mWidget->loadFromGlobal();
629 #endif
630 }
631 
632 namespace {
633 struct DoesntMatchEMailAddress {
634  explicit DoesntMatchEMailAddress( const QString & s )
635  : email( s.trimmed().toLower() ) {}
636  bool operator()( const GpgME::Key & key ) const;
637 private:
638  bool checkForEmail( const char * email ) const;
639  static QString extractEmail( const char * email );
640  const QString email;
641 };
642 
643 bool DoesntMatchEMailAddress::operator()( const GpgME::Key & key ) const {
644  const std::vector<GpgME::UserID> uids = key.userIDs();
645  std::vector<GpgME::UserID>::const_iterator end = uids.end();
646  for ( std::vector<GpgME::UserID>::const_iterator it = uids.begin() ; it != end ; ++it )
647  if ( checkForEmail( it->email() ? it->email() : it->id() ) )
648  return false;
649  return true; // note the negation!
650 }
651 
652 bool DoesntMatchEMailAddress::checkForEmail( const char * e ) const {
653  const QString em = extractEmail( e );
654  return !em.isEmpty() && email.toLower() == em.toLower();
655 }
656 
657 QString DoesntMatchEMailAddress::extractEmail( const char * e ) {
658  if ( !e || !*e )
659  return QString();
660  const QString em = QString::fromUtf8( e );
661  if ( e[0] == '<' )
662  return em.mid( 1, em.length() - 2 );
663  else
664  return em;
665 }
666 }
667 
668 void IdentityDialog::slotRefreshDefaultDomainName()
669 {
670  mDefaultDomainEdit->setText(QHostInfo::localHostName());
671 }
672 
673 void IdentityDialog::slotButtonClicked( int button )
674 {
675  if ( button != KDialog::Ok ) {
676  KDialog::slotButtonClicked( button );
677  return;
678  }
679 
680  const QStringList aliases = mAliasEdit->stringList();
681  foreach ( const QString &alias, aliases ) {
682  if ( !KPIMUtils::isValidSimpleAddress( alias ) ) {
683  const QString errorMsg( KPIMUtils::simpleEmailAddressErrorMsg() );
684  KMessageBox::sorry( this, errorMsg, i18n( "Invalid Email Alias \"%1\"", alias ) );
685  return;
686  }
687  }
688 
689  // Validate email addresses
690  const QString email = mEmailEdit->text().trimmed();
691  if ( !KPIMUtils::isValidSimpleAddress( email ) ) {
692  const QString errorMsg( KPIMUtils::simpleEmailAddressErrorMsg() );
693  KMessageBox::sorry( this, errorMsg, i18n("Invalid Email Address") );
694  return;
695  }
696 
697  // Check if the 'Reply to' and 'BCC' recipients are valid
698  const QString recipients = mReplyToEdit->text().trimmed() + QLatin1String( ", " ) + mBccEdit->text().trimmed() + QLatin1String( ", " ) + mCcEdit->text().trimmed();
699  AddressValidationJob *job = new AddressValidationJob( recipients, this, this );
700  //Use default Value
701  job->setDefaultDomain(mDefaultDomainEdit->text());
702  job->setProperty( "email", email );
703  connect( job, SIGNAL(result(KJob*)), SLOT(slotDelayedButtonClicked(KJob*)) );
704  job->start();
705 }
706 
707 void IdentityDialog::slotDelayedButtonClicked( KJob *job )
708 {
709  const AddressValidationJob *validationJob = qobject_cast<AddressValidationJob*>( job );
710 
711  // Abort if one of the recipient addresses is invalid
712  if ( !validationJob->isValid() )
713  return;
714 
715  const QString email = validationJob->property( "email" ).toString();
716 
717  const std::vector<GpgME::Key> &pgpSigningKeys =
718  mPGPSigningKeyRequester->keys();
719  const std::vector<GpgME::Key> &pgpEncryptionKeys =
720  mPGPEncryptionKeyRequester->keys();
721  const std::vector<GpgME::Key> &smimeSigningKeys =
722  mSMIMESigningKeyRequester->keys();
723  const std::vector<GpgME::Key> &smimeEncryptionKeys =
724  mSMIMEEncryptionKeyRequester->keys();
725 
726  QString msg;
727  bool err = false;
728  if ( std::find_if( pgpSigningKeys.begin(), pgpSigningKeys.end(),
729  DoesntMatchEMailAddress( email ) ) != pgpSigningKeys.end() ) {
730  msg = i18n("One of the configured OpenPGP signing keys does not contain "
731  "any user ID with the configured email address for this "
732  "identity (%1).\n"
733  "This might result in warning messages on the receiving side "
734  "when trying to verify signatures made with this configuration.", email);
735  err = true;
736  } else if ( std::find_if( pgpEncryptionKeys.begin(), pgpEncryptionKeys.end(),
737  DoesntMatchEMailAddress( email ) ) != pgpEncryptionKeys.end() ) {
738  msg = i18n("One of the configured OpenPGP encryption keys does not contain "
739  "any user ID with the configured email address for this "
740  "identity (%1).", email);
741  err = true;
742  } else if ( std::find_if( smimeSigningKeys.begin(), smimeSigningKeys.end(),
743  DoesntMatchEMailAddress( email ) ) != smimeSigningKeys.end() ) {
744  msg = i18n("One of the configured S/MIME signing certificates does not contain "
745  "the configured email address for this "
746  "identity (%1).\n"
747  "This might result in warning messages on the receiving side "
748  "when trying to verify signatures made with this configuration.", email);
749  err = true;
750  } else if ( std::find_if( smimeEncryptionKeys.begin(), smimeEncryptionKeys.end(),
751  DoesntMatchEMailAddress( email ) ) != smimeEncryptionKeys.end() ) {
752  msg = i18n("One of the configured S/MIME encryption certificates does not contain "
753  "the configured email address for this "
754  "identity (%1).", email);
755  err = true;
756  }
757 
758  if ( err ) {
759  if ( KMessageBox::warningContinueCancel( this, msg,
760  i18n("Email Address Not Found in Key/Certificates"),
761  KStandardGuiItem::cont(),
762  KStandardGuiItem::cancel(),
763  QLatin1String("warn_email_not_in_certificate") )
764  != KMessageBox::Continue) {
765  return;
766  }
767  }
768 
769 
770  if ( mSignatureConfigurator->isSignatureEnabled() &&
771  mSignatureConfigurator->signatureType()==Signature::FromFile ) {
772  KUrl url( mSignatureConfigurator->fileURL() );
773  KFileItem signatureFile( KFileItem::Unknown, KFileItem::Unknown, url );
774  if ( !signatureFile.isFile() || !signatureFile.isReadable() || !signatureFile.isLocalFile() ) {
775  KMessageBox::error( this, i18n( "The signature file is not valid" ) );
776  return;
777  }
778  }
779 
780  accept();
781 }
782 
783 bool IdentityDialog::checkFolderExists( const QString & folderID,
784  const QString & msg )
785 {
786  const Akonadi::Collection folder = CommonKernel->collectionFromId( folderID.toLongLong() );
787  if ( !folder.isValid() ) {
788  KMessageBox::sorry( this, msg );
789  return false;
790  }
791 
792  return true;
793 }
794 
795 void IdentityDialog::setIdentity( KPIMIdentities::Identity & ident ) {
796 
797  setCaption( i18n("Edit Identity \"%1\"", ident.identityName() ) );
798 
799  // "General" tab:
800  mNameEdit->setText( ident.fullName() );
801  mOrganizationEdit->setText( ident.organization() );
802  mEmailEdit->setText( ident.primaryEmailAddress() );
803  mAliasEdit->setStringList( ident.emailAliases() );
804 
805  // "Cryptography" tab:
806  mPGPSigningKeyRequester->setFingerprint( QLatin1String(ident.pgpSigningKey()) );
807  mPGPEncryptionKeyRequester->setFingerprint( QLatin1String(ident.pgpEncryptionKey()) );
808  mSMIMESigningKeyRequester->setFingerprint( QLatin1String(ident.smimeSigningKey()) );
809  mSMIMEEncryptionKeyRequester->setFingerprint( QLatin1String(ident.smimeEncryptionKey()) );
810 
811  mPreferredCryptoMessageFormat->setCurrentIndex( format2cb(
812  Kleo::stringToCryptoMessageFormat( ident.preferredCryptoMessageFormat() ) ) );
813  mAutoSign->setChecked(ident.pgpAutoSign());
814 
815  // "Advanced" tab:
816  mReplyToEdit->setText( ident.replyToAddr() );
817  mBccEdit->setText( ident.bcc() );
818  mCcEdit->setText( ident.cc() );
819  const int transportId = ident.transport().isEmpty() ? -1 : ident.transport().toInt();
820  const Transport *transport = TransportManager::self()->transportById( transportId, true );
821  mTransportCheck->setChecked( transportId != -1 );
822  mTransportCombo->setEnabled( transportId != -1 );
823  if ( transport )
824  mTransportCombo->setCurrentTransport( transport->id() );
825  mDictionaryCombo->setCurrentByDictionaryName( ident.dictionary() );
826 
827  mSentMailFolderCheck->setChecked(!ident.disabledFcc());
828  mFccCombo->setEnabled(mSentMailFolderCheck->isChecked());
829  if ( ident.fcc().isEmpty() ||
830  !checkFolderExists( ident.fcc(),
831  i18n("The custom sent-mail folder for identity "
832  "\"%1\" does not exist (anymore); "
833  "therefore, the default sent-mail folder "
834  "will be used.",
835  ident.identityName() ) ) ) {
836  mFccCombo->setCollection( CommonKernel->sentCollectionFolder() );
837  }
838  else {
839  mFccCombo->setCollection( Akonadi::Collection( ident.fcc().toLongLong() ) );
840  }
841  if ( ident.drafts().isEmpty() ||
842  !checkFolderExists( ident.drafts(),
843  i18n("The custom drafts folder for identity "
844  "\"%1\" does not exist (anymore); "
845  "therefore, the default drafts folder "
846  "will be used.",
847  ident.identityName() ) ) ) {
848  mDraftsCombo->setCollection( CommonKernel->draftsCollectionFolder() );
849  }
850  else
851  mDraftsCombo->setCollection( Akonadi::Collection( ident.drafts().toLongLong() ) );
852 
853  if ( ident.templates().isEmpty() ||
854  !checkFolderExists( ident.templates(),
855  i18n("The custom templates folder for identity "
856  "\"%1\" does not exist (anymore); "
857  "therefore, the default templates folder "
858  "will be used.", ident.identityName()) ) ) {
859  mTemplatesCombo->setCollection( CommonKernel->templatesCollectionFolder() );
860 
861  }
862  else
863  mTemplatesCombo->setCollection( Akonadi::Collection( ident.templates().toLongLong() ) );
864 
865  mVcardFilename = ident.vCardFile();
866 
867  mAutoCorrectionLanguage->setLanguage(ident.autocorrectionLanguage());
868  updateVcardButton();
869  if(mVcardFilename.isEmpty()) {
870  mVcardFilename = KStandardDirs::locateLocal("appdata",ident.identityName() + QLatin1String(".vcf"));
871  }
872  mAttachMyVCard->setChecked(ident.attachVcard());
873  QString defaultDomainName = ident.defaultDomainName();
874  if (defaultDomainName.isEmpty()) {
875  defaultDomainName = QHostInfo::localHostName();
876  }
877  mDefaultDomainEdit->setText(defaultDomainName);
878 
879  // "Templates" tab:
880 #ifndef KDEPIM_MOBILE_UI
881  uint identity = ident.uoid();
882  QString iid = TemplateParser::TemplatesConfiguration::configIdString( identity );
883  TemplateParser::Templates t( iid );
884  mCustom->setChecked(t.useCustomTemplates());
885  mWidget->loadFromIdentity( identity );
886 #endif
887 
888  // "Signature" tab:
889  mSignatureConfigurator->setImageLocation( ident );
890  mSignatureConfigurator->setSignature( ident.signature() );
891 #ifndef KDEPIM_MOBILE_UI
892  mXFaceConfigurator->setXFace( ident.xface() );
893  mXFaceConfigurator->setXFaceEnabled( ident.isXFaceEnabled() );
894 #endif
895 }
896 
897 void IdentityDialog::updateIdentity( KPIMIdentities::Identity & ident ) {
898  // "General" tab:
899  ident.setFullName( mNameEdit->text() );
900  ident.setOrganization( mOrganizationEdit->text() );
901  QString email = mEmailEdit->text();
902  ident.setPrimaryEmailAddress( email );
903  ident.setEmailAliases( mAliasEdit->stringList() );
904  // "Cryptography" tab:
905  ident.setPGPSigningKey( mPGPSigningKeyRequester->fingerprint().toLatin1() );
906  ident.setPGPEncryptionKey( mPGPEncryptionKeyRequester->fingerprint().toLatin1() );
907  ident.setSMIMESigningKey( mSMIMESigningKeyRequester->fingerprint().toLatin1() );
908  ident.setSMIMEEncryptionKey( mSMIMEEncryptionKeyRequester->fingerprint().toLatin1() );
909  ident.setPreferredCryptoMessageFormat(
910  QLatin1String(Kleo::cryptoMessageFormatToString(cb2format( mPreferredCryptoMessageFormat->currentIndex() ) )) );
911  ident.setPgpAutoSign(mAutoSign->isChecked());
912  // "Advanced" tab:
913  ident.setReplyToAddr( mReplyToEdit->text() );
914  ident.setBcc( mBccEdit->text() );
915  ident.setCc( mCcEdit->text() );
916  ident.setTransport( mTransportCheck->isChecked() ? QString::number( mTransportCombo->currentTransportId() )
917  : QString() );
918  ident.setDictionary( mDictionaryCombo->currentDictionaryName() );
919  ident.setDisabledFcc( !mSentMailFolderCheck->isChecked() );
920  Akonadi::Collection collection = mFccCombo->collection();
921  if ( collection.isValid() ) {
922  ident.setFcc( QString::number( collection.id() ) );
923  Akonadi::EntityDisplayAttribute *attribute = collection.attribute<Akonadi::EntityDisplayAttribute>( Akonadi::Entity::AddIfMissing );
924  attribute->setIconName( QLatin1String( "mail-folder-sent" ) );
925  new Akonadi::CollectionModifyJob( collection );
926  }
927  else
928  ident.setFcc( QString() );
929 
930  collection = mDraftsCombo->collection();
931  if ( collection.isValid() ) {
932  ident.setDrafts( QString::number( collection.id() ) );
933  Akonadi::EntityDisplayAttribute *attribute = collection.attribute<Akonadi::EntityDisplayAttribute>( Akonadi::Entity::AddIfMissing );
934  attribute->setIconName( QLatin1String( "document-properties" ) );
935  new Akonadi::CollectionModifyJob( collection );
936  }
937  else
938  ident.setDrafts( QString() );
939 
940  collection = mTemplatesCombo->collection();
941  if ( collection.isValid() ) {
942  ident.setTemplates( QString::number( collection.id() ) );
943  Akonadi::EntityDisplayAttribute *attribute = collection.attribute<Akonadi::EntityDisplayAttribute>( Akonadi::Entity::AddIfMissing );
944  attribute->setIconName( QLatin1String( "document-new" ) );
945  new Akonadi::CollectionModifyJob( collection );
946  }
947  else
948  ident.setTemplates( QString() );
949  ident.setVCardFile(mVcardFilename);
950  ident.setAutocorrectionLanguage(mAutoCorrectionLanguage->language());
951  updateVcardButton();
952  ident.setAttachVcard(mAttachMyVCard->isChecked());
953  //Add default ?
954  ident.setDefaultDomainName(mDefaultDomainEdit->text());
955 
956  // "Templates" tab:
957 #ifndef KDEPIM_MOBILE_UI
958  uint identity = ident.uoid();
959  QString iid = TemplateParser::TemplatesConfiguration::configIdString( identity );
960  TemplateParser::Templates t( iid );
961  kDebug() << "use custom templates for identity" << identity <<":" << mCustom->isChecked();
962  t.setUseCustomTemplates(mCustom->isChecked());
963  t.writeConfig();
964  mWidget->saveToIdentity( identity );
965 #endif
966 
967  // "Signature" tab:
968  ident.setSignature( mSignatureConfigurator->signature() );
969 #ifndef KDEPIM_MOBILE_UI
970  ident.setXFace( mXFaceConfigurator->xface() );
971  ident.setXFaceEnabled( mXFaceConfigurator->isXFaceEnabled() );
972 #endif
973 
974 }
975 void IdentityDialog::slotEditVcard()
976 {
977  if(QFile(mVcardFilename).exists()) {
978  editVcard(mVcardFilename);
979  } else {
980  if ( !MailCommon::Kernel::self()->kernelIsRegistered() ) {
981  return;
982  }
983  KPIMIdentities::IdentityManager *manager = KernelIf->identityManager();
984 
985  QPointer<IdentityAddVcardDialog> dlg = new IdentityAddVcardDialog(manager->shadowIdentities(), this);
986  if(dlg->exec()) {
987  IdentityAddVcardDialog::DuplicateMode mode = dlg->duplicateMode();
988  switch(mode) {
989  case IdentityAddVcardDialog::Empty: {
990  editVcard(mVcardFilename);
991  break;
992  }
993  case IdentityAddVcardDialog::ExistingEntry: {
994  KPIMIdentities::Identity ident = manager->modifyIdentityForName( dlg->duplicateVcardFromIdentity() );
995  const QString filename = ident.vCardFile();
996  if(!filename.isEmpty()) {
997  QFile::copy(filename,mVcardFilename);
998  }
999  editVcard(mVcardFilename);
1000  break;
1001  }
1002  case IdentityAddVcardDialog::FromExistingVCard: {
1003  const QString filename = dlg->existingVCard().path();
1004  if(!filename.isEmpty()) {
1005  mVcardFilename = filename;
1006  }
1007  editVcard(mVcardFilename);
1008  break;
1009  }
1010  }
1011  }
1012  delete dlg;
1013  }
1014 }
1015 
1016 void IdentityDialog::editVcard(const QString &filename)
1017 {
1018  QPointer<IdentityEditVcardDialog> dlg = new IdentityEditVcardDialog(filename, this);
1019  connect(dlg, SIGNAL(vcardRemoved()), SLOT(slotVCardRemoved()));
1020  if(dlg->exec()) {
1021  mVcardFilename = dlg->saveVcard();
1022  }
1023  updateVcardButton();
1024  delete dlg;
1025 }
1026 
1027 void IdentityDialog::slotVCardRemoved()
1028 {
1029  mVcardFilename.clear();
1030 }
1031 
1032 void IdentityDialog::updateVcardButton()
1033 {
1034  if(mVcardFilename.isEmpty() || !QFile(mVcardFilename).exists()) {
1035  mEditVCard->setText(i18n("Create..."));
1036  } else {
1037  mEditVCard->setText(i18n("Edit..."));
1038  }
1039 }
1040 
1041 }
1042 
QWidget::layout
QLayout * layout() const
AddressValidationJob
Definition: addressvalidationjob.h:28
globalsettings.h
QWidget
identityaddvcarddialog.h
KMail::IdentityDialog::slotCopyGlobal
void slotCopyGlobal()
Definition: identitydialog.cpp:626
KMail::IdentityDialog::updateIdentity
void updateIdentity(KPIMIdentities::Identity &ident)
Definition: identitydialog.cpp:897
QString::end
iterator end()
KMail::IdentityDialog::slotAboutToShow
void slotAboutToShow(int)
Definition: identitydialog.cpp:613
QGridLayout::addWidget
void addWidget(QWidget *widget, int row, int column, QFlags< Qt::AlignmentFlag > alignment)
IdentityEditVcardDialog
Definition: identityeditvcarddialog.h:27
email
const QString email
Definition: identitydialog.cpp:640
AddressValidationJob::start
void start()
Definition: addressvalidationjob.cpp:117
QPointer
AddressValidationJob::isValid
bool isValid() const
Definition: addressvalidationjob.cpp:124
QHBoxLayout
AddressValidationJob::setDefaultDomain
void setDefaultDomain(const QString &domainName)
Definition: addressvalidationjob.cpp:112
QGridLayout
IdentityAddVcardDialog::DuplicateMode
DuplicateMode
Definition: identityaddvcarddialog.h:29
KDialog
KMail::IdentityDialog::~IdentityDialog
~IdentityDialog()
Definition: identitydialog.cpp:607
QFile::exists
bool exists() const
IdentityAddVcardDialog::FromExistingVCard
Definition: identityaddvcarddialog.h:32
KMail::XFaceConfigurator::setXFaceEnabled
void setXFaceEnabled(bool enable)
Definition: xfaceconfigurator.cpp:200
KMail::XFaceConfigurator::setXFace
void setXFace(const QString &text)
Definition: xfaceconfigurator.cpp:210
QAbstractButton::setIcon
void setIcon(const QIcon &icon)
QFile
QFile::copy
bool copy(const QString &newName)
QGridLayout::setSpacing
void setSpacing(int spacing)
QString::clear
void clear()
QLabel::setBuddy
void setBuddy(QWidget *buddy)
QWidget::setEnabled
void setEnabled(bool)
QBoxLayout::addWidget
void addWidget(QWidget *widget, int stretch, QFlags< Qt::AlignmentFlag > alignment)
QString::number
QString number(int n, int base)
QString::fromUtf8
QString fromUtf8(const char *str, int size)
QGridLayout::setRowStretch
void setRowStretch(int row, int stretch)
addresseelineedit.h
KPIM::AddresseeLineEdit
QCheckBox
QString::isEmpty
bool isEmpty() const
KMail::XFaceConfigurator::isXFaceEnabled
bool isXFaceEnabled() const
Definition: xfaceconfigurator.cpp:195
QVBoxLayout
KMail::IdentityDialog::slotButtonClicked
void slotButtonClicked(int button)
Definition: identitydialog.cpp:673
IdentityAddVcardDialog::Empty
Definition: identityaddvcarddialog.h:30
QString
QWidget::hide
void hide()
QLayout::setMargin
void setMargin(int margin)
QStringList
QString::toLower
QString toLower() const
QToolButton
QAbstractButton::setChecked
void setChecked(bool)
QGridLayout::addLayout
void addLayout(QLayout *layout, int row, int column, QFlags< Qt::AlignmentFlag > alignment)
GlobalSettings::self
static GlobalSettings * self()
Definition: globalsettings.cpp:30
kmkernel.h
KLineEdit
QWidget::setWhatsThis
void setWhatsThis(const QString &)
xfaceconfigurator.h
IdentityAddVcardDialog
Definition: identityaddvcarddialog.h:25
QString::mid
QString mid(int position, int n) const
QLatin1String
QBoxLayout::addStretch
void addStretch(int stretch)
QGridLayout::setColumnStretch
void setColumnStretch(int column, int stretch)
identitydialog.h
identityeditvcarddialog.h
KComboBox
QString::length
int length() const
addressvalidationjob.h
QHostInfo::localHostName
QString localHostName()
QWidget::setToolTip
void setToolTip(const QString &)
KMail::XFaceConfigurator
Definition: xfaceconfigurator.h:32
IdentityAddVcardDialog::ExistingEntry
Definition: identityaddvcarddialog.h:31
QLabel
KMail::XFaceConfigurator::xface
QString xface() const
Definition: xfaceconfigurator.cpp:205
KJob
QString::toLongLong
qlonglong toLongLong(bool *ok, int base) const
QBoxLayout::setSpacing
void setSpacing(int spacing)
QBoxLayout::addLayout
void addLayout(QLayout *layout, int stretch)
KMail::IdentityDialog::setIdentity
void setIdentity(KPIMIdentities::Identity &ident)
Definition: identitydialog.cpp:795
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:34:33 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kmail

Skip menu "kmail"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

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