-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 @@ -149,7 +149,9 @@ ComposeMail::ComposeMail( Settings *sett, QWidget *parent, const char *name, boo return; } connect( smtpAccountBox, SIGNAL( activated(int) ), SLOT( fillValues(int) ) ); - + connect( SaveSigButton, SIGNAL( clicked() ), SLOT( saveSig()) ); + if ( smtpAccountBox->count()) + fillValues(0); } @@ -165,8 +167,15 @@ void ComposeMail::fillSettings() } 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() { @@ -338,7 +347,7 @@ void ComposeMail::pickAddressReply() pickAddress( ); } -void ComposeMail::fillValues( int ) +void ComposeMail::fillValues( int current ) { #if 0 SMTPaccount *smtp = smtpAccounts.at( current ); @@ -354,8 +363,10 @@ void ComposeMail::fillValues( int ) 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() |