55
59
#include <kpimidentities/identity.h>
56
60
#include <kpimidentities/signatureconfigurator.h>
62
#include "messagecomposer/autocorrection/composerautocorrectionlanguage.h"
58
64
#include <libkdepim/addresseelineedit.h>
60
66
#include "libkleo/ui/keyrequester.h"
359
367
glay->setSpacing( spacingHint() );
360
368
glay->setMargin( marginHint() );
361
369
// the last (empty) row takes all the remaining space
362
glay->setRowStretch( 9-1, 1 );
363
370
glay->setColumnStretch( 1, 1 );
365
372
// "Reply-To Address" line edit and label:
470
477
connect( mTransportCheck, SIGNAL(toggled(bool)),
471
478
mTransportCombo, SLOT(setEnabled(bool)) );
481
mAttachMyVCard = new QCheckBox(i18n("Attach my vcard to message"), tab);
482
glay->addWidget( mAttachMyVCard, row, 0 );
483
mEditVCard = new KPushButton(i18n("Create..."),tab);
484
connect(mEditVCard,SIGNAL(clicked()),SLOT(slotEditVcard()));
485
glay->addWidget( mEditVCard, row, 1 );
489
mAutoCorrectionLanguage = new MessageComposer::ComposerAutoCorrectionLanguage(tab);
490
glay->addWidget( mAutoCorrectionLanguage, row, 1 );
491
label = new QLabel( i18n("Autocorrection Language:"), tab );
492
label->setBuddy( mAutoCorrectionLanguage );
493
glay->addWidget( label, row, 0 );
496
glay->setRowStretch( row, 1 );
473
498
// the last row is a spacer
794
819
mTemplatesCombo->setCollection( Akonadi::Collection( ident.templates().toLongLong() ) );
821
mVcardFilename = ident.vCardFile();
823
mAutoCorrectionLanguage->setLanguage(ident.autocorrectionLanguage());
825
if(mVcardFilename.isEmpty()) {
826
mVcardFilename = KStandardDirs::locateLocal("appdata",ident.identityName() + QLatin1String(".vcf"));
828
mAttachMyVCard->setChecked(ident.attachVcard());
796
829
// "Templates" tab:
797
830
#ifndef KDEPIM_MOBILE_UI
798
831
uint identity = ident.uoid();
863
896
ident.setTemplates( QString() );
897
ident.setVCardFile(mVcardFilename);
898
ident.setAutocorrectionLanguage(mAutoCorrectionLanguage->language());
900
ident.setAttachVcard(mAttachMyVCard->isChecked());
864
902
// "Templates" tab:
865
903
#ifndef KDEPIM_MOBILE_UI
866
904
uint identity = ident.uoid();
878
916
ident.setXFace( mXFaceConfigurator->xface() );
879
917
ident.setXFaceEnabled( mXFaceConfigurator->isXFaceEnabled() );
921
void IdentityDialog::slotEditVcard()
923
if(QFile(mVcardFilename).exists()) {
924
editVcard(mVcardFilename);
926
if ( !MailCommon::Kernel::self()->kernelIsRegistered() ) {
929
KPIMIdentities::IdentityManager *manager = KernelIf->identityManager();
931
IdentityAddVcardDialog dlg(manager, this);
933
IdentityAddVcardDialog::DuplicateMode mode = dlg.duplicateMode();
935
case IdentityAddVcardDialog::Empty: {
936
editVcard(mVcardFilename);
939
case IdentityAddVcardDialog::ExistingEntry: {
940
KPIMIdentities::Identity ident = manager->modifyIdentityForName( dlg.duplicateVcardFromIdentity() );
941
const QString filename = ident.vCardFile();
942
if(!filename.isEmpty()) {
943
QFile::copy(filename,mVcardFilename);
945
editVcard(mVcardFilename);
953
void IdentityDialog::editVcard(const QString& filename)
955
IdentityEditVcardDialog dlg(this);
956
dlg.loadVcard(filename);
958
mVcardFilename = dlg.saveVcard();
963
void IdentityDialog::updateVcardButton()
965
if(!QFile(mVcardFilename).exists()) {
966
mEditVCard->setText(i18n("Create..."));
968
mEditVCard->setText(i18n("Edit..."));
884
974
#include "identitydialog.moc"