summaryrefslogtreecommitdiffabout
path: root/kmicromail/composemail.cpp
Side-by-side diff
Diffstat (limited to 'kmicromail/composemail.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kmicromail/composemail.cpp21
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
@@ -140,42 +140,51 @@ ComposeMail::ComposeMail( Settings *sett, QWidget *parent, const char *name, boo
#endif
message->setFont ( KOPrefs::instance()->mComposeFont );
message->setWordWrap (QMultiLineEdit::WidgetWidth);
if ( smtpAccounts.count() > 0 ) {
fillValues( smtpAccountBox->currentItem() );
} else {
QMessageBox::information( 0, i18n( "Problem" ),
i18n( "Please create an\nSMTP account first.\nThe SMTP is needed\nfor sending mail.\n" ),
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()
{
if ( QApplication::desktop()->width() < 320 )
fromBox->setMaximumWidth( 100 );
QStringList mailList = QStringList::split(";",KOPrefs::instance()->mEmail);
QStringList::ConstIterator sit = mailList.begin();
int pref = 0;
for (;sit!=mailList.end();++sit) {
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();
mail->setMail(fromBox->currentText());
mail->setTo( toLine->text() );
mail->setName(senderNameEdit->text());
mail->setCC( ccLine->text() );
mail->setBCC( bccLine->text() );
mail->setReply( replyLine->text() );
mail->setSubject( subjectLine->text() );
if (!m_replyid.isEmpty()) {
@@ -329,42 +338,44 @@ void ComposeMail::pickAddressCC()
void ComposeMail::pickAddressBCC()
{
mPickLineEdit = bccLine;
pickAddress( );
}
void ComposeMail::pickAddressReply()
{
mPickLineEdit = replyLine;
pickAddress( );
}
-void ComposeMail::fillValues( int )
+void ComposeMail::fillValues( int current )
{
#if 0
SMTPaccount *smtp = smtpAccounts.at( current );
ccLine->clear();
if ( smtp->getUseCC() ) {
ccLine->setText( smtp->getCC() );
}
bccLine->clear();
if ( smtp->getUseBCC() ) {
bccLine->setText( smtp->getBCC() );
}
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()
{
int currPage = tabWidget->currentPageIndex();
tabWidget->showPage( attachTab );
attList->setColumnWidth( 0, attList->visibleWidth() - 80 );
attList->setColumnWidth( 1, 80 );
tabWidget->setCurrentPage( currPage );
}