• 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
  • configuredialog
configurecomposerpage.cpp
Go to the documentation of this file.
1 /*
2  Copyright (c) 2013-2015 Montel Laurent <montel@kde.org>
3 
4  This program is free software; you can redistribute it and/or modify it
5  under the terms of the GNU General Public License, version 2, as
6  published by the Free Software Foundation.
7 
8  This program is distributed in the hope that it will be useful, but
9  WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License along
14  with this program; if not, write to the Free Software Foundation, Inc.,
15  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17 
18 #include "configurecomposerpage.h"
19 #include "pimcommon/widgets/configureimmutablewidgetutils.h"
20 #include "configurestorageservicewidget.h"
21 using namespace PimCommon::ConfigureImmutableWidgetUtils;
22 #include "kmkernel.h"
23 #include "kmmainwidget.h"
24 #include "pimcommon/autocorrection/autocorrectionwidget.h"
25 #include "messagecomposer/imagescaling/imagescalingwidget.h"
26 #include "messagecomposer/settings/messagecomposersettings.h"
27 #include "messagecore/settings/globalsettings.h"
28 #include "settings/globalsettings.h"
29 #include "configuredialog/configuredialoglistview.h"
30 #include "pimcommon/widgets/simplestringlisteditor.h"
31 #include "templateparser/templatesconfiguration_kfg.h"
32 #include "templateparser/templatesconfiguration.h"
33 #include "templateparser/customtemplates.h"
34 #include "templateparser/globalsettings_base.h"
35 #include "messageviewer/utils/autoqpointer.h"
36 #include "addressline/recentaddress/recentaddresses.h"
37 #include "addressline/recentaddress/recentaddressdialog.h"
38 #include <libkdepim/ldap/ldapclientsearch.h>
39 #include "addressline/completionorder/completionordereditor.h"
40 using KPIM::RecentAddresses;
41 
42 
43 #include <KLocalizedString>
44 #include <KSeparator>
45 #include <KCharsets>
46 #include <KUrlRequester>
47 #include <KHBox>
48 #include <KMessageBox>
49 #include <KFile>
50 #include <kascii.h>
51 #include <KIntSpinBox>
52 #include <KIntNumInput>
53 
54 #include <QLabel>
55 #include <QGroupBox>
56 #include <QVBoxLayout>
57 #include <QGridLayout>
58 #include <QTextCodec>
59 #include <QCheckBox>
60 
61 #include <addressline/blacklistbaloocompletion/blacklistbalooemailcompletiondialog.h>
62 
63 QString ComposerPage::helpAnchor() const
64 {
65  return QString::fromLatin1("configure-composer");
66 }
67 
68 ComposerPage::ComposerPage( const KComponentData &instance, QWidget *parent )
69  : ConfigModuleWithTabs( instance, parent )
70 {
71  //
72  // "General" tab:
73  //
74  mGeneralTab = new GeneralTab();
75  addTab( mGeneralTab, i18nc("General settings for the composer.", "General") );
76  addConfig( GlobalSettings::self(), mGeneralTab );
77 
78  //
79  // "Templates" tab:
80  //
81  mTemplatesTab = new TemplatesTab();
82  addTab( mTemplatesTab, i18n("Standard Templates") );
83 
84  //
85  // "Custom Templates" tab:
86  //
87  mCustomTemplatesTab = new CustomTemplatesTab();
88  addTab( mCustomTemplatesTab, i18n("Custom Templates") );
89 
90  //
91  // "Subject" tab:
92  //
93  mSubjectTab = new SubjectTab();
94  addTab( mSubjectTab, i18nc("Settings regarding the subject when composing a message.","Subject") );
95  addConfig( GlobalSettings::self(), mSubjectTab );
96 
97  //
98  // "Charset" tab:
99  //
100  mCharsetTab = new CharsetTab();
101  addTab( mCharsetTab, i18n("Charset") );
102 
103  //
104  // "Headers" tab:
105  //
106  mHeadersTab = new HeadersTab();
107  addTab( mHeadersTab, i18n("Headers") );
108 
109  //
110  // "Attachments" tab:
111  //
112  mAttachmentsTab = new AttachmentsTab();
113  addTab( mAttachmentsTab, i18nc("Config->Composer->Attachments", "Attachments") );
114 
115  //
116  // "autocorrection" tab:
117  //
118  mAutoCorrectionTab = new AutoCorrectionTab();
119  addTab( mAutoCorrectionTab, i18n("Autocorrection") );
120 
121  //
122  // "autoresize" tab:
123  //
124  mAutoImageResizeTab = new AutoImageResizeTab();
125  addTab( mAutoImageResizeTab, i18n("Auto Resize Image") );
126 
127  //
128  // "external editor" tab:
129  mExternalEditorTab = new ExternalEditorTab();
130  addTab( mExternalEditorTab, i18n("External Editor") );
131 }
132 
133 QString ComposerPage::GeneralTab::helpAnchor() const
134 {
135  return QString::fromLatin1("configure-composer-general");
136 }
137 
138 ComposerPageGeneralTab::ComposerPageGeneralTab( QWidget * parent )
139  : ConfigModuleTab( parent )
140 {
141  // Main layout
142  QHBoxLayout *hb1 = new QHBoxLayout(); // box with 2 columns
143  QVBoxLayout *vb1 = new QVBoxLayout(); // first with 2 groupboxes
144  QVBoxLayout *vb2 = new QVBoxLayout(); // second with 1 groupbox
145 
146  // "Signature" group
147  QGroupBox *groupBox = new QGroupBox( i18nc( "@title:group", "Signature" ) );
148  QVBoxLayout *groupVBoxLayout = new QVBoxLayout();
149 
150  // "Automatically insert signature" checkbox
151  mAutoAppSignFileCheck = new QCheckBox(
152  MessageComposer::MessageComposerSettings::self()->autoTextSignatureItem()->label(),
153  this );
154 
155  QString helpText = i18n( "Automatically insert the configured signature\n"
156  "when starting to compose a message" );
157  mAutoAppSignFileCheck->setToolTip( helpText );
158  mAutoAppSignFileCheck->setWhatsThis( helpText );
159 
160  connect( mAutoAppSignFileCheck, SIGNAL(stateChanged(int)),
161  this, SLOT(slotEmitChanged()) );
162  groupVBoxLayout->addWidget( mAutoAppSignFileCheck );
163 
164  // "Insert signature above quoted text" checkbox
165  mTopQuoteCheck = new QCheckBox(
166  MessageComposer::MessageComposerSettings::self()->prependSignatureItem()->label(), this );
167  mTopQuoteCheck->setEnabled( false );
168 
169  helpText = i18n( "Insert the signature above any quoted text" );
170  mTopQuoteCheck->setToolTip( helpText );
171  mTopQuoteCheck->setWhatsThis( helpText );
172 
173  connect( mTopQuoteCheck, SIGNAL(stateChanged(int)),
174  this, SLOT(slotEmitChanged()) );
175  connect( mAutoAppSignFileCheck, SIGNAL(toggled(bool)),
176  mTopQuoteCheck, SLOT(setEnabled(bool)) );
177  groupVBoxLayout->addWidget( mTopQuoteCheck );
178 
179  // "Prepend separator to signature" checkbox
180  mDashDashCheck = new QCheckBox(
181  MessageComposer::MessageComposerSettings::self()->dashDashSignatureItem()->label(), this );
182  mDashDashCheck->setEnabled( false );
183 
184  helpText = i18n( "Insert the RFC-compliant signature separator\n"
185  "(two dashes and a space on a line) before the signature" );
186  mDashDashCheck->setToolTip( helpText );
187  mDashDashCheck->setWhatsThis( helpText );
188 
189  connect( mDashDashCheck, SIGNAL(stateChanged(int)),
190  this, SLOT(slotEmitChanged()) );
191  connect( mAutoAppSignFileCheck, SIGNAL(toggled(bool)),
192  mDashDashCheck, SLOT(setEnabled(bool)) );
193  groupVBoxLayout->addWidget( mDashDashCheck);
194 
195  // "Remove signature when replying" checkbox
196  mStripSignatureCheck = new QCheckBox( TemplateParser::GlobalSettings::self()->stripSignatureItem()->label(),
197  this );
198 
199  helpText = i18n( "When replying, do not quote any existing signature" );
200  mStripSignatureCheck->setToolTip( helpText );
201  mStripSignatureCheck->setWhatsThis( helpText );
202 
203  connect( mStripSignatureCheck, SIGNAL(stateChanged(int)),
204  this, SLOT(slotEmitChanged()) );
205  groupVBoxLayout->addWidget( mStripSignatureCheck );
206 
207  groupBox->setLayout( groupVBoxLayout );
208  vb1->addWidget( groupBox );
209 
210  // "Format" group
211  groupBox = new QGroupBox( i18nc( "@title:group", "Format" ) );
212  QGridLayout *groupGridLayout = new QGridLayout();
213  int row = 0;
214 
215  // "Only quote selected text when replying" checkbox
216  mQuoteSelectionOnlyCheck = new QCheckBox( MessageComposer::MessageComposerSettings::self()->quoteSelectionOnlyItem()->label(),
217  this );
218  helpText = i18n( "When replying, only quote the selected text\n"
219  "(instead of the complete message), if\n"
220  "there is text selected in the message window." );
221  mQuoteSelectionOnlyCheck->setToolTip( helpText );
222  mQuoteSelectionOnlyCheck->setWhatsThis( helpText );
223 
224  connect( mQuoteSelectionOnlyCheck, SIGNAL(stateChanged(int)),
225  this, SLOT(slotEmitChanged()) );
226  groupGridLayout->addWidget( mQuoteSelectionOnlyCheck, row, 0, 1, -1 );
227  ++row;
228 
229  // "Use smart quoting" checkbox
230  mSmartQuoteCheck = new QCheckBox(
231  TemplateParser::GlobalSettings::self()->smartQuoteItem()->label(), this );
232  helpText = i18n( "When replying, add quote signs in front of all lines of the quoted text,\n"
233  "even when the line was created by adding an additional line break while\n"
234  "word-wrapping the text." );
235  mSmartQuoteCheck->setToolTip( helpText );
236  mSmartQuoteCheck->setWhatsThis( helpText );
237 
238  connect( mSmartQuoteCheck, SIGNAL(stateChanged(int)),
239  this, SLOT(slotEmitChanged()) );
240  groupGridLayout->addWidget( mSmartQuoteCheck, row, 0, 1, -1 );
241  ++row;
242 
243  // "Word wrap at column" checkbox/spinbox
244  mWordWrapCheck = new QCheckBox(
245  MessageComposer::MessageComposerSettings::self()->wordWrapItem()->label(), this);
246 
247  helpText = i18n( "Enable automatic word wrapping at the specified width" );
248  mWordWrapCheck->setToolTip( helpText );
249  mWordWrapCheck->setWhatsThis( helpText );
250 
251  mWrapColumnSpin = new KIntSpinBox( 30/*min*/, 78/*max*/, 1/*step*/,
252  78/*init*/, this );
253  mWrapColumnSpin->setEnabled( false ); // since !mWordWrapCheck->isChecked()
254 
255  helpText = i18n( "Set the text width for automatic word wrapping" );
256  mWrapColumnSpin->setToolTip( helpText );
257  mWrapColumnSpin->setWhatsThis( helpText );
258 
259  connect( mWordWrapCheck, SIGNAL(stateChanged(int)),
260  this, SLOT(slotEmitChanged()) );
261  connect( mWrapColumnSpin, SIGNAL(valueChanged(int)),
262  this, SLOT(slotEmitChanged()) );
263  // only enable the spinbox if the checkbox is checked
264  connect( mWordWrapCheck, SIGNAL(toggled(bool)),
265  mWrapColumnSpin, SLOT(setEnabled(bool)) );
266 
267  groupGridLayout->addWidget( mWordWrapCheck, row, 0 );
268  groupGridLayout->addWidget( mWrapColumnSpin, row, 1 );
269  ++row;
270 
271  // Spacing
272  groupGridLayout->setRowMinimumHeight( row, KDialog::spacingHint() );
273  ++row;
274 
275  // "Reply/Forward using HTML if present" checkbox
276  mReplyUsingHtml = new QCheckBox( TemplateParser::GlobalSettings::self()->replyUsingHtmlItem()->label(), this );
277  helpText = i18n( "When replying or forwarding, quote the message\n"
278  "in the original format it was received.\n"
279  "If unchecked, the reply will be as plain text by default." );
280  mReplyUsingHtml->setToolTip( helpText );
281  mReplyUsingHtml->setWhatsThis( helpText );
282 
283  connect( mReplyUsingHtml, SIGNAL(stateChanged(int)),
284  this, SLOT(slotEmitChanged()) );
285  groupGridLayout->addWidget( mReplyUsingHtml, row, 0, 1, -1 );
286  ++row;
287 
288  // "Improve plain text of HTML" checkbox
289  mImprovePlainTextOfHtmlMessage = new QCheckBox( MessageComposer::MessageComposerSettings::self()->improvePlainTextOfHtmlMessageItem()->label(), this );
290 
291  // For what is supported see http://www.grantlee.org/apidox/classGrantlee_1_1PlainTextMarkupBuilder.html
292  helpText = i18n( "Format the plain text part of a message from the HTML markup.\n"
293  "Bold, italic and underlined text, lists, and external references\n"
294  "are supported." );
295  mImprovePlainTextOfHtmlMessage->setToolTip( helpText );
296  mImprovePlainTextOfHtmlMessage->setWhatsThis( helpText );
297 
298  connect( mImprovePlainTextOfHtmlMessage, SIGNAL(stateChanged(int)),
299  this, SLOT(slotEmitChanged()) );
300  groupGridLayout->addWidget( mImprovePlainTextOfHtmlMessage, row, 0, 1, -1 );
301  ++row;
302 
303  // Spacing
304  groupGridLayout->setRowMinimumHeight( row, KDialog::spacingHint() );
305  ++row;
306 
307  // "Autosave interval" spinbox
308  mAutoSave = new KIntSpinBox( 0, 60, 1, 1, this );
309  mAutoSave->setObjectName( QLatin1String("kcfg_AutosaveInterval") );
310  mAutoSave->setSpecialValueText( i18n("No autosave") );
311  mAutoSave->setSuffix( ki18ncp( "Interval suffix", " minute", " minutes" ) );
312 
313  helpText = i18n( "Automatically save the message at this specified interval" );
314  mAutoSave->setToolTip( helpText );
315  mAutoSave->setWhatsThis( helpText );
316 
317  QLabel *label = new QLabel( GlobalSettings::self()->autosaveIntervalItem()->label(), this );
318  label->setBuddy( mAutoSave );
319 
320  connect( mAutoSave, SIGNAL(valueChanged(int)),
321  this, SLOT(slotEmitChanged()) );
322 
323  groupGridLayout->addWidget( label, row, 0 );
324  groupGridLayout->addWidget( mAutoSave, row, 1 );
325  ++row;
326 
327 #ifdef KDEPIM_ENTERPRISE_BUILD
328  // "Default forwarding type" combobox
329  mForwardTypeCombo = new KComboBox( false, this );
330  mForwardTypeCombo->addItems( QStringList() << i18nc( "@item:inlistbox Inline mail forwarding",
331  "Inline" )
332  << i18n( "As Attachment" ) );
333 
334  helpText = i18n( "Set the default forwarded message format" );
335  mForwardTypeCombo->setToolTip( helpText );
336  mForwardTypeCombo->setWhatsThis( helpText );
337 
338  label = new QLabel( i18n( "Default forwarding type:" ), this );
339  label->setBuddy( mForwardTypeCombo );
340 
341  connect( mForwardTypeCombo, SIGNAL(activated(int)),
342  this, SLOT(slotEmitChanged()) );
343 
344  groupGridLayout->addWidget( label, row, 0 );
345  groupGridLayout->addWidget( mForwardTypeCombo, row, 1 );
346  ++row;
347 #endif
348 
349  groupBox->setLayout( groupGridLayout );
350  vb1->addWidget( groupBox );
351 
352  // "Recipients" group
353  groupBox = new QGroupBox( i18nc( "@title:group", "Recipients" ) );
354  groupGridLayout = new QGridLayout();
355  row = 0;
356 
357  // "Automatically request MDNs" checkbox
358  mAutoRequestMDNCheck = new QCheckBox( GlobalSettings::self()->requestMDNItem()->label(),
359  this);
360 
361  helpText = i18n( "By default, request an MDN when starting to compose a message.\n"
362  "You can select this on a per-message basis using \"Options - Request Disposition Notification\"" );
363  mAutoRequestMDNCheck->setToolTip( helpText );
364  mAutoRequestMDNCheck->setWhatsThis( helpText );
365 
366  connect( mAutoRequestMDNCheck, SIGNAL(stateChanged(int)),
367  this, SLOT(slotEmitChanged()) );
368  groupGridLayout->addWidget( mAutoRequestMDNCheck, row, 0, 1, -1 );
369  ++row;
370 
371  // Spacing
372  groupGridLayout->setRowMinimumHeight( row, KDialog::spacingHint() );
373  ++row;
374 
375  // "Use Baloo seach in composer" checkbox
376  mShowBalooSearchAddressesInComposer = new QCheckBox(
377  MessageComposer::MessageComposerSettings::self()->showBalooSearchInComposerItem()->label(),
378  this);
379 
380  connect( mShowBalooSearchAddressesInComposer, SIGNAL(stateChanged(int)),
381  this, SLOT(slotEmitChanged()) );
382  groupGridLayout->addWidget( mShowBalooSearchAddressesInComposer, row, 0, 1, -1 );
383  ++row;
384 
385 
386 #ifdef KDEPIM_ENTERPRISE_BUILD
387  // "Warn if too many recipients" checkbox/spinbox
388  mRecipientCheck = new QCheckBox(
389  GlobalSettings::self()->tooManyRecipientsItem()->label(), this);
390  mRecipientCheck->setObjectName( QLatin1String("kcfg_TooManyRecipients") );
391  helpText = i18n( GlobalSettings::self()->tooManyRecipientsItem()->whatsThis().toUtf8() );
392  mRecipientCheck->setWhatsThis( helpText );
393  mRecipientCheck->setToolTip( i18n( "Warn if too many recipients are specified" ) );
394 
395  mRecipientSpin = new KIntSpinBox( 1/*min*/, 100/*max*/, 1/*step*/,
396  5/*init*/, this );
397  mRecipientSpin->setObjectName( QLatin1String("kcfg_RecipientThreshold") );
398  mRecipientSpin->setEnabled( false );
399  helpText = i18n( GlobalSettings::self()->recipientThresholdItem()->whatsThis().toUtf8() );
400  mRecipientSpin->setWhatsThis( helpText );
401  mRecipientSpin->setToolTip( i18n( "Set the maximum number of recipients for the warning" ) );
402 
403  connect( mRecipientCheck, SIGNAL(stateChanged(int)),
404  this, SLOT(slotEmitChanged()) );
405  connect( mRecipientSpin, SIGNAL(valueChanged(int)),
406  this, SLOT(slotEmitChanged()) );
407  // only enable the spinbox if the checkbox is checked
408  connect( mRecipientCheck, SIGNAL(toggled(bool)),
409  mRecipientSpin, SLOT(setEnabled(bool)) );
410 
411  groupGridLayout->addWidget( mRecipientCheck, row, 0, 1, 2);
412  groupGridLayout->addWidget( mRecipientSpin, row, 2 );
413  ++row;
414 #endif
415 
416  // "Maximum Reply-to-All recipients" spinbox
417  mMaximumRecipients = new KIntSpinBox( 0, 9999, 1, 1, this );
418 
419  helpText = i18n( "Only allow this many recipients to be specified for the message.\n"
420  "This applies to doing a \"Reply to All\", entering recipients manually\n"
421  "or using the \"Select...\" picker. Setting this limit helps you to\n"
422  "avoid accidentally sending a message to too many people. Note,\n"
423  "however, that it does not take account of distribution lists or\n"
424  "mailing lists." );
425  mMaximumRecipients->setToolTip( helpText );
426  mMaximumRecipients->setWhatsThis( helpText );
427 
428  label = new QLabel( MessageComposer::MessageComposerSettings::self()->maximumRecipientsItem()->label(), this );
429  label->setBuddy(mMaximumRecipients);
430 
431  connect( mMaximumRecipients, SIGNAL(valueChanged(int)),
432  this, SLOT(slotEmitChanged()) );
433 
434  groupGridLayout->addWidget( label, row, 0, 1, 2 );
435  groupGridLayout->addWidget( mMaximumRecipients, row, 2 );
436  ++row;
437 
438  // Spacing
439  groupGridLayout->setRowMinimumHeight( row, KDialog::spacingHint() );
440  ++row;
441 
442  // "Use recent addresses for autocompletion" checkbox
443  mShowRecentAddressesInComposer = new QCheckBox(
444  MessageComposer::MessageComposerSettings::self()->showRecentAddressesInComposerItem()->label(),
445  this);
446 
447  helpText = i18n( "Remember recent addresses entered,\n"
448  "and offer them for recipient completion" );
449  mShowRecentAddressesInComposer->setToolTip( helpText );
450  mShowRecentAddressesInComposer->setWhatsThis( helpText );
451 
452  connect( mShowRecentAddressesInComposer, SIGNAL(stateChanged(int)),
453  this, SLOT(slotEmitChanged()) );
454  groupGridLayout->addWidget( mShowRecentAddressesInComposer, row, 0, 1, -1 );
455  ++row;
456 
457  // "Maximum recent addresses retained" spinbox
458  mMaximumRecentAddress = new KIntNumInput( this );
459  mMaximumRecentAddress->setSliderEnabled( false );
460  mMaximumRecentAddress->setMinimum( 0 );
461  mMaximumRecentAddress->setMaximum( 999 );
462  mMaximumRecentAddress->setSpecialValueText( i18nc( "No addresses are retained", "No save" ) );
463  mMaximumRecentAddress->setEnabled( false );
464 
465  label = new QLabel( i18n( "Maximum recent addresses retained:" ) );
466  label->setBuddy( mMaximumRecentAddress );
467  label->setEnabled( false );
468 
469  helpText = i18n( "The maximum number of recently entered addresses that will\n"
470  "be remembered for completion" );
471  mMaximumRecentAddress->setToolTip( helpText );
472  mMaximumRecentAddress->setWhatsThis( helpText );
473 
474  connect( mMaximumRecentAddress, SIGNAL(valueChanged(int)),
475  this, SLOT(slotEmitChanged()) );
476  connect( mShowRecentAddressesInComposer, SIGNAL(toggled(bool)),
477  mMaximumRecentAddress, SLOT(setEnabled(bool)) );
478  connect( mShowRecentAddressesInComposer, SIGNAL(toggled(bool)),
479  label, SLOT(setEnabled(bool)) );
480 
481  groupGridLayout->addWidget( label, row, 0, 1, 2 );
482  groupGridLayout->addWidget( mMaximumRecentAddress, row, 2 );
483  ++row;
484 
485  // "Edit Recent Addresses" button
486  QPushButton *recentAddressesBtn = new QPushButton( i18n( "Edit Recent Addresses..." ), this );
487  helpText = i18n( "Edit, add or remove recent addresses" );
488  recentAddressesBtn->setToolTip( helpText );
489  recentAddressesBtn->setWhatsThis( helpText );
490 
491  connect( recentAddressesBtn, SIGNAL(clicked()),
492  this, SLOT(slotConfigureRecentAddresses()) );
493  groupGridLayout->addWidget( recentAddressesBtn, row, 1, 1, 2 );
494  ++row;
495 
496 
497  // "Configure Completion Order" button
498  QPushButton *completionOrderBtn = new QPushButton( i18n( "Configure Completion Order..." ), this );
499  helpText = i18n( "Configure the order in which address books\n"
500  "will be used when doing address completion" );
501  completionOrderBtn->setToolTip( helpText );
502  completionOrderBtn->setWhatsThis( helpText );
503 
504  connect( completionOrderBtn, SIGNAL(clicked()),
505  this, SLOT(slotConfigureCompletionOrder()) );
506  groupGridLayout->addWidget( completionOrderBtn, row, 1, 1, 2 );
507  ++row;
508  // "Configure Completion Order" button
509  // KF5 add i18n
510  QPushButton *completionEmailBacklistBtn = new QPushButton( QLatin1String( "Configure Email Blacklist..." ), this );
511 
512  connect( completionEmailBacklistBtn, SIGNAL(clicked()),
513  this, SLOT(slotConfigureEmailBlacklist()) );
514  groupGridLayout->addWidget( completionEmailBacklistBtn, row, 1, 1, 2 );
515 
516  // Spacing
517  groupGridLayout->setRowMinimumHeight( row, KDialog::spacingHint() );
518  ++row;
519 
520  groupBox->setLayout( groupGridLayout );
521  vb2->addWidget( groupBox );
522 
523  // Finish up main layout
524  vb1->addStretch( 1 );
525  vb2->addStretch( 1 );
526 
527  hb1->addLayout( vb1 );
528  hb1->addLayout( vb2 );
529  setLayout( hb1 );
530 }
531 
532 
533 void ComposerPage::GeneralTab::doResetToDefaultsOther()
534 {
535  const bool bUseDefaults = MessageComposer::MessageComposerSettings::self()->useDefaults( true );
536 
537  const bool autoAppSignFile = MessageComposer::MessageComposerSettings::self()->autoTextSignature()==QLatin1String( "auto" );
538  const bool topQuoteCheck = MessageComposer::MessageComposerSettings::self()->prependSignature();
539  const bool dashDashSignature = MessageComposer::MessageComposerSettings::self()->dashDashSignature();
540  const bool smartQuoteCheck = MessageComposer::MessageComposerSettings::self()->quoteSelectionOnly();
541  const bool wordWrap = MessageComposer::MessageComposerSettings::self()->wordWrap();
542  const int wrapColumn = MessageComposer::MessageComposerSettings::self()->lineWrapWidth();
543  const bool showRecentAddress = MessageComposer::MessageComposerSettings::self()->showRecentAddressesInComposer();
544  const int maximumRecipient = MessageComposer::MessageComposerSettings::self()->maximumRecipients();
545  const bool improvePlainText = MessageComposer::MessageComposerSettings::self()->improvePlainTextOfHtmlMessage();
546  const bool showBalooSearchInComposer = MessageComposer::MessageComposerSettings::self()->showBalooSearchInComposer();
547  MessageComposer::MessageComposerSettings::self()->useDefaults( bUseDefaults );
548 
549  mAutoAppSignFileCheck->setChecked( autoAppSignFile );
550  mTopQuoteCheck->setChecked( topQuoteCheck );
551  mDashDashCheck->setChecked( dashDashSignature );
552  mQuoteSelectionOnlyCheck->setChecked( smartQuoteCheck );
553  mWordWrapCheck->setChecked( wordWrap );
554  mWrapColumnSpin->setValue( wrapColumn );
555  mMaximumRecipients->setValue( maximumRecipient );
556  mShowRecentAddressesInComposer->setChecked( showRecentAddress );
557  mShowBalooSearchAddressesInComposer->setChecked(showBalooSearchInComposer);
558  mImprovePlainTextOfHtmlMessage->setChecked(improvePlainText);
559 
560  mMaximumRecentAddress->setValue( 40 );
561 }
562 
563 void ComposerPage::GeneralTab::doLoadFromGlobalSettings()
564 {
565  // various check boxes:
566 
567  mAutoAppSignFileCheck->setChecked(
568  MessageComposer::MessageComposerSettings::self()->autoTextSignature()==QLatin1String( "auto" ) );
569  loadWidget(mTopQuoteCheck, MessageComposer::MessageComposerSettings::self()->prependSignatureItem() );
570  loadWidget(mDashDashCheck, MessageComposer::MessageComposerSettings::self()->dashDashSignatureItem() );
571  loadWidget(mSmartQuoteCheck,TemplateParser::GlobalSettings::self()->smartQuoteItem() );
572  loadWidget(mQuoteSelectionOnlyCheck, MessageComposer::MessageComposerSettings::self()->quoteSelectionOnlyItem() );
573 
574  loadWidget(mReplyUsingHtml, TemplateParser::GlobalSettings::self()->replyUsingHtmlItem() );
575  loadWidget(mStripSignatureCheck, TemplateParser::GlobalSettings::self()->stripSignatureItem() );
576  loadWidget(mAutoRequestMDNCheck, GlobalSettings::self()->requestMDNItem() );
577  loadWidget(mWordWrapCheck, MessageComposer::MessageComposerSettings::self()->wordWrapItem() );
578 
579  loadWidget(mWrapColumnSpin, MessageComposer::MessageComposerSettings::self()->lineWrapWidthItem() );
580  loadWidget(mMaximumRecipients, MessageComposer::MessageComposerSettings::self()->maximumRecipientsItem() );
581  mAutoSave->setValue( GlobalSettings::self()->autosaveInterval() );
582  loadWidget(mShowRecentAddressesInComposer, MessageComposer::MessageComposerSettings::self()->showRecentAddressesInComposerItem() );
583  loadWidget(mShowBalooSearchAddressesInComposer, MessageComposer::MessageComposerSettings::self()->showBalooSearchInComposerItem() );
584  mImprovePlainTextOfHtmlMessage->setChecked(MessageComposer::MessageComposerSettings::self()->improvePlainTextOfHtmlMessage());
585 
586 #ifdef KDEPIM_ENTERPRISE_BUILD
587  mRecipientCheck->setChecked( GlobalSettings::self()->tooManyRecipients() );
588  mRecipientSpin->setValue( GlobalSettings::self()->recipientThreshold() );
589  if ( GlobalSettings::self()->forwardingInlineByDefault() )
590  mForwardTypeCombo->setCurrentIndex( 0 );
591  else
592  mForwardTypeCombo->setCurrentIndex( 1 );
593 #endif
594 
595  mMaximumRecentAddress->setValue(RecentAddresses::self( MessageComposer::MessageComposerSettings::self()->config() )->maxCount());
596 }
597 
598 void ComposerPage::GeneralTab::save() {
599 
600  saveCheckBox(mTopQuoteCheck, MessageComposer::MessageComposerSettings::self()->prependSignatureItem() );
601  saveCheckBox(mDashDashCheck, MessageComposer::MessageComposerSettings::self()->dashDashSignatureItem() );
602  saveCheckBox(mSmartQuoteCheck,TemplateParser::GlobalSettings::self()->smartQuoteItem() );
603  saveCheckBox(mQuoteSelectionOnlyCheck, MessageComposer::MessageComposerSettings::self()->quoteSelectionOnlyItem() );
604 
605  saveCheckBox(mReplyUsingHtml, TemplateParser::GlobalSettings::self()->replyUsingHtmlItem() );
606  saveCheckBox(mStripSignatureCheck, TemplateParser::GlobalSettings::self()->stripSignatureItem() );
607  saveCheckBox(mAutoRequestMDNCheck, GlobalSettings::self()->requestMDNItem() );
608  saveCheckBox(mWordWrapCheck, MessageComposer::MessageComposerSettings::self()->wordWrapItem() );
609 
610 
611  MessageComposer::MessageComposerSettings::self()->setAutoTextSignature(
612  mAutoAppSignFileCheck->isChecked() ? QLatin1String("auto") : QLatin1String("manual") );
613  saveSpinBox(mWrapColumnSpin, MessageComposer::MessageComposerSettings::self()->lineWrapWidthItem() );
614  saveSpinBox(mMaximumRecipients, MessageComposer::MessageComposerSettings::self()->maximumRecipientsItem() );
615  GlobalSettings::self()->setAutosaveInterval( mAutoSave->value() );
616  MessageComposer::MessageComposerSettings::self()->setShowRecentAddressesInComposer( mShowRecentAddressesInComposer->isChecked() );
617  MessageComposer::MessageComposerSettings::self()->setShowBalooSearchInComposer( mShowBalooSearchAddressesInComposer->isChecked() );
618  MessageComposer::MessageComposerSettings::self()->setImprovePlainTextOfHtmlMessage( mImprovePlainTextOfHtmlMessage->isChecked() );
619 #ifdef KDEPIM_ENTERPRISE_BUILD
620  GlobalSettings::self()->setTooManyRecipients( mRecipientCheck->isChecked() );
621  GlobalSettings::self()->setRecipientThreshold( mRecipientSpin->value() );
622  GlobalSettings::self()->setForwardingInlineByDefault( mForwardTypeCombo->currentIndex() == 0 );
623 #endif
624 
625  RecentAddresses::self( MessageComposer::MessageComposerSettings::self()->config() )->setMaxCount( mMaximumRecentAddress->value() );
626 
627  MessageComposer::MessageComposerSettings::self()->requestSync();
628 }
629 
630 void ComposerPage::GeneralTab::slotConfigureRecentAddresses()
631 {
632  MessageViewer::AutoQPointer<KPIM::RecentAddressDialog> dlg( new KPIM::RecentAddressDialog( this ) );
633  dlg->setAddresses( RecentAddresses::self( MessageComposer::MessageComposerSettings::self()->config() )->addresses() );
634  if ( dlg->exec() && dlg ) {
635  if (dlg->wasChanged()) {
636  RecentAddresses::self( MessageComposer::MessageComposerSettings::self()->config() )->clear();
637  dlg->storeAddresses(MessageComposer::MessageComposerSettings::self()->config());
638  }
639  }
640 }
641 
642 void ComposerPage::GeneralTab::slotConfigureEmailBlacklist()
643 {
644  QPointer<KPIM::BlackListBalooEmailCompletionDialog> dlg = new KPIM::BlackListBalooEmailCompletionDialog(this);
645  KSharedConfig::Ptr config = KSharedConfig::openConfig( QLatin1String("kpimbalooblacklist") );
646  KConfigGroup group( config, "AddressLineEdit" );
647  const QStringList balooBlackList = group.readEntry( "BalooBackList", QStringList() );
648  dlg->setEmailBlackList(balooBlackList);
649  dlg->exec();
650  delete dlg;
651 }
652 
653 void ComposerPage::GeneralTab::slotConfigureCompletionOrder()
654 {
655  KLDAP::LdapClientSearch search;
656  KPIM::CompletionOrderEditor editor( &search, this );
657  editor.exec();
658 }
659 
660 QString ComposerPage::ExternalEditorTab::helpAnchor() const
661 {
662  return QString::fromLatin1("configure-composer-externaleditor");
663 }
664 
665 ComposerPageExternalEditorTab::ComposerPageExternalEditorTab( QWidget * parent )
666  : ConfigModuleTab( parent )
667 {
668  QVBoxLayout *layout = new QVBoxLayout( this );
669 
670  mExternalEditorCheck = new QCheckBox(
671  GlobalSettings::self()->useExternalEditorItem()->label(), this);
672  mExternalEditorCheck->setObjectName( QLatin1String("kcfg_UseExternalEditor") );
673  connect( mExternalEditorCheck, SIGNAL(toggled(bool)),
674  this, SLOT(slotEmitChanged()) );
675 
676  KHBox *hbox = new KHBox( this );
677  QLabel *label = new QLabel( GlobalSettings::self()->externalEditorItem()->label(),
678  hbox );
679  mEditorRequester = new KUrlRequester( hbox );
680  //Laurent 25/10/2011 fix #Bug 256655 - A "save changes?" dialog appears ALWAYS when leaving composer settings, even when unchanged.
681  //mEditorRequester->setObjectName( "kcfg_ExternalEditor" );
682  connect( mEditorRequester, SIGNAL(urlSelected(KUrl)),
683  this, SLOT(slotEmitChanged()) );
684  connect( mEditorRequester, SIGNAL(textChanged(QString)),
685  this, SLOT(slotEmitChanged()) );
686 
687  hbox->setStretchFactor( mEditorRequester, 1 );
688  label->setBuddy( mEditorRequester );
689  label->setEnabled( false ); // since !mExternalEditorCheck->isChecked()
690  // ### FIXME: allow only executables (x-bit when available..)
691  mEditorRequester->setFilter( QLatin1String("application/x-executable "
692  "application/x-shellscript "
693  "application/x-desktop") );
694  mEditorRequester->setMode(KFile::File|KFile::ExistingOnly|KFile::LocalOnly);
695  mEditorRequester->setEnabled( false ); // !mExternalEditorCheck->isChecked()
696  connect( mExternalEditorCheck, SIGNAL(toggled(bool)),
697  label, SLOT(setEnabled(bool)) );
698  connect( mExternalEditorCheck, SIGNAL(toggled(bool)),
699  mEditorRequester, SLOT(setEnabled(bool)) );
700 
701  label = new QLabel( i18n("<b>%f</b> will be replaced with the "
702  "filename to edit.<br />"
703  "<b>%w</b> will be replaced with the window id.<br />"
704  "<b>%l</b> will be replaced with the line number."), this );
705  label->setEnabled( false ); // see above
706  connect( mExternalEditorCheck, SIGNAL(toggled(bool)),
707  label, SLOT(setEnabled(bool)) );
708  layout->addWidget( mExternalEditorCheck );
709  layout->addWidget( hbox );
710  layout->addWidget( label );
711  layout->addStretch();
712 }
713 
714 void ComposerPage::ExternalEditorTab::doLoadFromGlobalSettings()
715 {
716  loadWidget(mExternalEditorCheck, GlobalSettings::self()->useExternalEditorItem() );
717  loadWidget(mEditorRequester, GlobalSettings::self()->externalEditorItem() );
718 }
719 
720 void ComposerPage::ExternalEditorTab::save()
721 {
722  saveCheckBox(mExternalEditorCheck, GlobalSettings::self()->useExternalEditorItem() );
723  saveUrlRequester(mEditorRequester, GlobalSettings::self()->externalEditorItem() );
724 }
725 
726 QString ComposerPage::TemplatesTab::helpAnchor() const
727 {
728  return QString::fromLatin1("configure-composer-templates");
729 }
730 
731 ComposerPageTemplatesTab::ComposerPageTemplatesTab( QWidget * parent )
732  : ConfigModuleTab ( parent )
733 {
734  QVBoxLayout* vlay = new QVBoxLayout( this );
735  vlay->setMargin( 0 );
736  vlay->setSpacing( KDialog::spacingHint() );
737 
738  mWidget = new TemplateParser::TemplatesConfiguration( this );
739  vlay->addWidget( mWidget );
740 
741  connect( mWidget, SIGNAL(changed()),
742  this, SLOT(slotEmitChanged()) );
743 }
744 
745 void ComposerPage::TemplatesTab::doLoadFromGlobalSettings()
746 {
747  mWidget->loadFromGlobal();
748 }
749 
750 void ComposerPage::TemplatesTab::save()
751 {
752  mWidget->saveToGlobal();
753 }
754 
755 void ComposerPage::TemplatesTab::doResetToDefaultsOther()
756 {
757  mWidget->resetToDefault();
758 }
759 
760 QString ComposerPage::CustomTemplatesTab::helpAnchor() const
761 {
762  return QString::fromLatin1("configure-composer-custom-templates");
763 }
764 
765 ComposerPageCustomTemplatesTab::ComposerPageCustomTemplatesTab( QWidget * parent )
766  : ConfigModuleTab ( parent )
767 {
768  QVBoxLayout* vlay = new QVBoxLayout( this );
769  vlay->setMargin( 0 );
770  vlay->setSpacing( KDialog::spacingHint() );
771 
772  mWidget = new TemplateParser::CustomTemplates( kmkernel->getKMMainWidget() ? kmkernel->getKMMainWidget()->actionCollections() : QList<KActionCollection*>(), this );
773  vlay->addWidget( mWidget );
774 
775  connect( mWidget, SIGNAL(changed()),
776  this, SLOT(slotEmitChanged()) );
777  if( KMKernel::self() )
778  connect( mWidget, SIGNAL(templatesUpdated()), KMKernel::self(), SLOT(updatedTemplates()) );
779 }
780 
781 void ComposerPage::CustomTemplatesTab::doLoadFromGlobalSettings()
782 {
783  mWidget->load();
784 }
785 
786 void ComposerPage::CustomTemplatesTab::save()
787 {
788  mWidget->save();
789 }
790 
791 QString ComposerPage::SubjectTab::helpAnchor() const
792 {
793  return QString::fromLatin1("configure-composer-subject");
794 }
795 
796 ComposerPageSubjectTab::ComposerPageSubjectTab( QWidget * parent )
797  : ConfigModuleTab( parent )
798 {
799  QVBoxLayout *vlay = new QVBoxLayout( this );
800  vlay->setSpacing( KDialog::spacingHint() );
801  vlay->setMargin( KDialog::marginHint() );
802 
803  QGroupBox *group = new QGroupBox( i18n("Repl&y Subject Prefixes"), this );
804  QLayout *layout = new QVBoxLayout( group );
805  group->layout()->setSpacing( KDialog::spacingHint() );
806 
807  // row 0: help text:
808  QLabel *label = new QLabel( i18n("Recognize any sequence of the following prefixes\n"
809  "(entries are case-insensitive regular expressions):"), group );
810  label->setWordWrap( true );
811  label->setAlignment( Qt::AlignLeft );
812 
813  // row 1, string list editor:
814  PimCommon::SimpleStringListEditor::ButtonCode buttonCode =
815  static_cast<PimCommon::SimpleStringListEditor::ButtonCode>( PimCommon::SimpleStringListEditor::Add | PimCommon::SimpleStringListEditor::Remove | PimCommon::SimpleStringListEditor::Modify );
816  mReplyListEditor =
817  new PimCommon::SimpleStringListEditor( group, buttonCode,
818  i18n("A&dd..."), i18n("Re&move"),
819  i18n("Mod&ify..."),
820  i18n("Enter new reply prefix:") );
821  connect( mReplyListEditor, SIGNAL(changed()),
822  this, SLOT(slotEmitChanged()) );
823 
824  // row 2: "replace [...]" check box:
825  mReplaceReplyPrefixCheck = new QCheckBox(
826  MessageComposer::MessageComposerSettings::self()->replaceReplyPrefixItem()->label(),
827  group);
828  connect( mReplaceReplyPrefixCheck, SIGNAL(stateChanged(int)),
829  this, SLOT(slotEmitChanged()) );
830  layout->addWidget( label );
831  layout->addWidget( mReplyListEditor );
832  layout->addWidget( mReplaceReplyPrefixCheck );
833 
834  vlay->addWidget( group );
835 
836 
837  group = new QGroupBox( i18n("For&ward Subject Prefixes"), this );
838  layout = new QVBoxLayout( group );
839  group->layout()->setSpacing( KDialog::marginHint() );
840 
841  // row 0: help text:
842  label= new QLabel( i18n("Recognize any sequence of the following prefixes\n"
843  "(entries are case-insensitive regular expressions):"), group );
844  label->setAlignment( Qt::AlignLeft );
845  label->setWordWrap( true );
846 
847  // row 1: string list editor
848  mForwardListEditor =
849  new PimCommon::SimpleStringListEditor( group, buttonCode,
850  i18n("Add..."),
851  i18n("Remo&ve"),
852  i18n("Modify..."),
853  i18n("Enter new forward prefix:") );
854  connect( mForwardListEditor, SIGNAL(changed()),
855  this, SLOT(slotEmitChanged()) );
856 
857  // row 3: "replace [...]" check box:
858  mReplaceForwardPrefixCheck = new QCheckBox(
859  MessageComposer::MessageComposerSettings::self()->replaceForwardPrefixItem()->label(),
860  group);
861  connect( mReplaceForwardPrefixCheck, SIGNAL(stateChanged(int)),
862  this, SLOT(slotEmitChanged()) );
863  layout->addWidget( label );
864  layout->addWidget( mForwardListEditor );
865  layout->addWidget( mReplaceForwardPrefixCheck );
866  vlay->addWidget( group );
867 }
868 
869 void ComposerPage::SubjectTab::doLoadFromGlobalSettings()
870 {
871  loadWidget(mReplyListEditor, MessageComposer::MessageComposerSettings::self()->replyPrefixesItem() );
872  loadWidget(mForwardListEditor, MessageComposer::MessageComposerSettings::self()->forwardPrefixesItem() );
873  loadWidget(mReplaceForwardPrefixCheck, MessageComposer::MessageComposerSettings::self()->replaceForwardPrefixItem());
874  loadWidget(mReplaceReplyPrefixCheck, MessageComposer::MessageComposerSettings::self()->replaceReplyPrefixItem());
875 }
876 
877 void ComposerPage::SubjectTab::save()
878 {
879  saveSimpleStringListEditor(mReplyListEditor, MessageComposer::MessageComposerSettings::self()->replyPrefixesItem() );
880  saveSimpleStringListEditor(mForwardListEditor, MessageComposer::MessageComposerSettings::self()->forwardPrefixesItem() );
881  saveCheckBox(mReplaceForwardPrefixCheck, MessageComposer::MessageComposerSettings::self()->replaceForwardPrefixItem());
882  saveCheckBox(mReplaceReplyPrefixCheck, MessageComposer::MessageComposerSettings::self()->replaceReplyPrefixItem());
883 }
884 
885 void ComposerPage::SubjectTab::doResetToDefaultsOther()
886 {
887  const bool bUseDefaults = MessageComposer::MessageComposerSettings::self()->useDefaults( true );
888  loadWidget(mReplyListEditor, MessageComposer::MessageComposerSettings::self()->replyPrefixesItem() );
889  loadWidget(mForwardListEditor, MessageComposer::MessageComposerSettings::self()->forwardPrefixesItem() );
890  loadWidget(mReplaceForwardPrefixCheck, MessageComposer::MessageComposerSettings::self()->replaceForwardPrefixItem());
891  loadWidget(mReplaceReplyPrefixCheck, MessageComposer::MessageComposerSettings::self()->replaceReplyPrefixItem());
892  MessageComposer::MessageComposerSettings::self()->useDefaults( bUseDefaults );
893 }
894 
895 
896 QString ComposerPage::CharsetTab::helpAnchor() const
897 {
898  return QString::fromLatin1("configure-composer-charset");
899 }
900 
901 ComposerPageCharsetTab::ComposerPageCharsetTab( QWidget * parent )
902  : ConfigModuleTab( parent )
903 {
904  QVBoxLayout *vlay = new QVBoxLayout( this );
905  vlay->setSpacing( KDialog::spacingHint() );
906  vlay->setMargin( KDialog::marginHint() );
907 
908  QLabel *label = new QLabel( i18n("This list is checked for every outgoing message "
909  "from the top to the bottom for a charset that "
910  "contains all required characters."), this );
911  label->setWordWrap(true);
912  vlay->addWidget( label );
913 
914  mCharsetListEditor =
915  new PimCommon::SimpleStringListEditor( this, PimCommon::SimpleStringListEditor::All,
916  i18n("A&dd..."), i18n("Remo&ve"),
917  i18n("&Modify..."), i18n("Enter charset:") );
918  mCharsetListEditor->setUpDownAutoRepeat(true);
919  connect( mCharsetListEditor, SIGNAL(changed()),
920  this, SLOT(slotEmitChanged()) );
921 
922  vlay->addWidget( mCharsetListEditor, 1 );
923 
924  mKeepReplyCharsetCheck = new QCheckBox( i18n("&Keep original charset when "
925  "replying or forwarding (if "
926  "possible)"), this );
927  connect( mKeepReplyCharsetCheck, SIGNAL (stateChanged(int)),
928  this, SLOT(slotEmitChanged()) );
929  vlay->addWidget( mKeepReplyCharsetCheck );
930 
931  connect( mCharsetListEditor, SIGNAL(aboutToAdd(QString&)),
932  this, SLOT(slotVerifyCharset(QString&)) );
933  setEnabled(kmkernel);
934 }
935 
936 void ComposerPage::CharsetTab::slotVerifyCharset( QString & charset )
937 {
938  if ( charset.isEmpty() ) return;
939 
940  // KCharsets::codecForName("us-ascii") returns "iso-8859-1" (cf. Bug #49812)
941  // therefore we have to treat this case specially
942  if ( charset.toLower() == QString::fromLatin1("us-ascii") ) {
943  charset = QString::fromLatin1("us-ascii");
944  return;
945  }
946 
947  if ( charset.toLower() == QString::fromLatin1("locale") ) {
948  charset = QString::fromLatin1("%1 (locale)")
949  .arg( QString::fromLatin1(kmkernel->networkCodec()->name() ).toLower() );
950  return;
951  }
952 
953  bool ok = false;
954  QTextCodec *codec = KGlobal::charsets()->codecForName( charset, ok );
955  if ( ok && codec ) {
956  charset = QString::fromLatin1( codec->name() ).toLower();
957  return;
958  }
959 
960  KMessageBox::sorry( this, i18n("This charset is not supported.") );
961  charset.clear();
962 }
963 
964 void ComposerPage::CharsetTab::doLoadOther()
965 {
966  if (!kmkernel)
967  return;
968  QStringList charsets = MessageComposer::MessageComposerSettings::preferredCharsets();
969  QStringList::Iterator end( charsets.end() );
970  for ( QStringList::Iterator it = charsets.begin() ;
971  it != end ; ++it )
972  if ( (*it) == QString::fromLatin1("locale") ) {
973  QByteArray cset = kmkernel->networkCodec()->name();
974  kAsciiToLower( cset.data() );
975  (*it) = QString::fromLatin1("%1 (locale)").arg( QString::fromLatin1( cset ) );
976  }
977 
978  mCharsetListEditor->setStringList( charsets );
979  loadWidget(mKeepReplyCharsetCheck, MessageComposer::MessageComposerSettings::self()->forceReplyCharsetItem());
980 }
981 
982 
983 void ComposerPage::CharsetTab::doResetToDefaultsOther()
984 {
985  const bool bUseDefaults = MessageComposer::MessageComposerSettings::self()->useDefaults( true );
986  mCharsetListEditor->setStringList( MessageComposer::MessageComposerSettings::preferredCharsets());
987  mKeepReplyCharsetCheck->setChecked( MessageComposer::MessageComposerSettings::forceReplyCharset() );
988  saveCheckBox(mKeepReplyCharsetCheck, MessageComposer::MessageComposerSettings::self()->forceReplyCharsetItem());
989 
990  MessageComposer::MessageComposerSettings::self()->useDefaults( bUseDefaults );
991  slotEmitChanged();
992 }
993 
994 void ComposerPage::CharsetTab::save()
995 {
996  if (!kmkernel)
997  return;
998  QStringList charsetList = mCharsetListEditor->stringList();
999  QStringList::Iterator it = charsetList.begin();
1000  QStringList::Iterator end = charsetList.end();
1001 
1002  for ( ; it != end ; ++it )
1003  if ( (*it).endsWith( QLatin1String("(locale)") ) )
1004  (*it) = QLatin1String("locale");
1005  MessageComposer::MessageComposerSettings::setPreferredCharsets( charsetList );
1006  saveCheckBox(mKeepReplyCharsetCheck, MessageComposer::MessageComposerSettings::self()->forceReplyCharsetItem());
1007 }
1008 
1009 QString ComposerPage::HeadersTab::helpAnchor() const
1010 {
1011  return QString::fromLatin1("configure-composer-headers");
1012 }
1013 
1014 ComposerPageHeadersTab::ComposerPageHeadersTab( QWidget * parent )
1015  : ConfigModuleTab( parent )
1016 {
1017  QVBoxLayout *vlay = new QVBoxLayout( this );
1018  vlay->setSpacing( KDialog::spacingHint() );
1019  vlay->setMargin( KDialog::marginHint() );
1020 
1021  // "Use custom Message-Id suffix" checkbox:
1022  mCreateOwnMessageIdCheck =
1023  new QCheckBox( i18n("&Use custom message-id suffix"), this );
1024  connect( mCreateOwnMessageIdCheck, SIGNAL (stateChanged(int)),
1025  this, SLOT(slotEmitChanged()) );
1026  vlay->addWidget( mCreateOwnMessageIdCheck );
1027 
1028  // "Message-Id suffix" line edit and label:
1029  QHBoxLayout *hlay = new QHBoxLayout(); // inherits spacing
1030  vlay->addLayout( hlay );
1031  mMessageIdSuffixEdit = new KLineEdit( this );
1032  mMessageIdSuffixEdit->setClearButtonShown( true );
1033  // only ASCII letters, digits, plus, minus and dots are allowed
1034  QRegExpValidator *messageIdSuffixValidator =
1035  new QRegExpValidator( QRegExp( QLatin1String("[a-zA-Z0-9+-]+(?:\\.[a-zA-Z0-9+-]+)*") ), this );
1036  mMessageIdSuffixEdit->setValidator( messageIdSuffixValidator );
1037  QLabel *label = new QLabel(i18n("Custom message-&id suffix:"), this );
1038  label->setBuddy( mMessageIdSuffixEdit );
1039  label->setEnabled( false ); // since !mCreateOwnMessageIdCheck->isChecked()
1040  mMessageIdSuffixEdit->setEnabled( false );
1041  hlay->addWidget( label );
1042  hlay->addWidget( mMessageIdSuffixEdit, 1 );
1043  connect( mCreateOwnMessageIdCheck, SIGNAL(toggled(bool)),
1044  label, SLOT(setEnabled(bool)) );
1045  connect( mCreateOwnMessageIdCheck, SIGNAL(toggled(bool)),
1046  mMessageIdSuffixEdit, SLOT(setEnabled(bool)) );
1047  connect( mMessageIdSuffixEdit, SIGNAL(textChanged(QString)),
1048  this, SLOT(slotEmitChanged()) );
1049 
1050  // horizontal rule and "custom header fields" label:
1051  vlay->addWidget( new KSeparator( Qt::Horizontal, this ) );
1052  vlay->addWidget( new QLabel( i18n("Define custom mime header fields:"), this) );
1053 
1054  // "custom header fields" listbox:
1055  QGridLayout *glay = new QGridLayout(); // inherits spacing
1056  vlay->addLayout( glay );
1057  glay->setRowStretch( 2, 1 );
1058  glay->setColumnStretch( 1, 1 );
1059  mHeaderList = new ListView( this );
1060  mHeaderList->setHeaderLabels( QStringList() << i18nc("@title:column Name of the mime header.","Name")
1061  << i18nc("@title:column Value of the mimeheader.","Value") );
1062  mHeaderList->setSortingEnabled( false );
1063  connect( mHeaderList, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)),
1064  this, SLOT(slotMimeHeaderSelectionChanged()) );
1065  connect( mHeaderList, SIGNAL(addHeader()), SLOT(slotNewMimeHeader()));
1066  connect( mHeaderList, SIGNAL(removeHeader()), SLOT(slotRemoveMimeHeader()));
1067  glay->addWidget( mHeaderList, 0, 0, 3, 2 );
1068 
1069  // "new" and "remove" buttons:
1070  QPushButton *button = new QPushButton( i18nc("@action:button Add new mime header field.","Ne&w"), this );
1071  connect( button, SIGNAL(clicked()), this, SLOT(slotNewMimeHeader()) );
1072  button->setAutoDefault( false );
1073  glay->addWidget( button, 0, 2 );
1074  mRemoveHeaderButton = new QPushButton( i18n("Re&move"), this );
1075  connect( mRemoveHeaderButton, SIGNAL(clicked()),
1076  this, SLOT(slotRemoveMimeHeader()) );
1077  button->setAutoDefault( false );
1078  glay->addWidget( mRemoveHeaderButton, 1, 2 );
1079 
1080  // "name" and "value" line edits and labels:
1081  mTagNameEdit = new KLineEdit( this );
1082  mTagNameEdit->setClearButtonShown(true);
1083  mTagNameEdit->setEnabled( false );
1084  mTagNameLabel = new QLabel( i18nc("@label:textbox Name of the mime header.","&Name:"), this );
1085  mTagNameLabel->setBuddy( mTagNameEdit );
1086  mTagNameLabel->setEnabled( false );
1087  glay->addWidget( mTagNameLabel, 3, 0 );
1088  glay->addWidget( mTagNameEdit, 3, 1 );
1089  connect( mTagNameEdit, SIGNAL(textChanged(QString)),
1090  this, SLOT(slotMimeHeaderNameChanged(QString)) );
1091 
1092  mTagValueEdit = new KLineEdit( this );
1093  mTagValueEdit->setClearButtonShown(true);
1094  mTagValueEdit->setEnabled( false );
1095  mTagValueLabel = new QLabel( i18n("&Value:"), this );
1096  mTagValueLabel->setBuddy( mTagValueEdit );
1097  mTagValueLabel->setEnabled( false );
1098  glay->addWidget( mTagValueLabel, 4, 0 );
1099  glay->addWidget( mTagValueEdit, 4, 1 );
1100  connect( mTagValueEdit, SIGNAL(textChanged(QString)),
1101  this, SLOT(slotMimeHeaderValueChanged(QString)) );
1102 }
1103 
1104 void ComposerPage::HeadersTab::slotMimeHeaderSelectionChanged()
1105 {
1106  mEmitChanges = false;
1107  QTreeWidgetItem * item = mHeaderList->currentItem();
1108 
1109  if ( item ) {
1110  mTagNameEdit->setText( item->text( 0 ) );
1111  mTagValueEdit->setText( item->text( 1 ) );
1112  } else {
1113  mTagNameEdit->clear();
1114  mTagValueEdit->clear();
1115  }
1116  mRemoveHeaderButton->setEnabled( item );
1117  mTagNameEdit->setEnabled( item );
1118  mTagValueEdit->setEnabled( item );
1119  mTagNameLabel->setEnabled( item );
1120  mTagValueLabel->setEnabled( item );
1121  mEmitChanges = true;
1122 }
1123 
1124 
1125 void ComposerPage::HeadersTab::slotMimeHeaderNameChanged( const QString & text )
1126 {
1127  // is called on ::setup(), when clearing the line edits. So be
1128  // prepared to not find a selection:
1129  QTreeWidgetItem * item = mHeaderList->currentItem();
1130  if ( item )
1131  item->setText( 0, text );
1132  slotEmitChanged();
1133 }
1134 
1135 
1136 void ComposerPage::HeadersTab::slotMimeHeaderValueChanged( const QString & text )
1137 {
1138  // is called on ::setup(), when clearing the line edits. So be
1139  // prepared to not find a selection:
1140  QTreeWidgetItem * item = mHeaderList->currentItem();
1141  if ( item )
1142  item->setText( 1, text );
1143  slotEmitChanged();
1144 }
1145 
1146 
1147 void ComposerPage::HeadersTab::slotNewMimeHeader()
1148 {
1149  QTreeWidgetItem *listItem = new QTreeWidgetItem( mHeaderList );
1150  mHeaderList->setCurrentItem( listItem );
1151  slotEmitChanged();
1152 }
1153 
1154 
1155 void ComposerPage::HeadersTab::slotRemoveMimeHeader()
1156 {
1157  // calling this w/o selection is a programming error:
1158  QTreeWidgetItem *item = mHeaderList->currentItem();
1159  if ( !item ) {
1160  kDebug() << "=================================================="
1161  << "Error: Remove button was pressed although no custom header was selected\n"
1162  << "==================================================\n";
1163  return;
1164  }
1165 
1166  QTreeWidgetItem *below = mHeaderList->itemBelow( item );
1167 
1168  if ( below ) {
1169  kDebug() << "below";
1170  mHeaderList->setCurrentItem( below );
1171  delete item;
1172  item = 0;
1173  } else if ( mHeaderList->topLevelItemCount() > 0 ) {
1174  delete item;
1175  item = 0;
1176  mHeaderList->setCurrentItem(
1177  mHeaderList->topLevelItem( mHeaderList->topLevelItemCount() - 1 )
1178  );
1179  }
1180 
1181  slotEmitChanged();
1182 }
1183 
1184 void ComposerPage::HeadersTab::doLoadOther()
1185 {
1186  mMessageIdSuffixEdit->setText( MessageComposer::MessageComposerSettings::customMsgIDSuffix() );
1187  const bool state = ( !MessageComposer::MessageComposerSettings::customMsgIDSuffix().isEmpty() &&
1188  MessageComposer::MessageComposerSettings::useCustomMessageIdSuffix() );
1189  mCreateOwnMessageIdCheck->setChecked( state );
1190 
1191  mHeaderList->clear();
1192  mTagNameEdit->clear();
1193  mTagValueEdit->clear();
1194 
1195  QTreeWidgetItem * item = 0;
1196 
1197  const int count = GlobalSettings::self()->customMessageHeadersCount();
1198  for ( int i = 0 ; i < count ; ++i ) {
1199  KConfigGroup config( KMKernel::self()->config(),
1200  QLatin1String("Mime #") + QString::number(i) );
1201  const QString name = config.readEntry( "name" );
1202  const QString value = config.readEntry( "value" );
1203  if( !name.isEmpty() ) {
1204  item = new QTreeWidgetItem( mHeaderList, item );
1205  item->setText( 0, name );
1206  item->setText( 1, value );
1207  }
1208  }
1209  if ( mHeaderList->topLevelItemCount() > 0 ) {
1210  mHeaderList->setCurrentItem( mHeaderList->topLevelItem( 0 ) );
1211  }
1212  else {
1213  // disable the "Remove" button
1214  mRemoveHeaderButton->setEnabled( false );
1215  }
1216 }
1217 
1218 void ComposerPage::HeadersTab::save()
1219 {
1220  MessageComposer::MessageComposerSettings::self()->setCustomMsgIDSuffix( mMessageIdSuffixEdit->text() );
1221  MessageComposer::MessageComposerSettings::self()->setUseCustomMessageIdSuffix( mCreateOwnMessageIdCheck->isChecked() );
1222 
1223  //Clean config
1224  const int oldHeadersCount = GlobalSettings::self()->customMessageHeadersCount();
1225  for ( int i = 0; i < oldHeadersCount; ++i ) {
1226  const QString groupMimeName = QString::fromLatin1( "Mime #%1" ).arg( i );
1227  if ( KMKernel::self()->config()->hasGroup( groupMimeName ) ) {
1228  KConfigGroup config( KMKernel::self()->config(), groupMimeName);
1229  config.deleteGroup();
1230  }
1231  }
1232 
1233 
1234  int numValidEntries = 0;
1235  QTreeWidgetItem *item = 0;
1236  const int numberOfEntry = mHeaderList->topLevelItemCount();
1237  for ( int i = 0; i < numberOfEntry; ++i ) {
1238  item = mHeaderList->topLevelItem( i );
1239  if( !item->text(0).isEmpty() ) {
1240  KConfigGroup config( KMKernel::self()->config(), QString::fromLatin1("Mime #%1").arg( numValidEntries ) );
1241  config.writeEntry( "name", item->text( 0 ) );
1242  config.writeEntry( "value", item->text( 1 ) );
1243  numValidEntries++;
1244  }
1245  }
1246  GlobalSettings::self()->setCustomMessageHeadersCount( numValidEntries );
1247 }
1248 
1249 void ComposerPage::HeadersTab::doResetToDefaultsOther()
1250 {
1251  const bool bUseDefaults = MessageComposer::MessageComposerSettings::self()->useDefaults( true );
1252  const QString messageIdSuffix = MessageComposer::MessageComposerSettings::customMsgIDSuffix();
1253  const bool useCustomMessageIdSuffix = MessageComposer::MessageComposerSettings::useCustomMessageIdSuffix();
1254  MessageComposer::MessageComposerSettings::self()->useDefaults( bUseDefaults );
1255 
1256  mMessageIdSuffixEdit->setText( messageIdSuffix );
1257  const bool state = ( !messageIdSuffix.isEmpty() && useCustomMessageIdSuffix );
1258  mCreateOwnMessageIdCheck->setChecked( state );
1259 
1260  mHeaderList->clear();
1261  mTagNameEdit->clear();
1262  mTagValueEdit->clear();
1263  // disable the "Remove" button
1264  mRemoveHeaderButton->setEnabled( false );
1265 }
1266 
1267 QString ComposerPage::AttachmentsTab::helpAnchor() const
1268 {
1269  return QString::fromLatin1("configure-composer-attachments");
1270 }
1271 
1272 ComposerPageAttachmentsTab::ComposerPageAttachmentsTab( QWidget * parent )
1273  : ConfigModuleTab( parent )
1274 {
1275  QVBoxLayout *vlay = new QVBoxLayout( this );
1276  vlay->setSpacing( KDialog::spacingHint() );
1277  vlay->setMargin( KDialog::marginHint() );
1278 
1279  // "Outlook compatible attachment naming" check box
1280  mOutlookCompatibleCheck =
1281  new QCheckBox( i18n( "Outlook-compatible attachment naming" ), this );
1282  mOutlookCompatibleCheck->setChecked( false );
1283  mOutlookCompatibleCheck->setToolTip( i18n(
1284  "Turn this option on to make Outlook(tm) understand attachment names "
1285  "containing non-English characters" ) );
1286  connect( mOutlookCompatibleCheck, SIGNAL(stateChanged(int)),
1287  this, SLOT(slotEmitChanged()) );
1288  connect( mOutlookCompatibleCheck, SIGNAL(clicked()),
1289  this, SLOT(slotOutlookCompatibleClicked()) );
1290  vlay->addWidget( mOutlookCompatibleCheck );
1291  vlay->addSpacing( 5 );
1292 
1293  // "Enable detection of missing attachments" check box
1294  mMissingAttachmentDetectionCheck =
1295  new QCheckBox( i18n("E&nable detection of missing attachments"), this );
1296  mMissingAttachmentDetectionCheck->setChecked( true );
1297  connect( mMissingAttachmentDetectionCheck, SIGNAL(stateChanged(int)),
1298  this, SLOT(slotEmitChanged()) );
1299  vlay->addWidget( mMissingAttachmentDetectionCheck );
1300 
1301 
1302 
1303 
1304  // "Attachment key words" label and string list editor
1305  QLabel *label = new QLabel( i18n("Recognize any of the following key words as "
1306  "intention to attach a file:"), this );
1307  label->setAlignment( Qt::AlignLeft );
1308  label->setWordWrap( true );
1309 
1310  vlay->addWidget( label );
1311 
1312  PimCommon::SimpleStringListEditor::ButtonCode buttonCode =
1313  static_cast<PimCommon::SimpleStringListEditor::ButtonCode>( PimCommon::SimpleStringListEditor::Add | PimCommon::SimpleStringListEditor::Remove | PimCommon::SimpleStringListEditor::Modify );
1314  mAttachWordsListEditor =
1315  new PimCommon::SimpleStringListEditor( this, buttonCode,
1316  i18n("A&dd..."), i18n("Re&move"),
1317  i18n("Mod&ify..."),
1318  i18n("Enter new key word:") );
1319  connect( mAttachWordsListEditor, SIGNAL(changed()),
1320  this, SLOT(slotEmitChanged()) );
1321  vlay->addWidget( mAttachWordsListEditor );
1322 
1323  connect( mMissingAttachmentDetectionCheck, SIGNAL(toggled(bool)),
1324  label, SLOT(setEnabled(bool)) );
1325  connect( mMissingAttachmentDetectionCheck, SIGNAL(toggled(bool)),
1326  mAttachWordsListEditor, SLOT(setEnabled(bool)) );
1327 
1328 
1329  QHBoxLayout * layAttachment = new QHBoxLayout;
1330  label = new QLabel( i18n("Offer to share for files larger than:"), this );
1331  label->setAlignment( Qt::AlignLeft );
1332  layAttachment->addWidget(label);
1333 
1334  mMaximumAttachmentSize = new KIntNumInput( this );
1335  mMaximumAttachmentSize->setRange( -1, 99999 );
1336  mMaximumAttachmentSize->setSingleStep( 100 );
1337  mMaximumAttachmentSize->setSuffix(i18nc("spinbox suffix: unit for kilobyte", " kB"));
1338  connect( mMaximumAttachmentSize, SIGNAL(valueChanged(int)),
1339  this, SLOT(slotEmitChanged()) );
1340  mMaximumAttachmentSize->setSpecialValueText(i18n("No limit"));
1341  layAttachment->addWidget(mMaximumAttachmentSize);
1342  vlay->addLayout(layAttachment);
1343 
1344  mStorageServiceWidget = new ConfigureStorageServiceWidget;
1345  vlay->addWidget(mStorageServiceWidget);
1346  connect(mStorageServiceWidget, SIGNAL(changed()), this, SLOT(slotEmitChanged()));
1347 }
1348 
1349 void ComposerPage::AttachmentsTab::doLoadFromGlobalSettings()
1350 {
1351  loadWidget(mOutlookCompatibleCheck, MessageComposer::MessageComposerSettings::self()->outlookCompatibleAttachmentsItem());
1352  loadWidget(mMissingAttachmentDetectionCheck, GlobalSettings::self()->showForgottenAttachmentWarningItem());
1353  loadWidget(mAttachWordsListEditor, GlobalSettings::self()->attachmentKeywordsItem() );
1354  const int maximumAttachmentSize(MessageCore::GlobalSettings::self()->maximumAttachmentSize());
1355  mMaximumAttachmentSize->setValue(maximumAttachmentSize == -1 ? -1 : MessageCore::GlobalSettings::self()->maximumAttachmentSize()/1024);
1356  mStorageServiceWidget->doLoadFromGlobalSettings();
1357 }
1358 
1359 void ComposerPage::AttachmentsTab::save()
1360 {
1361  saveCheckBox(mOutlookCompatibleCheck, MessageComposer::MessageComposerSettings::self()->outlookCompatibleAttachmentsItem());
1362  saveCheckBox(mMissingAttachmentDetectionCheck, GlobalSettings::self()->showForgottenAttachmentWarningItem());
1363  saveSimpleStringListEditor(mAttachWordsListEditor, GlobalSettings::self()->attachmentKeywordsItem() );
1364 
1365  KMime::setUseOutlookAttachmentEncoding( mOutlookCompatibleCheck->isChecked() );
1366  const int maximumAttachmentSize(mMaximumAttachmentSize->value());
1367  MessageCore::GlobalSettings::self()->setMaximumAttachmentSize(maximumAttachmentSize == -1 ? -1 : maximumAttachmentSize*1024);
1368  mStorageServiceWidget->save();
1369 }
1370 
1371 void ComposerPageAttachmentsTab::slotOutlookCompatibleClicked()
1372 {
1373  if (mOutlookCompatibleCheck->isChecked()) {
1374  KMessageBox::information(0,i18n("You have chosen to "
1375  "encode attachment names containing non-English characters in a way that "
1376  "is understood by Outlook(tm) and other mail clients that do not "
1377  "support standard-compliant encoded attachment names.\n"
1378  "Note that KMail may create non-standard compliant messages, "
1379  "and consequently it is possible that your messages will not be "
1380  "understood by standard-compliant mail clients; so, unless you have no "
1381  "other choice, you should not enable this option." ) );
1382  }
1383 }
1384 
1385 ComposerPageAutoCorrectionTab::ComposerPageAutoCorrectionTab(QWidget *parent)
1386  : ConfigModuleTab(parent)
1387 {
1388  QVBoxLayout *vlay = new QVBoxLayout( this );
1389  vlay->setSpacing( 0 );
1390  vlay->setMargin( 0 );
1391  autocorrectionWidget = new PimCommon::AutoCorrectionWidget(this);
1392  if(KMKernel::self())
1393  autocorrectionWidget->setAutoCorrection(KMKernel::self()->composerAutoCorrection());
1394  vlay->addWidget(autocorrectionWidget);
1395  setLayout(vlay);
1396  connect( autocorrectionWidget, SIGNAL(changed()), this, SLOT(slotEmitChanged()) );
1397 }
1398 
1399 QString ComposerPageAutoCorrectionTab::helpAnchor() const
1400 {
1401  return QString::fromLatin1("configure-autocorrection");
1402 }
1403 
1404 void ComposerPageAutoCorrectionTab::save()
1405 {
1406  autocorrectionWidget->writeConfig();
1407 }
1408 
1409 void ComposerPageAutoCorrectionTab::doLoadFromGlobalSettings()
1410 {
1411  autocorrectionWidget->loadConfig();
1412 }
1413 
1414 void ComposerPageAutoCorrectionTab::doResetToDefaultsOther()
1415 {
1416  autocorrectionWidget->resetToDefault();
1417 }
1418 
1419 
1420 ComposerPageAutoImageResizeTab::ComposerPageAutoImageResizeTab(QWidget *parent)
1421  : ConfigModuleTab(parent)
1422 {
1423  QVBoxLayout *vlay = new QVBoxLayout( this );
1424  vlay->setSpacing( 0 );
1425  vlay->setMargin( 0 );
1426  autoResizeWidget = new MessageComposer::ImageScalingWidget(this);
1427  vlay->addWidget(autoResizeWidget);
1428  setLayout(vlay);
1429  connect( autoResizeWidget, SIGNAL(changed()), this, SLOT(slotEmitChanged()) );
1430 
1431 }
1432 
1433 QString ComposerPageAutoImageResizeTab::helpAnchor() const
1434 {
1435  return QString::fromLatin1("configure-image-resize");
1436 }
1437 
1438 void ComposerPageAutoImageResizeTab::save()
1439 {
1440  autoResizeWidget->writeConfig();
1441 }
1442 
1443 void ComposerPageAutoImageResizeTab::doLoadFromGlobalSettings()
1444 {
1445  autoResizeWidget->loadConfig();
1446 }
1447 
1448 void ComposerPageAutoImageResizeTab::doResetToDefaultsOther()
1449 {
1450  autoResizeWidget->resetToDefault();
1451 }
QWidget::layout
QLayout * layout() const
ComposerPage::CharsetTab
ComposerPageCharsetTab CharsetTab
Definition: configurecomposerpage.h:277
globalsettings.h
QWidget
KPIM::CompletionOrderEditor
ComposerPageTemplatesTab::ComposerPageTemplatesTab
ComposerPageTemplatesTab(QWidget *parent=0)
Definition: configurecomposerpage.cpp:731
ComposerPage::SubjectTab
ComposerPageSubjectTab SubjectTab
Definition: configurecomposerpage.h:276
QRegExpValidator
kmmainwidget.h
QTextCodec::name
virtual QByteArray name() const =0
ConfigModuleTab
Definition: configuredialog_p.h:19
ComposerPageGeneralTab::ComposerPageGeneralTab
ComposerPageGeneralTab(QWidget *parent=0)
Definition: configurecomposerpage.cpp:138
ldapclientsearch.h
QGridLayout::addWidget
void addWidget(QWidget *widget, int row, int column, QFlags< Qt::AlignmentFlag > alignment)
QByteArray
ComposerPageHeadersTab::helpAnchor
QString helpAnchor() const
Definition: configurecomposerpage.cpp:1009
text
virtual QByteArray text(quint32 serialNumber) const =0
ComposerPageAutoCorrectionTab::save
void save()
Definition: configurecomposerpage.cpp:1404
KLDAP::LdapClientSearch
configuredialoglistview.h
ComposerPage::helpAnchor
QString helpAnchor() const
Should return the help anchor for this page or tab.
Definition: configurecomposerpage.cpp:63
QLayout
ComposerPageSubjectTab::ComposerPageSubjectTab
ComposerPageSubjectTab(QWidget *parent=0)
Definition: configurecomposerpage.cpp:796
QPointer
ComposerPageCharsetTab::ComposerPageCharsetTab
ComposerPageCharsetTab(QWidget *parent=0)
Definition: configurecomposerpage.cpp:901
QHBoxLayout
ComposerPageGeneralTab::helpAnchor
QString helpAnchor() const
Definition: configurecomposerpage.cpp:133
QLabel::setAlignment
void setAlignment(QFlags< Qt::AlignmentFlag >)
ComposerPageAttachmentsTab::save
void save()
Definition: configurecomposerpage.cpp:1359
ComposerPageHeadersTab::ComposerPageHeadersTab
ComposerPageHeadersTab(QWidget *parent=0)
Definition: configurecomposerpage.cpp:1014
QTreeWidget::itemBelow
QTreeWidgetItem * itemBelow(const QTreeWidgetItem *item) const
QGridLayout
ComposerPageCharsetTab::save
void save()
Definition: configurecomposerpage.cpp:994
ComposerPageSubjectTab::helpAnchor
QString helpAnchor() const
Definition: configurecomposerpage.cpp:791
QBoxLayout::addSpacing
void addSpacing(int size)
ComposerPageAutoImageResizeTab::save
void save()
Definition: configurecomposerpage.cpp:1438
ComposerPage::ExternalEditorTab
ComposerPageExternalEditorTab ExternalEditorTab
Definition: configurecomposerpage.h:282
ComposerPageCustomTemplatesTab::helpAnchor
QString helpAnchor() const
Definition: configurecomposerpage.cpp:760
ComposerPage::AttachmentsTab
ComposerPageAttachmentsTab AttachmentsTab
Definition: configurecomposerpage.h:279
KMKernel::self
static KMKernel * self()
normal control stuff
Definition: kmkernel.cpp:1471
QTreeWidget::clear
void clear()
QString::clear
void clear()
QLabel::setBuddy
void setBuddy(QWidget *buddy)
QRegExp
QObject::name
const char * name() const
ComposerPage::AutoCorrectionTab
ComposerPageAutoCorrectionTab AutoCorrectionTab
Definition: configurecomposerpage.h:280
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)
ComposerPage::CustomTemplatesTab
ComposerPageCustomTemplatesTab CustomTemplatesTab
Definition: configurecomposerpage.h:275
QGridLayout::setRowStretch
void setRowStretch(int row, int stretch)
QWidget::setLayout
void setLayout(QLayout *layout)
QGroupBox
QCheckBox
QObject::setObjectName
void setObjectName(const QString &name)
ComposerPageAutoImageResizeTab::helpAnchor
QString helpAnchor() const
Definition: configurecomposerpage.cpp:1433
QString::isEmpty
bool isEmpty() const
ComposerPageGeneralTab::save
void save()
Definition: configurecomposerpage.cpp:598
ConfigModuleTab::slotEmitChanged
void slotEmitChanged()
QVBoxLayout
QList::Iterator
typedef Iterator
ConfigModuleWithTabs::addTab
void addTab(ConfigModuleTab *tab, const QString &title)
ComposerPageTemplatesTab::save
void save()
Definition: configurecomposerpage.cpp:750
ComposerPage::AutoImageResizeTab
ComposerPageAutoImageResizeTab AutoImageResizeTab
Definition: configurecomposerpage.h:281
QTreeWidget::currentItem
QTreeWidgetItem * currentItem() const
QString
QList< KActionCollection * >
QTextCodec
QLayout::setMargin
void setMargin(int margin)
QLayout::addWidget
void addWidget(QWidget *w)
kmkernel
#define kmkernel
Definition: kmkernel.h:24
QStringList
completionordereditor.h
ComposerPageSubjectTab::save
void save()
Definition: configurecomposerpage.cpp:877
ComposerPageAutoImageResizeTab::ComposerPageAutoImageResizeTab
ComposerPageAutoImageResizeTab(QWidget *parent=0)
Definition: configurecomposerpage.cpp:1420
KPIM::BlackListBalooEmailCompletionDialog
QList::end
iterator end()
QString::toLower
QString toLower() const
ComposerPageAttachmentsTab::helpAnchor
QString helpAnchor() const
Definition: configurecomposerpage.cpp:1267
KPIM::RecentAddressDialog
ConfigureStorageServiceWidget::doLoadFromGlobalSettings
void doLoadFromGlobalSettings()
Definition: configurestorageservicewidget.cpp:82
ConfigModuleTab::changed
void changed(bool)
ListView
Definition: configuredialoglistview.h:9
ComposerPageExternalEditorTab::ComposerPageExternalEditorTab
ComposerPageExternalEditorTab(QWidget *parent=0)
Definition: configurecomposerpage.cpp:665
GlobalSettings::requestSync
void requestSync()
Call this slot instead of directly KConfig::sync() to minimize the overall config writes...
Definition: globalsettings.cpp:47
ComposerPageTemplatesTab::helpAnchor
QString helpAnchor() const
Definition: configurecomposerpage.cpp:726
QTreeWidget::setCurrentItem
void setCurrentItem(QTreeWidgetItem *item)
QAbstractButton::setChecked
void setChecked(bool)
QTreeWidget::setHeaderLabels
void setHeaderLabels(const QStringList &labels)
GlobalSettings::self
static GlobalSettings * self()
Definition: globalsettings.cpp:30
ComposerPage::GeneralTab
ComposerPageGeneralTab GeneralTab
Definition: configurecomposerpage.h:273
QTreeView::setSortingEnabled
void setSortingEnabled(bool enable)
kmkernel.h
KLineEdit
QWidget::setWhatsThis
void setWhatsThis(const QString &)
ConfigModuleTab::mEmitChanges
bool mEmitChanges
Definition: configuredialog_p.h:36
ConfigureStorageServiceWidget::save
void save()
Definition: configurestorageservicewidget.cpp:76
QTreeWidgetItem
ComposerPageHeadersTab::save
void save()
Definition: configurecomposerpage.cpp:1218
QLatin1String
QBoxLayout::addStretch
void addStretch(int stretch)
QGridLayout::setColumnStretch
void setColumnStretch(int column, int stretch)
ComposerPageAutoCorrectionTab::helpAnchor
QString helpAnchor() const
Definition: configurecomposerpage.cpp:1399
ComposerPageCustomTemplatesTab::save
void save()
Definition: configurecomposerpage.cpp:786
QTextCodec::codecForName
QTextCodec * codecForName(const QByteArray &name)
QTreeWidgetItem::setText
void setText(int column, const QString &text)
KComboBox
ComposerPage::ComposerPage
ComposerPage(const KComponentData &instance, QWidget *parent=0)
Definition: configurecomposerpage.cpp:68
QByteArray::data
char * data()
configurestorageservicewidget.h
configurecomposerpage.h
ComposerPage::HeadersTab
ComposerPageHeadersTab HeadersTab
Definition: configurecomposerpage.h:278
recentaddressdialog.h
QString::fromLatin1
QString fromLatin1(const char *str, int size)
QLayout::setSpacing
void setSpacing(int)
ComposerPageAttachmentsTab::ComposerPageAttachmentsTab
ComposerPageAttachmentsTab(QWidget *parent=0)
Definition: configurecomposerpage.cpp:1272
QPushButton
ConfigureStorageServiceWidget
Definition: configurestorageservicewidget.h:26
KHBox
ComposerPageExternalEditorTab::helpAnchor
QString helpAnchor() const
Definition: configurecomposerpage.cpp:660
ConfigModuleWithTabs
Definition: configuredialog_p.h:54
QTreeWidget::topLevelItem
QTreeWidgetItem * topLevelItem(int index) const
QWidget::setToolTip
void setToolTip(const QString &)
ComposerPageAutoCorrectionTab::ComposerPageAutoCorrectionTab
ComposerPageAutoCorrectionTab(QWidget *parent=0)
Definition: configurecomposerpage.cpp:1385
QGridLayout::setRowMinimumHeight
void setRowMinimumHeight(int row, int minSize)
ComposerPageExternalEditorTab::save
void save()
Definition: configurecomposerpage.cpp:720
QTreeWidget::topLevelItemCount
topLevelItemCount
ComposerPageCustomTemplatesTab::ComposerPageCustomTemplatesTab
ComposerPageCustomTemplatesTab(QWidget *parent=0)
Definition: configurecomposerpage.cpp:765
QObject::connect
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QLabel
KPIM::RecentAddresses
QString::arg
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
ComposerPageCharsetTab::helpAnchor
QString helpAnchor() const
Definition: configurecomposerpage.cpp:896
blacklistbalooemailcompletiondialog.h
ComposerPage::TemplatesTab
ComposerPageTemplatesTab TemplatesTab
Definition: configurecomposerpage.h:274
QTreeWidgetItem::text
QString text(int column) const
QList::begin
iterator begin()
QLabel::setWordWrap
void setWordWrap(bool on)
QBoxLayout::setSpacing
void setSpacing(int spacing)
QBoxLayout::addLayout
void addLayout(QLayout *layout, int stretch)
QPushButton::setAutoDefault
void setAutoDefault(bool)
recentaddresses.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:34:32 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