author | zautrix <zautrix> | 2005-02-03 10:48:05 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-03 10:48:05 (UTC) |
commit | fb6753570dc90e936b4e89092554ab012e946a56 (patch) (unidiff) | |
tree | 6d3ae5c866f0bbb99f0b6bc8194d04d2c7681ff9 /kmicromail/composemail.cpp | |
parent | e0fce8c0f108e054cb6e4e4767affd04b398da45 (diff) | |
download | kdepimpi-fb6753570dc90e936b4e89092554ab012e946a56.zip kdepimpi-fb6753570dc90e936b4e89092554ab012e946a56.tar.gz kdepimpi-fb6753570dc90e936b4e89092554ab012e946a56.tar.bz2 |
mail fixes
-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 | |||
@@ -136,50 +136,59 @@ ComposeMail::ComposeMail( Settings *sett, QWidget *parent, const char *name, boo | |||
136 | #ifndef DESKTOP_VERSION | 136 | #ifndef DESKTOP_VERSION |
137 | QPEApplication::setStylusOperation( message, QPEApplication::RightOnHold ); | 137 | QPEApplication::setStylusOperation( message, QPEApplication::RightOnHold ); |
138 | QPEApplication::setStylusOperation( senderNameEdit, QPEApplication::RightOnHold ); | 138 | QPEApplication::setStylusOperation( senderNameEdit, QPEApplication::RightOnHold ); |
139 | QPEApplication::setStylusOperation( subjectLine, QPEApplication::RightOnHold ); | 139 | QPEApplication::setStylusOperation( subjectLine, QPEApplication::RightOnHold ); |
140 | #endif | 140 | #endif |
141 | message->setFont ( KOPrefs::instance()->mComposeFont ); | 141 | message->setFont ( KOPrefs::instance()->mComposeFont ); |
142 | message->setWordWrap (QMultiLineEdit::WidgetWidth); | 142 | message->setWordWrap (QMultiLineEdit::WidgetWidth); |
143 | if ( smtpAccounts.count() > 0 ) { | 143 | if ( smtpAccounts.count() > 0 ) { |
144 | fillValues( smtpAccountBox->currentItem() ); | 144 | fillValues( smtpAccountBox->currentItem() ); |
145 | } else { | 145 | } else { |
146 | QMessageBox::information( 0, i18n( "Problem" ), | 146 | QMessageBox::information( 0, i18n( "Problem" ), |
147 | i18n( "Please create an\nSMTP account first.\nThe SMTP is needed\nfor sending mail.\n" ), | 147 | i18n( "Please create an\nSMTP account first.\nThe SMTP is needed\nfor sending mail.\n" ), |
148 | i18n( "Ok" ) ); | 148 | i18n( "Ok" ) ); |
149 | return; | 149 | return; |
150 | } | 150 | } |
151 | connect( smtpAccountBox, SIGNAL( activated(int) ), SLOT( fillValues(int) ) ); | 151 | connect( smtpAccountBox, SIGNAL( activated(int) ), SLOT( fillValues(int) ) ); |
152 | 152 | connect( SaveSigButton, SIGNAL( clicked() ), SLOT( saveSig()) ); | |
153 | if ( smtpAccountBox->count()) | ||
154 | fillValues(0); | ||
153 | 155 | ||
154 | } | 156 | } |
155 | 157 | ||
156 | void ComposeMail::fillSettings() | 158 | void ComposeMail::fillSettings() |
157 | { | 159 | { |
158 | if ( QApplication::desktop()->width() < 320 ) | 160 | if ( QApplication::desktop()->width() < 320 ) |
159 | fromBox->setMaximumWidth( 100 ); | 161 | fromBox->setMaximumWidth( 100 ); |
160 | QStringList mailList = QStringList::split(";",KOPrefs::instance()->mEmail); | 162 | QStringList mailList = QStringList::split(";",KOPrefs::instance()->mEmail); |
161 | QStringList::ConstIterator sit = mailList.begin(); | 163 | QStringList::ConstIterator sit = mailList.begin(); |
162 | int pref = 0; | 164 | int pref = 0; |
163 | for (;sit!=mailList.end();++sit) { | 165 | for (;sit!=mailList.end();++sit) { |
164 | fromBox->insertItem((*sit)); | 166 | fromBox->insertItem((*sit)); |
165 | } | 167 | } |
166 | senderNameEdit->setText(KOPrefs::instance()->mName); | 168 | senderNameEdit->setText(KOPrefs::instance()->mName); |
167 | } | 169 | } |
168 | 170 | void ComposeMail::saveSig() | |
169 | 171 | { | |
172 | if ( smtpAccountBox->count()) { | ||
173 | int cur = smtpAccountBox->currentItem (); | ||
174 | SMTPaccount *smtp = smtpAccounts.at( cur ); | ||
175 | if ( smtp ) | ||
176 | smtp->setSignature( sigMultiLine->text()); | ||
177 | } | ||
178 | } | ||
170 | void ComposeMail::saveAsDraft() | 179 | void ComposeMail::saveAsDraft() |
171 | { | 180 | { |
172 | 181 | ||
173 | Opie::Core::OSmartPointer<Mail> mail= new Mail(); | 182 | Opie::Core::OSmartPointer<Mail> mail= new Mail(); |
174 | mail->setMail(fromBox->currentText()); | 183 | mail->setMail(fromBox->currentText()); |
175 | mail->setTo( toLine->text() ); | 184 | mail->setTo( toLine->text() ); |
176 | mail->setName(senderNameEdit->text()); | 185 | mail->setName(senderNameEdit->text()); |
177 | mail->setCC( ccLine->text() ); | 186 | mail->setCC( ccLine->text() ); |
178 | mail->setBCC( bccLine->text() ); | 187 | mail->setBCC( bccLine->text() ); |
179 | mail->setReply( replyLine->text() ); | 188 | mail->setReply( replyLine->text() ); |
180 | mail->setSubject( subjectLine->text() ); | 189 | mail->setSubject( subjectLine->text() ); |
181 | if (!m_replyid.isEmpty()) { | 190 | if (!m_replyid.isEmpty()) { |
182 | QStringList ids; | 191 | QStringList ids; |
183 | ids.append(m_replyid); | 192 | ids.append(m_replyid); |
184 | mail->setInreply(ids); | 193 | mail->setInreply(ids); |
185 | } | 194 | } |
@@ -325,50 +334,52 @@ void ComposeMail::pickAddressCC() | |||
325 | mPickLineEdit = ccLine; | 334 | mPickLineEdit = ccLine; |
326 | pickAddress( ); | 335 | pickAddress( ); |
327 | } | 336 | } |
328 | 337 | ||
329 | void ComposeMail::pickAddressBCC() | 338 | void ComposeMail::pickAddressBCC() |
330 | { | 339 | { |
331 | mPickLineEdit = bccLine; | 340 | mPickLineEdit = bccLine; |
332 | pickAddress( ); | 341 | pickAddress( ); |
333 | } | 342 | } |
334 | 343 | ||
335 | void ComposeMail::pickAddressReply() | 344 | void ComposeMail::pickAddressReply() |
336 | { | 345 | { |
337 | mPickLineEdit = replyLine; | 346 | mPickLineEdit = replyLine; |
338 | pickAddress( ); | 347 | pickAddress( ); |
339 | } | 348 | } |
340 | 349 | ||
341 | void ComposeMail::fillValues( int ) | 350 | void ComposeMail::fillValues( int current ) |
342 | { | 351 | { |
343 | #if 0 | 352 | #if 0 |
344 | SMTPaccount *smtp = smtpAccounts.at( current ); | 353 | SMTPaccount *smtp = smtpAccounts.at( current ); |
345 | ccLine->clear(); | 354 | ccLine->clear(); |
346 | if ( smtp->getUseCC() ) { | 355 | if ( smtp->getUseCC() ) { |
347 | ccLine->setText( smtp->getCC() ); | 356 | ccLine->setText( smtp->getCC() ); |
348 | } | 357 | } |
349 | bccLine->clear(); | 358 | bccLine->clear(); |
350 | if ( smtp->getUseBCC() ) { | 359 | if ( smtp->getUseBCC() ) { |
351 | bccLine->setText( smtp->getBCC() ); | 360 | bccLine->setText( smtp->getBCC() ); |
352 | } | 361 | } |
353 | replyLine->clear(); | 362 | replyLine->clear(); |
354 | if ( smtp->getUseReply() ) { | 363 | if ( smtp->getUseReply() ) { |
355 | replyLine->setText( smtp->getReply() ); | 364 | replyLine->setText( smtp->getReply() ); |
356 | } | 365 | } |
357 | sigMultiLine->setText( smtp->getSignature() ); | ||
358 | #endif | 366 | #endif |
367 | SMTPaccount *smtp = smtpAccounts.at( current ); | ||
368 | if ( smtp ) | ||
369 | sigMultiLine->setText( smtp->getSignature() ); | ||
359 | } | 370 | } |
360 | 371 | ||
361 | void ComposeMail::slotAdjustColumns() | 372 | void ComposeMail::slotAdjustColumns() |
362 | { | 373 | { |
363 | int currPage = tabWidget->currentPageIndex(); | 374 | int currPage = tabWidget->currentPageIndex(); |
364 | 375 | ||
365 | tabWidget->showPage( attachTab ); | 376 | tabWidget->showPage( attachTab ); |
366 | attList->setColumnWidth( 0, attList->visibleWidth() - 80 ); | 377 | attList->setColumnWidth( 0, attList->visibleWidth() - 80 ); |
367 | attList->setColumnWidth( 1, 80 ); | 378 | attList->setColumnWidth( 1, 80 ); |
368 | 379 | ||
369 | tabWidget->setCurrentPage( currPage ); | 380 | tabWidget->setCurrentPage( currPage ); |
370 | } | 381 | } |
371 | 382 | ||
372 | void ComposeMail::addAttachment() | 383 | void ComposeMail::addAttachment() |
373 | { | 384 | { |
374 | QString lnk = KFileDialog::getOpenFileName( "", "Add Attachment", this ); | 385 | QString lnk = KFileDialog::getOpenFileName( "", "Add Attachment", this ); |