summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/mail2/composer.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/noncore/unsupported/mail2/composer.cpp b/noncore/unsupported/mail2/composer.cpp
index cabffe5..1d793ee 100644
--- a/noncore/unsupported/mail2/composer.cpp
+++ b/noncore/unsupported/mail2/composer.cpp
@@ -255,97 +255,98 @@ void Composer::slotSendQueued()
255 255
256 qDebug("remove mail %i", i); 256 qDebug("remove mail %i", i);
257 cfg.clearGroup(); 257 cfg.clearGroup();
258 cfg.removeEntry( "Mail_" + QString::number(i) ); 258 cfg.removeEntry( "Mail_" + QString::number(i) );
259 } 259 }
260} 260}
261 261
262void Composer::slotQueueMail() 262void Composer::slotQueueMail()
263{ 263{
264 if (to->text().find(QRegExp(".*\\@.*\\..*")) == -1) { 264 if (to->text().find(QRegExp(".*\\@.*\\..*")) == -1) {
265 QMessageBox::information(this, tr("Error"), tr("<p>You have to specify a recipient.<br>(eg: foo@bar.org)</p>"), tr("Ok")); 265 QMessageBox::information(this, tr("Error"), tr("<p>You have to specify a recipient.<br>(eg: foo@bar.org)</p>"), tr("Ok"));
266 return; 266 return;
267 } 267 }
268 268
269 Config cfg( "mailqueue", Config::User ); 269 Config cfg( "mailqueue", Config::User );
270 270
271 cfg.setGroup( "Settings" ); 271 cfg.setGroup( "Settings" );
272 int count = cfg.readNumEntry( "count", 0 ); 272 int count = cfg.readNumEntry( "count", 0 );
273 count++; 273 count++;
274 cfg.writeEntry( "count", count ); 274 cfg.writeEntry( "count", count );
275 qDebug("queueing mail %i",count); 275 qDebug("queueing mail %i",count);
276 276
277 cfg.setGroup( "Mail_" + QString::number( count )); 277 cfg.setGroup( "Mail_" + QString::number( count ));
278 cfg.writeEntry( "from", from->currentText() ); 278 cfg.writeEntry( "from", from->currentText() );
279 cfg.writeEntry( "reply", replyto->text()); 279 cfg.writeEntry( "reply", replyto->text());
280 cfg.writeEntry( "to", to->text()); 280 cfg.writeEntry( "to", to->text());
281 cfg.writeEntry( "cc", cc->text()); 281 cfg.writeEntry( "cc", cc->text());
282 cfg.writeEntry( "bcc", bcc->text()); 282 cfg.writeEntry( "bcc", bcc->text());
283 cfg.writeEntry( "subject", subject->text()); 283 cfg.writeEntry( "subject", subject->text());
284 cfg.writeEntryCrypt( "message", message->text()); 284 cfg.writeEntryCrypt( "message", message->text());
285 cfg.writeEntry( "mime", attachView->childCount() == 0 ); 285 cfg.writeEntry( "mime", attachView->childCount() == 0 );
286 cfg.writeEntry( "account", from->currentItem()); 286 cfg.writeEntry( "account", from->currentItem());
287 cfg.writeEntry( "priority", priority->currentItem() ); 287 cfg.writeEntry( "priority", priority->currentItem() );
288 cfg.writeEntry( "attachments", attachView->childCount() ); 288 cfg.writeEntry( "attachments", attachView->childCount() );
289 289
290 Attachment a; 290 Attachment a;
291 QListViewItem *item; 291 QListViewItem *item;
292 QString an; 292 QString an;
293 int i = 0; 293 int i = 0;
294 for (item = attachView->firstChild(); item != 0; item = item->itemBelow()) { 294 for (item = attachView->firstChild(); item != 0; item = item->itemBelow()) {
295 a = ((AttachViewItem *)item)->attachment(); 295 a = ((AttachViewItem *)item)->attachment();
296 an = "Attachment_" + QString::number( i++ ); 296 an = "Attachment_" + QString::number( i++ );
297 cfg.writeEntry( an + "fileName", a.fileName() ); 297 cfg.writeEntry( an + "fileName", a.fileName() );
298 cfg.writeEntry( an + "newName", a.newName() ); 298 cfg.writeEntry( an + "newName", a.newName() );
299 cfg.writeEntry( an + "description", a.description() ); 299 cfg.writeEntry( an + "description", a.description() );
300 cfg.writeEntry( an + "docLnk", a.docLnk().file() ); 300 cfg.writeEntry( an + "docLnk", a.docLnk().file() );
301 } 301 }
302 302
303 //cfg.close(); 303 QMessageBox::information(this, tr("Success"), tr("<p>The mail was queued successfully.</p><p>The queue contains ")+QString::number(count)+tr(" mails.</p>"), tr("Ok"));
304
304} 305}
305 306
306void Composer::slotSendError(const QString &error) 307void Composer::slotSendError(const QString &error)
307{ 308{
308 status->setText(tr("<font color=#ff0000>Error occoured during sending.</font>")); 309 status->setText(tr("<font color=#ff0000>Error occoured during sending.</font>"));
309 QMessageBox::warning(this, tr("Error"), tr("<p>%1</p").arg(error), tr("Ok")); 310 QMessageBox::warning(this, tr("Error"), tr("<p>%1</p").arg(error), tr("Ok"));
310} 311}
311 312
312void Composer::slotSendFinished() 313void Composer::slotSendFinished()
313{ 314{
314 QMessageBox::information(this, tr("Success"), tr("<p>The mail was sent successfully.</p>"), tr("Ok")); 315 QMessageBox::information(this, tr("Success"), tr("<p>The mail was sent successfully.</p>"), tr("Ok"));
315 316
316 status->setText(QString(0)); 317 status->setText(QString(0));
317 abort->setEnabled(false); 318 abort->setEnabled(false);
318} 319}
319 320
320void Composer::slotFillStuff() 321void Composer::slotFillStuff()
321{ 322{
322 QValueList<Account> accounts = ConfigFile::getAccounts(); 323 QValueList<Account> accounts = ConfigFile::getAccounts();
323 int i = 0; 324 int i = 0;
324 325
325 QValueList<Account>::Iterator it; 326 QValueList<Account>::Iterator it;
326 for (it = accounts.begin(); it != accounts.end(); it++) { 327 for (it = accounts.begin(); it != accounts.end(); it++) {
327 if (!(*it).email().isEmpty() && !(*it).smtpServer().isEmpty() && !(*it).smtpPort().isEmpty()) { 328 if (!(*it).email().isEmpty() && !(*it).smtpServer().isEmpty() && !(*it).smtpPort().isEmpty()) {
328 if (!(*it).realName().isEmpty()) 329 if (!(*it).realName().isEmpty())
329 from->insertItem((*it).realName() + " <" + (*it).email() + ">", i); 330 from->insertItem((*it).realName() + " <" + (*it).email() + ">", i);
330 else 331 else
331 from->insertItem((*it).email()); 332 from->insertItem((*it).email());
332 333
333 accountsLoaded.append(*it); 334 accountsLoaded.append(*it);
334 i++; 335 i++;
335 } 336 }
336 } 337 }
337} 338}
338 339
339void Composer::slotFromChanged(int id) 340void Composer::slotFromChanged(int id)
340{ 341{
341 Account account = accountsLoaded[id]; 342 Account account = accountsLoaded[id];
342 343
343 if (account.defaultCc()) cc->setText(account.cc()); 344 if (account.defaultCc()) cc->setText(account.cc());
344 if (account.defaultBcc()) bcc->setText(account.bcc()); 345 if (account.defaultBcc()) bcc->setText(account.bcc());
345 if (account.defaultReplyTo()) replyto->setText(account.replyTo()); 346 if (account.defaultReplyTo()) replyto->setText(account.replyTo());
346 if (!account.signature().isEmpty()) 347 if (!account.signature().isEmpty())
347 message->setText(message->text() + "\n\n-- \n" + account.signature()); 348 message->setText(message->text() + "\n\n-- \n" + account.signature());
348} 349}
349 350
350void Composer::slotOpenAddressPicker() 351void Composer::slotOpenAddressPicker()
351{ 352{