From 72ab68a3dd5c47a4797225d216ac04b97a59b654 Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Sat, 16 Dec 2006 01:24:43 +0000 Subject: [PATCH] merge SVN commit 602738 by marten: GUI for an identity-specific templates folder FEATURE: GUI: svn path=/branches/KDE/3.5/kdepim/; revision=614031 --- identitydialog.cpp | 26 ++++++++++++++++++++++++-- identitydialog.h | 1 + 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/identitydialog.cpp b/identitydialog.cpp index dafcd3d80..43e7b30e6 100644 --- a/identitydialog.cpp +++ b/identitydialog.cpp @@ -288,9 +288,9 @@ namespace KMail { row = -1; tab = new QWidget( tabWidget ); tabWidget->addTab( tab, i18n("&Advanced") ); - glay = new QGridLayout( tab, 7, 2, marginHint(), spacingHint() ); + glay = new QGridLayout( tab, 8, 2, marginHint(), spacingHint() ); // the last (empty) row takes all the remaining space - glay->setRowStretch( 7-1, 1 ); + glay->setRowStretch( 8-1, 1 ); glay->setColStretch( 1, 1 ); // "Reply-To Address" line edit and label: @@ -355,6 +355,15 @@ namespace KMail { glay->addWidget( new QLabel( mDraftsCombo, i18n("&Drafts folder:"), tab ), row, 0 ); + // "Templates Folder" combo box and label: + ++row; + mTemplatesCombo = new FolderRequester( tab, + kmkernel->getKMMainWidget()->folderTree() ); + mTemplatesCombo->setShowOutbox( false ); + glay->addWidget( mTemplatesCombo, row, 1 ); + glay->addWidget( new QLabel( mTemplatesCombo, i18n("&Templates folder:"), tab ), + row, 0 ); + // "Special transport" combobox and label: ++row; mTransportCheck = new QCheckBox( i18n("Special &transport:"), tab ); @@ -614,6 +623,17 @@ void IdentityDialog::slotOk() { else mDraftsCombo->setFolder( ident.drafts() ); + if ( ident.templates().isEmpty() || + !checkFolderExists( ident.templates(), + i18n("The custom templates folder for identity " + "\"%1\" does not exist (anymore); " + "therefore, the default templates folder " + "will be used.") + .arg( ident.identityName() ) ) ) + mTemplatesCombo->setFolder( kmkernel->templatesFolder() ); + else + mTemplatesCombo->setFolder( ident.templates() ); + // "Templates" tab: uint identity = ident.uoid(); QString iid = QString("IDENTITY_%1").arg( identity ); @@ -649,6 +669,8 @@ void IdentityDialog::slotOk() { mFccCombo->folder()->idString() : QString::null ); ident.setDrafts( mDraftsCombo->folder() ? mDraftsCombo->folder()->idString() : QString::null ); + ident.setTemplates( mTemplatesCombo->folder() ? + mTemplatesCombo->folder()->idString() : QString::null ); // "Templates" tab: uint identity = ident.uoid(); QString iid = QString("IDENTITY_%1").arg( identity ); diff --git a/identitydialog.h b/identitydialog.h index 89589e64a..b43f3ebe0 100644 --- a/identitydialog.h +++ b/identitydialog.h @@ -100,6 +100,7 @@ namespace KMail { KMail::DictionaryComboBox *mDictionaryCombo; FolderRequester *mFccCombo; FolderRequester *mDraftsCombo; + FolderRequester *mTemplatesCombo; QCheckBox *mTransportCheck; QComboBox *mTransportCombo; // should be a KMTransportCombo... // "templates" tab: