summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/plugins/qtopia/resourceqtopia.cpp5
-rw-r--r--kmicromail/accountitem.cpp97
-rw-r--r--kmicromail/accountview.cpp9
-rw-r--r--kmicromail/addresspicker.cpp6
-rw-r--r--kmicromail/composemail.cpp66
-rw-r--r--kmicromail/editaccounts.cpp45
-rw-r--r--kmicromail/libmailwrapper/abstractmail.cpp22
-rw-r--r--kmicromail/libmailwrapper/imapwrapper.cpp58
-rw-r--r--kmicromail/libmailwrapper/mboxwrapper.cpp29
-rw-r--r--kmicromail/libmailwrapper/pop3wrapper.cpp21
-rw-r--r--kmicromail/libmailwrapper/smtpwrapper.cpp59
-rw-r--r--kmicromail/nntpgroupsdlg.cpp3
-rw-r--r--kmicromail/selectsmtp.cpp5
-rw-r--r--kmicromail/viewmail.cpp23
-rw-r--r--kmicromail/viewmailbase.cpp21
15 files changed, 240 insertions, 229 deletions
diff --git a/kabc/plugins/qtopia/resourceqtopia.cpp b/kabc/plugins/qtopia/resourceqtopia.cpp
index 99e8618..d6df981 100644
--- a/kabc/plugins/qtopia/resourceqtopia.cpp
+++ b/kabc/plugins/qtopia/resourceqtopia.cpp
@@ -17,26 +17,27 @@
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21/* 21/*
22Enhanced Version of the file for platform independent KDE tools. 22Enhanced Version of the file for platform independent KDE tools.
23Copyright (c) 2004 Ulf Schenk 23Copyright (c) 2004 Ulf Schenk
24 24
25$Id$ 25$Id$
26*/ 26*/
27#include <sys/types.h> 27#include <sys/types.h>
28#include <sys/stat.h> 28#include <sys/stat.h>
29//#include <unistd.h> 29#ifndef _WIN32_
30 30#include <unistd.h>
31#endif
31#include <qdir.h> 32#include <qdir.h>
32#include <qfile.h> 33#include <qfile.h>
33#include <qtextstream.h> 34#include <qtextstream.h>
34#include <qfileinfo.h> 35#include <qfileinfo.h>
35#include <qregexp.h> 36#include <qregexp.h>
36//US #include <qtimer.h> 37//US #include <qtimer.h>
37 38
38#include <kapplication.h> 39#include <kapplication.h>
39#include <kconfig.h> 40#include <kconfig.h>
40#include <kdebug.h> 41#include <kdebug.h>
41#include <klocale.h> 42#include <klocale.h>
42//US #include <ksavefile.h> 43//US #include <ksavefile.h>
diff --git a/kmicromail/accountitem.cpp b/kmicromail/accountitem.cpp
index 49d86fc..567de87 100644
--- a/kmicromail/accountitem.cpp
+++ b/kmicromail/accountitem.cpp
@@ -6,24 +6,25 @@
6#include "defines.h" 6#include "defines.h"
7 7
8#include <libmailwrapper/mailtypes.h> 8#include <libmailwrapper/mailtypes.h>
9#include <libmailwrapper/abstractmail.h> 9#include <libmailwrapper/abstractmail.h>
10#include <libmailwrapper/mailwrapper.h> 10#include <libmailwrapper/mailwrapper.h>
11/* OPIE */ 11/* OPIE */
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
21using namespace Opie::Core; 22using 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/**
24 * POP3 Account stuff 25 * POP3 Account stuff
25 */ 26 */
26POP3viewItem::POP3viewItem( POP3account *a, AccountView *parent ) 27POP3viewItem::POP3viewItem( POP3account *a, AccountView *parent )
27 : AccountViewItem( parent ) 28 : AccountViewItem( parent )
28{ 29{
29 account = a; 30 account = a;
@@ -83,32 +84,32 @@ RECBODYP POP3viewItem::fetchBody( const RecMailP &mail )
83{ 84{
84 85
85 return wrapper->fetchBody( mail ); 86 return wrapper->fetchBody( mail );
86} 87}
87 88
88QPopupMenu * POP3viewItem::getContextMenu() 89QPopupMenu * 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
108void POP3viewItem::disconnect() 109void POP3viewItem::disconnect()
109{ 110{
110 QListViewItem *child = firstChild(); 111 QListViewItem *child = firstChild();
111 while ( child ) 112 while ( child )
112 { 113 {
113 QListViewItem *tmp = child; 114 QListViewItem *tmp = child;
114 child = child->nextSibling(); 115 child = child->nextSibling();
@@ -178,28 +179,28 @@ void POP3folderItem::refresh(QValueList<RecMailP>&target)
178} 179}
179 180
180RECBODYP POP3folderItem::fetchBody(const RecMailP&aMail) 181RECBODYP POP3folderItem::fetchBody(const RecMailP&aMail)
181{ 182{
182 return pop3->getWrapper()->fetchBody(aMail); 183 return pop3->getWrapper()->fetchBody(aMail);
183} 184}
184 185
185QPopupMenu * POP3folderItem::getContextMenu() 186QPopupMenu * 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
198void POP3folderItem::downloadMails() 199void POP3folderItem::downloadMails()
199{ 200{
200 AccountView*bl = pop3->accountView(); 201 AccountView*bl = pop3->accountView();
201 if (!bl) return; 202 if (!bl) return;
202 bl->downloadMails(folder,pop3->getWrapper()); 203 bl->downloadMails(folder,pop3->getWrapper());
203} 204}
204 205
205void POP3folderItem::contextMenuSelected(int which) 206void POP3folderItem::contextMenuSelected(int which)
@@ -291,31 +292,31 @@ RECBODYP NNTPviewItem::fetchBody( const RecMailP &mail )
291{ 292{
292 293
293 return wrapper->fetchBody( mail ); 294 return wrapper->fetchBody( mail );
294} 295}
295 296
296QPopupMenu * NNTPviewItem::getContextMenu() 297QPopupMenu * 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
315void NNTPviewItem::subscribeGroups() 316void NNTPviewItem::subscribeGroups()
316{ 317{
317 NNTPGroupsDlg dlg(account); 318 NNTPGroupsDlg dlg(account);
318 dlg.showMaximized(); 319 dlg.showMaximized();
319 if ( dlg.exec()== QDialog::Accepted ){ 320 if ( dlg.exec()== QDialog::Accepted ){
320 refresh(); 321 refresh();
321 } 322 }
@@ -387,26 +388,26 @@ void NNTPfolderItem::refresh(QValueList<RecMailP>&target)
387} 388}
388 389
389RECBODYP NNTPfolderItem::fetchBody(const RecMailP&aMail) 390RECBODYP NNTPfolderItem::fetchBody(const RecMailP&aMail)
390{ 391{
391 return nntp->getWrapper()->fetchBody(aMail); 392 return nntp->getWrapper()->fetchBody(aMail);
392} 393}
393 394
394QPopupMenu * NNTPfolderItem::getContextMenu() 395QPopupMenu * 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
405void NNTPfolderItem::downloadMails() 406void NNTPfolderItem::downloadMails()
406{ 407{
407 AccountView*bl = nntp->accountView(); 408 AccountView*bl = nntp->accountView();
408 if (!bl) return; 409 if (!bl) return;
409 bl->downloadMails(folder,nntp->getWrapper()); 410 bl->downloadMails(folder,nntp->getWrapper());
410} 411}
411 412
412void NNTPfolderItem::contextMenuSelected(int which) 413void NNTPfolderItem::contextMenuSelected(int which)
@@ -508,36 +509,36 @@ void IMAPviewItem::refreshFolders(bool force)
508 } 509 }
509 } 510 }
510 delete folders; 511 delete folders;
511} 512}
512 513
513QPopupMenu * IMAPviewItem::getContextMenu() 514QPopupMenu * 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
537void IMAPviewItem::createNewFolder() 538void IMAPviewItem::createNewFolder()
538{ 539{
539 Newmdirdlg ndirdlg; 540 Newmdirdlg ndirdlg;
540 541
541 ndirdlg.showMaximized(); 542 ndirdlg.showMaximized();
542 if ( ndirdlg.exec() ) 543 if ( ndirdlg.exec() )
543 { 544 {
@@ -663,63 +664,63 @@ void IMAPfolderItem::refresh(QValueList<RecMailP>&target)
663RECBODYP IMAPfolderItem::fetchBody(const RecMailP&aMail) 664RECBODYP IMAPfolderItem::fetchBody(const RecMailP&aMail)
664{ 665{
665 return imap->getWrapper()->fetchBody(aMail); 666 return imap->getWrapper()->fetchBody(aMail);
666} 667}
667 668
668QPopupMenu * IMAPfolderItem::getContextMenu() 669QPopupMenu * 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
692void IMAPfolderItem::createNewFolder() 693void IMAPfolderItem::createNewFolder()
693{ 694{
694 Newmdirdlg ndirdlg; 695 Newmdirdlg ndirdlg;
695 ndirdlg.showMaximized(); 696 ndirdlg.showMaximized();
696 if ( ndirdlg.exec() ) 697 if ( ndirdlg.exec() )
697 { 698 {
698 QString ndir = ndirdlg.Newdir(); 699 QString ndir = ndirdlg.Newdir();
699 bool makesubs = ndirdlg.subpossible(); 700 bool makesubs = ndirdlg.subpossible();
700 QString delemiter = Delemiter(); 701 QString delemiter = Delemiter();
701 if (imap->wrapper->createMbox(ndir,folder,delemiter,makesubs)) 702 if (imap->wrapper->createMbox(ndir,folder,delemiter,makesubs))
702 { 703 {
703 imap->refreshFolders(true); 704 imap->refreshFolders(true);
704 } 705 }
705 } 706 }
706} 707}
707 708
708void IMAPfolderItem::deleteFolder() 709void 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();
720 IMAPviewItem * box = imap; 721 IMAPviewItem * box = imap;
721 /* be carefull - after that this object is destroyd so don't use 722 /* be carefull - after that this object is destroyd so don't use
722 * any member of it after that call!!*/ 723 * any member of it after that call!!*/
723 imap->refreshFolders(true); 724 imap->refreshFolders(true);
724 if (v) 725 if (v)
725 { 726 {
@@ -848,28 +849,28 @@ void MHviewItem::refresh(bool force)
848 849
849RECBODYP MHviewItem::fetchBody( const RecMailP &mail ) 850RECBODYP MHviewItem::fetchBody( const RecMailP &mail )
850{ 851{
851 852
852 return wrapper->fetchBody( mail ); 853 return wrapper->fetchBody( mail );
853} 854}
854 855
855QPopupMenu * MHviewItem::getContextMenu() 856QPopupMenu * 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
868void MHviewItem::createFolder() 869void MHviewItem::createFolder()
869{ 870{
870 Newmdirdlg ndirdlg(0,0,true); 871 Newmdirdlg ndirdlg(0,0,true);
871 ndirdlg.showMaximized(); 872 ndirdlg.showMaximized();
872 if ( ndirdlg.exec() ) 873 if ( ndirdlg.exec() )
873 { 874 {
874 QString ndir = ndirdlg.Newdir(); 875 QString ndir = ndirdlg.Newdir();
875 if (wrapper->createMbox(ndir)) 876 if (wrapper->createMbox(ndir))
@@ -966,55 +967,55 @@ void MHfolderItem::refresh(QValueList<RecMailP>&target)
966{ 967{
967 if (folder->may_select()) 968 if (folder->may_select())
968 mbox->getWrapper()->listMessages( folder->getName(),target ); 969 mbox->getWrapper()->listMessages( folder->getName(),target );
969} 970}
970 971
971RECBODYP MHfolderItem::fetchBody(const RecMailP&aMail) 972RECBODYP MHfolderItem::fetchBody(const RecMailP&aMail)
972{ 973{
973 return mbox->getWrapper()->fetchBody(aMail); 974 return mbox->getWrapper()->fetchBody(aMail);
974} 975}
975 976
976void MHfolderItem::deleteFolder() 977void 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();
988 MHviewItem * box = mbox; 989 MHviewItem * box = mbox;
989 /* be carefull - after that this object is destroyd so don't use 990 /* be carefull - after that this object is destroyd so don't use
990 * any member of it after that call!!*/ 991 * any member of it after that call!!*/
991 mbox->refresh(true); 992 mbox->refresh(true);
992 if (v) 993 if (v)
993 { 994 {
994 v->setSelected(box,true); 995 v->setSelected(box,true);
995 } 996 }
996 } 997 }
997 } 998 }
998} 999}
999 1000
1000QPopupMenu * MHfolderItem::getContextMenu() 1001QPopupMenu * 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
1013void MHfolderItem::downloadMails() 1014void MHfolderItem::downloadMails()
1014{ 1015{
1015 AccountView*bl = mbox->accountView(); 1016 AccountView*bl = mbox->accountView();
1016 if (!bl) return; 1017 if (!bl) return;
1017 bl->downloadMails(folder,mbox->getWrapper()); 1018 bl->downloadMails(folder,mbox->getWrapper());
1018} 1019}
1019 1020
1020void MHfolderItem::createFolder() 1021void MHfolderItem::createFolder()
@@ -1108,29 +1109,29 @@ AccountViewItem::~AccountViewItem()
1108} 1109}
1109 1110
1110AccountView*AccountViewItem::accountView() 1111AccountView*AccountViewItem::accountView()
1111{ 1112{
1112 return m_Backlink; 1113 return m_Backlink;
1113} 1114}
1114 1115
1115void AccountViewItem::deleteAllMail(AbstractMail*wrapper,const FolderP&folder) 1116void 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();
1131 if (view) view->refreshCurrent(); 1132 if (view) view->refreshCurrent();
1132 } 1133 }
1133 } 1134 }
1134} 1135}
1135 1136
1136void AccountViewItem::removeChilds() 1137void AccountViewItem::removeChilds()
diff --git a/kmicromail/accountview.cpp b/kmicromail/accountview.cpp
index de8c5bb..c10d384 100644
--- a/kmicromail/accountview.cpp
+++ b/kmicromail/accountview.cpp
@@ -7,24 +7,25 @@
7#include <libmailwrapper/mailwrapper.h> 7#include <libmailwrapper/mailwrapper.h>
8#include <libmailwrapper/mailtypes.h> 8#include <libmailwrapper/mailtypes.h>
9#include <libmailwrapper/abstractmail.h> 9#include <libmailwrapper/abstractmail.h>
10 10
11/* OPIE */ 11/* OPIE */
12#include <qpe/qpeapplication.h> 12#include <qpe/qpeapplication.h>
13 13
14/* QT */ 14/* QT */
15#include <qmessagebox.h> 15#include <qmessagebox.h>
16#include <qpopupmenu.h> 16#include <qpopupmenu.h>
17#include <qcheckbox.h> 17#include <qcheckbox.h>
18#include <qspinbox.h> 18#include <qspinbox.h>
19#include <klocale.h>
19 20
20using namespace Opie::Core; 21using namespace Opie::Core;
21AccountView::AccountView( QWidget *parent, const char *name, WFlags flags ) 22AccountView::AccountView( QWidget *parent, const char *name, WFlags flags )
22 : QListView( parent, name, flags ) 23 : QListView( parent, name, flags )
23{ 24{
24 connect( this, SIGNAL( selectionChanged(QListViewItem*) ), 25 connect( this, SIGNAL( selectionChanged(QListViewItem*) ),
25 SLOT( refresh(QListViewItem*) ) ); 26 SLOT( refresh(QListViewItem*) ) );
26 connect( this, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, 27 connect( this, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this,
27 SLOT( slotHold(int,QListViewItem*,const QPoint&,int) ) ); 28 SLOT( slotHold(int,QListViewItem*,const QPoint&,int) ) );
28 setSorting(0); 29 setSorting(0);
29} 30}
30 31
@@ -147,26 +148,26 @@ void AccountView::downloadMailsInbox(const FolderP&fromFolder,AbstractMail*fromW
147 Selectstore sels; 148 Selectstore sels;
148 setupFolderselect(&sels); 149 setupFolderselect(&sels);
149 if (!sels.exec()) return; 150 if (!sels.exec()) return;
150 targetMail = sels.currentMail(); 151 targetMail = sels.currentMail();
151 targetFolder = sels.currentFolder(); 152 targetFolder = sels.currentFolder();
152 if ( (fromWrapper==targetMail && fromFolder->getName()==targetFolder) || 153 if ( (fromWrapper==targetMail && fromFolder->getName()==targetFolder) ||
153 targetFolder.isEmpty()) 154 targetFolder.isEmpty())
154 { 155 {
155 return; 156 return;
156 } 157 }
157 if (sels.newFolder() && !targetMail->createMbox(targetFolder)) 158 if (sels.newFolder() && !targetMail->createMbox(targetFolder))
158 { 159 {
159 QMessageBox::critical(0,tr("Error creating new Folder"), 160 QMessageBox::critical(0,i18n("Error creating new Folder"),
160 tr("<center>Error while creating<br>new folder - breaking.</center>")); 161 i18n("<center>Error while creating<br>new folder - breaking.</center>"));
161 return; 162 return;
162 } 163 }
163 int maxsize = 0; 164 int maxsize = 0;
164 if ( sels.useSize->isChecked()) 165 if ( sels.useSize->isChecked())
165 maxsize = sels.sizeSpinBox->value(); 166 maxsize = sels.sizeSpinBox->value();
166 fromWrapper->mvcpAllMails(fromFolder,targetFolder,targetMail,sels.moveMails(), maxsize); 167 fromWrapper->mvcpAllMails(fromFolder,targetFolder,targetMail,sels.moveMails(), maxsize);
167#endif 168#endif
168 fromWrapper->downloadNewMails( fromFolder, mhAccounts[0]->getWrapper()); 169 fromWrapper->downloadNewMails( fromFolder, mhAccounts[0]->getWrapper());
169 refreshCurrent(); 170 refreshCurrent();
170 171
171} 172}
172 173
@@ -177,26 +178,26 @@ void AccountView::downloadMails(const FolderP&fromFolder,AbstractMail*fromWrappe
177 Selectstore sels; 178 Selectstore sels;
178 setupFolderselect(&sels); 179 setupFolderselect(&sels);
179 if (!sels.exec()) return; 180 if (!sels.exec()) return;
180 targetMail = sels.currentMail(); 181 targetMail = sels.currentMail();
181 targetFolder = sels.currentFolder(); 182 targetFolder = sels.currentFolder();
182 if ( (fromWrapper==targetMail && fromFolder->getName()==targetFolder) || 183 if ( (fromWrapper==targetMail && fromFolder->getName()==targetFolder) ||
183 targetFolder.isEmpty()) 184 targetFolder.isEmpty())
184 { 185 {
185 return; 186 return;
186 } 187 }
187 if (sels.newFolder() && !targetMail->createMbox(targetFolder)) 188 if (sels.newFolder() && !targetMail->createMbox(targetFolder))
188 { 189 {
189 QMessageBox::critical(0,tr("Error creating new Folder"), 190 QMessageBox::critical(0,i18n("Error creating new Folder"),
190 tr("<center>Error while creating<br>new folder - breaking.</center>")); 191 i18n("<center>Error while creating<br>new folder - breaking.</center>"));
191 return; 192 return;
192 } 193 }
193 int maxsize = 0; 194 int maxsize = 0;
194 if ( sels.useSize->isChecked()) 195 if ( sels.useSize->isChecked())
195 maxsize = sels.sizeSpinBox->value(); 196 maxsize = sels.sizeSpinBox->value();
196 197
197 fromWrapper->mvcpAllMails(fromFolder,targetFolder,targetMail,sels.moveMails(), maxsize); 198 fromWrapper->mvcpAllMails(fromFolder,targetFolder,targetMail,sels.moveMails(), maxsize);
198 refreshCurrent(); 199 refreshCurrent();
199} 200}
200 201
201bool AccountView::currentisDraft() 202bool AccountView::currentisDraft()
202{ 203{
diff --git a/kmicromail/addresspicker.cpp b/kmicromail/addresspicker.cpp
index ec6da49..f4234b4 100644
--- a/kmicromail/addresspicker.cpp
+++ b/kmicromail/addresspicker.cpp
@@ -53,25 +53,25 @@ AddressPicker::AddressPicker( QWidget *parent, const char *name, bool modal, WFl
53 for (;sit!=mails.end();++sit) 53 for (;sit!=mails.end();++sit)
54 { 54 {
55 contactLine=pre+(*sit)+suf; 55 contactLine=pre+(*sit)+suf;
56 addressList->insertItem(contactLine); 56 addressList->insertItem(contactLine);
57 } 57 }
58 } 58 }
59 } 59 }
60 if ( addressList->count() <= 0 ) 60 if ( addressList->count() <= 0 )
61 { 61 {
62#if 0 62#if 0
63 // makes this realy sense?? 63 // makes this realy sense??
64 addressList->insertItem( 64 addressList->insertItem(
65 tr( "There are no entries in the addressbook." ) ); 65 i18n( "There are no entries in the addressbook." ) );
66#endif 66#endif
67 addressList->setEnabled( false ); 67 addressList->setEnabled( false );
68 okButton->setEnabled( false ); 68 okButton->setEnabled( false );
69 } 69 }
70 else 70 else
71 { 71 {
72 // addressList->sort(); 72 // addressList->sort();
73 } 73 }
74#endif 74#endif
75} 75}
76 76
77void AddressPicker::accept() 77void AddressPicker::accept()
@@ -80,26 +80,26 @@ void AddressPicker::accept()
80 QString names; 80 QString names;
81 81
82 while ( item ) 82 while ( item )
83 { 83 {
84 if ( item->selected() ) 84 if ( item->selected() )
85 names += item->text() + ", "; 85 names += item->text() + ", ";
86 item = item->next(); 86 item = item->next();
87 } 87 }
88 names.replace( names.length() - 2, 2, "" ); 88 names.replace( names.length() - 2, 2, "" );
89 89
90 if ( names.isEmpty() ) 90 if ( names.isEmpty() )
91 { 91 {
92 QMessageBox::information(this, tr("Error"), tr("<p>You have to select" 92 QMessageBox::information(this, i18n("Error"), i18n("<p>You have to select"
93 " at least one address entry.</p>"), tr("Ok")); 93 " at least one address entry.</p>"), i18n("Ok"));
94 return; 94 return;
95 } 95 }
96 96
97 selectedNames = names; 97 selectedNames = names;
98 QDialog::accept(); 98 QDialog::accept();
99} 99}
100 100
101QString AddressPicker::getNames() 101QString AddressPicker::getNames()
102{ 102{
103 QString names = 0; 103 QString names = 0;
104 104
105 AddressPicker picker(0, 0, true); 105 AddressPicker picker(0, 0, true);
diff --git a/kmicromail/composemail.cpp b/kmicromail/composemail.cpp
index 946e97d..35ad367 100644
--- a/kmicromail/composemail.cpp
+++ b/kmicromail/composemail.cpp
@@ -43,88 +43,88 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m
43{ 43{
44 mPickLineEdit = 0; 44 mPickLineEdit = 0;
45 connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)), 45 connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)),
46 this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&))); 46 this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&)));
47 settings = s; 47 settings = s;
48 m_replyid = ""; 48 m_replyid = "";
49 if ( KOPrefs::instance()->mUseKapi) { 49 if ( KOPrefs::instance()->mUseKapi) {
50 KConfig config( locateLocal("config", "kabcrc") ); 50 KConfig config( locateLocal("config", "kabcrc") );
51 config.setGroup( "General" ); 51 config.setGroup( "General" );
52 QString whoami_uid = config.readEntry( "WhoAmI" ); 52 QString whoami_uid = config.readEntry( "WhoAmI" );
53 53
54 if ( whoami_uid.isEmpty() ) { 54 if ( whoami_uid.isEmpty() ) {
55 QMessageBox::information( 0, tr( "Hint" ), 55 QMessageBox::information( 0, i18n( "Hint" ),
56 tr( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), 56 i18n( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ),
57 tr( "Ok" ) ); 57 i18n( "Ok" ) );
58 58
59 59
60 fillSettings(); 60 fillSettings();
61 } else 61 } else
62 ExternalAppHandler::instance()->requestDetailsFromKAPI("", "sendbacklist", whoami_uid); 62 ExternalAppHandler::instance()->requestDetailsFromKAPI("", "sendbacklist", whoami_uid);
63 63
64 64
65#ifdef DESKTOP_VERSION 65#ifdef DESKTOP_VERSION
66 KABC::Addressee con = KABC::StdAddressBook::self()->whoAmI( ); 66 KABC::Addressee con = KABC::StdAddressBook::self()->whoAmI( );
67 QStringList mails = con.emails(); 67 QStringList mails = con.emails();
68 QString defmail = con.preferredEmail(); 68 QString defmail = con.preferredEmail();
69 if ( mails.count() == 0) 69 if ( mails.count() == 0)
70 QMessageBox::information( 0, tr( "Hint" ), 70 QMessageBox::information( 0, i18n( "Hint" ),
71 tr( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), 71 i18n( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ),
72 tr( "Ok" ) ); 72 i18n( "Ok" ) );
73 if (defmail.length()!=0) { 73 if (defmail.length()!=0) {
74 fromBox->insertItem(defmail); 74 fromBox->insertItem(defmail);
75 } 75 }
76 QStringList::ConstIterator sit = mails.begin(); 76 QStringList::ConstIterator sit = mails.begin();
77 for (;sit!=mails.end();++sit) { 77 for (;sit!=mails.end();++sit) {
78 if ( (*sit)==defmail) 78 if ( (*sit)==defmail)
79 continue; 79 continue;
80 fromBox->insertItem((*sit)); 80 fromBox->insertItem((*sit));
81 } 81 }
82 senderNameEdit->setText(con.formattedName()); 82 senderNameEdit->setText(con.formattedName());
83#endif 83#endif
84 84
85 } else { 85 } else {
86 fillSettings(); 86 fillSettings();
87 } 87 }
88 checkBoxLater->setChecked( KOPrefs::instance()->mSendLater ); 88 checkBoxLater->setChecked( KOPrefs::instance()->mSendLater );
89 89
90 attList->addColumn( tr( "Name" ) ); 90 attList->addColumn( i18n( "Name" ) );
91 attList->addColumn( tr( "Size" ) ); 91 attList->addColumn( i18n( "Size" ) );
92 QList<Account> accounts = settings->getAccounts(); 92 QList<Account> accounts = settings->getAccounts();
93 93
94 if ( QApplication::desktop()->width() < 320 ) 94 if ( QApplication::desktop()->width() < 320 )
95 smtpAccountBox->setMaximumWidth( 80 ); 95 smtpAccountBox->setMaximumWidth( 80 );
96 Account *it; 96 Account *it;
97 for ( it = accounts.first(); it; it = accounts.next() ) { 97 for ( it = accounts.first(); it; it = accounts.next() ) {
98 if ( it->getType()==MAILLIB::A_SMTP ) { 98 if ( it->getType()==MAILLIB::A_SMTP ) {
99 SMTPaccount *smtp = static_cast<SMTPaccount *>(it); 99 SMTPaccount *smtp = static_cast<SMTPaccount *>(it);
100 smtpAccountBox->insertItem( smtp->getAccountName() ); 100 smtpAccountBox->insertItem( smtp->getAccountName() );
101 smtpAccounts.append( smtp ); 101 smtpAccounts.append( smtp );
102 } 102 }
103 } 103 }
104 connect( toButton, SIGNAL( clicked() ), SLOT( pickAddressTo() ) ); 104 connect( toButton, SIGNAL( clicked() ), SLOT( pickAddressTo() ) );
105 connect( ccButton, SIGNAL( clicked() ), SLOT( pickAddressCC() ) ); 105 connect( ccButton, SIGNAL( clicked() ), SLOT( pickAddressCC() ) );
106 connect( bccButton, SIGNAL( clicked() ), SLOT( pickAddressBCC() ) ); 106 connect( bccButton, SIGNAL( clicked() ), SLOT( pickAddressBCC() ) );
107 connect( replyButton, SIGNAL( clicked() ), SLOT( pickAddressReply() ) ); 107 connect( replyButton, SIGNAL( clicked() ), SLOT( pickAddressReply() ) );
108 connect( addButton, SIGNAL( clicked() ), SLOT( addAttachment() ) ); 108 connect( addButton, SIGNAL( clicked() ), SLOT( addAttachment() ) );
109 connect( deleteButton, SIGNAL( clicked() ), SLOT( removeAttachment() ) ); 109 connect( deleteButton, SIGNAL( clicked() ), SLOT( removeAttachment() ) );
110 connect( SaveButton, SIGNAL( clicked() ), SLOT( saveAsDraft()) ); 110 connect( SaveButton, SIGNAL( clicked() ), SLOT( saveAsDraft()) );
111 mMail = 0; 111 mMail = 0;
112 warnAttach = true; 112 warnAttach = true;
113 if ( smtpAccounts.count() > 0 ) { 113 if ( smtpAccounts.count() > 0 ) {
114 fillValues( smtpAccountBox->currentItem() ); 114 fillValues( smtpAccountBox->currentItem() );
115 } else { 115 } else {
116 QMessageBox::information( 0, tr( "Problem" ), 116 QMessageBox::information( 0, i18n( "Problem" ),
117 tr( "Please create an SMTP account first.\nThe SMTP is needed for sending mail.\n" ), 117 i18n( "Please create an SMTP account first.\nThe SMTP is needed for sending mail.\n" ),
118 tr( "Ok" ) ); 118 i18n( "Ok" ) );
119 return; 119 return;
120 } 120 }
121 connect( smtpAccountBox, SIGNAL( activated(int) ), SLOT( fillValues(int) ) ); 121 connect( smtpAccountBox, SIGNAL( activated(int) ), SLOT( fillValues(int) ) );
122 message->setFont ( KOPrefs::instance()->mComposeFont ); 122 message->setFont ( KOPrefs::instance()->mComposeFont );
123 message->setWordWrap (QMultiLineEdit::WidgetWidth); 123 message->setWordWrap (QMultiLineEdit::WidgetWidth);
124#ifndef DESKTOP_VERSION 124#ifndef DESKTOP_VERSION
125 QPEApplication::setStylusOperation( message, QPEApplication::RightOnHold ); 125 QPEApplication::setStylusOperation( message, QPEApplication::RightOnHold );
126#endif 126#endif
127 127
128} 128}
129 129
130void ComposeMail::fillSettings() 130void ComposeMail::fillSettings()
@@ -163,33 +163,33 @@ void ComposeMail::saveAsDraft()
163 txt.append( sigMultiLine->text() ); 163 txt.append( sigMultiLine->text() );
164 } 164 }
165 mail->setMessage( txt ); 165 mail->setMessage( txt );
166 166
167 /* only use the default drafts folder name! */ 167 /* only use the default drafts folder name! */
168 Storemail wrapper(AbstractMail::draftFolder()); 168 Storemail wrapper(AbstractMail::draftFolder());
169 wrapper.storeMail(mail); 169 wrapper.storeMail(mail);
170 170
171 AttachViewItem *it = (AttachViewItem *) attList->firstChild(); 171 AttachViewItem *it = (AttachViewItem *) attList->firstChild();
172 /* attachments we will ignore! */ 172 /* attachments we will ignore! */
173 if ( it != 0 ) { 173 if ( it != 0 ) {
174 if ( warnAttach ) 174 if ( warnAttach )
175 QMessageBox::warning(0,tr("Store message"), 175 QMessageBox::warning(0,i18n("Store message"),
176 tr("<center>Attachments will not be stored in \"Draft\" folder</center>")); 176 i18n("<center>Attachments will not be stored in \"Draft\" folder</center>"));
177 warnAttach = false; 177 warnAttach = false;
178 } 178 }
179 setStatus( tr("Mail saved as draft!") ); 179 setStatus( i18n("Mail saved as draft!") );
180} 180}
181void ComposeMail::clearStatus() 181void ComposeMail::clearStatus()
182{ 182{
183 topLevelWidget()->setCaption( tr("Compose mail") ); 183 topLevelWidget()->setCaption( i18n("Compose mail") );
184} 184}
185void ComposeMail::setStatus( QString status ) 185void ComposeMail::setStatus( QString status )
186{ 186{
187 topLevelWidget()->setCaption( status ); 187 topLevelWidget()->setCaption( status );
188 QTimer::singleShot ( 10000, this, SLOT( clearStatus() ) ) ; 188 QTimer::singleShot ( 10000, this, SLOT( clearStatus() ) ) ;
189} 189}
190void ComposeMail::pickAddress( ) 190void ComposeMail::pickAddress( )
191{ 191{
192 192
193 QLineEdit *line = mPickLineEdit; 193 QLineEdit *line = mPickLineEdit;
194 if ( line == 0 ) 194 if ( line == 0 )
195 return; 195 return;
@@ -219,27 +219,27 @@ void ComposeMail::pickAddress( )
219 // the result should now arrive through method insertAttendees 219 // the result should now arrive through method insertAttendees
220#endif 220#endif
221} 221}
222//the map includes name/email pairs, that comes from Ka/Pi 222//the map includes name/email pairs, that comes from Ka/Pi
223void ComposeMail::insertAttendees(const QString& uid,const QStringList& nameList,const QStringList& emailList,const QStringList& uidList) 223void ComposeMail::insertAttendees(const QString& uid,const QStringList& nameList,const QStringList& emailList,const QStringList& uidList)
224{ 224{
225 //qDebug("ComposeMail::insertAttendees "); 225 //qDebug("ComposeMail::insertAttendees ");
226 raise(); 226 raise();
227 227
228 if ( mPickLineEdit == 0 ) { //whoami received 228 if ( mPickLineEdit == 0 ) { //whoami received
229 QString defmail = uidList[0]; 229 QString defmail = uidList[0];
230 if ( emailList.count() == 0 ) 230 if ( emailList.count() == 0 )
231 QMessageBox::information( 0, tr( "Hint" ), 231 QMessageBox::information( 0, i18n( "Hint" ),
232 tr( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), 232 i18n( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ),
233 tr( "Ok" ) ); 233 i18n( "Ok" ) );
234 if (defmail.length()!=0) { 234 if (defmail.length()!=0) {
235 fromBox->insertItem(defmail); 235 fromBox->insertItem(defmail);
236 } 236 }
237 QStringList::ConstIterator sit = emailList.begin(); 237 QStringList::ConstIterator sit = emailList.begin();
238 int pref = 0; 238 int pref = 0;
239 for (;sit!=emailList.end();++sit) { 239 for (;sit!=emailList.end();++sit) {
240 if ( (*sit)==defmail) 240 if ( (*sit)==defmail)
241 continue; 241 continue;
242 fromBox->insertItem((*sit)); 242 fromBox->insertItem((*sit));
243 } 243 }
244 senderNameEdit->setText(nameList[0]); 244 senderNameEdit->setText(nameList[0]);
245 return; 245 return;
@@ -346,64 +346,64 @@ void ComposeMail::slotAdjustColumns()
346void ComposeMail::addAttachment() 346void ComposeMail::addAttachment()
347{ 347{
348 QString lnk = KFileDialog::getOpenFileName( "", "Add Attachment", this ); 348 QString lnk = KFileDialog::getOpenFileName( "", "Add Attachment", this );
349 if ( !lnk.isEmpty() ) { 349 if ( !lnk.isEmpty() ) {
350 Attachment *att = new Attachment( lnk ); 350 Attachment *att = new Attachment( lnk );
351 (void) new AttachViewItem( attList, att ); 351 (void) new AttachViewItem( attList, att );
352 } 352 }
353} 353}
354 354
355void ComposeMail::removeAttachment() 355void ComposeMail::removeAttachment()
356{ 356{
357 if ( !attList->currentItem() ) { 357 if ( !attList->currentItem() ) {
358 QMessageBox::information( this, tr( "Error" ), 358 QMessageBox::information( this, i18n( "Error" ),
359 tr( "<p>Please select a File.</p>" ), 359 i18n( "<p>Please select a File.</p>" ),
360 tr( "Ok" ) ); 360 i18n( "Ok" ) );
361 } else { 361 } else {
362 attList->takeItem( attList->currentItem() ); 362 attList->takeItem( attList->currentItem() );
363 } 363 }
364} 364}
365 365
366void ComposeMail::accept() 366void ComposeMail::accept()
367{ 367{
368 if ( smtpAccountBox->count() == 0 ) { 368 if ( smtpAccountBox->count() == 0 ) {
369 369
370 reject(); 370 reject();
371 return; 371 return;
372 } 372 }
373 373
374 if (! checkBoxLater->isChecked() ) { 374 if (! checkBoxLater->isChecked() ) {
375 int yesno = QMessageBox::warning(0,tr("Stop editing message"), 375 int yesno = QMessageBox::warning(0,i18n("Stop editing message"),
376 tr("Send this message?"), 376 i18n("Send this message?"),
377 tr("Yes"), 377 i18n("Yes"),
378 tr("Cancel")); 378 i18n("Cancel"));
379 379
380 if (yesno == 1) { 380 if (yesno == 1) {
381 return; 381 return;
382 } 382 }
383 } 383 }
384#if 0 384#if 0
385 odebug << "Sending Mail with " 385 odebug << "Sending Mail with "
386 << smtpAccounts.at( smtpAccountBox->currentItem() )->getAccountName() << oendl; 386 << smtpAccounts.at( smtpAccountBox->currentItem() )->getAccountName() << oendl;
387#endif 387#endif
388 Opie::Core::OSmartPointer<Mail> mail=new Mail; 388 Opie::Core::OSmartPointer<Mail> mail=new Mail;
389 389
390 SMTPaccount *smtp = smtpAccounts.at( smtpAccountBox->currentItem() ); 390 SMTPaccount *smtp = smtpAccounts.at( smtpAccountBox->currentItem() );
391 mail->setMail(fromBox->currentText()); 391 mail->setMail(fromBox->currentText());
392 392
393 if ( !toLine->text().isEmpty() ) { 393 if ( !toLine->text().isEmpty() ) {
394 mail->setTo( toLine->text() ); 394 mail->setTo( toLine->text() );
395 } else { 395 } else {
396 QMessageBox::warning(0,tr("Sending mail"), 396 QMessageBox::warning(0,i18n("Sending mail"),
397 tr("No Receiver spezified" ) ); 397 i18n("No Receiver spezified" ) );
398 return; 398 return;
399 } 399 }
400 400
401 mail->setName(senderNameEdit->text()); 401 mail->setName(senderNameEdit->text());
402 mail->setCC( ccLine->text() ); 402 mail->setCC( ccLine->text() );
403 mail->setBCC( bccLine->text() ); 403 mail->setBCC( bccLine->text() );
404 mail->setReply( replyLine->text() ); 404 mail->setReply( replyLine->text() );
405 mail->setSubject( subjectLine->text() ); 405 mail->setSubject( subjectLine->text() );
406 if (!m_replyid.isEmpty()) { 406 if (!m_replyid.isEmpty()) {
407 QStringList ids; 407 QStringList ids;
408 ids.append(m_replyid); 408 ids.append(m_replyid);
409 mail->setInreply(ids); 409 mail->setInreply(ids);
@@ -426,34 +426,34 @@ void ComposeMail::accept()
426 else { 426 else {
427 setStatus( tr ("Error: Something went wrong. Nothing sent")); 427 setStatus( tr ("Error: Something went wrong. Nothing sent"));
428 return; 428 return;
429 } 429 }
430 430
431 431
432 QDialog::accept(); 432 QDialog::accept();
433} 433}
434 434
435void ComposeMail::reject() 435void ComposeMail::reject()
436{ 436{
437 //qDebug("ComposeMail::reject() "); 437 //qDebug("ComposeMail::reject() ");
438 int yesno = QMessageBox::warning(0,tr("Store message?"), 438 int yesno = QMessageBox::warning(0,i18n("Store message?"),
439 tr("Store message into drafts?\n"), 439 i18n("Store message into drafts?\n"),
440 tr("Yes"), 440 i18n("Yes"),
441 tr("No")); 441 i18n("No"));
442 442
443 //qDebug("button %d ", yesno); 443 //qDebug("button %d ", yesno);
444 if (yesno == 0) { 444 if (yesno == 0) {
445 if ( toLine->text().isEmpty() ) { 445 if ( toLine->text().isEmpty() ) {
446 QMessageBox::warning(0,tr("Sending mail"), 446 QMessageBox::warning(0,i18n("Sending mail"),
447 tr("No Receiver spezified" ) ); 447 i18n("No Receiver spezified" ) );
448 return; 448 return;
449 } 449 }
450 saveAsDraft(); 450 saveAsDraft();
451 } 451 }
452 if (yesno == 2) { 452 if (yesno == 2) {
453 qDebug("return "); 453 qDebug("return ");
454 return; 454 return;
455 } 455 }
456 QDialog::reject(); 456 QDialog::reject();
457} 457}
458 458
459ComposeMail::~ComposeMail() 459ComposeMail::~ComposeMail()
diff --git a/kmicromail/editaccounts.cpp b/kmicromail/editaccounts.cpp
index 733e38a..7ad4ec8 100644
--- a/kmicromail/editaccounts.cpp
+++ b/kmicromail/editaccounts.cpp
@@ -8,24 +8,25 @@
8/* QT */ 8/* QT */
9#include <qstringlist.h> 9#include <qstringlist.h>
10 10
11#include <qcombobox.h> 11#include <qcombobox.h>
12#include <qcheckbox.h> 12#include <qcheckbox.h>
13#include <qmessagebox.h> 13#include <qmessagebox.h>
14#include <qpushbutton.h> 14#include <qpushbutton.h>
15#include <qlineedit.h> 15#include <qlineedit.h>
16#include <qlabel.h> 16#include <qlabel.h>
17#include <qtabwidget.h> 17#include <qtabwidget.h>
18#include <qlistview.h> 18#include <qlistview.h>
19#include <qspinbox.h> 19#include <qspinbox.h>
20#include <klocale.h>
20 21
21#include <libmailwrapper/nntpwrapper.h> 22#include <libmailwrapper/nntpwrapper.h>
22 23
23using namespace Opie::Core; 24using namespace Opie::Core;
24 25
25AccountListItem::AccountListItem( QListView *parent, Account *a) 26AccountListItem::AccountListItem( QListView *parent, Account *a)
26 : QListViewItem( parent ) 27 : QListViewItem( parent )
27{ 28{
28 account = a; 29 account = a;
29 setText( 0, account->getAccountName() ); 30 setText( 0, account->getAccountName() );
30 QString ttext = ""; 31 QString ttext = "";
31 switch (account->getType()) { 32 switch (account->getType()) {
@@ -44,28 +45,28 @@ AccountListItem::AccountListItem( QListView *parent, Account *a)
44 default: 45 default:
45 ttext = "UNKNOWN"; 46 ttext = "UNKNOWN";
46 break; 47 break;
47 } 48 }
48 setText( 1, ttext); 49 setText( 1, ttext);
49} 50}
50 51
51EditAccounts::EditAccounts( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags ) 52EditAccounts::EditAccounts( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags )
52 : EditAccountsUI( parent, name, modal, flags ) 53 : EditAccountsUI( parent, name, modal, flags )
53{ 54{
54 settings = s; 55 settings = s;
55 56
56 mailList->addColumn( tr( "Account" ) ); 57 mailList->addColumn( i18n( "Account" ) );
57 mailList->addColumn( tr( "Type" ) ); 58 mailList->addColumn( i18n( "Type" ) );
58 59
59 newsList->addColumn( tr( "Account" ) ); 60 newsList->addColumn( i18n( "Account" ) );
60 61
61 connect( newMail, SIGNAL( clicked() ), SLOT( slotNewMail() ) ); 62 connect( newMail, SIGNAL( clicked() ), SLOT( slotNewMail() ) );
62 connect( editMail, SIGNAL( clicked() ), SLOT( slotEditMail() ) ); 63 connect( editMail, SIGNAL( clicked() ), SLOT( slotEditMail() ) );
63 connect( deleteMail, SIGNAL( clicked() ), SLOT( slotDeleteMail() ) ); 64 connect( deleteMail, SIGNAL( clicked() ), SLOT( slotDeleteMail() ) );
64 connect( newNews, SIGNAL( clicked() ), SLOT( slotNewNews() ) ); 65 connect( newNews, SIGNAL( clicked() ), SLOT( slotNewNews() ) );
65 connect( editNews, SIGNAL( clicked() ), SLOT( slotEditNews() ) ); 66 connect( editNews, SIGNAL( clicked() ), SLOT( slotEditNews() ) );
66 connect( deleteNews, SIGNAL( clicked() ), SLOT( slotDeleteNews() ) ); 67 connect( deleteNews, SIGNAL( clicked() ), SLOT( slotDeleteNews() ) );
67 68
68 slotFillLists(); 69 slotFillLists();
69} 70}
70 71
71void EditAccounts::slotFillLists() 72void EditAccounts::slotFillLists()
@@ -198,87 +199,87 @@ void EditAccounts::slotEditAccount( Account *account )
198 { 199 {
199 NNTPaccount *nntpAcc = static_cast<NNTPaccount *>(account); 200 NNTPaccount *nntpAcc = static_cast<NNTPaccount *>(account);
200 NNTPconfig nntp( nntpAcc, this, 0, true, WStyle_ContextHelp ); 201 NNTPconfig nntp( nntpAcc, this, 0, true, WStyle_ContextHelp );
201 if ( QDialog::Accepted == KApplication::execDialog( &nntp ) ) 202 if ( QDialog::Accepted == KApplication::execDialog( &nntp ) )
202 { 203 {
203 slotFillLists(); 204 slotFillLists();
204 } 205 }
205 } 206 }
206} 207}
207 208
208void EditAccounts::slotDeleteAccount( Account *account ) 209void EditAccounts::slotDeleteAccount( Account *account )
209{ 210{
210 if ( QMessageBox::information( this, tr( "Question" ), 211 if ( QMessageBox::information( this, i18n( "Question" ),
211 tr( "<p>Do you really want to delete the selected Account?</p>" ), 212 i18n( "<p>Do you really want to delete the selected Account?</p>" ),
212 tr( "Yes" ), tr( "No" ) ) == 0 ) 213 i18n( "Yes" ), i18n( "No" ) ) == 0 )
213 { 214 {
214 settings->delAccount( account ); 215 settings->delAccount( account );
215 slotFillLists(); 216 slotFillLists();
216 } 217 }
217} 218}
218 219
219void EditAccounts::slotEditMail() 220void EditAccounts::slotEditMail()
220{ 221{
221 if ( !mailList->currentItem() ) 222 if ( !mailList->currentItem() )
222 { 223 {
223 QMessageBox::information( this, tr( "Error" ), 224 QMessageBox::information( this, i18n( "Error" ),
224 tr( "<p>Please select an account.</p>" ), 225 i18n( "<p>Please select an account.</p>" ),
225 tr( "Ok" ) ); 226 i18n( "Ok" ) );
226 return; 227 return;
227 } 228 }
228 229
229 Account *a = ((AccountListItem *) mailList->currentItem())->getAccount(); 230 Account *a = ((AccountListItem *) mailList->currentItem())->getAccount();
230 slotEditAccount( a ); 231 slotEditAccount( a );
231} 232}
232 233
233void EditAccounts::slotDeleteMail() 234void EditAccounts::slotDeleteMail()
234{ 235{
235 if ( !mailList->currentItem() ) 236 if ( !mailList->currentItem() )
236 { 237 {
237 QMessageBox::information( this, tr( "Error" ), 238 QMessageBox::information( this, i18n( "Error" ),
238 tr( "<p>Please select an account.</p>" ), 239 i18n( "<p>Please select an account.</p>" ),
239 tr( "Ok" ) ); 240 i18n( "Ok" ) );
240 return; 241 return;
241 } 242 }
242 243
243 Account *a = ((AccountListItem *) mailList->currentItem())->getAccount(); 244 Account *a = ((AccountListItem *) mailList->currentItem())->getAccount();
244 slotDeleteAccount( a ); 245 slotDeleteAccount( a );
245} 246}
246 247
247void EditAccounts::slotNewNews() 248void EditAccounts::slotNewNews()
248{ 249{
249 slotNewAccount( "NNTP" ); 250 slotNewAccount( "NNTP" );
250} 251}
251 252
252void EditAccounts::slotEditNews() 253void EditAccounts::slotEditNews()
253{ 254{
254 if ( !newsList->currentItem() ) 255 if ( !newsList->currentItem() )
255 { 256 {
256 QMessageBox::information( this, tr( "Error" ), 257 QMessageBox::information( this, i18n( "Error" ),
257 tr( "<p>Please select an account.</p>" ), 258 i18n( "<p>Please select an account.</p>" ),
258 tr( "Ok" ) ); 259 i18n( "Ok" ) );
259 return; 260 return;
260 } 261 }
261 262
262 Account *a = ((AccountListItem *) newsList->currentItem())->getAccount(); 263 Account *a = ((AccountListItem *) newsList->currentItem())->getAccount();
263 slotEditAccount( a ); 264 slotEditAccount( a );
264} 265}
265 266
266void EditAccounts::slotDeleteNews() 267void EditAccounts::slotDeleteNews()
267{ 268{
268 if ( !newsList->currentItem() ) 269 if ( !newsList->currentItem() )
269 { 270 {
270 QMessageBox::information( this, tr( "Error" ), 271 QMessageBox::information( this, i18n( "Error" ),
271 tr( "<p>Please select an account.</p>" ), 272 i18n( "<p>Please select an account.</p>" ),
272 tr( "Ok" ) ); 273 i18n( "Ok" ) );
273 return; 274 return;
274 } 275 }
275 276
276 Account *a = ((AccountListItem *) newsList->currentItem())->getAccount(); 277 Account *a = ((AccountListItem *) newsList->currentItem())->getAccount();
277 slotDeleteAccount( a ); 278 slotDeleteAccount( a );
278} 279}
279 280
280void EditAccounts::slotAdjustColumns() 281void EditAccounts::slotAdjustColumns()
281{ 282{
282 int currPage = configTab->currentPageIndex(); 283 int currPage = configTab->currentPageIndex();
283 284
284 configTab->showPage( mailTab ); 285 configTab->showPage( mailTab );
@@ -546,52 +547,52 @@ NNTPconfig::NNTPconfig( NNTPaccount *account, QWidget *parent, const char *name,
546} 547}
547 548
548void NNTPconfig::slotShowSub() 549void NNTPconfig::slotShowSub()
549{ 550{
550 save(); 551 save();
551 data->save(); 552 data->save();
552 ListViewGroups->clear(); 553 ListViewGroups->clear();
553 for ( QStringList::Iterator it = subscribedGroups.begin(); it != subscribedGroups.end(); ++it ) { 554 for ( QStringList::Iterator it = subscribedGroups.begin(); it != subscribedGroups.end(); ++it ) {
554 QCheckListItem *item; 555 QCheckListItem *item;
555 item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox ); 556 item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox );
556 item->setOn( true ); 557 item->setOn( true );
557 } 558 }
558 topLevelWidget()->setCaption( tr("%1 groups subscribed").arg( subscribedGroups.count())); 559 topLevelWidget()->setCaption( i18n("%1 groups subscribed").arg( subscribedGroups.count()));
559} 560}
560void NNTPconfig::slotShowFilter() 561void NNTPconfig::slotShowFilter()
561{ 562{
562 save(); 563 save();
563 data->save(); 564 data->save();
564 ListViewGroups->clear(); 565 ListViewGroups->clear();
565 int count = 0; 566 int count = 0;
566 for ( QStringList::Iterator it = allGroups.begin(); it != allGroups.end(); ++it ) { 567 for ( QStringList::Iterator it = allGroups.begin(); it != allGroups.end(); ++it ) {
567 QCheckListItem *item; 568 QCheckListItem *item;
568 if ( GroupFilter->text().isEmpty() || (*it).find( GroupFilter->text() ) >= 0 ) { 569 if ( GroupFilter->text().isEmpty() || (*it).find( GroupFilter->text() ) >= 0 ) {
569 item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox ); 570 item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox );
570 ++count; 571 ++count;
571 if ( subscribedGroups.contains( (*it) ) >= 1 ) { 572 if ( subscribedGroups.contains( (*it) ) >= 1 ) {
572 item->setOn( true ); 573 item->setOn( true );
573 } 574 }
574 } 575 }
575 } 576 }
576 topLevelWidget()->setCaption( tr("Filter found %1 groups").arg( count)); 577 topLevelWidget()->setCaption( i18n("Filter found %1 groups").arg( count));
577} 578}
578void NNTPconfig::slotGetNG() { 579void NNTPconfig::slotGetNG() {
579 save(); 580 save();
580 data->save(); 581 data->save();
581 topLevelWidget()->setCaption( tr("Fetching group list...")); 582 topLevelWidget()->setCaption( i18n("Fetching group list..."));
582 qApp->processEvents(); 583 qApp->processEvents();
583 NNTPwrapper* tmp = new NNTPwrapper( data ); 584 NNTPwrapper* tmp = new NNTPwrapper( data );
584 allGroups = tmp->listAllNewsgroups(); 585 allGroups = tmp->listAllNewsgroups();
585 topLevelWidget()->setCaption( tr("Downloaded %1 group names").arg( allGroups.count())); 586 topLevelWidget()->setCaption( i18n("Downloaded %1 group names").arg( allGroups.count()));
586 587
587 ListViewGroups->clear(); 588 ListViewGroups->clear();
588 589
589 for ( QStringList::Iterator it = allGroups.begin(); it != allGroups.end(); ++it ) { 590 for ( QStringList::Iterator it = allGroups.begin(); it != allGroups.end(); ++it ) {
590 QCheckListItem *item; 591 QCheckListItem *item;
591 item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox ); 592 item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox );
592 if ( subscribedGroups.contains( (*it) ) >= 1 ) { 593 if ( subscribedGroups.contains( (*it) ) >= 1 ) {
593 item->setOn( true ); 594 item->setOn( true );
594 595
595 } 596 }
596 } 597 }
597 delete tmp; 598 delete tmp;
diff --git a/kmicromail/libmailwrapper/abstractmail.cpp b/kmicromail/libmailwrapper/abstractmail.cpp
index 2d7533c..8ee112c 100644
--- a/kmicromail/libmailwrapper/abstractmail.cpp
+++ b/kmicromail/libmailwrapper/abstractmail.cpp
@@ -2,25 +2,25 @@
2#include "abstractmail.h" 2#include "abstractmail.h"
3#include "imapwrapper.h" 3#include "imapwrapper.h"
4#include "pop3wrapper.h" 4#include "pop3wrapper.h"
5#include "nntpwrapper.h" 5#include "nntpwrapper.h"
6#include "mhwrapper.h" 6#include "mhwrapper.h"
7#include "mailtypes.h" 7#include "mailtypes.h"
8#include <qpe/global.h> 8#include <qpe/global.h>
9 9
10 10
11#include <qprogressbar.h> 11#include <qprogressbar.h>
12#include <qapplication.h> 12#include <qapplication.h>
13#include <qmessagebox.h> 13#include <qmessagebox.h>
14 14#include <klocale.h>
15#include <kdecore/kstandarddirs.h> 15#include <kdecore/kstandarddirs.h>
16#include <qfile.h> 16#include <qfile.h>
17#include <qtextstream.h> 17#include <qtextstream.h>
18#include <stdlib.h> 18#include <stdlib.h>
19#include <libetpan/mailmime_content.h> 19#include <libetpan/mailmime_content.h>
20#include <libetpan/mailmime.h> 20#include <libetpan/mailmime.h>
21 21
22using namespace Opie::Core; 22using namespace Opie::Core;
23AbstractMail* AbstractMail::getWrapper(IMAPaccount *a) 23AbstractMail* AbstractMail::getWrapper(IMAPaccount *a)
24{ 24{
25 return new IMAPwrapper(a); 25 return new IMAPwrapper(a);
26} 26}
@@ -138,58 +138,58 @@ QString AbstractMail::draftFolder()
138 138
139/* temporary - will be removed when implemented in all classes */ 139/* temporary - will be removed when implemented in all classes */
140void AbstractMail::deleteMails(const QString &,const QValueList<Opie::Core::OSmartPointer<RecMail> > &) 140void AbstractMail::deleteMails(const QString &,const QValueList<Opie::Core::OSmartPointer<RecMail> > &)
141{ 141{
142} 142}
143void AbstractMail::deleteMailList(const QValueList<RecMailP>&target) 143void AbstractMail::deleteMailList(const QValueList<RecMailP>&target)
144{ 144{
145 //qDebug("AbstractMail::deleteMailList:: Please reimplement! "); 145 //qDebug("AbstractMail::deleteMailList:: Please reimplement! ");
146 // this is currently re-implemented in pop3wrapper and imapwrapper 146 // this is currently re-implemented in pop3wrapper and imapwrapper
147 int iii = 0; 147 int iii = 0;
148 int count = target.count(); 148 int count = target.count();
149 QProgressBar wid ( count ); 149 QProgressBar wid ( count );
150 wid.setCaption( tr("Deleting ...")); 150 wid.setCaption( i18n("Deleting ..."));
151 wid.show(); 151 wid.show();
152 while (iii < count ) { 152 while (iii < count ) {
153 Global::statusMessage(tr("Delete message %1 of %2").arg(iii).arg(count)); 153 Global::statusMessage(i18n("Delete message %1 of %2").arg(iii).arg(count));
154 wid.setProgress( iii ); 154 wid.setProgress( iii );
155 wid.raise(); 155 wid.raise();
156 qApp->processEvents(); 156 qApp->processEvents();
157 RecMailP mail = (*target.at( iii )); 157 RecMailP mail = (*target.at( iii ));
158 deleteMail(mail); 158 deleteMail(mail);
159 ++iii; 159 ++iii;
160 } 160 }
161} 161}
162 162
163void AbstractMail::downloadNewMails(const FolderP&fromFolder, AbstractMail*targetMail ) 163void AbstractMail::downloadNewMails(const FolderP&fromFolder, AbstractMail*targetMail )
164{ 164{
165 //qDebug("AbstractMail::downloadNewMails %s ", fromFolder->getName().latin1()); 165 //qDebug("AbstractMail::downloadNewMails %s ", fromFolder->getName().latin1());
166 // get local folder 166 // get local folder
167 Account * acc = getAccount(); 167 Account * acc = getAccount();
168 if ( !acc ) return; 168 if ( !acc ) return;
169 QString lfName = acc->getLocalFolder(); 169 QString lfName = acc->getLocalFolder();
170 if ( lfName.isEmpty() ) 170 if ( lfName.isEmpty() )
171 lfName = acc->getAccountName(); 171 lfName = acc->getAccountName();
172 // create local folder 172 // create local folder
173 if ( !targetMail->createMbox(lfName)) 173 if ( !targetMail->createMbox(lfName))
174 { 174 {
175 QMessageBox::critical(0,tr("Error creating new Folder"), 175 QMessageBox::critical(0,i18n("Error creating new Folder"),
176 tr("Error while creating new folder\n%1\n\nCancelling action.").arg(lfName)); 176 i18n("Error while creating new folder\n%1\n\nCancelling action.").arg(lfName));
177 return; 177 return;
178 } 178 }
179 QValueList<RecMailP> t; 179 QValueList<RecMailP> t;
180 listMessages(fromFolder->getName(),t,acc->getMaxMailSize() ); 180 listMessages(fromFolder->getName(),t,acc->getMaxMailSize() );
181 if ( t.count() == 0 ) { 181 if ( t.count() == 0 ) {
182 qDebug("There are no new messages %s", fromFolder->getName().latin1()); 182 qDebug("There are no new messages %s", fromFolder->getName().latin1());
183 Global::statusMessage(tr("There are no new messages")); 183 Global::statusMessage(i18n("There are no new messages"));
184 return; 184 return;
185 } 185 }
186 QValueList<RecMailP> e; 186 QValueList<RecMailP> e;
187 targetMail->listMessages(lfName,e,acc->getMaxMailSize() ); 187 targetMail->listMessages(lfName,e,acc->getMaxMailSize() );
188 //qDebug("target has mails %d ", e.count()); 188 //qDebug("target has mails %d ", e.count());
189 QValueList<RecMailP> n; 189 QValueList<RecMailP> n;
190 int iii = 0; 190 int iii = 0;
191 int count = t.count(); 191 int count = t.count();
192 while (iii < count ) { 192 while (iii < count ) {
193 RecMailP r = (*t.at( iii )); 193 RecMailP r = (*t.at( iii ));
194 bool found = false; 194 bool found = false;
195 int jjj = 0; 195 int jjj = 0;
@@ -201,29 +201,29 @@ void AbstractMail::downloadNewMails(const FolderP&fromFolder, AbstractMail*targe
201 break; 201 break;
202 } 202 }
203 ++jjj; 203 ++jjj;
204 } 204 }
205 if ( !found ) { 205 if ( !found ) {
206 //qDebug("AAAdate *%s* ", r->isodate.latin1() ); 206 //qDebug("AAAdate *%s* ", r->isodate.latin1() );
207 n.append( r ); 207 n.append( r );
208 } 208 }
209 ++iii; 209 ++iii;
210 } 210 }
211 qDebug("Downloaded %d messages ",n.count() ); 211 qDebug("Downloaded %d messages ",n.count() );
212 if ( n.count() == 0 ) { 212 if ( n.count() == 0 ) {
213 Global::statusMessage(tr("There are no new messages")); 213 Global::statusMessage(i18n("There are no new messages"));
214 return; 214 return;
215 } 215 }
216 mvcpMailList( n,lfName,targetMail,!acc->getLeaveOnServer()); 216 mvcpMailList( n,lfName,targetMail,!acc->getLeaveOnServer());
217 Global::statusMessage(tr("Downloaded %1 messages").arg(n.count())); 217 Global::statusMessage(i18n("Downloaded %1 messages").arg(n.count()));
218 218
219#if 0 219#if 0
220 QValueList<RecMailP> t; 220 QValueList<RecMailP> t;
221 listMessages(fromFolder->getName(),t, maxSizeInKb); 221 listMessages(fromFolder->getName(),t, maxSizeInKb);
222 mvcpMailList( t,targetFolder,targetWrapper,moveit); 222 mvcpMailList( t,targetFolder,targetWrapper,moveit);
223#endif 223#endif
224 224
225} 225}
226void AbstractMail::mvcpAllMails(const FolderP&fromFolder, 226void AbstractMail::mvcpAllMails(const FolderP&fromFolder,
227 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit, int maxSizeInKb) 227 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit, int maxSizeInKb)
228{ 228{
229 QValueList<RecMailP> t; 229 QValueList<RecMailP> t;
@@ -231,31 +231,31 @@ void AbstractMail::mvcpAllMails(const FolderP&fromFolder,
231 mvcpMailList( t,targetFolder,targetWrapper,moveit); 231 mvcpMailList( t,targetFolder,targetWrapper,moveit);
232 232
233} 233}
234void AbstractMail::mvcpMailList(const QValueList<RecMailP>& t, 234void AbstractMail::mvcpMailList(const QValueList<RecMailP>& t,
235 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) 235 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit)
236{ 236{
237 encodedString*st = 0; 237 encodedString*st = 0;
238 int iii = 0; 238 int iii = 0;
239 int count = t.count(); 239 int count = t.count();
240 if ( count == 0 ) 240 if ( count == 0 )
241 return; 241 return;
242 // wel, processevents is qite strange, we need a widget for getting 242 // wel, processevents is qite strange, we need a widget for getting
243 // Global::statusMessage(tr("Copy2 message %1").arg(iii)); displaye 243 // Global::statusMessage(i18n("Copy2 message %1").arg(iii)); displaye
244 244
245 QProgressBar wid ( count ); 245 QProgressBar wid ( count );
246 wid.setCaption( tr("Copying ...")); 246 wid.setCaption( i18n("Copying..."));
247 wid.show(); 247 wid.show();
248 while (iii < count ) { 248 while (iii < count ) {
249 Global::statusMessage(tr("Copy message %1 of %2").arg(iii).arg(count)); 249 Global::statusMessage(i18n("Copy message %1 of %2").arg(iii).arg(count));
250 wid.setProgress( iii ); 250 wid.setProgress( iii );
251 wid.raise(); 251 wid.raise();
252 qApp->processEvents(); 252 qApp->processEvents();
253 RecMailP r = (*t.at( iii )); 253 RecMailP r = (*t.at( iii ));
254 st = fetchRawBody(r); 254 st = fetchRawBody(r);
255 if (st) { 255 if (st) {
256 targetWrapper->storeMessage(st->Content(),st->Length(),targetFolder); 256 targetWrapper->storeMessage(st->Content(),st->Length(),targetFolder);
257 delete st; 257 delete st;
258 } 258 }
259 ++iii; 259 ++iii;
260 } 260 }
261 if (moveit) { 261 if (moveit) {
diff --git a/kmicromail/libmailwrapper/imapwrapper.cpp b/kmicromail/libmailwrapper/imapwrapper.cpp
index 8150453..3aec13d 100644
--- a/kmicromail/libmailwrapper/imapwrapper.cpp
+++ b/kmicromail/libmailwrapper/imapwrapper.cpp
@@ -39,44 +39,44 @@ int IMAPwrapper::selectMbox(const QString&mbox)
39 int err = mailimap_select( m_imap, (char*)mbox.latin1()); 39 int err = mailimap_select( m_imap, (char*)mbox.latin1());
40 if ( err != MAILIMAP_NO_ERROR ) { 40 if ( err != MAILIMAP_NO_ERROR ) {
41 m_Lastmbox = ""; 41 m_Lastmbox = "";
42 return err; 42 return err;
43 } 43 }
44 m_Lastmbox = mbox; 44 m_Lastmbox = mbox;
45 return err; 45 return err;
46} 46}
47 47
48void IMAPwrapper::imap_progress( size_t current, size_t maximum ) 48void IMAPwrapper::imap_progress( size_t current, size_t maximum )
49{ 49{
50 //qDebug("imap progress %d of %d ",current,maximum ); 50 //qDebug("imap progress %d of %d ",current,maximum );
51 //Global::statusMessage(tr("Downloading message %1 of %2").arg( current).arg(maximum)); 51 //Global::statusMessage(i18n("Downloading message %1 of %2").arg( current).arg(maximum));
52 //qApp->processEvents() 52 //qApp->processEvents()
53 static int last = 0; 53 static int last = 0;
54 if ( last != current ) 54 if ( last != current )
55 IMAPwrapper::progress(); 55 IMAPwrapper::progress();
56 last = current; 56 last = current;
57} 57}
58void IMAPwrapper::progress( QString m ) 58void IMAPwrapper::progress( QString m )
59{ 59{
60 60
61 static QString mProgrMess; 61 static QString mProgrMess;
62 if ( m != QString::null ) { 62 if ( m != QString::null ) {
63 mProgrMess = m; 63 mProgrMess = m;
64 mCurrent = 1; 64 mCurrent = 1;
65 return; 65 return;
66 } 66 }
67 QString mess; 67 QString mess;
68 //qDebug("progress "); 68 //qDebug("progress ");
69 if ( mMax ) mess = mProgrMess +tr(" message %1 of %2").arg( mCurrent++).arg(mMax); 69 if ( mMax ) mess = mProgrMess +i18n(" message %1 of %2").arg( mCurrent++).arg(mMax);
70 else mess = mProgrMess +tr(" message %1").arg( mCurrent++); 70 else mess = mProgrMess +i18n(" message %1").arg( mCurrent++);
71 Global::statusMessage(mess); 71 Global::statusMessage(mess);
72 //qDebug("Progress %s %s", mess.latin1(), m.latin1()); 72 //qDebug("Progress %s %s", mess.latin1(), m.latin1());
73 qApp->processEvents(); 73 qApp->processEvents();
74} 74}
75bool IMAPwrapper::start_tls(bool force_tls) 75bool IMAPwrapper::start_tls(bool force_tls)
76{ 76{
77 int err; 77 int err;
78 bool try_tls; 78 bool try_tls;
79 mailimap_capability_data * cap_data = 0; 79 mailimap_capability_data * cap_data = 0;
80 80
81 err = mailimap_capability(m_imap,&cap_data); 81 err = mailimap_capability(m_imap,&cap_data);
82 if (err != MAILIMAP_NO_ERROR) { 82 if (err != MAILIMAP_NO_ERROR) {
@@ -91,25 +91,25 @@ bool IMAPwrapper::start_tls(bool force_tls)
91 if (strcasecmp(cap->cap_data.cap_name, "STARTTLS") == 0) { 91 if (strcasecmp(cap->cap_data.cap_name, "STARTTLS") == 0) {
92 try_tls = true; 92 try_tls = true;
93 break; 93 break;
94 } 94 }
95 } 95 }
96 } 96 }
97 if (cap_data) { 97 if (cap_data) {
98 mailimap_capability_data_free(cap_data); 98 mailimap_capability_data_free(cap_data);
99 } 99 }
100 if (try_tls) { 100 if (try_tls) {
101 err = mailimap_starttls(m_imap); 101 err = mailimap_starttls(m_imap);
102 if (err != MAILIMAP_NO_ERROR && force_tls) { 102 if (err != MAILIMAP_NO_ERROR && force_tls) {
103 Global::statusMessage(tr("Server has no TLS support!")); 103 Global::statusMessage(i18n("Server has no TLS support!"));
104 try_tls = false; 104 try_tls = false;
105 } else { 105 } else {
106 mailstream_low * low; 106 mailstream_low * low;
107 mailstream_low * new_low; 107 mailstream_low * new_low;
108 low = mailstream_get_low(m_imap->imap_stream); 108 low = mailstream_get_low(m_imap->imap_stream);
109 if (!low) { 109 if (!low) {
110 try_tls = false; 110 try_tls = false;
111 } else { 111 } else {
112 int fd = mailstream_low_get_fd(low); 112 int fd = mailstream_low_get_fd(low);
113 if (fd > -1 && (new_low = mailstream_low_ssl_open(fd))!=0) { 113 if (fd > -1 && (new_low = mailstream_low_ssl_open(fd))!=0) {
114 mailstream_low_free(low); 114 mailstream_low_free(low);
115 mailstream_set_low(m_imap->imap_stream, new_low); 115 mailstream_set_low(m_imap->imap_stream, new_low);
@@ -179,47 +179,47 @@ void IMAPwrapper::login()
179 err = mailimap_socket_connect( m_imap, (char*)server.latin1(), port ); 179 err = mailimap_socket_connect( m_imap, (char*)server.latin1(), port );
180 } 180 }
181 181
182 if ( err != MAILIMAP_NO_ERROR && 182 if ( err != MAILIMAP_NO_ERROR &&
183 err != MAILIMAP_NO_ERROR_AUTHENTICATED && 183 err != MAILIMAP_NO_ERROR_AUTHENTICATED &&
184 err != MAILIMAP_NO_ERROR_NON_AUTHENTICATED ) { 184 err != MAILIMAP_NO_ERROR_NON_AUTHENTICATED ) {
185 QString failure = ""; 185 QString failure = "";
186 if (err == MAILIMAP_ERROR_CONNECTION_REFUSED) { 186 if (err == MAILIMAP_ERROR_CONNECTION_REFUSED) {
187 failure="Connection refused"; 187 failure="Connection refused";
188 } else { 188 } else {
189 failure="Unknown failure"; 189 failure="Unknown failure";
190 } 190 }
191 Global::statusMessage(tr("error connecting imap server: %1").arg(failure)); 191 Global::statusMessage(i18n("error connecting imap server: %1").arg(failure));
192 mailimap_free( m_imap ); 192 mailimap_free( m_imap );
193 m_imap = 0; 193 m_imap = 0;
194 return; 194 return;
195 } 195 }
196 196
197 if (!ssl) { 197 if (!ssl) {
198 try_tls = start_tls(force_tls); 198 try_tls = start_tls(force_tls);
199 } 199 }
200 200
201 bool ok = true; 201 bool ok = true;
202 if (force_tls && !try_tls) { 202 if (force_tls && !try_tls) {
203 Global::statusMessage(tr("Server has no TLS support!")); 203 Global::statusMessage(i18n("Server has no TLS support!"));
204 ok = false; 204 ok = false;
205 } 205 }
206 206
207 207
208 /* login */ 208 /* login */
209 209
210 if (ok) { 210 if (ok) {
211 err = mailimap_login_simple( m_imap, (char*)user.latin1(), (char*)pass.latin1() ); 211 err = mailimap_login_simple( m_imap, (char*)user.latin1(), (char*)pass.latin1() );
212 if ( err != MAILIMAP_NO_ERROR ) { 212 if ( err != MAILIMAP_NO_ERROR ) {
213 Global::statusMessage(tr("error logging in imap server: %1").arg(m_imap->imap_response)); 213 Global::statusMessage(i18n("error logging in imap server: %1").arg(m_imap->imap_response));
214 ok = false; 214 ok = false;
215 } 215 }
216 } 216 }
217 if (!ok) { 217 if (!ok) {
218 err = mailimap_close( m_imap ); 218 err = mailimap_close( m_imap );
219 mailimap_free( m_imap ); 219 mailimap_free( m_imap );
220 m_imap = 0; 220 m_imap = 0;
221 } 221 }
222} 222}
223 223
224void IMAPwrapper::logout() 224void IMAPwrapper::logout()
225{ 225{
@@ -247,32 +247,32 @@ void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::Core::OSma
247 if (!m_imap) { 247 if (!m_imap) {
248 return; 248 return;
249 } 249 }
250 /* select mailbox READONLY for operations */ 250 /* select mailbox READONLY for operations */
251 err = selectMbox(mailbox); 251 err = selectMbox(mailbox);
252 if ( err != MAILIMAP_NO_ERROR ) { 252 if ( err != MAILIMAP_NO_ERROR ) {
253 return; 253 return;
254 } 254 }
255 255
256 int last = m_imap->imap_selection_info->sel_exists; 256 int last = m_imap->imap_selection_info->sel_exists;
257 257
258 if (last == 0) { 258 if (last == 0) {
259 Global::statusMessage(tr("Mailbox has no mails")); 259 Global::statusMessage(i18n("Mailbox has no mails"));
260 return; 260 return;
261 } else { 261 } else {
262 } 262 }
263 progress( tr("Fetch ")); 263 progress( i18n("Fetch "));
264 mMax = last; 264 mMax = last;
265 //qDebug("last %d ", last); 265 //qDebug("last %d ", last);
266 Global::statusMessage(tr("Fetching header list")); 266 Global::statusMessage(i18n("Fetching header list"));
267 qApp->processEvents(); 267 qApp->processEvents();
268 /* the range has to start at 1!!! not with 0!!!! */ 268 /* the range has to start at 1!!! not with 0!!!! */
269 //LR the access to web.de imap server is no working with value 1 269 //LR the access to web.de imap server is no working with value 1
270 //qDebug("interval %d - %d ", tryAgain, last-1+tryAgain ); 270 //qDebug("interval %d - %d ", tryAgain, last-1+tryAgain );
271 set = mailimap_set_new_interval( tryAgain, last ); 271 set = mailimap_set_new_interval( tryAgain, last );
272 fetchType = mailimap_fetch_type_new_fetch_att_list_empty(); 272 fetchType = mailimap_fetch_type_new_fetch_att_list_empty();
273 mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_envelope()); 273 mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_envelope());
274 mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_flags()); 274 mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_flags());
275 mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_internaldate()); 275 mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_internaldate());
276 mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_rfc822_size()); 276 mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_rfc822_size());
277 277
278 err = mailimap_fetch( m_imap, set, fetchType, &result ); 278 err = mailimap_fetch( m_imap, set, fetchType, &result );
@@ -290,30 +290,30 @@ void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::Core::OSma
290 //qDebug("iii %d ",i); 290 //qDebug("iii %d ",i);
291 msg_att = (mailimap_msg_att*)current->data; 291 msg_att = (mailimap_msg_att*)current->data;
292 RecMail*m = parse_list_result(msg_att); 292 RecMail*m = parse_list_result(msg_att);
293 if (m) { 293 if (m) {
294 if ( maxSizeInKb == 0 || m->Msgsize()<=maxSizeInKb*1024 ) { 294 if ( maxSizeInKb == 0 || m->Msgsize()<=maxSizeInKb*1024 ) {
295 m->setNumber(i); 295 m->setNumber(i);
296 m->setMbox(mailbox); 296 m->setMbox(mailbox);
297 m->setWrapper(this); 297 m->setWrapper(this);
298 target.append(m); 298 target.append(m);
299 } 299 }
300 } 300 }
301 } 301 }
302 Global::statusMessage(tr("Mailbox has %1 mails").arg(target.count())); 302 Global::statusMessage(i18n("Mailbox has %1 mails").arg(target.count()));
303 } else { 303 } else {
304 --tryAgain; 304 --tryAgain;
305 --tryAgain;//disabled tryagain by adding this line 305 --tryAgain;//disabled tryagain by adding this line
306 if ( tryAgain < 0 ) 306 if ( tryAgain < 0 )
307 Global::statusMessage(tr("Error fetching headers: %1").arg(m_imap->imap_response)); 307 Global::statusMessage(i18n("Error fetching headers: %1").arg(m_imap->imap_response));
308 else 308 else
309 qDebug("try again... "); 309 qDebug("try again... ");
310 } 310 }
311 311
312 if (result) mailimap_fetch_list_free(result); 312 if (result) mailimap_fetch_list_free(result);
313 } 313 }
314} 314}
315 315
316QValueList<Opie::Core::OSmartPointer<Folder> >* IMAPwrapper::listFolders() 316QValueList<Opie::Core::OSmartPointer<Folder> >* IMAPwrapper::listFolders()
317{ 317{
318 const char *path, *mask; 318 const char *path, *mask;
319 int err = MAILIMAP_NO_ERROR; 319 int err = MAILIMAP_NO_ERROR;
@@ -324,25 +324,25 @@ QValueList<Opie::Core::OSmartPointer<Folder> >* IMAPwrapper::listFolders()
324 324
325 QValueList<FolderP>* folders = new QValueList<FolderP>(); 325 QValueList<FolderP>* folders = new QValueList<FolderP>();
326 login(); 326 login();
327 if (!m_imap) { 327 if (!m_imap) {
328 return folders; 328 return folders;
329 } 329 }
330 330
331/* 331/*
332 * First we have to check for INBOX 'cause it sometimes it's not inside the path. 332 * First we have to check for INBOX 'cause it sometimes it's not inside the path.
333 * We must not forget to filter them out in next loop! 333 * We must not forget to filter them out in next loop!
334 * it seems like ugly code. and yes - it is ugly code. but the best way. 334 * it seems like ugly code. and yes - it is ugly code. but the best way.
335 */ 335 */
336 Global::statusMessage(tr("Fetching folder list")); 336 Global::statusMessage(i18n("Fetching folder list"));
337 qApp->processEvents(); 337 qApp->processEvents();
338 QString temp; 338 QString temp;
339 mask = "INBOX" ; 339 mask = "INBOX" ;
340 mailimap_mailbox_list *list; 340 mailimap_mailbox_list *list;
341 err = mailimap_list( m_imap, (char*)"", (char*)mask, &result ); 341 err = mailimap_list( m_imap, (char*)"", (char*)mask, &result );
342 QString del; 342 QString del;
343 bool selectable = true; 343 bool selectable = true;
344 bool no_inferiors = false; 344 bool no_inferiors = false;
345 if ( err == MAILIMAP_NO_ERROR ) { 345 if ( err == MAILIMAP_NO_ERROR ) {
346 current = result->first; 346 current = result->first;
347 for ( int i = result->count; i > 0; i-- ) { 347 for ( int i = result->count; i > 0; i-- ) {
348 list = (mailimap_mailbox_list *) current->data; 348 list = (mailimap_mailbox_list *) current->data;
@@ -960,31 +960,31 @@ void IMAPwrapper::deleteMailList(const QValueList<RecMailP>&target)
960 int err; 960 int err;
961 login(); 961 login();
962 //#endif 962 //#endif
963 if (!m_imap) { 963 if (!m_imap) {
964 return; 964 return;
965 } 965 }
966 int iii = 0; 966 int iii = 0;
967 int count = target.count(); 967 int count = target.count();
968 // qDebug("imap remove count %d ", count); 968 // qDebug("imap remove count %d ", count);
969 969
970 970
971 mMax = count; 971 mMax = count;
972 progress( tr("Delete")); 972 progress( i18n("Delete"));
973 973
974 QProgressBar wid ( count ); 974 QProgressBar wid ( count );
975 wid.setCaption( tr("Deleting ...")); 975 wid.setCaption( i18n("Deleting ..."));
976 wid.show(); 976 wid.show();
977 while (iii < count ) { 977 while (iii < count ) {
978 Global::statusMessage(tr("Delete message %1 of %2").arg(iii).arg(count)); 978 Global::statusMessage(i18n("Delete message %1 of %2").arg(iii).arg(count));
979 wid.setProgress( iii ); 979 wid.setProgress( iii );
980 wid.raise(); 980 wid.raise();
981 qApp->processEvents(); 981 qApp->processEvents();
982 RecMailP mail = (*target.at( iii )); 982 RecMailP mail = (*target.at( iii ));
983 //#if 0 983 //#if 0
984 //qDebug("IMAP remove %d %d ", iii, mail->getNumber() ); 984 //qDebug("IMAP remove %d %d ", iii, mail->getNumber() );
985 err = selectMbox(mail->getMbox()); 985 err = selectMbox(mail->getMbox());
986 if ( err != MAILIMAP_NO_ERROR ) { 986 if ( err != MAILIMAP_NO_ERROR ) {
987 return; 987 return;
988 } 988 }
989 flist = mailimap_flag_list_new_empty(); 989 flist = mailimap_flag_list_new_empty();
990 mailimap_flag_list_add(flist,mailimap_flag_new_deleted()); 990 mailimap_flag_list_add(flist,mailimap_flag_new_deleted());
@@ -994,34 +994,34 @@ void IMAPwrapper::deleteMailList(const QValueList<RecMailP>&target)
994 mailimap_set_free( set ); 994 mailimap_set_free( set );
995 mailimap_store_att_flags_free(store_flags); 995 mailimap_store_att_flags_free(store_flags);
996 996
997 if (err != MAILIMAP_NO_ERROR) { 997 if (err != MAILIMAP_NO_ERROR) {
998 // odebug << "error deleting mail: " << m_imap->imap_response << "" << oendl; 998 // odebug << "error deleting mail: " << m_imap->imap_response << "" << oendl;
999 return; 999 return;
1000 } 1000 }
1001 // odebug << "deleting mail: " << m_imap->imap_response << "" << oendl; 1001 // odebug << "deleting mail: " << m_imap->imap_response << "" << oendl;
1002 /* should we realy do that at this moment? */ 1002 /* should we realy do that at this moment? */
1003 1003
1004 // err = mailimap_expunge(m_imap); 1004 // err = mailimap_expunge(m_imap);
1005 //if (err != MAILIMAP_NO_ERROR) { 1005 //if (err != MAILIMAP_NO_ERROR) {
1006 // Global::statusMessage(tr("Error deleting mails: %s").arg(m_imap->imap_response)); 1006 // Global::statusMessage(i18n("Error deleting mails: %s").arg(m_imap->imap_response));
1007 // } 1007 // }
1008 //#endif 1008 //#endif
1009 //deleteMail( mail); 1009 //deleteMail( mail);
1010 ++iii; 1010 ++iii;
1011 } 1011 }
1012 //qDebug("Deleting imap mails... "); 1012 //qDebug("Deleting imap mails... ");
1013 err = mailimap_expunge(m_imap); 1013 err = mailimap_expunge(m_imap);
1014 if (err != MAILIMAP_NO_ERROR) { 1014 if (err != MAILIMAP_NO_ERROR) {
1015 Global::statusMessage(tr("Error deleting mails: %s").arg(m_imap->imap_response)); 1015 Global::statusMessage(i18n("Error deleting mails: %s").arg(m_imap->imap_response));
1016 } 1016 }
1017} 1017}
1018void IMAPwrapper::deleteMail(const RecMailP&mail) 1018void IMAPwrapper::deleteMail(const RecMailP&mail)
1019{ 1019{
1020 mailimap_flag_list*flist; 1020 mailimap_flag_list*flist;
1021 mailimap_set *set; 1021 mailimap_set *set;
1022 mailimap_store_att_flags * store_flags; 1022 mailimap_store_att_flags * store_flags;
1023 int err; 1023 int err;
1024 login(); 1024 login();
1025 if (!m_imap) { 1025 if (!m_imap) {
1026 return; 1026 return;
1027 } 1027 }
@@ -1037,25 +1037,25 @@ void IMAPwrapper::deleteMail(const RecMailP&mail)
1037 mailimap_set_free( set ); 1037 mailimap_set_free( set );
1038 mailimap_store_att_flags_free(store_flags); 1038 mailimap_store_att_flags_free(store_flags);
1039 1039
1040 if (err != MAILIMAP_NO_ERROR) { 1040 if (err != MAILIMAP_NO_ERROR) {
1041 // odebug << "error deleting mail: " << m_imap->imap_response << "" << oendl; 1041 // odebug << "error deleting mail: " << m_imap->imap_response << "" << oendl;
1042 return; 1042 return;
1043 } 1043 }
1044 // odebug << "deleting mail: " << m_imap->imap_response << "" << oendl; 1044 // odebug << "deleting mail: " << m_imap->imap_response << "" << oendl;
1045 /* should we realy do that at this moment? */ 1045 /* should we realy do that at this moment? */
1046 1046
1047 err = mailimap_expunge(m_imap); 1047 err = mailimap_expunge(m_imap);
1048 if (err != MAILIMAP_NO_ERROR) { 1048 if (err != MAILIMAP_NO_ERROR) {
1049 Global::statusMessage(tr("error deleting mail: %s").arg(m_imap->imap_response)); 1049 Global::statusMessage(i18n("error deleting mail: %s").arg(m_imap->imap_response));
1050 } 1050 }
1051 //qDebug("IMAPwrapper::deleteMail 2"); 1051 //qDebug("IMAPwrapper::deleteMail 2");
1052 1052
1053} 1053}
1054 1054
1055void IMAPwrapper::answeredMail(const RecMailP&mail) 1055void IMAPwrapper::answeredMail(const RecMailP&mail)
1056{ 1056{
1057 mailimap_flag_list*flist; 1057 mailimap_flag_list*flist;
1058 mailimap_set *set; 1058 mailimap_set *set;
1059 mailimap_store_att_flags * store_flags; 1059 mailimap_store_att_flags * store_flags;
1060 int err; 1060 int err;
1061 login(); 1061 login();
@@ -1120,87 +1120,87 @@ int IMAPwrapper::deleteAllMail(const FolderP&folder)
1120 return 0; 1120 return 0;
1121 } 1121 }
1122 mailimap_flag_list*flist; 1122 mailimap_flag_list*flist;
1123 mailimap_set *set; 1123 mailimap_set *set;
1124 mailimap_store_att_flags * store_flags; 1124 mailimap_store_att_flags * store_flags;
1125 int err = selectMbox(folder->getName()); 1125 int err = selectMbox(folder->getName());
1126 if ( err != MAILIMAP_NO_ERROR ) { 1126 if ( err != MAILIMAP_NO_ERROR ) {
1127 return 0; 1127 return 0;
1128 } 1128 }
1129 1129
1130 int last = m_imap->imap_selection_info->sel_exists; 1130 int last = m_imap->imap_selection_info->sel_exists;
1131 if (last == 0) { 1131 if (last == 0) {
1132 Global::statusMessage(tr("Mailbox has no mails!")); 1132 Global::statusMessage(i18n("Mailbox has no mails!"));
1133 return 0; 1133 return 0;
1134 } 1134 }
1135 flist = mailimap_flag_list_new_empty(); 1135 flist = mailimap_flag_list_new_empty();
1136 mailimap_flag_list_add(flist,mailimap_flag_new_deleted()); 1136 mailimap_flag_list_add(flist,mailimap_flag_new_deleted());
1137 store_flags = mailimap_store_att_flags_new_set_flags(flist); 1137 store_flags = mailimap_store_att_flags_new_set_flags(flist);
1138 set = mailimap_set_new_interval( 1, last ); 1138 set = mailimap_set_new_interval( 1, last );
1139 err = mailimap_store(m_imap,set,store_flags); 1139 err = mailimap_store(m_imap,set,store_flags);
1140 mailimap_set_free( set ); 1140 mailimap_set_free( set );
1141 mailimap_store_att_flags_free(store_flags); 1141 mailimap_store_att_flags_free(store_flags);
1142 if (err != MAILIMAP_NO_ERROR) { 1142 if (err != MAILIMAP_NO_ERROR) {
1143 Global::statusMessage(tr("error deleting mail: %s").arg(m_imap->imap_response)); 1143 Global::statusMessage(i18n("error deleting mail: %s").arg(m_imap->imap_response));
1144 return 0; 1144 return 0;
1145 } 1145 }
1146 // odebug << "deleting mail: " << m_imap->imap_response << "" << oendl; 1146 // odebug << "deleting mail: " << m_imap->imap_response << "" << oendl;
1147 /* should we realy do that at this moment? */ 1147 /* should we realy do that at this moment? */
1148 err = mailimap_expunge(m_imap); 1148 err = mailimap_expunge(m_imap);
1149 if (err != MAILIMAP_NO_ERROR) { 1149 if (err != MAILIMAP_NO_ERROR) {
1150 Global::statusMessage(tr("error deleting mail: %s").arg(m_imap->imap_response)); 1150 Global::statusMessage(i18n("error deleting mail: %s").arg(m_imap->imap_response));
1151 return 0; 1151 return 0;
1152 } 1152 }
1153 // odebug << "Delete successfull " << m_imap->imap_response << "" << oendl; 1153 // odebug << "Delete successfull " << m_imap->imap_response << "" << oendl;
1154 return 1; 1154 return 1;
1155} 1155}
1156 1156
1157int IMAPwrapper::createMbox(const QString&folder,const FolderP&parentfolder,const QString& delemiter,bool getsubfolder) 1157int IMAPwrapper::createMbox(const QString&folder,const FolderP&parentfolder,const QString& delemiter,bool getsubfolder)
1158{ 1158{
1159 if (folder.length()==0) return 0; 1159 if (folder.length()==0) return 0;
1160 login(); 1160 login();
1161 if (!m_imap) {return 0;} 1161 if (!m_imap) {return 0;}
1162 QString pre = account->getPrefix(); 1162 QString pre = account->getPrefix();
1163 if (delemiter.length()>0 && pre.findRev(delemiter)!=pre.length()-1) { 1163 if (delemiter.length()>0 && pre.findRev(delemiter)!=pre.length()-1) {
1164 pre+=delemiter; 1164 pre+=delemiter;
1165 } 1165 }
1166 if (parentfolder) { 1166 if (parentfolder) {
1167 pre += parentfolder->getDisplayName()+delemiter; 1167 pre += parentfolder->getDisplayName()+delemiter;
1168 } 1168 }
1169 pre+=folder; 1169 pre+=folder;
1170 if (getsubfolder) { 1170 if (getsubfolder) {
1171 if (delemiter.length()>0) { 1171 if (delemiter.length()>0) {
1172 pre+=delemiter; 1172 pre+=delemiter;
1173 } else { 1173 } else {
1174 Global::statusMessage(tr("Cannot create folder %1 for holding subfolders").arg(pre)); 1174 Global::statusMessage(i18n("Cannot create folder %1 for holding subfolders").arg(pre));
1175 return 0; 1175 return 0;
1176 } 1176 }
1177 } 1177 }
1178 // odebug << "Creating " << pre.latin1() << "" << oendl; 1178 // odebug << "Creating " << pre.latin1() << "" << oendl;
1179 int res = mailimap_create(m_imap,pre.latin1()); 1179 int res = mailimap_create(m_imap,pre.latin1());
1180 if (res != MAILIMAP_NO_ERROR) { 1180 if (res != MAILIMAP_NO_ERROR) {
1181 Global::statusMessage(tr("%1").arg(m_imap->imap_response)); 1181 Global::statusMessage(i18n("%1").arg(m_imap->imap_response));
1182 return 0; 1182 return 0;
1183 } 1183 }
1184 return 1; 1184 return 1;
1185} 1185}
1186 1186
1187int IMAPwrapper::deleteMbox(const FolderP&folder) 1187int IMAPwrapper::deleteMbox(const FolderP&folder)
1188{ 1188{
1189 if (!folder) return 0; 1189 if (!folder) return 0;
1190 login(); 1190 login();
1191 if (!m_imap) {return 0;} 1191 if (!m_imap) {return 0;}
1192 int res = mailimap_delete(m_imap,folder->getName()); 1192 int res = mailimap_delete(m_imap,folder->getName());
1193 if (res != MAILIMAP_NO_ERROR) { 1193 if (res != MAILIMAP_NO_ERROR) {
1194 Global::statusMessage(tr("%1").arg(m_imap->imap_response)); 1194 Global::statusMessage(i18n("%1").arg(m_imap->imap_response));
1195 return 0; 1195 return 0;
1196 } 1196 }
1197 return 1; 1197 return 1;
1198} 1198}
1199 1199
1200void IMAPwrapper::statusFolder(folderStat&target_stat,const QString & mailbox) 1200void IMAPwrapper::statusFolder(folderStat&target_stat,const QString & mailbox)
1201{ 1201{
1202 mailimap_status_att_list * att_list =0; 1202 mailimap_status_att_list * att_list =0;
1203 mailimap_mailbox_data_status * status=0; 1203 mailimap_mailbox_data_status * status=0;
1204 clistiter * cur = 0; 1204 clistiter * cur = 0;
1205 int r = 0; 1205 int r = 0;
1206 target_stat.message_count = 0; 1206 target_stat.message_count = 0;
@@ -1265,46 +1265,46 @@ const QString&IMAPwrapper::getName()const
1265encodedString* IMAPwrapper::fetchRawBody(const RecMailP&mail) 1265encodedString* IMAPwrapper::fetchRawBody(const RecMailP&mail)
1266{ 1266{
1267 // dummy 1267 // dummy
1268 QValueList<int> path; 1268 QValueList<int> path;
1269 return fetchRawPart(mail,path,false); 1269 return fetchRawPart(mail,path,false);
1270} 1270}
1271 1271
1272void IMAPwrapper::mvcpAllMails(const FolderP&fromFolder, 1272void IMAPwrapper::mvcpAllMails(const FolderP&fromFolder,
1273 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit, int maxSizeInKb) 1273 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit, int maxSizeInKb)
1274{ 1274{
1275 if (targetWrapper != this || maxSizeInKb > 0 ) { 1275 if (targetWrapper != this || maxSizeInKb > 0 ) {
1276 mMax = 0; 1276 mMax = 0;
1277 progress( tr("Copy")); 1277 progress( i18n("Copy"));
1278 AbstractMail::mvcpAllMails(fromFolder,targetFolder,targetWrapper,moveit, maxSizeInKb); 1278 AbstractMail::mvcpAllMails(fromFolder,targetFolder,targetWrapper,moveit, maxSizeInKb);
1279 //qDebug("IMAPwrapper::mvcpAllMails::Using generic"); 1279 //qDebug("IMAPwrapper::mvcpAllMails::Using generic");
1280 // odebug << "Using generic" << oendl; 1280 // odebug << "Using generic" << oendl;
1281 return; 1281 return;
1282 } 1282 }
1283 mailimap_set *set = 0; 1283 mailimap_set *set = 0;
1284 login(); 1284 login();
1285 if (!m_imap) { 1285 if (!m_imap) {
1286 return; 1286 return;
1287 } 1287 }
1288 int err = selectMbox(fromFolder->getName()); 1288 int err = selectMbox(fromFolder->getName());
1289 if ( err != MAILIMAP_NO_ERROR ) { 1289 if ( err != MAILIMAP_NO_ERROR ) {
1290 return; 1290 return;
1291 } 1291 }
1292 Global::statusMessage( tr("Copying mails on server...") ); 1292 Global::statusMessage( i18n("Copying mails on server...") );
1293 int last = m_imap->imap_selection_info->sel_exists; 1293 int last = m_imap->imap_selection_info->sel_exists;
1294 set = mailimap_set_new_interval( 1, last ); 1294 set = mailimap_set_new_interval( 1, last );
1295 err = mailimap_copy(m_imap,set,targetFolder.latin1()); 1295 err = mailimap_copy(m_imap,set,targetFolder.latin1());
1296 mailimap_set_free( set ); 1296 mailimap_set_free( set );
1297 if ( err != MAILIMAP_NO_ERROR ) { 1297 if ( err != MAILIMAP_NO_ERROR ) {
1298 QString error_msg = tr("Error copy mails: %1").arg(m_imap->imap_response); 1298 QString error_msg = i18n("Error copy mails: %1").arg(m_imap->imap_response);
1299 Global::statusMessage(error_msg); 1299 Global::statusMessage(error_msg);
1300 // odebug << error_msg << oendl; 1300 // odebug << error_msg << oendl;
1301 return; 1301 return;
1302 } 1302 }
1303 if (moveit) { 1303 if (moveit) {
1304 deleteAllMail(fromFolder); 1304 deleteAllMail(fromFolder);
1305 } 1305 }
1306} 1306}
1307 1307
1308void IMAPwrapper::mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) 1308void IMAPwrapper::mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit)
1309{ 1309{
1310 if (targetWrapper != this) { 1310 if (targetWrapper != this) {
@@ -1316,21 +1316,21 @@ void IMAPwrapper::mvcpMail(const RecMailP&mail,const QString&targetFolder,Abstra
1316 login(); 1316 login();
1317 if (!m_imap) { 1317 if (!m_imap) {
1318 return; 1318 return;
1319 } 1319 }
1320 int err = selectMbox(mail->getMbox()); 1320 int err = selectMbox(mail->getMbox());
1321 if ( err != MAILIMAP_NO_ERROR ) { 1321 if ( err != MAILIMAP_NO_ERROR ) {
1322 return; 1322 return;
1323 } 1323 }
1324 set = mailimap_set_new_single(mail->getNumber()); 1324 set = mailimap_set_new_single(mail->getNumber());
1325 err = mailimap_copy(m_imap,set,targetFolder.latin1()); 1325 err = mailimap_copy(m_imap,set,targetFolder.latin1());
1326 mailimap_set_free( set ); 1326 mailimap_set_free( set );
1327 if ( err != MAILIMAP_NO_ERROR ) { 1327 if ( err != MAILIMAP_NO_ERROR ) {
1328 QString error_msg = tr("error copy mail: %1").arg(m_imap->imap_response); 1328 QString error_msg = i18n("error copy mail: %1").arg(m_imap->imap_response);
1329 Global::statusMessage(error_msg); 1329 Global::statusMessage(error_msg);
1330 // odebug << error_msg << oendl; 1330 // odebug << error_msg << oendl;
1331 return; 1331 return;
1332 } 1332 }
1333 if (moveit) { 1333 if (moveit) {
1334 deleteMail(mail); 1334 deleteMail(mail);
1335 } 1335 }
1336} 1336}
diff --git a/kmicromail/libmailwrapper/mboxwrapper.cpp b/kmicromail/libmailwrapper/mboxwrapper.cpp
index 39dd156..0cdbae4 100644
--- a/kmicromail/libmailwrapper/mboxwrapper.cpp
+++ b/kmicromail/libmailwrapper/mboxwrapper.cpp
@@ -1,18 +1,19 @@
1#include "mboxwrapper.h" 1#include "mboxwrapper.h"
2#include "mailtypes.h" 2#include "mailtypes.h"
3#include "mailwrapper.h" 3#include "mailwrapper.h"
4#include <libetpan/libetpan.h> 4#include <libetpan/libetpan.h>
5#include <qdir.h> 5#include <qdir.h>
6#include <stdlib.h> 6#include <stdlib.h>
7#include <klocale.h>
7 8
8 9
9#include <qpe/global.h> 10#include <qpe/global.h>
10 11
11using namespace Opie::Core; 12using namespace Opie::Core;
12MBOXwrapper::MBOXwrapper(const QString & mbox_dir,const QString&mbox_name) 13MBOXwrapper::MBOXwrapper(const QString & mbox_dir,const QString&mbox_name)
13 : Genericwrapper(),MBOXPath(mbox_dir),MBOXName(mbox_name) 14 : Genericwrapper(),MBOXPath(mbox_dir),MBOXName(mbox_name)
14{ 15{
15 QDir dir(MBOXPath); 16 QDir dir(MBOXPath);
16 if (!dir.exists()) { 17 if (!dir.exists()) {
17 dir.mkdir(MBOXPath); 18 dir.mkdir(MBOXPath);
18 } 19 }
@@ -35,25 +36,25 @@ void MBOXwrapper::listMessages(const QString & mailbox, QValueList<RecMailP> &ta
35 if (r != MAIL_NO_ERROR) { 36 if (r != MAIL_NO_ERROR) {
36 //odebug << "Error initializing mbox" << oendl; 37 //odebug << "Error initializing mbox" << oendl;
37 mailfolder_free(folder); 38 mailfolder_free(folder);
38 mailstorage_free(storage); 39 mailstorage_free(storage);
39 return; 40 return;
40 } 41 }
41 42
42 parseList(target,folder->fld_session,mailbox); 43 parseList(target,folder->fld_session,mailbox);
43 44
44 mailfolder_disconnect(folder); 45 mailfolder_disconnect(folder);
45 mailfolder_free(folder); 46 mailfolder_free(folder);
46 mailstorage_free(storage); 47 mailstorage_free(storage);
47 Global::statusMessage(tr("Mailbox has %1 mail(s)").arg(target.count())); 48 Global::statusMessage(i18n("Mailbox has %1 mail(s)").arg(target.count()));
48} 49}
49 50
50QValueList<Opie::Core::OSmartPointer<Folder> >* MBOXwrapper::listFolders() 51QValueList<Opie::Core::OSmartPointer<Folder> >* MBOXwrapper::listFolders()
51{ 52{
52 QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<Opie::Core::OSmartPointer<Folder> >(); 53 QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<Opie::Core::OSmartPointer<Folder> >();
53 QDir dir(MBOXPath); 54 QDir dir(MBOXPath);
54 if (!dir.exists()) return folders; 55 if (!dir.exists()) return folders;
55 dir.setFilter(QDir::Files|QDir::Writable|QDir::Readable); 56 dir.setFilter(QDir::Files|QDir::Writable|QDir::Readable);
56 QStringList entries = dir.entryList(); 57 QStringList entries = dir.entryList();
57 QStringList::ConstIterator it = entries.begin(); 58 QStringList::ConstIterator it = entries.begin();
58 for (;it!=entries.end();++it) { 59 for (;it!=entries.end();++it) {
59 FolderP inb=new Folder(*it,"/"); 60 FolderP inb=new Folder(*it,"/");
@@ -134,83 +135,83 @@ RecBodyP MBOXwrapper::fetchBody( const RecMailP &mail )
134 135
135void MBOXwrapper::mbox_progress( size_t current, size_t maximum ) 136void MBOXwrapper::mbox_progress( size_t current, size_t maximum )
136{ 137{
137 ; // << "MBOX " << current << " von " << maximum << "" << oendl; 138 ; // << "MBOX " << current << " von " << maximum << "" << oendl;
138} 139}
139 140
140int MBOXwrapper::createMbox(const QString&folder,const FolderP&,const QString&,bool ) 141int MBOXwrapper::createMbox(const QString&folder,const FolderP&,const QString&,bool )
141{ 142{
142 QString p = MBOXPath+"/"; 143 QString p = MBOXPath+"/";
143 p+=folder; 144 p+=folder;
144 QFileInfo fi(p); 145 QFileInfo fi(p);
145 if (fi.exists()) { 146 if (fi.exists()) {
146 Global::statusMessage(tr("Mailbox exists.")); 147 Global::statusMessage(i18n("Mailbox exists."));
147 return 0; 148 return 0;
148 } 149 }
149 mailmbox_folder*f = 0; 150 mailmbox_folder*f = 0;
150 if (mailmbox_init(p.latin1(),0,1,0,&f) != MAIL_NO_ERROR) { 151 if (mailmbox_init(p.latin1(),0,1,0,&f) != MAIL_NO_ERROR) {
151 Global::statusMessage(tr("Error init folder")); 152 Global::statusMessage(i18n("Error init folder"));
152 return 0; 153 return 0;
153 } 154 }
154 if (f) mailmbox_done(f); 155 if (f) mailmbox_done(f);
155 return 1; 156 return 1;
156} 157}
157 158
158void MBOXwrapper::storeMessage(const char*msg,size_t length, const QString&folder) 159void MBOXwrapper::storeMessage(const char*msg,size_t length, const QString&folder)
159{ 160{
160 QString p = MBOXPath+"/"; 161 QString p = MBOXPath+"/";
161 p+=folder; 162 p+=folder;
162 mailmbox_folder*f = 0; 163 mailmbox_folder*f = 0;
163 int r = mailmbox_init(p.latin1(),0,1,0,&f); 164 int r = mailmbox_init(p.latin1(),0,1,0,&f);
164 if (r != MAIL_NO_ERROR) { 165 if (r != MAIL_NO_ERROR) {
165 Global::statusMessage(tr("Error init folder")); 166 Global::statusMessage(i18n("Error init folder"));
166 return; 167 return;
167 } 168 }
168 r = mailmbox_append_message(f,msg,length); 169 r = mailmbox_append_message(f,msg,length);
169 if (r != MAIL_NO_ERROR) { 170 if (r != MAIL_NO_ERROR) {
170 Global::statusMessage(tr("Error writing to message folder")); 171 Global::statusMessage(i18n("Error writing to message folder"));
171 } 172 }
172 mailmbox_done(f); 173 mailmbox_done(f);
173} 174}
174 175
175encodedString* MBOXwrapper::fetchRawBody(const RecMailP&mail) 176encodedString* MBOXwrapper::fetchRawBody(const RecMailP&mail)
176{ 177{
177 RecBody body; 178 RecBody body;
178 mailstorage*storage = mailstorage_new(NULL); 179 mailstorage*storage = mailstorage_new(NULL);
179 QString p = MBOXPath+"/"; 180 QString p = MBOXPath+"/";
180 p+=mail->getMbox(); 181 p+=mail->getMbox();
181 mailmessage * msg; 182 mailmessage * msg;
182 char*data=0; 183 char*data=0;
183 size_t size; 184 size_t size;
184 185
185 int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); 186 int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0);
186 mailfolder*folder; 187 mailfolder*folder;
187 folder = mailfolder_new( storage,(char*)p.latin1(),NULL); 188 folder = mailfolder_new( storage,(char*)p.latin1(),NULL);
188 r = mailfolder_connect(folder); 189 r = mailfolder_connect(folder);
189 if (r != MAIL_NO_ERROR) { 190 if (r != MAIL_NO_ERROR) {
190 Global::statusMessage(tr("Error initializing mbox")); 191 Global::statusMessage(i18n("Error initializing mbox"));
191 mailfolder_free(folder); 192 mailfolder_free(folder);
192 mailstorage_free(storage); 193 mailstorage_free(storage);
193 return 0; 194 return 0;
194 } 195 }
195 r = mailsession_get_message(folder->fld_session, mail->getNumber(), &msg); 196 r = mailsession_get_message(folder->fld_session, mail->getNumber(), &msg);
196 if (r != MAIL_NO_ERROR) { 197 if (r != MAIL_NO_ERROR) {
197 Global::statusMessage(tr("Error fetching mail %i").arg(mail->getNumber())); 198 Global::statusMessage(i18n("Error fetching mail %i").arg(mail->getNumber()));
198 mailfolder_free(folder); 199 mailfolder_free(folder);
199 mailstorage_free(storage); 200 mailstorage_free(storage);
200 return 0; 201 return 0;
201 } 202 }
202 r = mailmessage_fetch(msg,&data,&size); 203 r = mailmessage_fetch(msg,&data,&size);
203 if (r != MAIL_NO_ERROR) { 204 if (r != MAIL_NO_ERROR) {
204 Global::statusMessage(tr("Error fetching mail %i").arg(mail->getNumber())); 205 Global::statusMessage(i18n("Error fetching mail %i").arg(mail->getNumber()));
205 mailfolder_free(folder); 206 mailfolder_free(folder);
206 mailstorage_free(storage); 207 mailstorage_free(storage);
207 mailmessage_free(msg); 208 mailmessage_free(msg);
208 return 0; 209 return 0;
209 } 210 }
210 encodedString*result = new encodedString(data,size); 211 encodedString*result = new encodedString(data,size);
211 212
212 mailfolder_free(folder); 213 mailfolder_free(folder);
213 mailstorage_free(storage); 214 mailstorage_free(storage);
214 mailmessage_free(msg); 215 mailmessage_free(msg);
215 return result; 216 return result;
216} 217}
@@ -248,83 +249,83 @@ void MBOXwrapper::deleteMails(mailmbox_folder*f,const QValueList<RecMailP> &targ
248 249
249int MBOXwrapper::deleteAllMail(const FolderP&tfolder) 250int MBOXwrapper::deleteAllMail(const FolderP&tfolder)
250{ 251{
251 if (!tfolder) return 0; 252 if (!tfolder) return 0;
252 QString p = MBOXPath+"/"+tfolder->getDisplayName(); 253 QString p = MBOXPath+"/"+tfolder->getDisplayName();
253 int res = 1; 254 int res = 1;
254 255
255 mailfolder*folder = 0; 256 mailfolder*folder = 0;
256 mailmessage_list*l=0; 257 mailmessage_list*l=0;
257 mailstorage*storage = mailstorage_new(NULL); 258 mailstorage*storage = mailstorage_new(NULL);
258 int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); 259 int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0);
259 if (r != MAIL_NO_ERROR) { 260 if (r != MAIL_NO_ERROR) {
260 Global::statusMessage(tr("Error initializing mbox")); 261 Global::statusMessage(i18n("Error initializing mbox"));
261 res = 0; 262 res = 0;
262 } 263 }
263 if (res) { 264 if (res) {
264 folder = mailfolder_new( storage,(char*)p.latin1(),NULL); 265 folder = mailfolder_new( storage,(char*)p.latin1(),NULL);
265 r = mailfolder_connect(folder); 266 r = mailfolder_connect(folder);
266 if (r != MAIL_NO_ERROR) { 267 if (r != MAIL_NO_ERROR) {
267 Global::statusMessage(tr("Error initializing mbox")); 268 Global::statusMessage(i18n("Error initializing mbox"));
268 res = 0; 269 res = 0;
269 } 270 }
270 } 271 }
271 if (res) { 272 if (res) {
272 r = mailsession_get_messages_list(folder->fld_session,&l); 273 r = mailsession_get_messages_list(folder->fld_session,&l);
273 if (r != MAIL_NO_ERROR) { 274 if (r != MAIL_NO_ERROR) {
274 ; // << "Error message list" << oendl; 275 ; // << "Error message list" << oendl;
275 res=0; 276 res=0;
276 } 277 }
277 } 278 }
278 for(unsigned int i = 0 ; l!= 0 && res==1 && i < carray_count(l->msg_tab) ; ++i) { 279 for(unsigned int i = 0 ; l!= 0 && res==1 && i < carray_count(l->msg_tab) ; ++i) {
279 r = mailsession_remove_message(folder->fld_session,i+1); 280 r = mailsession_remove_message(folder->fld_session,i+1);
280 if (r != MAIL_NO_ERROR) { 281 if (r != MAIL_NO_ERROR) {
281 Global::statusMessage(tr("Error deleting mail %1").arg(i+1)); 282 Global::statusMessage(i18n("Error deleting mail %1").arg(i+1));
282 res = 0; 283 res = 0;
283 break; 284 break;
284 } 285 }
285 } 286 }
286 if (l) mailmessage_list_free(l); 287 if (l) mailmessage_list_free(l);
287 if (folder) mailfolder_free(folder); 288 if (folder) mailfolder_free(folder);
288 if (storage) mailstorage_free(storage); 289 if (storage) mailstorage_free(storage);
289 return res; 290 return res;
290} 291}
291 292
292int MBOXwrapper::deleteMbox(const FolderP&tfolder) 293int MBOXwrapper::deleteMbox(const FolderP&tfolder)
293{ 294{
294 if (!tfolder) return 0; 295 if (!tfolder) return 0;
295 QString p = MBOXPath+"/"+tfolder->getDisplayName(); 296 QString p = MBOXPath+"/"+tfolder->getDisplayName();
296 QFile fi(p); 297 QFile fi(p);
297 if (!fi.exists()) { 298 if (!fi.exists()) {
298 Global::statusMessage(tr("Mailbox doesn't exist.")); 299 Global::statusMessage(i18n("Mailbox doesn't exist."));
299 return 0; 300 return 0;
300 } 301 }
301 if (!fi.remove()) { 302 if (!fi.remove()) {
302 Global::statusMessage(tr("Error deleting Mailbox.")); 303 Global::statusMessage(i18n("Error deleting Mailbox."));
303 return 0; 304 return 0;
304 } 305 }
305 return 1; 306 return 1;
306} 307}
307 308
308void MBOXwrapper::statusFolder(folderStat&target_stat,const QString & mailbox) 309void MBOXwrapper::statusFolder(folderStat&target_stat,const QString & mailbox)
309{ 310{
310 mailfolder*folder = 0; 311 mailfolder*folder = 0;
311 mailstorage*storage = mailstorage_new(NULL); 312 mailstorage*storage = mailstorage_new(NULL);
312 target_stat.message_count = 0; 313 target_stat.message_count = 0;
313 target_stat.message_unseen = 0; 314 target_stat.message_unseen = 0;
314 target_stat.message_recent = 0; 315 target_stat.message_recent = 0;
315 QString p = MBOXPath+"/"+mailbox; 316 QString p = MBOXPath+"/"+mailbox;
316 QFile fi(p); 317 QFile fi(p);
317 if (!fi.exists()) { 318 if (!fi.exists()) {
318 Global::statusMessage(tr("Mailbox doesn't exist.")); 319 Global::statusMessage(i18n("Mailbox doesn't exist."));
319 return; 320 return;
320 } 321 }
321 int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); 322 int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0);
322 folder = mailfolder_new( storage,(char*)p.latin1(),NULL); 323 folder = mailfolder_new( storage,(char*)p.latin1(),NULL);
323 r = mailfolder_connect(folder); 324 r = mailfolder_connect(folder);
324 r = mailsession_status_folder(folder->fld_session,(char*)mailbox.latin1(),&target_stat.message_count, 325 r = mailsession_status_folder(folder->fld_session,(char*)mailbox.latin1(),&target_stat.message_count,
325 &target_stat.message_recent,&target_stat.message_unseen); 326 &target_stat.message_recent,&target_stat.message_unseen);
326 if (folder) mailfolder_free(folder); 327 if (folder) mailfolder_free(folder);
327 if (storage) mailstorage_free(storage); 328 if (storage) mailstorage_free(storage);
328} 329}
329 330
330MAILLIB::ATYPE MBOXwrapper::getType()const 331MAILLIB::ATYPE MBOXwrapper::getType()const
diff --git a/kmicromail/libmailwrapper/pop3wrapper.cpp b/kmicromail/libmailwrapper/pop3wrapper.cpp
index 9d52f52..2888f7c 100644
--- a/kmicromail/libmailwrapper/pop3wrapper.cpp
+++ b/kmicromail/libmailwrapper/pop3wrapper.cpp
@@ -1,19 +1,20 @@
1// CHANGED 2004-09-31 Lutz Rogowski 1// CHANGED 2004-09-31 Lutz Rogowski
2#include <stdlib.h> 2#include <stdlib.h>
3#include "pop3wrapper.h" 3#include "pop3wrapper.h"
4#include "mailtypes.h" 4#include "mailtypes.h"
5#include "logindialog.h" 5#include "logindialog.h"
6#include <libetpan/libetpan.h> 6#include <libetpan/libetpan.h>
7 7
8#include <klocale.h>
8 9
9#include <qpe/global.h> 10#include <qpe/global.h>
10#include <qfile.h> 11#include <qfile.h>
11#include <qprogressbar.h> 12#include <qprogressbar.h>
12#include <qapplication.h> 13#include <qapplication.h>
13 14
14/* we don't fetch messages larger than 5 MB */ 15/* we don't fetch messages larger than 5 MB */
15#define HARD_MSG_SIZE_LIMIT 5242880 16#define HARD_MSG_SIZE_LIMIT 5242880
16 17
17using namespace Opie::Core; 18using namespace Opie::Core;
18POP3wrapper::POP3wrapper( POP3account *a ) 19POP3wrapper::POP3wrapper( POP3account *a )
19: Genericwrapper() { 20: Genericwrapper() {
@@ -98,25 +99,25 @@ RecBodyP POP3wrapper::fetchBody( const RecMailP &mail ) {
98 99
99 return body; 100 return body;
100} 101}
101 102
102void POP3wrapper::listMessages(const QString &, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb ) 103void POP3wrapper::listMessages(const QString &, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb )
103{ 104{
104 login(); 105 login();
105 if (!m_pop3) 106 if (!m_pop3)
106 return; 107 return;
107 uint32_t res_messages,res_recent,res_unseen; 108 uint32_t res_messages,res_recent,res_unseen;
108 mailsession_status_folder(m_pop3->sto_session,"INBOX",&res_messages,&res_recent,&res_unseen); 109 mailsession_status_folder(m_pop3->sto_session,"INBOX",&res_messages,&res_recent,&res_unseen);
109 parseList(target,m_pop3->sto_session,"INBOX", false, maxSizeInKb); 110 parseList(target,m_pop3->sto_session,"INBOX", false, maxSizeInKb);
110 Global::statusMessage( tr("Mailbox contains %1 mail(s)").arg(res_messages)); 111 Global::statusMessage( i18n("Mailbox contains %1 mail(s)").arg(res_messages));
111} 112}
112 113
113void POP3wrapper::login() 114void POP3wrapper::login()
114{ 115{
115 if (account->getOffline()) 116 if (account->getOffline())
116 return; 117 return;
117 /* we'll hold the line */ 118 /* we'll hold the line */
118 if ( m_pop3 != NULL ) 119 if ( m_pop3 != NULL )
119 return; 120 return;
120 121
121 QString server,user, pass; 122 QString server,user, pass;
122 uint16_t port; 123 uint16_t port;
@@ -156,25 +157,25 @@ void POP3wrapper::login()
156 } else if ( conntypeset == 0 ) { 157 } else if ( conntypeset == 0 ) {
157 conntype = CONNECTION_TYPE_TRY_STARTTLS; 158 conntype = CONNECTION_TYPE_TRY_STARTTLS;
158 } 159 }
159 160
160 //(ssl?CONNECTION_TYPE_TLS:CONNECTION_TYPE_PLAIN); 161 //(ssl?CONNECTION_TYPE_TLS:CONNECTION_TYPE_PLAIN);
161 162
162 pop3_mailstorage_init(m_pop3,(char*)server.latin1(), port, NULL, conntype, POP3_AUTH_TYPE_PLAIN, 163 pop3_mailstorage_init(m_pop3,(char*)server.latin1(), port, NULL, conntype, POP3_AUTH_TYPE_PLAIN,
163 (char*)user.latin1(),(char*)pass.latin1(),0,0,0); 164 (char*)user.latin1(),(char*)pass.latin1(),0,0,0);
164 165
165 err = mailstorage_connect(m_pop3); 166 err = mailstorage_connect(m_pop3);
166 if (err != MAIL_NO_ERROR) { 167 if (err != MAIL_NO_ERROR) {
167 ; // odebug << QString( "FEHLERNUMMER %1" ).arg( err ) << oendl; 168 ; // odebug << QString( "FEHLERNUMMER %1" ).arg( err ) << oendl;
168 Global::statusMessage(tr("Error %1 initializing folder").arg( err )); 169 Global::statusMessage(i18n("Error %1 initializing folder").arg( err ));
169 mailstorage_free(m_pop3); 170 mailstorage_free(m_pop3);
170 m_pop3 = 0; 171 m_pop3 = 0;
171 } else { 172 } else {
172 mailsession * session = m_pop3->sto_session; 173 mailsession * session = m_pop3->sto_session;
173 mailpop3 * mail = ( ( pop3_session_state_data * )session->sess_data )->pop3_session; 174 mailpop3 * mail = ( ( pop3_session_state_data * )session->sess_data )->pop3_session;
174 if (mail) { 175 if (mail) {
175 mail->pop3_progr_fun = &pop3_progress; 176 mail->pop3_progr_fun = &pop3_progress;
176 } 177 }
177 } 178 }
178} 179}
179 180
180void POP3wrapper::logout() 181void POP3wrapper::logout()
@@ -193,79 +194,79 @@ QValueList<Opie::Core::OSmartPointer<Folder> >* POP3wrapper::listFolders() {
193 return folders; 194 return folders;
194} 195}
195 196
196void POP3wrapper::deleteMailList(const QValueList<RecMailP>&target) 197void POP3wrapper::deleteMailList(const QValueList<RecMailP>&target)
197{ 198{
198 login(); 199 login();
199 if (!m_pop3) 200 if (!m_pop3)
200 return; 201 return;
201 int iii = 0; 202 int iii = 0;
202 int count = target.count(); 203 int count = target.count();
203 204
204 QProgressBar wid ( count ); 205 QProgressBar wid ( count );
205 wid.setCaption( tr("Deleting ...")); 206 wid.setCaption( i18n("Deleting ..."));
206 wid.show(); 207 wid.show();
207 while (iii < count ) { 208 while (iii < count ) {
208 Global::statusMessage(tr("Delete message %1 of %2").arg(iii).arg(count)); 209 Global::statusMessage(i18n("Delete message %1 of %2").arg(iii).arg(count));
209 wid.setProgress( iii ); 210 wid.setProgress( iii );
210 wid.raise(); 211 wid.raise();
211 qApp->processEvents(); 212 qApp->processEvents();
212 //qDebug("delete "); 213 //qDebug("delete ");
213 RecMailP mail = (*target.at( iii )); 214 RecMailP mail = (*target.at( iii ));
214 int err = mailsession_remove_message(m_pop3->sto_session,mail->getNumber()); 215 int err = mailsession_remove_message(m_pop3->sto_session,mail->getNumber());
215 if (err != MAIL_NO_ERROR) { 216 if (err != MAIL_NO_ERROR) {
216 Global::statusMessage(tr("Error deleting mail")); 217 Global::statusMessage(i18n("Error deleting mail"));
217 } 218 }
218 ++iii; 219 ++iii;
219 } 220 }
220} 221}
221void POP3wrapper::deleteMail(const RecMailP&mail) { 222void POP3wrapper::deleteMail(const RecMailP&mail) {
222 login(); 223 login();
223 if (!m_pop3) 224 if (!m_pop3)
224 return; 225 return;
225 int err = mailsession_remove_message(m_pop3->sto_session,mail->getNumber()); 226 int err = mailsession_remove_message(m_pop3->sto_session,mail->getNumber());
226 if (err != MAIL_NO_ERROR) { 227 if (err != MAIL_NO_ERROR) {
227 Global::statusMessage(tr("error deleting mail")); 228 Global::statusMessage(i18n("error deleting mail"));
228 } 229 }
229} 230}
230 231
231void POP3wrapper::answeredMail(const RecMailP&) {} 232void POP3wrapper::answeredMail(const RecMailP&) {}
232 233
233int POP3wrapper::deleteAllMail(const FolderP&) { 234int POP3wrapper::deleteAllMail(const FolderP&) {
234 login(); 235 login();
235 if (!m_pop3) 236 if (!m_pop3)
236 return 0; 237 return 0;
237 int res = 1; 238 int res = 1;
238 239
239 uint32_t result = 0; 240 uint32_t result = 0;
240 int err = mailsession_messages_number(m_pop3->sto_session,NULL,&result); 241 int err = mailsession_messages_number(m_pop3->sto_session,NULL,&result);
241 if (err != MAIL_NO_ERROR) { 242 if (err != MAIL_NO_ERROR) {
242 Global::statusMessage(tr("Error getting folder info")); 243 Global::statusMessage(i18n("Error getting folder info"));
243 return 0; 244 return 0;
244 } 245 }
245 246
246 247
247 248
248 QProgressBar wid ( result ); 249 QProgressBar wid ( result );
249 wid.setCaption( tr("Deleting ...")); 250 wid.setCaption( i18n("Deleting ..."));
250 wid.show(); 251 wid.show();
251 for (unsigned int i = 0; i < result; ++i) { 252 for (unsigned int i = 0; i < result; ++i) {
252 Global::statusMessage(tr("Delete message %1 of %2").arg(i).arg(result)); 253 Global::statusMessage(i18n("Delete message %1 of %2").arg(i).arg(result));
253 wid.setProgress( i ); 254 wid.setProgress( i );
254 wid.raise(); 255 wid.raise();
255 qApp->processEvents(); 256 qApp->processEvents();
256 257
257 err = mailsession_remove_message(m_pop3->sto_session,i+1); 258 err = mailsession_remove_message(m_pop3->sto_session,i+1);
258 if (err != MAIL_NO_ERROR) { 259 if (err != MAIL_NO_ERROR) {
259 Global::statusMessage(tr("Error deleting mail %1").arg(i+1)); 260 Global::statusMessage(i18n("Error deleting mail %1").arg(i+1));
260 res=0; 261 res=0;
261 } 262 }
262 break; 263 break;
263 } 264 }
264 return res; 265 return res;
265} 266}
266 267
267void POP3wrapper::statusFolder(folderStat&target_stat,const QString&) { 268void POP3wrapper::statusFolder(folderStat&target_stat,const QString&) {
268 login(); 269 login();
269 target_stat.message_count = 0; 270 target_stat.message_count = 0;
270 target_stat.message_unseen = 0; 271 target_stat.message_unseen = 0;
271 target_stat.message_recent = 0; 272 target_stat.message_recent = 0;
diff --git a/kmicromail/libmailwrapper/smtpwrapper.cpp b/kmicromail/libmailwrapper/smtpwrapper.cpp
index d5a528c..dee1477 100644
--- a/kmicromail/libmailwrapper/smtpwrapper.cpp
+++ b/kmicromail/libmailwrapper/smtpwrapper.cpp
@@ -5,24 +5,25 @@
5#include "mailtypes.h" 5#include "mailtypes.h"
6#include "sendmailprogress.h" 6#include "sendmailprogress.h"
7 7
8//#include <opie2/odebug.h> 8//#include <opie2/odebug.h>
9//#include <qt.h> 9//#include <qt.h>
10#include <qapplication.h> 10#include <qapplication.h>
11#include <qmessagebox.h> 11#include <qmessagebox.h>
12#include <stdlib.h> 12#include <stdlib.h>
13#include <qpe/config.h> 13#include <qpe/config.h>
14#include <qpe/qcopenvelope_qws.h> 14#include <qpe/qcopenvelope_qws.h>
15 15
16#include <libetpan/libetpan.h> 16#include <libetpan/libetpan.h>
17#include <klocale.h>
17 18
18 19
19using namespace Opie::Core; 20using namespace Opie::Core;
20progressMailSend*SMTPwrapper::sendProgress = 0; 21progressMailSend*SMTPwrapper::sendProgress = 0;
21 22
22SMTPwrapper::SMTPwrapper(SMTPaccount * aSmtp ) 23SMTPwrapper::SMTPwrapper(SMTPaccount * aSmtp )
23 : Generatemail() 24 : Generatemail()
24{ 25{
25 m_SmtpAccount = aSmtp; 26 m_SmtpAccount = aSmtp;
26 Config cfg( "mail" ); 27 Config cfg( "mail" );
27 cfg.setGroup( "Status" ); 28 cfg.setGroup( "Status" );
28 m_queuedMail = cfg.readNumEntry( "outgoing", 0 ); 29 m_queuedMail = cfg.readNumEntry( "outgoing", 0 );
@@ -35,61 +36,61 @@ SMTPwrapper::~SMTPwrapper()
35{ 36{
36 disc_server(); 37 disc_server();
37} 38}
38 39
39void SMTPwrapper::emitQCop( int queued ) { 40void SMTPwrapper::emitQCop( int queued ) {
40 QCopEnvelope env( "QPE/Pim", "outgoingMails(int)" ); 41 QCopEnvelope env( "QPE/Pim", "outgoingMails(int)" );
41 env << queued; 42 env << queued;
42} 43}
43 44
44QString SMTPwrapper::mailsmtpError( int errnum ) { 45QString SMTPwrapper::mailsmtpError( int errnum ) {
45 switch ( errnum ) { 46 switch ( errnum ) {
46 case MAILSMTP_NO_ERROR: 47 case MAILSMTP_NO_ERROR:
47 return tr( "No error" ); 48 return i18n( "No error" );
48 case MAILSMTP_ERROR_UNEXPECTED_CODE: 49 case MAILSMTP_ERROR_UNEXPECTED_CODE:
49 return tr( "Unexpected error code" ); 50 return i18n( "Unexpected error code" );
50 case MAILSMTP_ERROR_SERVICE_NOT_AVAILABLE: 51 case MAILSMTP_ERROR_SERVICE_NOT_AVAILABLE:
51 return tr( "Service not available" ); 52 return i18n( "Service not available" );
52 case MAILSMTP_ERROR_STREAM: 53 case MAILSMTP_ERROR_STREAM:
53 return tr( "Stream error" ); 54 return i18n( "Stream error" );
54 case MAILSMTP_ERROR_HOSTNAME: 55 case MAILSMTP_ERROR_HOSTNAME:
55 return tr( "gethostname() failed" ); 56 return i18n( "gethostname() failed" );
56 case MAILSMTP_ERROR_NOT_IMPLEMENTED: 57 case MAILSMTP_ERROR_NOT_IMPLEMENTED:
57 return tr( "Not implemented" ); 58 return i18n( "Not implemented" );
58 case MAILSMTP_ERROR_ACTION_NOT_TAKEN: 59 case MAILSMTP_ERROR_ACTION_NOT_TAKEN:
59 return tr( "Error, action not taken" ); 60 return i18n( "Error, action not taken" );
60 case MAILSMTP_ERROR_EXCEED_STORAGE_ALLOCATION: 61 case MAILSMTP_ERROR_EXCEED_STORAGE_ALLOCATION:
61 return tr( "Data exceeds storage allocation" ); 62 return i18n( "Data exceeds storage allocation" );
62 case MAILSMTP_ERROR_IN_PROCESSING: 63 case MAILSMTP_ERROR_IN_PROCESSING:
63 return tr( "Error in processing" ); 64 return i18n( "Error in processing" );
64 case MAILSMTP_ERROR_STARTTLS_NOT_SUPPORTED: 65 case MAILSMTP_ERROR_STARTTLS_NOT_SUPPORTED:
65 return tr( "Starttls not supported" ); 66 return i18n( "Starttls not supported" );
66 // case MAILSMTP_ERROR_INSUFFISANT_SYSTEM_STORAGE: 67 // case MAILSMTP_ERROR_INSUFFISANT_SYSTEM_STORAGE:
67 // return tr( "Insufficient system storage" ); 68 // return i18n( "Insufficient system storage" );
68 case MAILSMTP_ERROR_MAILBOX_UNAVAILABLE: 69 case MAILSMTP_ERROR_MAILBOX_UNAVAILABLE:
69 return tr( "Mailbox unavailable" ); 70 return i18n( "Mailbox unavailable" );
70 case MAILSMTP_ERROR_MAILBOX_NAME_NOT_ALLOWED: 71 case MAILSMTP_ERROR_MAILBOX_NAME_NOT_ALLOWED:
71 return tr( "Mailbox name not allowed" ); 72 return i18n( "Mailbox name not allowed" );
72 case MAILSMTP_ERROR_BAD_SEQUENCE_OF_COMMAND: 73 case MAILSMTP_ERROR_BAD_SEQUENCE_OF_COMMAND:
73 return tr( "Bad command sequence" ); 74 return i18n( "Bad command sequence" );
74 case MAILSMTP_ERROR_USER_NOT_LOCAL: 75 case MAILSMTP_ERROR_USER_NOT_LOCAL:
75 return tr( "User not local" ); 76 return i18n( "User not local" );
76 case MAILSMTP_ERROR_TRANSACTION_FAILED: 77 case MAILSMTP_ERROR_TRANSACTION_FAILED:
77 return tr( "Transaction failed" ); 78 return i18n( "Transaction failed" );
78 case MAILSMTP_ERROR_MEMORY: 79 case MAILSMTP_ERROR_MEMORY:
79 return tr( "Memory error" ); 80 return i18n( "Memory error" );
80 case MAILSMTP_ERROR_CONNECTION_REFUSED: 81 case MAILSMTP_ERROR_CONNECTION_REFUSED:
81 return tr( "Connection refused" ); 82 return i18n( "Connection refused" );
82 default: 83 default:
83 return tr( "Unknown error code" ); 84 return i18n( "Unknown error code" );
84 } 85 }
85} 86}
86 87
87 88
88void SMTPwrapper::progress( size_t current, size_t maximum ) { 89void SMTPwrapper::progress( size_t current, size_t maximum ) {
89 if (SMTPwrapper::sendProgress) { 90 if (SMTPwrapper::sendProgress) {
90 SMTPwrapper::sendProgress->setSingleMail(current, maximum ); 91 SMTPwrapper::sendProgress->setSingleMail(current, maximum );
91 qApp->processEvents(); 92 qApp->processEvents();
92 } 93 }
93} 94}
94 95
95void SMTPwrapper::storeMail(const char*mail, size_t length, const QString&box) { 96void SMTPwrapper::storeMail(const char*mail, size_t length, const QString&box) {
@@ -143,26 +144,26 @@ bool SMTPwrapper::smtpSend( mailmime *mail,bool later) {
143 } 144 }
144 if (rcpts) 145 if (rcpts)
145 smtp_address_list_free( rcpts ); 146 smtp_address_list_free( rcpts );
146 return result; 147 return result;
147} 148}
148 149
149void SMTPwrapper::storeFailedMail(const char*data,unsigned int size, const char*failuremessage) 150void SMTPwrapper::storeFailedMail(const char*data,unsigned int size, const char*failuremessage)
150{ 151{
151 if (data) { 152 if (data) {
152 storeMail(data,size,"Sendfailed"); 153 storeMail(data,size,"Sendfailed");
153 } 154 }
154 if (failuremessage) { 155 if (failuremessage) {
155 QMessageBox::critical(0,tr("Error sending mail"), 156 QMessageBox::critical(0,i18n("Error sending mail"),
156 tr("<center>%1</center>").arg(failuremessage)); 157 i18n("<center>%1</center>").arg(failuremessage));
157 } 158 }
158} 159}
159 160
160int SMTPwrapper::start_smtp_tls() 161int SMTPwrapper::start_smtp_tls()
161{ 162{
162 if (!m_smtp) { 163 if (!m_smtp) {
163 return MAILSMTP_ERROR_IN_PROCESSING; 164 return MAILSMTP_ERROR_IN_PROCESSING;
164 } 165 }
165 int err = mailesmtp_starttls(m_smtp); 166 int err = mailesmtp_starttls(m_smtp);
166 if (err != MAILSMTP_NO_ERROR) return err; 167 if (err != MAILSMTP_NO_ERROR) return err;
167 mailstream_low * low; 168 mailstream_low * low;
168 mailstream_low * new_low; 169 mailstream_low * new_low;
@@ -212,77 +213,77 @@ void SMTPwrapper::connect_server()
212 213
213 int err = MAILSMTP_NO_ERROR; 214 int err = MAILSMTP_NO_ERROR;
214 ; // odebug << "Servername " << server << " at port " << port << "" << oendl; 215 ; // odebug << "Servername " << server << " at port " << port << "" << oendl;
215 if ( ssl ) { 216 if ( ssl ) {
216 ; // odebug << "SSL session" << oendl; 217 ; // odebug << "SSL session" << oendl;
217 err = mailsmtp_ssl_connect( m_smtp, server.latin1(), port ); 218 err = mailsmtp_ssl_connect( m_smtp, server.latin1(), port );
218 } else { 219 } else {
219 ; // odebug << "No SSL session" << oendl; 220 ; // odebug << "No SSL session" << oendl;
220 err = mailsmtp_socket_connect( m_smtp, server.latin1(), port ); 221 err = mailsmtp_socket_connect( m_smtp, server.latin1(), port );
221 } 222 }
222 if ( err != MAILSMTP_NO_ERROR ) { 223 if ( err != MAILSMTP_NO_ERROR ) {
223 ; // odebug << "Error init connection" << oendl; 224 ; // odebug << "Error init connection" << oendl;
224 failuretext = tr("Error init SMTP connection: %1").arg(mailsmtpError(err)); 225 failuretext = i18n("Error init SMTP connection: %1").arg(mailsmtpError(err));
225 result = 0; 226 result = 0;
226 } 227 }
227 228
228 /* switch to tls after init 'cause there it will send the ehlo */ 229 /* switch to tls after init 'cause there it will send the ehlo */
229 if (result) { 230 if (result) {
230 err = mailsmtp_init( m_smtp ); 231 err = mailsmtp_init( m_smtp );
231 if (err != MAILSMTP_NO_ERROR) { 232 if (err != MAILSMTP_NO_ERROR) {
232 result = 0; 233 result = 0;
233 failuretext = tr("Error init SMTP connection: %1").arg(mailsmtpError(err)); 234 failuretext = i18n("Error init SMTP connection: %1").arg(mailsmtpError(err));
234 } 235 }
235 } 236 }
236 237
237 if (try_tls) { 238 if (try_tls) {
238 err = start_smtp_tls(); 239 err = start_smtp_tls();
239 if (err != MAILSMTP_NO_ERROR) { 240 if (err != MAILSMTP_NO_ERROR) {
240 try_tls = false; 241 try_tls = false;
241 } else { 242 } else {
242 err = mailesmtp_ehlo(m_smtp); 243 err = mailesmtp_ehlo(m_smtp);
243 } 244 }
244 } 245 }
245 246
246 if (!try_tls && force_tls) { 247 if (!try_tls && force_tls) {
247 result = 0; 248 result = 0;
248 failuretext = tr("Error init SMTP tls: %1").arg(mailsmtpError(err)); 249 failuretext = i18n("Error init SMTP tls: %1").arg(mailsmtpError(err));
249 } 250 }
250 251
251 if (result==1 && m_SmtpAccount->getLogin() ) { 252 if (result==1 && m_SmtpAccount->getLogin() ) {
252 ; // odebug << "smtp with auth" << oendl; 253 ; // odebug << "smtp with auth" << oendl;
253 if ( m_SmtpAccount->getUser().isEmpty() || m_SmtpAccount->getPassword().isEmpty() ) { 254 if ( m_SmtpAccount->getUser().isEmpty() || m_SmtpAccount->getPassword().isEmpty() ) {
254 // get'em 255 // get'em
255 LoginDialog login( m_SmtpAccount->getUser(), 256 LoginDialog login( m_SmtpAccount->getUser(),
256 m_SmtpAccount->getPassword(), NULL, 0, true ); 257 m_SmtpAccount->getPassword(), NULL, 0, true );
257 login.show(); 258 login.show();
258 if ( QDialog::Accepted == login.exec() ) { 259 if ( QDialog::Accepted == login.exec() ) {
259 // ok 260 // ok
260 user = login.getUser(); 261 user = login.getUser();
261 pass = login.getPassword(); 262 pass = login.getPassword();
262 } else { 263 } else {
263 result = 0; 264 result = 0;
264 failuretext=tr("Login aborted - storing mail to localfolder"); 265 failuretext=i18n("Login aborted - storing mail to localfolder");
265 } 266 }
266 } else { 267 } else {
267 user = m_SmtpAccount->getUser(); 268 user = m_SmtpAccount->getUser();
268 pass = m_SmtpAccount->getPassword(); 269 pass = m_SmtpAccount->getPassword();
269 } 270 }
270 ; // odebug << "session->auth: " << m_smtp->auth << "" << oendl; 271 ; // odebug << "session->auth: " << m_smtp->auth << "" << oendl;
271 if (result) { 272 if (result) {
272 err = mailsmtp_auth( m_smtp, (char*)user.latin1(), (char*)pass.latin1() ); 273 err = mailsmtp_auth( m_smtp, (char*)user.latin1(), (char*)pass.latin1() );
273 if ( err == MAILSMTP_NO_ERROR ) { 274 if ( err == MAILSMTP_NO_ERROR ) {
274 ; // odebug << "auth ok" << oendl; 275 ; // odebug << "auth ok" << oendl;
275 } else { 276 } else {
276 failuretext = tr("Authentification failed"); 277 failuretext = i18n("Authentification failed");
277 result = 0; 278 result = 0;
278 } 279 }
279 } 280 }
280 } 281 }
281} 282}
282 283
283void SMTPwrapper::disc_server() 284void SMTPwrapper::disc_server()
284{ 285{
285 if (m_smtp) { 286 if (m_smtp) {
286 mailsmtp_quit( m_smtp ); 287 mailsmtp_quit( m_smtp );
287 mailsmtp_free( m_smtp ); 288 mailsmtp_free( m_smtp );
288 m_smtp = 0; 289 m_smtp = 0;
@@ -291,25 +292,25 @@ void SMTPwrapper::disc_server()
291 292
292int SMTPwrapper::smtpSend(char*from,clist*rcpts,const char*data,size_t size ) 293int SMTPwrapper::smtpSend(char*from,clist*rcpts,const char*data,size_t size )
293{ 294{
294 int err,result; 295 int err,result;
295 QString failuretext = ""; 296 QString failuretext = "";
296 297
297 connect_server(); 298 connect_server();
298 299
299 result = 1; 300 result = 1;
300 if (m_smtp) { 301 if (m_smtp) {
301 err = mailsmtp_send( m_smtp, from, rcpts, data, size ); 302 err = mailsmtp_send( m_smtp, from, rcpts, data, size );
302 if ( err != MAILSMTP_NO_ERROR ) { 303 if ( err != MAILSMTP_NO_ERROR ) {
303 failuretext=tr("Error sending mail: %1").arg(mailsmtpError(err)); 304 failuretext=i18n("Error sending mail: %1").arg(mailsmtpError(err));
304 result = 0; 305 result = 0;
305 } 306 }
306 } else { 307 } else {
307 result = 0; 308 result = 0;
308 } 309 }
309 310
310 if (!result) { 311 if (!result) {
311 storeFailedMail(data,size,failuretext); 312 storeFailedMail(data,size,failuretext);
312 } else { 313 } else {
313 ; // odebug << "Mail sent." << oendl; 314 ; // odebug << "Mail sent." << oendl;
314 storeMail(data,size,"Sent"); 315 storeMail(data,size,"Sent");
315 } 316 }
@@ -424,26 +425,26 @@ bool SMTPwrapper::flushOutbox() {
424 } else { 425 } else {
425 return true; 426 return true;
426 } 427 }
427 } 428 }
428 429
429 430
430 sendProgress = new progressMailSend(); 431 sendProgress = new progressMailSend();
431 sendProgress->show(); 432 sendProgress->show();
432 sendProgress->setMaxMails(mailsToSend.count()); 433 sendProgress->setMaxMails(mailsToSend.count());
433 434
434 while (mailsToSend.count()>0) { 435 while (mailsToSend.count()>0) {
435 if (sendQueuedMail(wrap, (*mailsToSend.begin()))==0) { 436 if (sendQueuedMail(wrap, (*mailsToSend.begin()))==0) {
436 QMessageBox::critical(0,tr("Error sending mail"), 437 QMessageBox::critical(0,i18n("Error sending mail"),
437 tr("Error sending queued mail - breaking")); 438 i18n("Error sending queued mail - breaking"));
438 returnValue = false; 439 returnValue = false;
439 break; 440 break;
440 } 441 }
441 mailsToRemove.append((*mailsToSend.begin())); 442 mailsToRemove.append((*mailsToSend.begin()));
442 mailsToSend.remove(mailsToSend.begin()); 443 mailsToSend.remove(mailsToSend.begin());
443 sendProgress->setCurrentMails(mailsToRemove.count()); 444 sendProgress->setCurrentMails(mailsToRemove.count());
444 } 445 }
445 if (reset_user_value) { 446 if (reset_user_value) {
446 m_SmtpAccount->setUser(oldUser); 447 m_SmtpAccount->setUser(oldUser);
447 m_SmtpAccount->setPassword(oldPw); 448 m_SmtpAccount->setPassword(oldPw);
448 } 449 }
449 Config cfg( "mail" ); 450 Config cfg( "mail" );
diff --git a/kmicromail/nntpgroupsdlg.cpp b/kmicromail/nntpgroupsdlg.cpp
index c94d9fa..a461bdf 100644
--- a/kmicromail/nntpgroupsdlg.cpp
+++ b/kmicromail/nntpgroupsdlg.cpp
@@ -1,23 +1,24 @@
1#include "nntpgroupsdlg.h" 1#include "nntpgroupsdlg.h"
2#include "nntpgroups.h" 2#include "nntpgroups.h"
3#include <klocale.h>
3 4
4#include <libmailwrapper/settings.h> 5#include <libmailwrapper/settings.h>
5 6
6#include <qlayout.h> 7#include <qlayout.h>
7 8
8NNTPGroupsDlg::NNTPGroupsDlg(NNTPaccount *account,QWidget * parent, const char * name) 9NNTPGroupsDlg::NNTPGroupsDlg(NNTPaccount *account,QWidget * parent, const char * name)
9 : QDialog(parent,name,true,WStyle_ContextHelp) 10 : QDialog(parent,name,true,WStyle_ContextHelp)
10{ 11{
11 setCaption(tr("Subscribed newsgroups")); 12 setCaption(i18n("Subscribed newsgroups"));
12 m_Account = account; 13 m_Account = account;
13 QVBoxLayout*dlglayout = new QVBoxLayout(this); 14 QVBoxLayout*dlglayout = new QVBoxLayout(this);
14 dlglayout->setSpacing(2); 15 dlglayout->setSpacing(2);
15 dlglayout->setMargin(1); 16 dlglayout->setMargin(1);
16 groupsWidget = new NNTPGroups(account,this); 17 groupsWidget = new NNTPGroups(account,this);
17 dlglayout->addWidget(groupsWidget); 18 dlglayout->addWidget(groupsWidget);
18} 19}
19 20
20NNTPGroupsDlg::~NNTPGroupsDlg() 21NNTPGroupsDlg::~NNTPGroupsDlg()
21{ 22{
22} 23}
23 24
diff --git a/kmicromail/selectsmtp.cpp b/kmicromail/selectsmtp.cpp
index 24eced1..ff8b524 100644
--- a/kmicromail/selectsmtp.cpp
+++ b/kmicromail/selectsmtp.cpp
@@ -1,41 +1,42 @@
1#include "selectsmtp.h" 1#include "selectsmtp.h"
2#include <libmailwrapper/mailwrapper.h> 2#include <libmailwrapper/mailwrapper.h>
3 3
4#include <qcombobox.h> 4#include <qcombobox.h>
5#include <qcheckbox.h> 5#include <qcheckbox.h>
6#include <qmessagebox.h> 6#include <qmessagebox.h>
7#include <qpushbutton.h> 7#include <qpushbutton.h>
8#include <qlineedit.h> 8#include <qlineedit.h>
9#include <qlabel.h> 9#include <qlabel.h>
10#include <qtabwidget.h> 10#include <qtabwidget.h>
11#include <qlistview.h> 11#include <qlistview.h>
12#include <klocale.h>
12selectsmtp::selectsmtp(QWidget* parent, const char* name, bool modal, WFlags fl) 13selectsmtp::selectsmtp(QWidget* parent, const char* name, bool modal, WFlags fl)
13 : selectstoreui(parent,name,modal,fl) 14 : selectstoreui(parent,name,modal,fl)
14{ 15{
15 //m_smtpList.setAutoDelete(false); 16 //m_smtpList.setAutoDelete(false);
16 m_smtpList = 0; 17 m_smtpList = 0;
17 //headlabel->setText(tr("<center>Select SMTP account to use</center>")); 18 //headlabel->setText(i18n("<center>Select SMTP account to use</center>"));
18 headlabel->hide(); 19 headlabel->hide();
19 folderSelection->hide(); 20 folderSelection->hide();
20 folderLabel->hide(); 21 folderLabel->hide();
21 accountlabel->setText("<center>SMTP Accounts</center>"); 22 accountlabel->setText("<center>SMTP Accounts</center>");
22 Line1->hide(); 23 Line1->hide();
23 newFoldersel->hide(); 24 newFoldersel->hide();
24 newFolderedit->hide(); 25 newFolderedit->hide();
25 newFolderLabel->hide(); 26 newFolderLabel->hide();
26 Line2->hide(); 27 Line2->hide();
27 selMove->hide(); 28 selMove->hide();
28 m_current_smtp = 0; 29 m_current_smtp = 0;
29 setCaption(tr("Select SMTP Account")); 30 setCaption(i18n("Select SMTP Account"));
30} 31}
31 32
32selectsmtp::~selectsmtp() 33selectsmtp::~selectsmtp()
33{ 34{
34} 35}
35 36
36void selectsmtp::slotAccountselected(int which) 37void selectsmtp::slotAccountselected(int which)
37{ 38{
38 if (!m_smtpList || (unsigned)which>=m_smtpList->count() || which < 0) { 39 if (!m_smtpList || (unsigned)which>=m_smtpList->count() || which < 0) {
39 m_current_smtp = 0; 40 m_current_smtp = 0;
40 return; 41 return;
41 } 42 }
diff --git a/kmicromail/viewmail.cpp b/kmicromail/viewmail.cpp
index 32a3b7c..7cf5c8e 100644
--- a/kmicromail/viewmail.cpp
+++ b/kmicromail/viewmail.cpp
@@ -17,24 +17,25 @@
17 17
18#include <qpe/qpeapplication.h> 18#include <qpe/qpeapplication.h>
19 19
20/* QT */ 20/* QT */
21#include <qtextbrowser.h> 21#include <qtextbrowser.h>
22#include <qmessagebox.h> 22#include <qmessagebox.h>
23#include <qtextstream.h> 23#include <qtextstream.h>
24#include <qaction.h> 24#include <qaction.h>
25#include <qpopupmenu.h> 25#include <qpopupmenu.h>
26#include <qfile.h> 26#include <qfile.h>
27#include <qlayout.h> 27#include <qlayout.h>
28#include "koprefs.h" 28#include "koprefs.h"
29#include <klocale.h>
29 30
30//using namespace Opie::Ui; 31//using namespace Opie::Ui;
31//using namespace Opie::Core; 32//using namespace Opie::Core;
32 33
33AttachItem::AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, 34AttachItem::AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file,
34 const QString&fsize,int num,const QValueList<int>&path) 35 const QString&fsize,int num,const QValueList<int>&path)
35 : QListViewItem(parent,after),_partNum(num) 36 : QListViewItem(parent,after),_partNum(num)
36{ 37{
37 _path=path; 38 _path=path;
38 setText(0, mime); 39 setText(0, mime);
39 setText(1, desc); 40 setText(1, desc);
40 setText(2, file); 41 setText(2, file);
@@ -209,30 +210,30 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int
209 return; 210 return;
210 211
211 if ( ( ( AttachItem* )item )->Partnumber() == -1 ) 212 if ( ( ( AttachItem* )item )->Partnumber() == -1 )
212 { 213 {
213 setText(); 214 setText();
214 return; 215 return;
215 } 216 }
216 QPopupMenu *menu = new QPopupMenu(); 217 QPopupMenu *menu = new QPopupMenu();
217 int ret=0; 218 int ret=0;
218 219
219 if ( item->text( 0 ).left( 5 ) == "text/" || item->text(0)=="message/rfc822" ) 220 if ( item->text( 0 ).left( 5 ) == "text/" || item->text(0)=="message/rfc822" )
220 { 221 {
221 menu->insertItem( tr( "Show Text" ), 1 ); 222 menu->insertItem( i18n( "Show Text" ), 1 );
222 } 223 }
223 if (item->text(0).left(6)=="image/") { 224 if (item->text(0).left(6)=="image/") {
224 menu->insertItem(tr("Display image preview"),2); 225 menu->insertItem(i18n("Display image preview"),2);
225 } 226 }
226 menu->insertItem( tr( "Save Attachment" ), 0 ); 227 menu->insertItem( i18n( "Save Attachment" ), 0 );
227 menu->insertSeparator(1); 228 menu->insertSeparator(1);
228 229
229 ret = menu->exec( point, 0 ); 230 ret = menu->exec( point, 0 );
230 231
231 switch(ret) 232 switch(ret)
232 { 233 {
233 case 0: 234 case 0:
234 { 235 {
235 //MimeTypes types; 236 //MimeTypes types;
236 //types.insert( "all", "*" ); 237 //types.insert( "all", "*" );
237 QString str = KFileDialog::getSaveFileName( "/", item->text( 2 ), this ); 238 QString str = KFileDialog::getSaveFileName( "/", item->text( 2 ), this );
238 239
@@ -347,34 +348,34 @@ void ViewMail::setText()
347 { 348 {
348 toString += (*it); 349 toString += (*it);
349 } 350 }
350 for ( QStringList::Iterator it = ( m_mail2[1] ).begin(); it != ( m_mail2[1] ).end(); ++it ) 351 for ( QStringList::Iterator it = ( m_mail2[1] ).begin(); it != ( m_mail2[1] ).end(); ++it )
351 { 352 {
352 ccString += (*it); 353 ccString += (*it);
353 } 354 }
354 for ( QStringList::Iterator it = ( m_mail2[2] ).begin(); it != ( m_mail2[2] ).end(); ++it ) 355 for ( QStringList::Iterator it = ( m_mail2[2] ).begin(); it != ( m_mail2[2] ).end(); ++it )
355 { 356 {
356 bccString += (*it); 357 bccString += (*it);
357 } 358 }
358 359
359 setCaption( tr("E-Mail by %1").arg( m_mail[0] ) ); 360 setCaption( i18n("E-Mail by %1").arg( m_mail[0] ) );
360 361
361 m_mailHtml = "<html><body>" 362 m_mailHtml = "<html><body>"
362 "<table width=\"100%\" border=\"0\"><tr bgcolor=\"#FFDD76\"><td>" 363 "<table width=\"100%\" border=\"0\"><tr bgcolor=\"#FFDD76\"><td>"
363 "<div align=left><b>" + deHtml( m_mail[1] ) + "</b></div>" 364 "<div align=left><b>" + deHtml( m_mail[1] ) + "</b></div>"
364 "</td></tr><tr bgcolor=\"#EEEEE6\"><td>" 365 "</td></tr><tr bgcolor=\"#EEEEE6\"><td>"
365 "<b>" + tr( "From" ) + ": </b><font color=#6C86C0>" + deHtml( m_mail[0] ) + "</font><br>" 366 "<b>" + i18n( "From" ) + ": </b><font color=#6C86C0>" + deHtml( m_mail[0] ) + "</font><br>"
366 "<b>" + tr( "To" ) + ": </b><font color=#6C86C0>" + deHtml( toString ) + "</font><br><b>" + 367 "<b>" + i18n( "To" ) + ": </b><font color=#6C86C0>" + deHtml( toString ) + "</font><br><b>" +
367 tr( "Cc" ) + ": </b>" + deHtml( ccString ) + "<br>" 368 i18n( "Cc" ) + ": </b>" + deHtml( ccString ) + "<br>"
368 "<b>" + tr( "Date" ) + ": </b> " + m_mail[3] + 369 "<b>" + i18n( "Date" ) + ": </b> " + m_mail[3] +
369 "</td></tr></table><font>"; 370 "</td></tr></table><font>";
370 371
371 if ( !m_showHtml ) 372 if ( !m_showHtml )
372 { 373 {
373 browser->setText( QString( m_mailHtml) + deHtml( m_mail[2] ) + "</font></html>" ); 374 browser->setText( QString( m_mailHtml) + deHtml( m_mail[2] ) + "</font></html>" );
374 } 375 }
375 else 376 else
376 { 377 {
377 browser->setText( QString( m_mailHtml) + m_mail[2] + "</font></html>" ); 378 browser->setText( QString( m_mailHtml) + m_mail[2] + "</font></html>" );
378 } 379 }
379 // remove later in favor of a real handling 380 // remove later in favor of a real handling
380 m_gotBody = true; 381 m_gotBody = true;
@@ -417,25 +418,25 @@ QString ViewMail::deHtml(const QString &string)
417 QString string_ = string; 418 QString string_ = string;
418 string_.replace(QRegExp("&"), "&amp;"); 419 string_.replace(QRegExp("&"), "&amp;");
419 string_.replace(QRegExp("<"), "&lt;"); 420 string_.replace(QRegExp("<"), "&lt;");
420 string_.replace(QRegExp(">"), "&gt;"); 421 string_.replace(QRegExp(">"), "&gt;");
421 string_.replace(QRegExp("\\n"), "<br>"); 422 string_.replace(QRegExp("\\n"), "<br>");
422 return string_; 423 return string_;
423} 424}
424 425
425void ViewMail::slotReply() 426void ViewMail::slotReply()
426{ 427{
427 if (!m_gotBody) 428 if (!m_gotBody)
428 { 429 {
429 QMessageBox::information(this, tr("Error"), tr("<p>The mail body is not yet downloaded, so you cannot reply yet."), tr("Ok")); 430 QMessageBox::information(this, i18n("Error"), i18n("<p>The mail body is not yet downloaded, so you cannot reply yet."), i18n("Ok"));
430 return; 431 return;
431 } 432 }
432 433
433 QString rtext; 434 QString rtext;
434 rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose 435 rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose
435 .arg( m_mail[0] ) 436 .arg( m_mail[0] )
436 .arg( m_mail[3] ); 437 .arg( m_mail[3] );
437 438
438 QString text = m_mail[2]; 439 QString text = m_mail[2];
439 QStringList lines = QStringList::split(QRegExp("\\n"), text); 440 QStringList lines = QStringList::split(QRegExp("\\n"), text);
440 QStringList::Iterator it; 441 QStringList::Iterator it;
441 for (it = lines.begin(); it != lines.end(); it++) 442 for (it = lines.begin(); it != lines.end(); it++)
@@ -460,25 +461,25 @@ void ViewMail::slotReply()
460 composer.setInReplyTo(m_recMail->Msgid()); 461 composer.setInReplyTo(m_recMail->Msgid());
461 462
462 if ( QDialog::Accepted == KApplication::execDialog( &composer ) ) 463 if ( QDialog::Accepted == KApplication::execDialog( &composer ) )
463 { 464 {
464 m_recMail->Wrapper()->answeredMail(m_recMail); 465 m_recMail->Wrapper()->answeredMail(m_recMail);
465 } 466 }
466} 467}
467 468
468void ViewMail::slotForward() 469void ViewMail::slotForward()
469{ 470{
470 if (!m_gotBody) 471 if (!m_gotBody)
471 { 472 {
472 QMessageBox::information(this, tr("Error"), tr("<p>The mail body is not yet downloaded, so you cannot forward yet."), tr("Ok")); 473 QMessageBox::information(this, i18n("Error"), i18n("<p>The mail body is not yet downloaded, so you cannot forward yet."), i18n("Ok"));
473 return; 474 return;
474 } 475 }
475 476
476 QString ftext; 477 QString ftext;
477 ftext += QString("\n----- Forwarded message from %1 -----\n\n") 478 ftext += QString("\n----- Forwarded message from %1 -----\n\n")
478 .arg( m_mail[0] ); 479 .arg( m_mail[0] );
479 if (!m_mail[3].isNull()) 480 if (!m_mail[3].isNull())
480 ftext += QString("Date: %1\n") 481 ftext += QString("Date: %1\n")
481 .arg( m_mail[3] ); 482 .arg( m_mail[3] );
482 if (!m_mail[0].isNull()) 483 if (!m_mail[0].isNull())
483 ftext += QString("From: %1\n") 484 ftext += QString("From: %1\n")
484 .arg( m_mail[0] ); 485 .arg( m_mail[0] );
@@ -493,25 +494,25 @@ void ViewMail::slotForward()
493 494
494 Settings *settings = new Settings(); 495 Settings *settings = new Settings();
495 ComposeMail composer( settings ,this, 0, true); 496 ComposeMail composer( settings ,this, 0, true);
496 composer.setSubject( "Fwd: " + m_mail[1] ); 497 composer.setSubject( "Fwd: " + m_mail[1] );
497 composer.setMessage( ftext ); 498 composer.setMessage( ftext );
498 if ( QDialog::Accepted == KApplication::execDialog( &composer )) 499 if ( QDialog::Accepted == KApplication::execDialog( &composer ))
499 { 500 {
500 } 501 }
501} 502}
502 503
503void ViewMail::slotDeleteMail( ) 504void ViewMail::slotDeleteMail( )
504{ 505{
505 if ( QMessageBox::warning(this, tr("Delete Mail"), QString( tr("<p>Do you really want to delete this mail? <br><br>" ) + m_mail[0] + " - " + m_mail[1] ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) 506 if ( QMessageBox::warning(this, i18n("Delete Mail"), QString( i18n("<p>Do you really want to delete this mail? <br><br>" ) + m_mail[0] + " - " + m_mail[1] ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes )
506 { 507 {
507 m_recMail->Wrapper()->deleteMail( m_recMail ); 508 m_recMail->Wrapper()->deleteMail( m_recMail );
508 hide(); 509 hide();
509 deleted = true; 510 deleted = true;
510 } 511 }
511} 512}
512 513
513MailImageDlg::MailImageDlg(const QString&fname,QWidget *parent, const char *name, bool modal, WFlags f) 514MailImageDlg::MailImageDlg(const QString&fname,QWidget *parent, const char *name, bool modal, WFlags f)
514 : KDialog(parent,name,modal) 515 : KDialog(parent,name,modal)
515{ 516{
516 QVBoxLayout*dlglayout = new QVBoxLayout(this); 517 QVBoxLayout*dlglayout = new QVBoxLayout(this);
517 dlglayout->setSpacing(2); 518 dlglayout->setSpacing(2);
diff --git a/kmicromail/viewmailbase.cpp b/kmicromail/viewmailbase.cpp
index 705b57f..3d7ed42 100644
--- a/kmicromail/viewmailbase.cpp
+++ b/kmicromail/viewmailbase.cpp
@@ -1,79 +1,80 @@
1// CHANGED 2004-08-06 Lutz Rogowski 1// CHANGED 2004-08-06 Lutz Rogowski
2#include <qtextbrowser.h> 2#include <qtextbrowser.h>
3#include <qlistview.h> 3#include <qlistview.h>
4#include <qaction.h> 4#include <qaction.h>
5#include <qlabel.h> 5#include <qlabel.h>
6#include <qvbox.h> 6#include <qvbox.h>
7 7
8#include <qtoolbar.h> 8#include <qtoolbar.h>
9#include <qmenubar.h> 9#include <qmenubar.h>
10#include <kiconloader.h> 10#include <kiconloader.h>
11//#include <qpe/resource.h> 11//#include <qpe/resource.h>
12#include <klocale.h>
12 13
13#include "viewmailbase.h" 14#include "viewmailbase.h"
14//#include "opendiag.h" 15//#include "opendiag.h"
15 16
16ViewMailBase::ViewMailBase(QWidget *parent, const char *name, WFlags fl) 17ViewMailBase::ViewMailBase(QWidget *parent, const char *name, WFlags fl)
17 : QMainWindow(parent, name, fl) 18 : QMainWindow(parent, name, fl)
18{ 19{
19 20
20 setToolBarsMovable(false); 21 setToolBarsMovable(false);
21 22
22 toolbar = new QToolBar(this); 23 toolbar = new QToolBar(this);
23 menubar = new QMenuBar( toolbar ); 24 menubar = new QMenuBar( toolbar );
24 mailmenu = new QPopupMenu( menubar ); 25 mailmenu = new QPopupMenu( menubar );
25 menubar->insertItem( tr( "Mail" ), mailmenu ); 26 menubar->insertItem( i18n( "Mail" ), mailmenu );
26 27
27 toolbar->setHorizontalStretchable(true); 28 toolbar->setHorizontalStretchable(true);
28 addToolBar(toolbar); 29 addToolBar(toolbar);
29 30
30 reply = new QAction(tr("Reply"),SmallIcon("reply"), 0, 0, this); 31 reply = new QAction(i18n("Reply"),SmallIcon("reply"), 0, 0, this);
31 reply->addTo(toolbar); 32 reply->addTo(toolbar);
32 reply->addTo(mailmenu); 33 reply->addTo(mailmenu);
33 34
34 forward = new QAction(tr("Forward"),SmallIcon("forward"), 0, 0, this); 35 forward = new QAction(i18n("Forward"),SmallIcon("forward"), 0, 0, this);
35 forward->addTo(toolbar); 36 forward->addTo(toolbar);
36 forward->addTo(mailmenu); 37 forward->addTo(mailmenu);
37 38
38 attachbutton = new QAction(tr("Attachments"),SmallIcon("attach"), 0, 0, this, 0, true); 39 attachbutton = new QAction(i18n("Attachments"),SmallIcon("attach"), 0, 0, this, 0, true);
39 attachbutton->addTo(toolbar); 40 attachbutton->addTo(toolbar);
40 attachbutton->addTo(mailmenu); 41 attachbutton->addTo(mailmenu);
41 connect(attachbutton, SIGNAL(toggled(bool)), SLOT(slotChangeAttachview(bool))); 42 connect(attachbutton, SIGNAL(toggled(bool)), SLOT(slotChangeAttachview(bool)));
42 43
43 44
44 showHtml = new QAction( tr( "Show Html" ), SmallIcon( "html" ), 0, 0, this, 0, true ); 45 showHtml = new QAction( i18n( "Show Html" ), SmallIcon( "html" ), 0, 0, this, 0, true );
45 showHtml->addTo( toolbar ); 46 showHtml->addTo( toolbar );
46 showHtml->addTo( mailmenu ); 47 showHtml->addTo( mailmenu );
47 48
48 deleteMail = new QAction(tr("Delete Mail"),SmallIcon("trash"), 0, 0, this); 49 deleteMail = new QAction(i18n("Delete Mail"),SmallIcon("trash"), 0, 0, this);
49 deleteMail->addTo(toolbar); 50 deleteMail->addTo(toolbar);
50 deleteMail->addTo(mailmenu); 51 deleteMail->addTo(mailmenu);
51 closeMail = new QAction(tr("Close"),SmallIcon("exit"), 0, 0, this); 52 closeMail = new QAction(i18n("Close"),SmallIcon("exit"), 0, 0, this);
52 QLabel *spacer = new QLabel(toolbar); 53 QLabel *spacer = new QLabel(toolbar);
53 spacer->setBackgroundMode(QWidget::PaletteButton); 54 spacer->setBackgroundMode(QWidget::PaletteButton);
54 toolbar->setStretchableWidget(spacer); 55 toolbar->setStretchableWidget(spacer);
55 closeMail->addTo(toolbar); 56 closeMail->addTo(toolbar);
56 closeMail->addTo(mailmenu); 57 closeMail->addTo(mailmenu);
57 QVBox *view = new QVBox(this); 58 QVBox *view = new QVBox(this);
58 setCentralWidget(view); 59 setCentralWidget(view);
59 60
60 attachments = new QListView(view); 61 attachments = new QListView(view);
61 attachments->setMinimumHeight(90); 62 attachments->setMinimumHeight(90);
62 attachments->setMaximumHeight(90); 63 attachments->setMaximumHeight(90);
63 attachments->setAllColumnsShowFocus(true); 64 attachments->setAllColumnsShowFocus(true);
64 attachments->addColumn("Mime Type", 60); 65 attachments->addColumn("Mime Type", 60);
65 attachments->addColumn(tr("Description"), 100); 66 attachments->addColumn(i18n("Description"), 100);
66 attachments->addColumn(tr("Filename"), 80); 67 attachments->addColumn(i18n("Filename"), 80);
67 attachments->addColumn(tr("Size"), 80); 68 attachments->addColumn(i18n("Size"), 80);
68 attachments->setSorting(-1); 69 attachments->setSorting(-1);
69 attachments->hide(); 70 attachments->hide();
70 71
71 browser = new QTextBrowser(view); 72 browser = new QTextBrowser(view);
72 73
73 //openDiag = new OpenDiag(view); 74 //openDiag = new OpenDiag(view);
74 //openDiag->hide(); 75 //openDiag->hide();
75 76
76} 77}
77 78
78void ViewMailBase::slotChangeAttachview(bool state) 79void ViewMailBase::slotChangeAttachview(bool state)
79{ 80{