-rw-r--r-- | kmicromail/accountitem.cpp | 97 |
1 files changed, 49 insertions, 48 deletions
diff --git a/kmicromail/accountitem.cpp b/kmicromail/accountitem.cpp index 49d86fc..567de87 100644 --- a/kmicromail/accountitem.cpp +++ b/kmicromail/accountitem.cpp | |||
@@ -12,12 +12,13 @@ | |||
12 | //#include <qpe/qpeapplication.h> | 12 | //#include <qpe/qpeapplication.h> |
13 | 13 | ||
14 | /* QT */ | 14 | /* QT */ |
15 | #include <qpopupmenu.h> | 15 | #include <qpopupmenu.h> |
16 | #include <qmessagebox.h> | 16 | #include <qmessagebox.h> |
17 | #include <kiconloader.h> | 17 | #include <kiconloader.h> |
18 | #include <klocale.h> | ||
18 | 19 | ||
19 | #define GET_NEW_MAILS 101 | 20 | #define GET_NEW_MAILS 101 |
20 | 21 | ||
21 | using namespace Opie::Core; | 22 | using namespace Opie::Core; |
22 | #define SETPIX(x) if (!account->getOffline()) {setPixmap( 0,x);} else {setPixmap( 0, PIXMAP_OFFLINE );} | 23 | #define SETPIX(x) if (!account->getOffline()) {setPixmap( 0,x);} else {setPixmap( 0, PIXMAP_OFFLINE );} |
23 | /** | 24 | /** |
@@ -89,20 +90,20 @@ QPopupMenu * POP3viewItem::getContextMenu() | |||
89 | { | 90 | { |
90 | QPopupMenu *m = new QPopupMenu(0); | 91 | QPopupMenu *m = new QPopupMenu(0); |
91 | if (m) | 92 | if (m) |
92 | { | 93 | { |
93 | if (!account->getOffline()) | 94 | if (!account->getOffline()) |
94 | { | 95 | { |
95 | m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS); | 96 | m->insertItem(i18n("Get new messages"),GET_NEW_MAILS); |
96 | m->insertItem(QObject::tr("Disconnect",contextName),0); | 97 | m->insertItem(i18n("Disconnect"),0); |
97 | m->insertItem(QObject::tr("Set offline",contextName),1); | 98 | m->insertItem(i18n("Set offline"),1); |
98 | } | 99 | } |
99 | else | 100 | else |
100 | { | 101 | { |
101 | m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS); | 102 | m->insertItem(i18n("Get new messages"),GET_NEW_MAILS); |
102 | m->insertItem(QObject::tr("Set online",contextName),1); | 103 | m->insertItem(i18n("Set online"),1); |
103 | } | 104 | } |
104 | } | 105 | } |
105 | return m; | 106 | return m; |
106 | } | 107 | } |
107 | 108 | ||
108 | void POP3viewItem::disconnect() | 109 | void POP3viewItem::disconnect() |
@@ -184,16 +185,16 @@ RECBODYP POP3folderItem::fetchBody(const RecMailP&aMail) | |||
184 | 185 | ||
185 | QPopupMenu * POP3folderItem::getContextMenu() | 186 | QPopupMenu * POP3folderItem::getContextMenu() |
186 | { | 187 | { |
187 | QPopupMenu *m = new QPopupMenu(0); | 188 | QPopupMenu *m = new QPopupMenu(0); |
188 | if (m) | 189 | if (m) |
189 | { | 190 | { |
190 | m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS); | 191 | m->insertItem(i18n("Get new messages"),GET_NEW_MAILS); |
191 | m->insertItem(QObject::tr("Refresh header list",contextName),0); | 192 | m->insertItem(i18n("Refresh header list"),0); |
192 | m->insertItem(QObject::tr("Delete all mails",contextName),1); | 193 | m->insertItem(i18n("Delete all mails"),1); |
193 | m->insertItem(QObject::tr("Move/Copie all mails",contextName),2); | 194 | m->insertItem(i18n("Move/Copie all mails"),2); |
194 | } | 195 | } |
195 | return m; | 196 | return m; |
196 | } | 197 | } |
197 | 198 | ||
198 | void POP3folderItem::downloadMails() | 199 | void POP3folderItem::downloadMails() |
199 | { | 200 | { |
@@ -297,19 +298,19 @@ QPopupMenu * NNTPviewItem::getContextMenu() | |||
297 | { | 298 | { |
298 | QPopupMenu *m = new QPopupMenu(0); | 299 | QPopupMenu *m = new QPopupMenu(0); |
299 | if (m) | 300 | if (m) |
300 | { | 301 | { |
301 | if (!account->getOffline()) | 302 | if (!account->getOffline()) |
302 | { | 303 | { |
303 | m->insertItem(QObject::tr("Disconnect",contextName),0); | 304 | m->insertItem(i18n("Disconnect"),0); |
304 | m->insertItem(QObject::tr("Set offline",contextName),1); | 305 | m->insertItem(i18n("Set offline"),1); |
305 | //m->insertItem(QObject::tr("(Un-)Subscribe groups",contextName),2); | 306 | //m->insertItem(i18n("(Un-)Subscribe groups"),2); |
306 | } | 307 | } |
307 | else | 308 | else |
308 | { | 309 | { |
309 | m->insertItem(QObject::tr("Set online",contextName),1); | 310 | m->insertItem(i18n("Set online"),1); |
310 | } | 311 | } |
311 | } | 312 | } |
312 | return m; | 313 | return m; |
313 | } | 314 | } |
314 | 315 | ||
315 | void NNTPviewItem::subscribeGroups() | 316 | void NNTPviewItem::subscribeGroups() |
@@ -393,14 +394,14 @@ RECBODYP NNTPfolderItem::fetchBody(const RecMailP&aMail) | |||
393 | 394 | ||
394 | QPopupMenu * NNTPfolderItem::getContextMenu() | 395 | QPopupMenu * NNTPfolderItem::getContextMenu() |
395 | { | 396 | { |
396 | QPopupMenu *m = new QPopupMenu(0); | 397 | QPopupMenu *m = new QPopupMenu(0); |
397 | if (m) | 398 | if (m) |
398 | { | 399 | { |
399 | m->insertItem(QObject::tr("Refresh header list",contextName),0); | 400 | m->insertItem(i18n("Refresh header list"),0); |
400 | m->insertItem(QObject::tr("Copy all postings",contextName),1); | 401 | m->insertItem(i18n("Copy all postings"),1); |
401 | } | 402 | } |
402 | return m; | 403 | return m; |
403 | } | 404 | } |
404 | 405 | ||
405 | void NNTPfolderItem::downloadMails() | 406 | void NNTPfolderItem::downloadMails() |
406 | { | 407 | { |
@@ -514,24 +515,24 @@ QPopupMenu * IMAPviewItem::getContextMenu() | |||
514 | { | 515 | { |
515 | QPopupMenu *m = new QPopupMenu(0); | 516 | QPopupMenu *m = new QPopupMenu(0); |
516 | if (m) | 517 | if (m) |
517 | { | 518 | { |
518 | if (!account->getOffline()) | 519 | if (!account->getOffline()) |
519 | { | 520 | { |
520 | m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS); | 521 | m->insertItem(i18n("Get new messages"),GET_NEW_MAILS); |
521 | m->insertItem(QObject::tr("Refresh folder list",contextName),0); | 522 | m->insertItem(i18n("Refresh folder list"),0); |
522 | m->insertItem(QObject::tr("Create new folder",contextName),1); | 523 | m->insertItem(i18n("Create new folder"),1); |
523 | m->insertSeparator(); | 524 | m->insertSeparator(); |
524 | m->insertItem(QObject::tr("Disconnect",contextName),2); | 525 | m->insertItem(i18n("Disconnect"),2); |
525 | m->insertItem(QObject::tr("Set offline",contextName),3); | 526 | m->insertItem(i18n("Set offline"),3); |
526 | m->insertSeparator(); | 527 | m->insertSeparator(); |
527 | } | 528 | } |
528 | else | 529 | else |
529 | { | 530 | { |
530 | m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS); | 531 | m->insertItem(i18n("Get new messages"),GET_NEW_MAILS); |
531 | m->insertItem(QObject::tr("Set online",contextName),3); | 532 | m->insertItem(i18n("Set online"),3); |
532 | } | 533 | } |
533 | } | 534 | } |
534 | return m; | 535 | return m; |
535 | } | 536 | } |
536 | 537 | ||
537 | void IMAPviewItem::createNewFolder() | 538 | void IMAPviewItem::createNewFolder() |
@@ -669,24 +670,24 @@ QPopupMenu * IMAPfolderItem::getContextMenu() | |||
669 | { | 670 | { |
670 | QPopupMenu *m = new QPopupMenu(0); | 671 | QPopupMenu *m = new QPopupMenu(0); |
671 | if (m) | 672 | if (m) |
672 | { | 673 | { |
673 | if (folder->may_select()) | 674 | if (folder->may_select()) |
674 | { | 675 | { |
675 | m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS); | 676 | m->insertItem(i18n("Get new messages"),GET_NEW_MAILS); |
676 | m->insertItem(QObject::tr("Refresh header list",contextName),0); | 677 | m->insertItem(i18n("Refresh header list"),0); |
677 | m->insertItem(QObject::tr("Move/Copie all mails",contextName),4); | 678 | m->insertItem(i18n("Move/Copie all mails"),4); |
678 | m->insertItem(QObject::tr("Delete all mails",contextName),1); | 679 | m->insertItem(i18n("Delete all mails"),1); |
679 | } | 680 | } |
680 | if (folder->no_inferior()==false) | 681 | if (folder->no_inferior()==false) |
681 | { | 682 | { |
682 | m->insertItem(QObject::tr("Create new subfolder",contextName),2); | 683 | m->insertItem(i18n("Create new subfolder"),2); |
683 | } | 684 | } |
684 | if (folder->getDisplayName().lower()!="inbox") | 685 | if (folder->getDisplayName().lower()!="inbox") |
685 | { | 686 | { |
686 | m->insertItem(QObject::tr("Delete folder",contextName),3); | 687 | m->insertItem(i18n("Delete folder"),3); |
687 | } | 688 | } |
688 | } | 689 | } |
689 | return m; | 690 | return m; |
690 | } | 691 | } |
691 | 692 | ||
692 | void IMAPfolderItem::createNewFolder() | 693 | void IMAPfolderItem::createNewFolder() |
@@ -704,16 +705,16 @@ void IMAPfolderItem::createNewFolder() | |||
704 | } | 705 | } |
705 | } | 706 | } |
706 | } | 707 | } |
707 | 708 | ||
708 | void IMAPfolderItem::deleteFolder() | 709 | void IMAPfolderItem::deleteFolder() |
709 | { | 710 | { |
710 | int yesno = QMessageBox::warning(0,QObject::tr("Delete folder",contextName), | 711 | int yesno = QMessageBox::warning(0,i18n("Delete folder"), |
711 | QObject::tr("<center>Realy delete folder <br><b>%1</b><br>and all if it content?</center>",contextName).arg(folder->getDisplayName()), | 712 | i18n("<center>Realy delete folder <br><b>%1</b><br>and all if it content?</center>").arg(folder->getDisplayName()), |
712 | QObject::tr("Yes",contextName), | 713 | i18n("Yes"), |
713 | QObject::tr("No",contextName),QString::null,1,1); | 714 | i18n("No"),QString::null,1,1); |
714 | 715 | ||
715 | if (yesno == 0) | 716 | if (yesno == 0) |
716 | { | 717 | { |
717 | if (imap->getWrapper()->deleteMbox(folder)) | 718 | if (imap->getWrapper()->deleteMbox(folder)) |
718 | { | 719 | { |
719 | QListView*v=listView(); | 720 | QListView*v=listView(); |
@@ -854,16 +855,16 @@ RECBODYP MHviewItem::fetchBody( const RecMailP &mail ) | |||
854 | 855 | ||
855 | QPopupMenu * MHviewItem::getContextMenu() | 856 | QPopupMenu * MHviewItem::getContextMenu() |
856 | { | 857 | { |
857 | QPopupMenu *m = new QPopupMenu(0); | 858 | QPopupMenu *m = new QPopupMenu(0); |
858 | if (m) | 859 | if (m) |
859 | { | 860 | { |
860 | m->insertItem(QObject::tr("Refresh folder list",contextName),0); | 861 | m->insertItem(i18n("Refresh folder list"),0); |
861 | m->insertItem(QObject::tr("Create new folder",contextName),1); | 862 | m->insertItem(i18n("Create new folder"),1); |
862 | m->insertItem(QObject::tr("Delete all mails",contextName),2); | 863 | m->insertItem(i18n("Delete all mails"),2); |
863 | m->insertItem(QObject::tr("Move/Copie all mails",contextName),3); | 864 | m->insertItem(i18n("Move/Copie all mails"),3); |
864 | } | 865 | } |
865 | return m; | 866 | return m; |
866 | } | 867 | } |
867 | 868 | ||
868 | void MHviewItem::createFolder() | 869 | void MHviewItem::createFolder() |
869 | { | 870 | { |
@@ -972,16 +973,16 @@ RECBODYP MHfolderItem::fetchBody(const RecMailP&aMail) | |||
972 | { | 973 | { |
973 | return mbox->getWrapper()->fetchBody(aMail); | 974 | return mbox->getWrapper()->fetchBody(aMail); |
974 | } | 975 | } |
975 | 976 | ||
976 | void MHfolderItem::deleteFolder() | 977 | void MHfolderItem::deleteFolder() |
977 | { | 978 | { |
978 | int yesno = QMessageBox::warning(0,QObject::tr("Delete folder",contextName), | 979 | int yesno = QMessageBox::warning(0,i18n("Delete folder"), |
979 | QObject::tr("<center>Realy delete folder <br><b>%1</b><br>and all if it content?</center>",contextName).arg(folder->getDisplayName()), | 980 | i18n("<center>Realy delete folder <br><b>%1</b><br>and all if it content?</center>").arg(folder->getDisplayName()), |
980 | QObject::tr("Yes",contextName), | 981 | i18n("Yes"), |
981 | QObject::tr("No",contextName),QString::null,1,1); | 982 | i18n("No"),QString::null,1,1); |
982 | 983 | ||
983 | if (yesno == 0) | 984 | if (yesno == 0) |
984 | { | 985 | { |
985 | if (mbox->getWrapper()->deleteMbox(folder)) | 986 | if (mbox->getWrapper()->deleteMbox(folder)) |
986 | { | 987 | { |
987 | QListView*v=listView(); | 988 | QListView*v=listView(); |
@@ -999,16 +1000,16 @@ void MHfolderItem::deleteFolder() | |||
999 | 1000 | ||
1000 | QPopupMenu * MHfolderItem::getContextMenu() | 1001 | QPopupMenu * MHfolderItem::getContextMenu() |
1001 | { | 1002 | { |
1002 | QPopupMenu *m = new QPopupMenu(0); | 1003 | QPopupMenu *m = new QPopupMenu(0); |
1003 | if (m) | 1004 | if (m) |
1004 | { | 1005 | { |
1005 | m->insertItem(QObject::tr("Move/Copie all mails",contextName),2); | 1006 | m->insertItem(i18n("Move/Copie all mails"),2); |
1006 | m->insertItem(QObject::tr("Delete all mails",contextName),0); | 1007 | m->insertItem(i18n("Delete all mails"),0); |
1007 | m->insertItem(QObject::tr("Create new subfolder",contextName),3); | 1008 | m->insertItem(i18n("Create new subfolder"),3); |
1008 | m->insertItem(QObject::tr("Delete folder",contextName),1); | 1009 | m->insertItem(i18n("Delete folder"),1); |
1009 | } | 1010 | } |
1010 | return m; | 1011 | return m; |
1011 | } | 1012 | } |
1012 | 1013 | ||
1013 | void MHfolderItem::downloadMails() | 1014 | void MHfolderItem::downloadMails() |
1014 | { | 1015 | { |
@@ -1114,17 +1115,17 @@ AccountView*AccountViewItem::accountView() | |||
1114 | 1115 | ||
1115 | void AccountViewItem::deleteAllMail(AbstractMail*wrapper,const FolderP&folder) | 1116 | void AccountViewItem::deleteAllMail(AbstractMail*wrapper,const FolderP&folder) |
1116 | { | 1117 | { |
1117 | if (!wrapper) return; | 1118 | if (!wrapper) return; |
1118 | QString fname=""; | 1119 | QString fname=""; |
1119 | if (folder) fname = folder->getDisplayName(); | 1120 | if (folder) fname = folder->getDisplayName(); |
1120 | int yesno = QMessageBox::warning(0,QObject::tr("Delete all mails",contextName), | 1121 | int yesno = QMessageBox::warning(0,i18n("Delete all mails"), |
1121 | QObject::tr("<center>Realy delete all mails in box <br>%1</center>",contextName). | 1122 | i18n("<center>Realy delete all mails in box <br>%1</center>"). |
1122 | arg(fname), | 1123 | arg(fname), |
1123 | QObject::tr("Yes",contextName), | 1124 | i18n("Yes"), |
1124 | QObject::tr("No",contextName),QString::null,1,1); | 1125 | i18n("No"),QString::null,1,1); |
1125 | 1126 | ||
1126 | if (yesno == 0) | 1127 | if (yesno == 0) |
1127 | { | 1128 | { |
1128 | if (wrapper->deleteAllMail(folder)) | 1129 | if (wrapper->deleteAllMail(folder)) |
1129 | { | 1130 | { |
1130 | AccountView * view = (AccountView*)listView(); | 1131 | AccountView * view = (AccountView*)listView(); |