summaryrefslogtreecommitdiffabout
path: root/kmicromail/opiemail.cpp
Unidiff
Diffstat (limited to 'kmicromail/opiemail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/opiemail.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp
index 68f0eb3..f56711d 100644
--- a/kmicromail/opiemail.cpp
+++ b/kmicromail/opiemail.cpp
@@ -242,399 +242,400 @@ void OpieMail::slotEditSettings()
242 242
243 KOPrefsDialog settingsDialog( this, "koprefs", true ); 243 KOPrefsDialog settingsDialog( this, "koprefs", true );
244#ifndef DESKTOP_VERSION 244#ifndef DESKTOP_VERSION
245 settingsDialog.showMaximized(); 245 settingsDialog.showMaximized();
246#endif 246#endif
247 settingsDialog.exec(); 247 settingsDialog.exec();
248 248
249 slotSetCodec( KOPrefs::instance()->mCurrentCodec ); 249 slotSetCodec( KOPrefs::instance()->mCurrentCodec );
250 // KApplication::execDialog(settingsDialog); 250 // KApplication::execDialog(settingsDialog);
251} 251}
252 252
253void OpieMail::slotEditAccounts() 253void OpieMail::slotEditAccounts()
254{ 254{
255 EditAccounts eaDialog( settings, this, 0, true ); 255 EditAccounts eaDialog( settings, this, 0, true );
256 eaDialog.slotAdjustColumns(); 256 eaDialog.slotAdjustColumns();
257#ifndef DESKTOP_VERSION 257#ifndef DESKTOP_VERSION
258 eaDialog.showMaximized(); 258 eaDialog.showMaximized();
259#endif 259#endif
260 eaDialog.exec(); 260 eaDialog.exec();
261 if ( settings ) delete settings; 261 if ( settings ) delete settings;
262 settings = new Settings(); 262 settings = new Settings();
263 263
264 folderView->populate( settings->getAccounts() ); 264 folderView->populate( settings->getAccounts() );
265} 265}
266void OpieMail::replyMail() 266void OpieMail::replyMail()
267{ 267{
268 268
269 QListViewItem*item = mailView->currentItem(); 269 QListViewItem*item = mailView->currentItem();
270 if (!item) return; 270 if (!item) return;
271 RecMailP mail = ((MailListViewItem*)item)->data(); 271 RecMailP mail = ((MailListViewItem*)item)->data();
272 RecBodyP body = folderView->fetchBody(mail); 272 RecBodyP body = folderView->fetchBody(mail);
273 273
274 QString rtext; 274 QString rtext;
275 rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose 275 rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose
276 .arg( mail->getFrom()) 276 .arg( mail->getFrom())
277 .arg( mail->getDate()); 277 .arg( mail->getDate());
278 278
279 QString text = body->Bodytext(); 279 QString text = body->Bodytext();
280 QStringList lines = QStringList::split(QRegExp("\\n"), text); 280 QStringList lines = QStringList::split(QRegExp("\\n"), text);
281 QStringList::Iterator it; 281 QStringList::Iterator it;
282 for (it = lines.begin(); it != lines.end(); it++) 282 for (it = lines.begin(); it != lines.end(); it++)
283 { 283 {
284 rtext += "> " + *it + "\n"; 284 rtext += "> " + *it + "\n";
285 } 285 }
286 rtext += "\n"; 286 rtext += "\n";
287 287
288 QString prefix; 288 QString prefix;
289 if ( mail->getSubject().find(QRegExp("^Re: .*$")) != -1) prefix = ""; 289 if ( mail->getSubject().find(QRegExp("^Re: .*$")) != -1) prefix = "";
290 else prefix = "Re: "; // no i18n on purpose 290 else prefix = "Re: "; // no i18n on purpose
291 291
292 Settings *settings = new Settings(); 292 Settings *settings = new Settings();
293 ComposeMail composer( settings ,this, 0, true); 293 ComposeMail composer( settings ,this, 0, true);
294 if (mail->Replyto().isEmpty()) { 294 if (mail->Replyto().isEmpty()) {
295 composer.setTo( mail->getFrom()); 295 composer.setTo( mail->getFrom());
296 } else { 296 } else {
297 composer.setTo( mail->Replyto()); 297 composer.setTo( mail->Replyto());
298 } 298 }
299 composer.setSubject( prefix + mail->getSubject()); 299 composer.setSubject( prefix + mail->getSubject());
300 composer.setMessage( rtext ); 300 composer.setMessage( rtext );
301 composer.setInReplyTo( mail->Msgid()); 301 composer.setInReplyTo( mail->Msgid());
302 composer.setCharset( body->getCharset() ); 302 composer.setCharset( body->getCharset() );
303 if ( QDialog::Accepted == KApplication::execDialog( &composer ) ) 303 if ( QDialog::Accepted == KApplication::execDialog( &composer ) )
304 { 304 {
305 mail->Wrapper()->answeredMail(mail); 305 mail->Wrapper()->answeredMail(mail);
306 } 306 }
307 delete settings; 307 delete settings;
308 308
309} 309}
310void OpieMail::closeViewMail(ViewMail * vm) 310void OpieMail::closeViewMail(ViewMail * vm)
311{ 311{
312 vm->hide(); 312 vm->hide();
313} 313}
314 314
315void OpieMail::slotDownloadMail( ) 315void OpieMail::slotDownloadMail( )
316{ 316{
317 QListViewItem*item = mailView->currentItem(); 317 QListViewItem*item = mailView->currentItem();
318 if (!item ) { 318 if (!item ) {
319 Global::statusMessage("Error: No item slected!"); 319 Global::statusMessage("Error: No item slected!");
320 return; 320 return;
321 } 321 }
322 RecMailP mail = ((MailListViewItem*)item)->data(); 322 RecMailP mail = ((MailListViewItem*)item)->data();
323 Account * acc = mail->Wrapper()->getAccount(); 323 Account * acc = mail->Wrapper()->getAccount();
324 if ( !acc ) { 324 if ( !acc ) {
325 Global::statusMessage("Mail is already stored locally!"); 325 Global::statusMessage("Mail is already stored locally!");
326 return; 326 return;
327 } 327 }
328 QString lfName = acc->getLocalFolder(); 328 QString lfName = acc->getLocalFolder();
329 //qDebug("local folder " + lfName ); 329 //qDebug("local folder " + lfName );
330 if ( lfName.isEmpty() ) 330 if ( lfName.isEmpty() )
331 lfName = acc->getAccountName(); 331 lfName = acc->getAccountName();
332 AbstractMail* targetMail = folderView->allAccounts()[0]->getWrapper(); 332 AbstractMail* targetMail = folderView->allAccounts()[0]->getWrapper();
333 //qDebug("target %d %d ",targetMail,mail->Wrapper() ); 333 //qDebug("target %d %d ",targetMail,mail->Wrapper() );
334 if ( targetMail == mail->Wrapper() ) { 334 if ( targetMail == mail->Wrapper() ) {
335 Global::statusMessage("Mail is already locally stored!"); 335 Global::statusMessage("Mail is already locally stored!");
336 return; 336 return;
337 } 337 }
338 if ( !targetMail->createMbox(lfName)) { 338 if ( !targetMail->createMbox(lfName)) {
339 Global::statusMessage("Error creating folder!"); 339 Global::statusMessage("Error creating folder!");
340 return; 340 return;
341 } 341 }
342 Global::statusMessage("Fetching mail...please wait!"); 342 Global::statusMessage("Fetching mail...please wait!");
343 qApp->processEvents(); 343 qApp->processEvents();
344 encodedString*st = 0; 344 encodedString*st = 0;
345 st = mail->Wrapper()->fetchRawBody(mail); 345 st = mail->Wrapper()->fetchRawBody(mail);
346 if ( st ) { 346 if ( st ) {
347 targetMail->storeMessage(st->Content(),st->Length(),lfName); 347 targetMail->storeMessage(st->Content(),st->Length(),lfName);
348 Global::statusMessage("Mail stored in "+ lfName); 348 Global::statusMessage("Mail stored in "+ lfName);
349 delete st; 349 delete st;
350 } else { 350 } else {
351 Global::statusMessage("Error: Cannot fetch mail!"); 351 Global::statusMessage("Error: Cannot fetch mail!");
352 } 352 }
353} 353}
354 354
355 355
356void OpieMail::deleteAndDisplayNextMail(ViewMail * vm) 356void OpieMail::deleteAndDisplayNextMail(ViewMail * vm)
357{ 357{
358 QListViewItem*item = mailView->currentItem(); 358 QListViewItem*item = mailView->currentItem();
359 if (!item ) { 359 if (!item ) {
360 closeViewMail(vm); 360 closeViewMail(vm);
361 return; 361 return;
362 } 362 }
363 RecMailP mail = ((MailListViewItem*)item)->data(); 363 RecMailP mail = ((MailListViewItem*)item)->data();
364 mail->Wrapper()->deleteMail( mail ); 364 mail->Wrapper()->deleteMail( mail );
365 item = item->itemBelow(); 365 item = item->itemBelow();
366 if (!item ) { 366 if (!item ) {
367 closeViewMail(vm); 367 closeViewMail(vm);
368 return; 368 return;
369 } 369 }
370 mailView->setCurrentItem(item); 370 mailView->setCurrentItem(item);
371 mail = ((MailListViewItem*)item)->data(); 371 mail = ((MailListViewItem*)item)->data();
372 RecBodyP body = folderView->fetchBody(mail); 372 RecBodyP body = folderView->fetchBody(mail);
373 vm->setBody( body ); 373 vm->setBody( body );
374 vm->setMail( mail ); 374 vm->setMail( mail );
375} 375}
376void OpieMail::displayNextMail(ViewMail * vm) 376void OpieMail::displayNextMail(ViewMail * vm)
377{ 377{
378 QListViewItem*item = mailView->currentItem(); 378 QListViewItem*item = mailView->currentItem();
379 if (!item) return; 379 if (!item) return;
380 ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); 380 ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() );
381 item = item->itemBelow(); 381 item = item->itemBelow();
382 if (!item) { 382 if (!item) {
383 vm->setCaption(i18n("End of List" )); 383 vm->setCaption(i18n("End of List" ));
384 return; 384 return;
385 } 385 }
386 mailView->setCurrentItem(item); 386 mailView->setCurrentItem(item);
387 RecMailP mail = ((MailListViewItem*)item)->data(); 387 RecMailP mail = ((MailListViewItem*)item)->data();
388 RecBodyP body = folderView->fetchBody(mail); 388 RecBodyP body = folderView->fetchBody(mail);
389 vm->setBody( body ); 389 vm->setBody( body );
390 vm->setMail( mail ); 390 vm->setMail( mail );
391} 391}
392void OpieMail::displayMail() 392void OpieMail::displayMail()
393{ 393{
394 QListViewItem*item = mailView->currentItem(); 394 QListViewItem*item = mailView->currentItem();
395 if (!item) return; 395 if (!item) return;
396 RecMailP mail = ((MailListViewItem*)item)->data(); 396 RecMailP mail = ((MailListViewItem*)item)->data();
397 RecBodyP body = folderView->fetchBody(mail); 397 RecBodyP body = folderView->fetchBody(mail);
398 ViewMail readMail( this,"", Qt::WType_Modal ); 398 ViewMail readMail( this,"", Qt::WType_Modal );
399 readMail.setBody( body ); 399 readMail.setBody( body );
400 readMail.setMail( mail ); 400 readMail.setMail( mail );
401#ifndef DESKTOP_VERSION 401#ifndef DESKTOP_VERSION
402 readMail.showMaximized(); 402 readMail.showMaximized();
403#else 403#else
404 readMail.resize( 640, 480); 404 readMail.resize( 640, 480);
405#endif 405#endif
406 connect( &readMail,SIGNAL( showNextMail(ViewMail *) ), this, SLOT( displayNextMail(ViewMail *) ) ); 406 connect( &readMail,SIGNAL( showNextMail(ViewMail *) ), this, SLOT( displayNextMail(ViewMail *) ) );
407 connect( &readMail,SIGNAL( deleteAndDisplayNextMail(ViewMail *) ), this, SLOT(deleteAndDisplayNextMail(ViewMail *) ) ); 407 connect( &readMail,SIGNAL( deleteAndDisplayNextMail(ViewMail *) ), this, SLOT(deleteAndDisplayNextMail(ViewMail *) ) );
408 connect( &readMail,SIGNAL( signalDownloadMail() ), this, SLOT( slotDownloadMail() ) ); 408 connect( &readMail,SIGNAL( signalDownloadMail() ), this, SLOT( slotDownloadMail() ) );
409 409
410 readMail.exec(); 410 readMail.exec();
411 411
412 if ( readMail.deleted ) 412 if ( readMail.deleted )
413 { 413 {
414 folderView->refreshCurrent(); 414 folderView->refreshCurrent();
415 } 415 }
416 else 416 else
417 { 417 {
418 QListViewItem*item = mailView->currentItem(); 418 QListViewItem*item = mailView->currentItem();
419 if (item) 419 if (item)
420 ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); 420 ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() );
421 } 421 }
422} 422}
423void OpieMail::slotGetAllMail() 423void OpieMail::slotGetAllMail()
424{ 424{
425 QListViewItem * item = folderView->firstChild(); 425 QListViewItem * item = folderView->firstChild();
426 while ( item ){ 426 while ( item ){
427 ((AccountViewItem *)item)->contextMenuSelected( 101 ); 427 ((AccountViewItem *)item)->contextMenuSelected( 101 );
428 item = item->nextSibling (); 428 item = item->nextSibling ();
429 } 429 }
430} 430}
431void OpieMail::slotGetMail() 431void OpieMail::slotGetMail()
432{ 432{
433 QListViewItem * item = folderView->currentItem(); 433 QListViewItem * item = folderView->currentItem();
434 if ( ! item ) return; 434 if ( ! item ) return;
435 ((AccountViewItem *)item)->contextMenuSelected( 101 ); 435 ((AccountViewItem *)item)->contextMenuSelected( 101 );
436} 436}
437void OpieMail::slotDeleteMail() 437void OpieMail::slotDeleteMail()
438{ 438{
439 if (!mailView->currentItem()) return; 439 if (!mailView->currentItem()) return;
440 RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); 440 RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data();
441 if ( QMessageBox::warning(this, i18n("Delete Mail"), QString( i18n("<p>Do you really want to delete this mail? <br><br>" ) + mail->getFrom() + " - " + mail->getSubject() ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) 441 if ( QMessageBox::warning(this, i18n("Delete Mail"), QString( i18n("<p>Do you really want to delete this mail? <br><br>" ) + mail->getFrom() + " - " + mail->getSubject() ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes )
442 { 442 {
443 mail->Wrapper()->deleteMail( mail ); 443 mail->Wrapper()->deleteMail( mail );
444 folderView->refreshCurrent(); 444 folderView->refreshCurrent();
445 } 445 }
446} 446}
447void OpieMail::slotDeleteAllMail() 447void OpieMail::slotDeleteAllMail()
448{ 448{
449 449
450 QValueList<RecMailP> t; 450 QValueList<RecMailP> t;
451 if ( QMessageBox::warning(this, i18n("Delete All Mails"), i18n("Do you really want to delete\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) 451 if ( QMessageBox::warning(this, i18n("Delete All Mails"), i18n("Do you really want to delete\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes )
452 { 452 {
453 MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); 453 MailListViewItem* item = (MailListViewItem*)mailView->firstChild ();
454 while ( item ) { 454 while ( item ) {
455 if ( item->isSelected() ) { 455 if ( item->isSelected() ) {
456 t.append( item->data() ); 456 t.append( item->data() );
457 } 457 }
458 item = (MailListViewItem*)item->nextSibling(); 458 item = (MailListViewItem*)item->nextSibling();
459 } 459 }
460 } 460 }
461 else 461 else
462 return; 462 return;
463 if ( t.count() == 0 ) 463 if ( t.count() == 0 )
464 return; 464 return;
465 RecMailP mail = t.first(); 465 RecMailP mail = t.first();
466 mail->Wrapper()->deleteMailList(t); 466 mail->Wrapper()->deleteMailList(t);
467 folderView->refreshCurrent(); 467 folderView->refreshCurrent();
468 468
469 469
470} 470}
471void OpieMail::clearSelection() 471void OpieMail::clearSelection()
472{ 472{
473 mailView->clearSelection(); 473 mailView->clearSelection();
474 474
475} 475}
476 476
477void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int ) 477void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int )
478{ 478{
479 if (!mailView->currentItem()) return; 479 if (!mailView->currentItem()) return;
480 MAILLIB::ATYPE mailtype = ((MailListViewItem*)mailView->currentItem() )->wrapperType(); 480 MAILLIB::ATYPE mailtype = ((MailListViewItem*)mailView->currentItem() )->wrapperType();
481 /* just the RIGHT button - or hold on pda */ 481 /* just the RIGHT button - or hold on pda */
482 if (button!=2) {return;} 482 if (button!=2) {return;}
483 if (!item) return; 483 if (!item) return;
484 QPopupMenu *m = new QPopupMenu(0); 484 QPopupMenu *m = new QPopupMenu(0);
485 if (m) 485 if (m)
486 { 486 {
487 if (mailtype==MAILLIB::A_NNTP) { 487 if (mailtype==MAILLIB::A_NNTP) {
488 m->insertItem(i18n("Read this posting"),this,SLOT(displayMail())); 488 m->insertItem(i18n("Read this posting"),this,SLOT(displayMail()));
489 m->insertItem(i18n("Copy this posting"),this,SLOT(slotMoveCopyMail())); 489 m->insertItem(i18n("Copy this posting"),this,SLOT(slotMoveCopyMail()));
490 m->insertSeparator(); 490 m->insertSeparator();
491 m->insertItem(i18n("Copy all selected postings"),this,SLOT(slotMoveCopyAllMail())); 491 m->insertItem(i18n("Copy all selected postings"),this,SLOT(slotMoveCopyAllMail()));
492 m->insertItem(i18n("Clear selection"),this,SLOT(clearSelection())); 492 m->insertItem(i18n("Clear selection"),this,SLOT(clearSelection()));
493 } else { 493 } else {
494 if (folderView->currentisDraft()) { 494 if (folderView->currentisDraft()) {
495 m->insertItem(i18n("Edit this mail"),this,SLOT(reEditMail())); 495 m->insertItem(i18n("Edit this mail"),this,SLOT(reEditMail()));
496 } 496 }
497 m->insertItem(i18n("Reply to this mail"),this,SLOT(replyMail())); 497 m->insertItem(i18n("Reply to this mail"),this,SLOT(replyMail()));
498 m->insertSeparator();
499 m->insertItem(i18n("Read this mail"),this,SLOT(displayMail())); 498 m->insertItem(i18n("Read this mail"),this,SLOT(displayMail()));
499 m->insertSeparator();
500 m->insertItem(i18n("Move/Copy this mail"),this,SLOT(slotMoveCopyMail())); 500 m->insertItem(i18n("Move/Copy this mail"),this,SLOT(slotMoveCopyMail()));
501 m->insertItem(i18n("Delete this mail"),this,SLOT(slotDeleteMail())); 501 m->insertItem(i18n("Delete this mail"),this,SLOT(slotDeleteMail()));
502 m->insertSeparator(); 502 m->insertSeparator();
503 m->insertItem(i18n("Move/Copy all selected mail"),this,SLOT(slotMoveCopyAllMail())); 503 m->insertItem(i18n("Move/Copy all selected mail"),this,SLOT(slotMoveCopyAllMail()));
504 m->insertItem(i18n("Delete all selected mails"),this,SLOT(slotDeleteAllMail())); 504 m->insertItem(i18n("Delete all selected mails"),this,SLOT(slotDeleteAllMail()));
505 m->insertSeparator();
505 m->insertItem(i18n("Clear selection"),this,SLOT(clearSelection())); 506 m->insertItem(i18n("Clear selection"),this,SLOT(clearSelection()));
506 } 507 }
507 m->setFocus(); 508 m->setFocus();
508 m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); 509 m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) );
509 delete m; 510 delete m;
510 } 511 }
511} 512}
512 513
513void OpieMail::slotShowFolders( bool show ) 514void OpieMail::slotShowFolders( bool show )
514{ 515{
515 if ( show && folderView->isHidden() ) 516 if ( show && folderView->isHidden() )
516 { 517 {
517 folderView->show(); 518 folderView->show();
518 } 519 }
519 else if ( !show && !folderView->isHidden() ) 520 else if ( !show && !folderView->isHidden() )
520 { 521 {
521 folderView->hide(); 522 folderView->hide();
522 } 523 }
523} 524}
524 525
525void OpieMail::refreshMailView(const QValueList<RecMailP>&list) 526void OpieMail::refreshMailView(const QValueList<RecMailP>&list)
526{ 527{
527 MailListViewItem*item = 0; 528 MailListViewItem*item = 0;
528 mailView->clear(); 529 mailView->clear();
529 530
530 QValueList<RecMailP>::ConstIterator it; 531 QValueList<RecMailP>::ConstIterator it;
531 for (it = list.begin(); it != list.end();++it) 532 for (it = list.begin(); it != list.end();++it)
532 { 533 {
533 item = new MailListViewItem(mailView,item); 534 item = new MailListViewItem(mailView,item);
534 item->storeData((*it)); 535 item->storeData((*it));
535 item->showEntry(); 536 item->showEntry();
536 } 537 }
537 mailView->setSorting ( 4, false ); 538 mailView->setSorting ( 4, false );
538} 539}
539 540
540void OpieMail::mailLeftClicked( QListViewItem *item ) 541void OpieMail::mailLeftClicked( QListViewItem *item )
541{ 542{
542 mailView->clearSelection(); 543 mailView->clearSelection();
543 /* just LEFT button - or tap with stylus on pda */ 544 /* just LEFT button - or tap with stylus on pda */
544 //if (button!=1) return; 545 //if (button!=1) return;
545 if (!item) return; 546 if (!item) return;
546 if (folderView->currentisDraft()) { 547 if (folderView->currentisDraft()) {
547 reEditMail(); 548 reEditMail();
548 } else { 549 } else {
549 displayMail(); 550 displayMail();
550 } 551 }
551} 552}
552 553
553void OpieMail::slotMoveCopyMail() 554void OpieMail::slotMoveCopyMail()
554{ 555{
555 if (!mailView->currentItem()) return; 556 if (!mailView->currentItem()) return;
556 RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); 557 RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data();
557 AbstractMail*targetMail = 0; 558 AbstractMail*targetMail = 0;
558 QString targetFolder = ""; 559 QString targetFolder = "";
559 Selectstore sels; 560 Selectstore sels;
560 folderView->setupFolderselect(&sels); 561 folderView->setupFolderselect(&sels);
561 if (!sels.exec()) return; 562 if (!sels.exec()) return;
562 targetMail = sels.currentMail(); 563 targetMail = sels.currentMail();
563 targetFolder = sels.currentFolder(); 564 targetFolder = sels.currentFolder();
564 if ( (mail->Wrapper()==targetMail && mail->getMbox()==targetFolder) || 565 if ( (mail->Wrapper()==targetMail && mail->getMbox()==targetFolder) ||
565 targetFolder.isEmpty()) 566 targetFolder.isEmpty())
566 { 567 {
567 return; 568 return;
568 } 569 }
569 if (sels.newFolder() && !targetMail->createMbox(targetFolder)) 570 if (sels.newFolder() && !targetMail->createMbox(targetFolder))
570 { 571 {
571 QMessageBox::critical(0,i18n("Error creating new Folder"), 572 QMessageBox::critical(0,i18n("Error creating new Folder"),
572 i18n("<center>Error while creating<br>new folder - breaking.</center>")); 573 i18n("<center>Error while creating<br>new folder - breaking.</center>"));
573 return; 574 return;
574 } 575 }
575 sels.hide(); 576 sels.hide();
576 qApp->processEvents(); 577 qApp->processEvents();
577 // qDebug("hiding sels "); 578 // qDebug("hiding sels ");
578 mail->Wrapper()->mvcpMail(mail,targetFolder,targetMail,sels.moveMails()); 579 mail->Wrapper()->mvcpMail(mail,targetFolder,targetMail,sels.moveMails());
579 folderView->refreshCurrent(); 580 folderView->refreshCurrent();
580} 581}
581 582
582void OpieMail::slotMoveCopyAllMail() 583void OpieMail::slotMoveCopyAllMail()
583{ 584{
584 585
585 if (!mailView->currentItem()) return; 586 if (!mailView->currentItem()) return;
586 QValueList<RecMailP> t; 587 QValueList<RecMailP> t;
587 // if ( QMessageBox::warning(this, i18n("Move/Copy all selected mails"), i18n("Do you really want to copy/move\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) 588 // if ( QMessageBox::warning(this, i18n("Move/Copy all selected mails"), i18n("Do you really want to copy/move\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes )
588 { 589 {
589 MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); 590 MailListViewItem* item = (MailListViewItem*)mailView->firstChild ();
590 while ( item ) { 591 while ( item ) {
591 if ( item->isSelected() ) { 592 if ( item->isSelected() ) {
592 t.append( item->data() ); 593 t.append( item->data() );
593 } 594 }
594 item = (MailListViewItem*)item->nextSibling(); 595 item = (MailListViewItem*)item->nextSibling();
595 } 596 }
596 } 597 }
597 // else 598 // else
598 // return; 599 // return;
599 if ( t.count() == 0 ) 600 if ( t.count() == 0 )
600 return; 601 return;
601 RecMailP mail = t.first(); 602 RecMailP mail = t.first();
602 AbstractMail*targetMail = 0; 603 AbstractMail*targetMail = 0;
603 QString targetFolder = ""; 604 QString targetFolder = "";
604 Selectstore sels; 605 Selectstore sels;
605 folderView->setupFolderselect(&sels); 606 folderView->setupFolderselect(&sels);
606 if (!sels.exec()) return; 607 if (!sels.exec()) return;
607 targetMail = sels.currentMail(); 608 targetMail = sels.currentMail();
608 targetFolder = sels.currentFolder(); 609 targetFolder = sels.currentFolder();
609 if ( (mail->Wrapper()==targetMail && mail->getMbox()==targetFolder) || 610 if ( (mail->Wrapper()==targetMail && mail->getMbox()==targetFolder) ||
610 targetFolder.isEmpty()) 611 targetFolder.isEmpty())
611 { 612 {
612 return; 613 return;
613 } 614 }
614 if (sels.newFolder() && !targetMail->createMbox(targetFolder)) 615 if (sels.newFolder() && !targetMail->createMbox(targetFolder))
615 { 616 {
616 QMessageBox::critical(0,i18n("Error creating new Folder"), 617 QMessageBox::critical(0,i18n("Error creating new Folder"),
617 i18n("<center>Error while creating<br>new folder - breaking.</center>")); 618 i18n("<center>Error while creating<br>new folder - breaking.</center>"));
618 return; 619 return;
619 } 620 }
620 sels.hide(); 621 sels.hide();
621 qApp->processEvents(); 622 qApp->processEvents();
622 //qDebug("hiding sels "); 623 //qDebug("hiding sels ");
623 mail->Wrapper()->mvcpMailList(t,targetFolder,targetMail,sels.moveMails()); 624 mail->Wrapper()->mvcpMailList(t,targetFolder,targetMail,sels.moveMails());
624 folderView->refreshCurrent(); 625 folderView->refreshCurrent();
625} 626}
626 627
627void OpieMail::reEditMail() 628void OpieMail::reEditMail()
628{ 629{
629 if (!mailView->currentItem()) return; 630 if (!mailView->currentItem()) return;
630 631
631 ComposeMail compose( settings, this, 0, true ); 632 ComposeMail compose( settings, this, 0, true );
632 compose.reEditMail(((MailListViewItem*)mailView->currentItem() )->data()); 633 compose.reEditMail(((MailListViewItem*)mailView->currentItem() )->data());
633 compose.slotAdjustColumns(); 634 compose.slotAdjustColumns();
634#ifndef DESKTOP_VERSION 635#ifndef DESKTOP_VERSION
635 compose.showMaximized(); 636 compose.showMaximized();
636#else 637#else
637 compose.resize(640,480); 638 compose.resize(640,480);
638#endif 639#endif
639 compose.exec(); 640 compose.exec();
640} 641}