-rw-r--r-- | kmicromail/composemail.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/kmicromail/composemail.cpp b/kmicromail/composemail.cpp index 976e309..ed8a2ee 100644 --- a/kmicromail/composemail.cpp +++ b/kmicromail/composemail.cpp @@ -148,9 +148,11 @@ ComposeMail::ComposeMail( Settings *sett, QWidget *parent, const char *name, boo i18n( "Ok" ) ); return; } connect( smtpAccountBox, SIGNAL( activated(int) ), SLOT( fillValues(int) ) ); - + connect( SaveSigButton, SIGNAL( clicked() ), SLOT( saveSig()) ); + if ( smtpAccountBox->count()) + fillValues(0); } void ComposeMail::fillSettings() @@ -164,10 +166,17 @@ void ComposeMail::fillSettings() fromBox->insertItem((*sit)); } senderNameEdit->setText(KOPrefs::instance()->mName); } - - +void ComposeMail::saveSig() +{ + if ( smtpAccountBox->count()) { + int cur = smtpAccountBox->currentItem (); + SMTPaccount *smtp = smtpAccounts.at( cur ); + if ( smtp ) + smtp->setSignature( sigMultiLine->text()); + } +} void ComposeMail::saveAsDraft() { Opie::Core::OSmartPointer<Mail> mail= new Mail(); @@ -337,9 +346,9 @@ void ComposeMail::pickAddressReply() mPickLineEdit = replyLine; pickAddress( ); } -void ComposeMail::fillValues( int ) +void ComposeMail::fillValues( int current ) { #if 0 SMTPaccount *smtp = smtpAccounts.at( current ); ccLine->clear(); @@ -353,10 +362,12 @@ void ComposeMail::fillValues( int ) replyLine->clear(); if ( smtp->getUseReply() ) { replyLine->setText( smtp->getReply() ); } - sigMultiLine->setText( smtp->getSignature() ); #endif + SMTPaccount *smtp = smtpAccounts.at( current ); + if ( smtp ) + sigMultiLine->setText( smtp->getSignature() ); } void ComposeMail::slotAdjustColumns() { |