Diffstat (limited to 'noncore/unsupported/mailit/emailclient.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/mailit/emailclient.cpp | 177 |
1 files changed, 89 insertions, 88 deletions
diff --git a/noncore/unsupported/mailit/emailclient.cpp b/noncore/unsupported/mailit/emailclient.cpp index b039cc4..2102ba7 100644 --- a/noncore/unsupported/mailit/emailclient.cpp +++ b/noncore/unsupported/mailit/emailclient.cpp | |||
@@ -344,49 +344,49 @@ void EmailClient::getNewMail() { | |||
344 | while (item != NULL) { | 344 | while (item != NULL) { |
345 | mailPtr = item->getMail(); | 345 | mailPtr = item->getMail(); |
346 | if ( (!mailPtr->downloaded) && (mailPtr->fromAccountId == currentAccount->id) ) { | 346 | if ( (!mailPtr->downloaded) && (mailPtr->fromAccountId == currentAccount->id) ) { |
347 | mailDownloadList.sizeInsert(mailPtr->serverId, mailPtr->size); | 347 | mailDownloadList.sizeInsert(mailPtr->serverId, mailPtr->size); |
348 | } | 348 | } |
349 | item = (EmailListItem *) item->nextSibling(); | 349 | item = (EmailListItem *) item->nextSibling(); |
350 | }*/ | 350 | }*/ |
351 | 351 | ||
352 | emailHandler->getMailHeaders(); | 352 | emailHandler->getMailHeaders(); |
353 | 353 | ||
354 | } | 354 | } |
355 | 355 | ||
356 | void EmailClient::getAllNewMail() | 356 | void EmailClient::getAllNewMail() |
357 | { | 357 | { |
358 | allAccounts = TRUE; | 358 | allAccounts = TRUE; |
359 | currentAccount = accountList.first(); | 359 | currentAccount = accountList.first(); |
360 | getNewMail(); | 360 | getNewMail(); |
361 | } | 361 | } |
362 | 362 | ||
363 | void EmailClient::mailArrived(const Email &mail, bool fromDisk) | 363 | void EmailClient::mailArrived(const Email &mail, bool fromDisk) |
364 | { | 364 | { |
365 | Enclosure *ePtr; | 365 | Enclosure *ePtr; |
366 | Email newMail; | 366 | Email newMail; |
367 | int thisMailId; | 367 | int thisMailId; |
368 | emailHandler->parse(mail.rawMail, lineShift, &newMail); | 368 | emailHandler->parse( mail.rawMail, lineShift, &newMail); |
369 | mailconf->setGroup(newMail.id); | 369 | mailconf->setGroup(newMail.id); |
370 | 370 | ||
371 | if (fromDisk) | 371 | if (fromDisk) |
372 | { | 372 | { |
373 | 373 | ||
374 | newMail.downloaded = mailconf->readBoolEntry("downloaded"); | 374 | newMail.downloaded = mailconf->readBoolEntry("downloaded"); |
375 | newMail.size = mailconf->readNumEntry("size"); | 375 | newMail.size = mailconf->readNumEntry("size"); |
376 | newMail.serverId = mailconf->readNumEntry("serverid"); | 376 | newMail.serverId = mailconf->readNumEntry("serverid"); |
377 | newMail.fromAccountId = mailconf->readNumEntry("fromaccountid"); | 377 | newMail.fromAccountId = mailconf->readNumEntry("fromaccountid"); |
378 | } | 378 | } |
379 | else | 379 | else |
380 | { //mail arrived from server | 380 | { //mail arrived from server |
381 | 381 | ||
382 | newMail.serverId = mail.serverId; | 382 | newMail.serverId = mail.serverId; |
383 | newMail.size = mail.size; | 383 | newMail.size = mail.size; |
384 | newMail.downloaded = mail.downloaded; | 384 | newMail.downloaded = mail.downloaded; |
385 | 385 | ||
386 | newMail.fromAccountId = emailHandler->getAccount()->id; | 386 | newMail.fromAccountId = emailHandler->getAccount()->id; |
387 | mailconf->writeEntry("fromaccountid", newMail.fromAccountId); | 387 | mailconf->writeEntry("fromaccountid", newMail.fromAccountId); |
388 | } | 388 | } |
389 | 389 | ||
390 | //add if read or not | 390 | //add if read or not |
391 | newMail.read = mailconf->readBoolEntry("mailread"); | 391 | newMail.read = mailconf->readBoolEntry("mailread"); |
392 | 392 | ||
@@ -440,59 +440,60 @@ void EmailClient::mailArrived(const Email &mail, bool fromDisk) | |||
440 | } | 440 | } |
441 | } else { | 441 | } else { |
442 | ePtr->saved = mailconf->readBoolEntry("saved_" + stringId); | 442 | ePtr->saved = mailconf->readBoolEntry("saved_" + stringId); |
443 | ePtr->installed = mailconf->readBoolEntry("installed_" + stringId); | 443 | ePtr->installed = mailconf->readBoolEntry("installed_" + stringId); |
444 | if (ePtr->saved) { | 444 | if (ePtr->saved) { |
445 | ePtr->name = mailconf->readEntry("filename_" + stringId); | 445 | ePtr->name = mailconf->readEntry("filename_" + stringId); |
446 | ePtr->path = mailconf->readEntry("path_" + stringId); | 446 | ePtr->path = mailconf->readEntry("path_" + stringId); |
447 | } | 447 | } |
448 | } | 448 | } |
449 | } | 449 | } |
450 | 450 | ||
451 | bool found=false; | 451 | bool found=false; |
452 | 452 | ||
453 | if (!fromDisk) | 453 | if (!fromDisk) |
454 | { | 454 | { |
455 | 455 | ||
456 | Email *mailPtr; | 456 | Email *mailPtr; |
457 | item = (EmailListItem *) inboxView->firstChild(); | 457 | item = (EmailListItem *) inboxView->firstChild(); |
458 | while ((item != NULL)&&(!found)) | 458 | while ((item != NULL)&&(!found)) |
459 | { | 459 | { |
460 | mailPtr = item->getMail(); | 460 | mailPtr = item->getMail(); |
461 | if (mailPtr->id == newMail.id) { | 461 | if (mailPtr->id == newMail.id) { |
462 | item->setMail(newMail); | 462 | item->setMail(newMail); |
463 | emit mailUpdated(item->getMail()); | 463 | emit mailUpdated(item->getMail()); |
464 | found = true; | 464 | found = true; |
465 | } | 465 | } |
466 | item = (EmailListItem *) item->nextSibling(); | 466 | item = (EmailListItem *) item->nextSibling(); |
467 | } | 467 | } |
468 | } | 468 | } |
469 | if ((!found)||(fromDisk)) item = new EmailListItem(inboxView, newMail, TRUE); | 469 | if ((!found)||(fromDisk)) { |
470 | 470 | item = new EmailListItem(inboxView, newMail, TRUE); | |
471 | if (item->getMail()->files.count()>0) | 471 | } |
472 | { | 472 | if (item->getMail()->files.count()>0) |
473 | item->setPixmap(0, Resource::loadPixmap("mailit/attach")); | 473 | { |
474 | } | 474 | item->setPixmap(0, Resource::loadPixmap("mailit/attach")); |
475 | } | ||
475 | /*if (!newMail.downloaded) | 476 | /*if (!newMail.downloaded) |
476 | mailDownloadList.sizeInsert(newMail.serverId, newMail.size);*/ | 477 | mailDownloadList.sizeInsert(newMail.serverId, newMail.size);*/ |
477 | 478 | ||
478 | mailboxView->setCurrentTab(0); | 479 | mailboxView->setCurrentTab(0); |
479 | 480 | ||
480 | } | 481 | } |
481 | 482 | ||
482 | void EmailClient::allMailArrived(int count) | 483 | void EmailClient::allMailArrived(int count) |
483 | { | 484 | { |
484 | // not previewing means all mailtransfer has been done | 485 | // not previewing means all mailtransfer has been done |
485 | /*if (!previewingMail) {*/ | 486 | /*if (!previewingMail) {*/ |
486 | if ( (allAccounts) && ( (currentAccount = accountList.next()) !=0 ) ) { | 487 | if ( (allAccounts) && ( (currentAccount = accountList.next()) !=0 ) ) { |
487 | emit newCaption("Mailit - " + currentAccount->accountName); | 488 | emit newCaption("Mailit - " + currentAccount->accountName); |
488 | getNewMail(); | 489 | getNewMail(); |
489 | return; | 490 | return; |
490 | } else { | 491 | } else { |
491 | allAccounts = FALSE; | 492 | allAccounts = FALSE; |
492 | receiving = FALSE; | 493 | receiving = FALSE; |
493 | getMailButton->setEnabled(TRUE); | 494 | getMailButton->setEnabled(TRUE); |
494 | cancelButton->setEnabled(FALSE); | 495 | cancelButton->setEnabled(FALSE); |
495 | selectAccountMenu->setEnabled(TRUE); | 496 | selectAccountMenu->setEnabled(TRUE); |
496 | status1Label->setText("Idle"); | 497 | status1Label->setText("Idle"); |
497 | 498 | ||
498 | progressBar->reset(); | 499 | progressBar->reset(); |
@@ -621,49 +622,49 @@ void EmailClient::readMail() | |||
621 | QFile fo(getPath(FALSE) + "outbox.txt"); | 622 | QFile fo(getPath(FALSE) + "outbox.txt"); |
622 | if ( fo.open(IO_ReadOnly) ) { // file opened successfully | 623 | if ( fo.open(IO_ReadOnly) ) { // file opened successfully |
623 | QTextStream t( &fo ); // use a text stream | 624 | QTextStream t( &fo ); // use a text stream |
624 | s = t.read(); | 625 | s = t.read(); |
625 | fo.close(); | 626 | fo.close(); |
626 | 627 | ||
627 | start = 0; | 628 | start = 0; |
628 | del = "\n.\n"; | 629 | del = "\n.\n"; |
629 | while ((uint) start < s.length()) { | 630 | while ((uint) start < s.length()) { |
630 | stop = s.find(del, start); | 631 | stop = s.find(del, start); |
631 | if (stop == -1) | 632 | if (stop == -1) |
632 | stop = s.length() - del.length(); | 633 | stop = s.length() - del.length(); |
633 | 634 | ||
634 | mail.rawMail = s.mid(start, stop + del.length() - start ); | 635 | mail.rawMail = s.mid(start, stop + del.length() - start ); |
635 | start = stop + del.length(); | 636 | start = stop + del.length(); |
636 | emailHandler->parse(mail.rawMail, lineShift, &mail); | 637 | emailHandler->parse(mail.rawMail, lineShift, &mail); |
637 | mail.sent = false; | 638 | mail.sent = false; |
638 | mail.received = false; | 639 | mail.received = false; |
639 | enqueMail(mail); | 640 | enqueMail(mail); |
640 | 641 | ||
641 | } | 642 | } |
642 | } | 643 | } |
643 | } | 644 | } |
644 | 645 | ||
645 | void EmailClient::saveMail(QString fileName, QListView *view) | 646 | void EmailClient::saveMail(const QString &fileName, QListView *view) |
646 | { | 647 | { |
647 | QFile f(fileName); | 648 | QFile f(fileName); |
648 | Email *mail; | 649 | Email *mail; |
649 | 650 | ||
650 | if (! f.open(IO_WriteOnly) ) { | 651 | if (! f.open(IO_WriteOnly) ) { |
651 | qWarning("could not open file"); | 652 | qWarning("could not open file"); |
652 | return; | 653 | return; |
653 | } | 654 | } |
654 | item = (EmailListItem *) view->firstChild(); | 655 | item = (EmailListItem *) view->firstChild(); |
655 | QTextStream t(&f); | 656 | QTextStream t(&f); |
656 | while (item != NULL) { | 657 | while (item != NULL) { |
657 | mail = item->getMail(); | 658 | mail = item->getMail(); |
658 | t << mail->rawMail; | 659 | t << mail->rawMail; |
659 | 660 | ||
660 | mailconf->setGroup(mail->id); | 661 | mailconf->setGroup(mail->id); |
661 | mailconf->writeEntry("mailread", mail->read); | 662 | mailconf->writeEntry("mailread", mail->read); |
662 | 663 | ||
663 | item = (EmailListItem *) item->nextSibling(); | 664 | item = (EmailListItem *) item->nextSibling(); |
664 | } | 665 | } |
665 | f.close(); | 666 | f.close(); |
666 | } | 667 | } |
667 | 668 | ||
668 | //paths for mailit, is settings, inbox, enclosures | 669 | //paths for mailit, is settings, inbox, enclosures |
669 | QString EmailClient::getPath(bool enclosurePath) | 670 | QString EmailClient::getPath(bool enclosurePath) |
@@ -691,49 +692,49 @@ void EmailClient::readSettings() | |||
691 | { | 692 | { |
692 | int y,acc_count; | 693 | int y,acc_count; |
693 | 694 | ||
694 | mailconf->setGroup("mailitglobal"); | 695 | mailconf->setGroup("mailitglobal"); |
695 | acc_count=mailconf->readNumEntry("Accounts",0); | 696 | acc_count=mailconf->readNumEntry("Accounts",0); |
696 | 697 | ||
697 | for (int accountPos = 0;accountPos<acc_count ; accountPos++) | 698 | for (int accountPos = 0;accountPos<acc_count ; accountPos++) |
698 | { | 699 | { |
699 | mailconf->setGroup("Account_"+QString::number(accountPos+1)); //Account numbers start at 1 ... | 700 | mailconf->setGroup("Account_"+QString::number(accountPos+1)); //Account numbers start at 1 ... |
700 | account.accountName = mailconf->readEntry("AccName",""); | 701 | account.accountName = mailconf->readEntry("AccName",""); |
701 | account.name = mailconf->readEntry("UserName",""); | 702 | account.name = mailconf->readEntry("UserName",""); |
702 | account.emailAddress = mailconf->readEntry("Email",""); | 703 | account.emailAddress = mailconf->readEntry("Email",""); |
703 | account.popUserName = mailconf->readEntry("POPUser",""); | 704 | account.popUserName = mailconf->readEntry("POPUser",""); |
704 | account.popPasswd = mailconf->readEntryCrypt("POPPassword",""); | 705 | account.popPasswd = mailconf->readEntryCrypt("POPPassword",""); |
705 | account.popServer = mailconf->readEntry("POPServer",""); | 706 | account.popServer = mailconf->readEntry("POPServer",""); |
706 | account.smtpServer = mailconf->readEntry("SMTPServer",""); | 707 | account.smtpServer = mailconf->readEntry("SMTPServer",""); |
707 | account.id = mailconf->readNumEntry("AccountId",0); | 708 | account.id = mailconf->readNumEntry("AccountId",0); |
708 | account.syncLimit = mailconf->readNumEntry("HeaderLimit",0); | 709 | account.syncLimit = mailconf->readNumEntry("HeaderLimit",0); |
709 | account.lastServerMailCount = 0; | 710 | account.lastServerMailCount = 0; |
710 | account.synchronize = FALSE; | 711 | account.synchronize = FALSE; |
711 | 712 | ||
712 | account.synchronize = (mailconf->readEntry("Synchronize","No")=="Yes"); | 713 | account.synchronize = (mailconf->readEntry("Synchronize","No")=="Yes"); |
713 | if (account.synchronize) | 714 | if (account.synchronize) |
714 | { | 715 | { |
715 | mailconf->readNumEntry("LASTSERVERMAILCOUNT",0); | 716 | mailconf->readNumEntry("LASTSERVERMAILCOUNT",0); |
716 | } | 717 | } |
717 | 718 | ||
718 | accountList.append(&account); | 719 | accountList.append(&account); |
719 | } | 720 | } |
720 | 721 | ||
721 | mailconf->setGroup("mailitglobal"); | 722 | mailconf->setGroup("mailitglobal"); |
722 | 723 | ||
723 | if ( (y = mailconf->readNumEntry("mailidcount", -1)) != -1) | 724 | if ( (y = mailconf->readNumEntry("mailidcount", -1)) != -1) |
724 | { | 725 | { |
725 | mailIdCount = y; | 726 | mailIdCount = y; |
726 | } | 727 | } |
727 | if ( (y = mailconf->readNumEntry("accountidcount", -1)) != -1) | 728 | if ( (y = mailconf->readNumEntry("accountidcount", -1)) != -1) |
728 | { | 729 | { |
729 | accountIdCount = y; | 730 | accountIdCount = y; |
730 | } | 731 | } |
731 | } | 732 | } |
732 | 733 | ||
733 | void EmailClient::saveSettings() | 734 | void EmailClient::saveSettings() |
734 | { | 735 | { |
735 | int acc_count=0; | 736 | int acc_count=0; |
736 | MailAccount *accountPtr; | 737 | MailAccount *accountPtr; |
737 | 738 | ||
738 | 739 | ||
739 | if (!mailconf) | 740 | if (!mailconf) |
@@ -894,143 +895,143 @@ void EmailClient::deleteMail(EmailListItem *mailItem, bool &inbox) | |||
894 | void EmailClient::setMailSize(int size) | 895 | void EmailClient::setMailSize(int size) |
895 | { | 896 | { |
896 | progressBar->reset(); | 897 | progressBar->reset(); |
897 | progressBar->setTotalSteps(size); | 898 | progressBar->setTotalSteps(size); |
898 | } | 899 | } |
899 | 900 | ||
900 | void EmailClient::setTotalSize(int size) | 901 | void EmailClient::setTotalSize(int size) |
901 | { | 902 | { |
902 | 903 | ||
903 | } | 904 | } |
904 | 905 | ||
905 | void EmailClient::setDownloadedSize(int size) | 906 | void EmailClient::setDownloadedSize(int size) |
906 | { | 907 | { |
907 | int total = progressBar->totalSteps(); | 908 | int total = progressBar->totalSteps(); |
908 | 909 | ||
909 | if (size < total) { | 910 | if (size < total) { |
910 | progressBar->setProgress(size); | 911 | progressBar->setProgress(size); |
911 | } else { | 912 | } else { |
912 | progressBar->setProgress(total); | 913 | progressBar->setProgress(total); |
913 | } | 914 | } |
914 | } | 915 | } |
915 | 916 | ||
916 | void EmailClient::deleteItem() | 917 | void EmailClient::deleteItem() |
917 | { | 918 | { |
918 | bool inbox=mailboxView->currentTab()==0; | 919 | bool inbox=mailboxView->currentTab()==0; |
919 | QListView* box; | 920 | QListView* box; |
920 | 921 | ||
921 | EmailListItem* eli; | 922 | EmailListItem* eli; |
922 | int pos; | 923 | int pos; |
923 | 924 | ||
924 | inbox ? box=inboxView : box=outboxView; | 925 | inbox ? box=inboxView : box=outboxView; |
925 | 926 | ||
926 | eli=(EmailListItem*)box->selectedItem(); | 927 | eli=(EmailListItem*)box->selectedItem(); |
927 | 928 | ||
928 | if (eli) | 929 | if (eli) |
929 | { | 930 | { |
930 | box->setSelected(eli->itemBelow(),true);//select the previous item | 931 | box->setSelected(eli->itemBelow(),true); //select the previous item |
931 | 932 | ||
932 | deleteMail(eli,(bool&)inbox); //remove mail entry | 933 | deleteMail(eli,(bool&)inbox); //remove mail entry |
933 | } | 934 | } |
934 | } | 935 | } |
935 | 936 | ||
936 | void EmailClient::inboxItemPressed() | 937 | void EmailClient::inboxItemPressed() |
937 | { | 938 | { |
938 | //timerID=startTimer(500); | 939 | // timerID=startTimer(500); |
939 | } | 940 | } |
940 | 941 | ||
941 | void EmailClient::inboxItemReleased() | 942 | void EmailClient::inboxItemReleased() |
942 | { | 943 | { |
943 | //killTimer(timerID); | 944 | // killTimer(timerID); |
944 | } | 945 | } |
945 | 946 | ||
946 | /*void EmailClient::timerEvent(QTimerEvent *e) | 947 | /*void EmailClient::timerEvent(QTimerEvent *e) |
947 | { | 948 | { |
948 | /*killTimer(timerID); | 949 | /*killTimer(timerID); |
949 | 950 | ||
950 | 951 | ||
951 | QPopupMenu *action = new QPopupMenu(this); | 952 | QPopupMenu *action = new QPopupMenu(this); |
952 | 953 | ||
953 | int reply=0; | 954 | int reply=0; |
954 | 955 | ||
955 | action->insertItem(tr( "Reply To" ),this,SLOT(reply())); | 956 | action->insertItem(tr( "Reply To" ),this,SLOT(reply())); |
956 | action->insertItem( tr( "Reply All" ),this,SLOT(replyAll())); | 957 | action->insertItem( tr( "Reply All" ),this,SLOT(replyAll())); |
957 | action->insertItem( tr( "Forward" ), this,SLOT(forward())); | 958 | action->insertItem( tr( "Forward" ), this,SLOT(forward())); |
958 | action->insertItem( tr( "Remove Mail" ), this,SLOT(remove())); | 959 | action->insertItem( tr( "Remove Mail" ), this,SLOT(remove())); |
959 | 960 | ||
960 | action->exec(QCursor::pos()); | 961 | action->exec(QCursor::pos()); |
961 | 962 | ||
962 | if (action) delete action; | 963 | if (action) delete action; |
963 | 964 | ||
964 | }*/ | 965 | }*/ |
965 | 966 | ||
966 | Email* EmailClient::getCurrentMail() | 967 | Email* EmailClient::getCurrentMail() |
967 | { | 968 | { |
968 | EmailListItem *eli=(EmailListItem* ) (inboxView->selectedItem()); | 969 | EmailListItem *eli=(EmailListItem* ) (inboxView->selectedItem()); |
969 | if (eli!=NULL) | 970 | if (eli!=NULL) |
970 | return eli->getMail(); | 971 | return eli->getMail(); |
971 | else | 972 | else |
972 | return NULL; | 973 | return NULL; |
973 | } | 974 | } |
974 | 975 | ||
975 | void EmailClient::download(Email* mail) | 976 | void EmailClient::download(Email* mail) |
976 | { | 977 | { |
977 | MailAccount* acc=0; | 978 | MailAccount* acc=0; |
978 | 979 | ||
979 | tempMailDownloadList.clear(); | 980 | tempMailDownloadList.clear(); |
980 | tempMailDownloadList.sizeInsert(mail->serverId, mail->size); | 981 | tempMailDownloadList.sizeInsert(mail->serverId, mail->size); |
981 | 982 | ||
982 | acc=accountList.at(mail->fromAccountId-1); | 983 | acc=accountList.at(mail->fromAccountId-1); |
983 | if (acc) | 984 | if (acc) |
984 | { | 985 | { |
985 | emailHandler->setAccount(*acc); | 986 | emailHandler->setAccount(*acc); |
986 | emailHandler->getMailByList(&tempMailDownloadList); | 987 | emailHandler->getMailByList(&tempMailDownloadList); |
987 | } | 988 | } |
988 | else | 989 | else |
989 | QMessageBox::warning(qApp->activeWindow(), | 990 | QMessageBox::warning(qApp->activeWindow(), |
990 | tr("No account associated"), tr("There is no active account \nassociated to this mail\n it can not be downloaded"), "Abort\n"); | 991 | tr("No account associated"), tr("There is no active account \nassociated to this mail\n it can not be downloaded"), "Abort\n"); |
991 | } | 992 | } |
992 | 993 | ||
993 | void EmailClient::receive(const QCString& msg, const QByteArray& data) | 994 | void EmailClient::receive(const QCString& msg, const QByteArray& data) |
994 | { | 995 | { |
995 | /*if (msg=="getMail()") | 996 | /*if (msg=="getMail()") |
996 | { | 997 | { |
997 | /*QDialog qd(qApp->activeWindow(),"Getting mail",true); | 998 | /*QDialog qd(qApp->activeWindow(),"Getting mail",true); |
998 | QVBoxLayout *vbProg = new QVBoxLayout( &qd ); | 999 | QVBoxLayout *vbProg = new QVBoxLayout( &qd ); |
999 | 1000 | ||
1000 | initStatusBar(&qd); | 1001 | initStatusBar(&qd); |
1001 | 1002 | ||
1002 | if (statusBar==0) | 1003 | if (statusBar==0) |
1003 | { | 1004 | { |
1004 | qDebug("No Bar ..."); | 1005 | qDebug("No Bar ..."); |
1005 | //statusBar=new ProgressBar(&qd); | 1006 | //statusBar=new ProgressBar(&qd); |
1006 | } | 1007 | } |
1007 | statusBar->show(); | 1008 | statusBar->show(); |
1008 | vbProg->addWidget(statusBar); | 1009 | vbProg->addWidget(statusBar); |
1009 | qd.showMaximized(); | 1010 | qd.showMaximized(); |
1010 | qd.show(); | 1011 | qd.show(); |
1011 | emit getAllNewMail(); | 1012 | emit getAllNewMail(); |
1012 | //qd.exec(); | 1013 | //qd.exec(); |
1013 | } | 1014 | } |
1014 | else if (msg=="compose()") | 1015 | else if (msg=="compose()") |
1015 | { | 1016 | { |
1016 | QDialog qd(qApp->activeWindow(),"Getting mail",true); | 1017 | QDialog qd(qApp->activeWindow(),"Getting mail",true); |
1017 | 1018 | ||
1018 | WriteMail wm(&qd,"write new mail"); | 1019 | WriteMail wm(&qd,"write new mail"); |
1019 | QVBoxLayout vbProg( &qd ); | 1020 | QVBoxLayout vbProg( &qd ); |
1020 | 1021 | ||
1021 | wm.showMaximized(); | 1022 | wm.showMaximized(); |
1022 | vbProg.addWidget(&wm); | 1023 | vbProg.addWidget(&wm); |
1023 | 1024 | ||
1024 | qd.showMaximized(); | 1025 | qd.showMaximized(); |
1025 | 1026 | ||
1026 | emit composeRequested(); | 1027 | emit composeRequested(); |
1027 | qd.exec(); | 1028 | qd.exec(); |
1028 | 1029 | ||
1029 | QMessageBox::warning(qApp->activeWindow(),tr("Info"), tr("Info"), "OK\n"); | 1030 | QMessageBox::warning(qApp->activeWindow(),tr("Info"), tr("Info"), "OK\n"); |
1030 | } | 1031 | } |
1031 | 1032 | ||
1032 | else if (msg=="dialog()") | 1033 | else if (msg=="dialog()") |
1033 | { | 1034 | { |
1034 | QMessageBox::warning(qApp->activeWindow(),tr("Info"), tr("Info"), "OK\n"); | 1035 | QMessageBox::warning(qApp->activeWindow(),tr("Info"), tr("Info"), "OK\n"); |
1035 | }*/ | 1036 | }*/ |
1036 | } | 1037 | } |