summaryrefslogtreecommitdiff
path: root/noncore
Unidiff
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mailit/addatt.cpp4
-rw-r--r--noncore/net/mailit/emailclient.cpp73
-rw-r--r--noncore/net/mailit/emailclient.h4
-rw-r--r--noncore/net/mailit/emailhandler.cpp10
-rw-r--r--noncore/net/mailit/emailhandler.h4
-rw-r--r--noncore/net/mailit/mailit.pro1
-rw-r--r--noncore/net/mailit/mailitwindow.cpp4
-rw-r--r--noncore/net/mailit/maillist.cpp160
-rw-r--r--noncore/net/mailit/popclient.cpp16
-rw-r--r--noncore/net/mailit/popclient.h3
-rw-r--r--noncore/net/mailit/smtpclient.cpp35
-rw-r--r--noncore/net/mailit/smtpclient.h3
-rw-r--r--noncore/net/mailit/viewatt.cpp14
-rw-r--r--noncore/net/mailit/writemail.cpp598
-rw-r--r--noncore/unsupported/mailit/addatt.cpp4
-rw-r--r--noncore/unsupported/mailit/emailclient.cpp73
-rw-r--r--noncore/unsupported/mailit/emailclient.h4
-rw-r--r--noncore/unsupported/mailit/emailhandler.cpp10
-rw-r--r--noncore/unsupported/mailit/emailhandler.h4
-rw-r--r--noncore/unsupported/mailit/mailit.pro1
-rw-r--r--noncore/unsupported/mailit/mailitwindow.cpp4
-rw-r--r--noncore/unsupported/mailit/maillist.cpp160
-rw-r--r--noncore/unsupported/mailit/popclient.cpp16
-rw-r--r--noncore/unsupported/mailit/popclient.h3
-rw-r--r--noncore/unsupported/mailit/smtpclient.cpp35
-rw-r--r--noncore/unsupported/mailit/smtpclient.h3
-rw-r--r--noncore/unsupported/mailit/viewatt.cpp14
-rw-r--r--noncore/unsupported/mailit/writemail.cpp598
28 files changed, 948 insertions, 910 deletions
diff --git a/noncore/net/mailit/addatt.cpp b/noncore/net/mailit/addatt.cpp
index daefac6..19ac58f 100644
--- a/noncore/net/mailit/addatt.cpp
+++ b/noncore/net/mailit/addatt.cpp
@@ -58,3 +58,3 @@ AddAtt::AddAtt(QWidget *parent, const char *name, WFlags f)
58{ 58{
59 setCaption("Adding attachments"); 59 setCaption(tr("Adding attachments") );
60 60
@@ -124,3 +124,3 @@ void AddAtt::clear()
124void AddAtt::addattachment() 124void AddAtt::addattachment()
125 { 125 {// ### FIXME wrong use -zecke
126 OFileDialog ofs("Attachments",this,0,0,"/root/Documents"); 126 OFileDialog ofs("Attachments",this,0,0,"/root/Documents");
diff --git a/noncore/net/mailit/emailclient.cpp b/noncore/net/mailit/emailclient.cpp
index da1226c..749a4e9 100644
--- a/noncore/net/mailit/emailclient.cpp
+++ b/noncore/net/mailit/emailclient.cpp
@@ -61,6 +61,6 @@ EmailClient::EmailClient( QWidget* parent, const char* name, WFlags fl )
61 61
62 connect(emailHandler, SIGNAL(smtpError(int)), this, 62 connect(emailHandler, SIGNAL(smtpError(int,const QString &)), this,
63 SLOT(smtpError(int)) ); 63 SLOT(smtpError(int,const QString &)) );
64 connect(emailHandler, SIGNAL(popError(int)), this, 64 connect(emailHandler, SIGNAL(popError(int,const QString &)), this,
65 SLOT(popError(int)) ); 65 SLOT(popError(int,const QString &)) );
66 66
@@ -482,3 +482,3 @@ void EmailClient::mailArrived(const Email &mail, bool fromDisk)
482 482
483void EmailClient::allMailArrived(int count) 483void EmailClient::allMailArrived(int /*count*/)
484{ 484{
@@ -520,3 +520,3 @@ void EmailClient::moveMailFront(Email *mailPtr)
520 520
521void EmailClient::smtpError(int code) 521void EmailClient::smtpError(int code, const QString & Msg)
522{ 522{
@@ -524,11 +524,13 @@ void EmailClient::smtpError(int code)
524 524
525 if (code == ErrUnknownResponse) 525 if (code == ErrUnknownResponse) {
526 temp = "Unknown response from server"; 526 temp = tr("<qt>Unknown response from server</qt>");
527 527 if( ! Msg.isEmpty() )
528 if (code == QSocket::ErrHostNotFound) 528 temp += Msg;
529 temp = "host not found"; 529 } else if (code == QSocket::ErrHostNotFound) {
530 if (code == QSocket::ErrConnectionRefused) 530 temp = tr("<qt>host not found</qt>");
531 temp = "connection refused"; 531 } else if (code == QSocket::ErrConnectionRefused) {
532 if (code == QSocket::ErrSocketRead) 532 temp = tr("<qt>connection refused</qt>");
533 temp = "socket packet error"; 533 } else if (code == QSocket::ErrSocketRead) {
534 temp = tr("<qt>socket packet error</qt>");
535 }
534 536
@@ -546,3 +548,3 @@ void EmailClient::smtpError(int code)
546 548
547void EmailClient::popError(int code) 549void EmailClient::popError(int code, const QString & Msg)
548{ 550{
@@ -550,16 +552,19 @@ void EmailClient::popError(int code)
550 552
551 if (code == ErrUnknownResponse) 553 if (code == ErrUnknownResponse) {
552 temp = "Unknown response from server"; 554 temp = tr("<qt>Unknown response from server</qt>");
553 if (code == ErrLoginFailed) 555 if( ! Msg.isEmpty() )
554 temp = "Login failed\nCheck user name and password"; 556 temp += Msg;
555 557 } else if (code == ErrLoginFailed) {
556 if (code == QSocket::ErrHostNotFound) 558 temp = tr("<qt>Login failed\nCheck user name and password</qt>");
557 temp = "host not found"; 559 } else if (code == QSocket::ErrHostNotFound) {
558 if (code == QSocket::ErrConnectionRefused) 560 temp = tr("<qt>host not found</qt>");
559 temp = "connection refused"; 561 } else if (code == QSocket::ErrConnectionRefused) {
560 if (code == QSocket::ErrSocketRead) 562 temp = tr("<qt>connection refused</qt>");
561 temp = "socket packet error"; 563 } else if (code == QSocket::ErrSocketRead) {
562 564 temp = tr("<qt>socket packet error</qt>");
565 }
566
563 if (code != ErrCancel) { 567 if (code != ErrCancel) {
564 QMessageBox::warning(qApp->activeWindow(), "Receiving error", temp, "OK\n"); 568 QMessageBox::warning(qApp->activeWindow(), tr("Receiving error"), temp, tr("OK\n"));
569
565 } else { 570 } else {
@@ -900,3 +905,3 @@ void EmailClient::setMailSize(int size)
900 905
901void EmailClient::setTotalSize(int size) 906void EmailClient::setTotalSize(int /*size*/)
902{ 907{
@@ -922,3 +927,3 @@ void EmailClient::deleteItem()
922 EmailListItem* eli; 927 EmailListItem* eli;
923 int pos; 928 // int pos;
924 929
@@ -948,3 +953,3 @@ void EmailClient::inboxItemReleased()
948{ 953{
949 /*killTimer(timerID); 954 //killTimer(timerID);
950 955
@@ -993,3 +998,3 @@ void EmailClient::download(Email* mail)
993 998
994void EmailClient::receive(const QCString& msg, const QByteArray& data) 999void EmailClient::receive(const QCString& /*msg*/, const QByteArray& /*data*/)
995{ 1000{
@@ -997,3 +1002,3 @@ void EmailClient::receive(const QCString& msg, const QByteArray& data)
997 { 1002 {
998 /*QDialog qd(qApp->activeWindow(),"Getting mail",true); 1003 //QDialog qd(qApp->activeWindow(),"Getting mail",true);
999 QVBoxLayout *vbProg = new QVBoxLayout( &qd ); 1004 QVBoxLayout *vbProg = new QVBoxLayout( &qd );
diff --git a/noncore/net/mailit/emailclient.h b/noncore/net/mailit/emailclient.h
index c98cfce..80c6d31 100644
--- a/noncore/net/mailit/emailclient.h
+++ b/noncore/net/mailit/emailclient.h
@@ -100,4 +100,4 @@ public slots:
100 void getAllNewMail(); 100 void getAllNewMail();
101 void smtpError(int code); 101 void smtpError(int code, const QString & Msg );
102 void popError(int code); 102 void popError(int code, const QString & Msg);
103 void inboxItemSelected(); 103 void inboxItemSelected();
diff --git a/noncore/net/mailit/emailhandler.cpp b/noncore/net/mailit/emailhandler.cpp
index 39f693d..5b8bda1 100644
--- a/noncore/net/mailit/emailhandler.cpp
+++ b/noncore/net/mailit/emailhandler.cpp
@@ -46,4 +46,4 @@ EmailHandler::EmailHandler()
46 46
47 connect(smtpClient, SIGNAL(errorOccurred(int)), this, 47 connect(smtpClient, SIGNAL(errorOccurred(int, const QString &)), this,
48 SIGNAL(smtpError(int)) ); 48 SIGNAL(smtpError(int, const QString &)) );
49 connect(smtpClient, SIGNAL(mailSent()), this, SIGNAL(mailSent()) ); 49 connect(smtpClient, SIGNAL(mailSent()), this, SIGNAL(mailSent()) );
@@ -52,4 +52,4 @@ EmailHandler::EmailHandler()
52 52
53 connect(popClient, SIGNAL(errorOccurred(int)), this, 53 connect(popClient, SIGNAL(errorOccurred(int, const QString &)), this,
54 SIGNAL(popError(int)) ); 54 SIGNAL(popError(int, const QString &)) );
55 connect(popClient, SIGNAL(newMessage(const QString &, int, uint, bool)), 55 connect(popClient, SIGNAL(newMessage(const QString &, int, uint, bool)),
@@ -164,3 +164,3 @@ bool EmailHandler::parse(const QString &in, const QString &lineShift, Email *mai
164 temp = lineShift + "." + lineShift; 164 temp = lineShift + "." + lineShift;
165 165
166 if (in.right(temp.length()) != temp) { 166 if (in.right(temp.length()) != temp) {
diff --git a/noncore/net/mailit/emailhandler.h b/noncore/net/mailit/emailhandler.h
index e4e7f46..74a8e4c 100644
--- a/noncore/net/mailit/emailhandler.h
+++ b/noncore/net/mailit/emailhandler.h
@@ -129,4 +129,4 @@ signals:
129 void mailSent(); 129 void mailSent();
130 void smtpError(int); 130 void smtpError(int, const QString & Msg );
131 void popError(int); 131 void popError(int, const QString & Msg );
132 void mailArrived(const Email &, bool); 132 void mailArrived(const Email &, bool);
diff --git a/noncore/net/mailit/mailit.pro b/noncore/net/mailit/mailit.pro
index cfbda36..5e9a83a 100644
--- a/noncore/net/mailit/mailit.pro
+++ b/noncore/net/mailit/mailit.pro
@@ -1,2 +1,3 @@
1TEMPLATE = app 1TEMPLATE = app
2TARGET = mailit
2CONFIG = qt warn_on release 3CONFIG = qt warn_on release
diff --git a/noncore/net/mailit/mailitwindow.cpp b/noncore/net/mailit/mailitwindow.cpp
index f945a0f..6e298c7 100644
--- a/noncore/net/mailit/mailitwindow.cpp
+++ b/noncore/net/mailit/mailitwindow.cpp
@@ -23,6 +23,6 @@
23 23
24MailItWindow::MailItWindow(QWidget *parent, const char *name, WFlags fl) 24MailItWindow::MailItWindow(QWidget *parent, const char *name, WFlags /*fl*/)
25 : QMainWindow(parent, name, WStyle_ContextHelp) 25 : QMainWindow(parent, name, WStyle_ContextHelp)
26{ 26{
27 currentCaption = "Mailit"; 27 currentCaption = tr("Mailit");
28 setCaption(tr(currentCaption)); 28 setCaption(tr(currentCaption));
diff --git a/noncore/net/mailit/maillist.cpp b/noncore/net/mailit/maillist.cpp
index b5325a9..8c34295 100644
--- a/noncore/net/mailit/maillist.cpp
+++ b/noncore/net/mailit/maillist.cpp
@@ -23,5 +23,5 @@ void MailList::clear()
23{ 23{
24 sortedList.setAutoDelete(TRUE); 24 sortedList.setAutoDelete(TRUE);
25 sortedList.clear(); 25 sortedList.clear();
26 currentPos = 0; 26 currentPos = 0;
27} 27}
@@ -30,3 +30,3 @@ int MailList::count()
30{ 30{
31 return sortedList.count(); 31 return sortedList.count();
32} 32}
@@ -35,10 +35,10 @@ int* MailList::first()
35{ 35{
36 dList *mPtr; 36 dList *mPtr;
37 37
38 if (sortedList.count() == 0) 38 if (sortedList.count() == 0)
39 return NULL; 39 return NULL;
40 40
41 mPtr = sortedList.at(0); 41 mPtr = sortedList.at(0);
42 currentPos = 1; 42 currentPos = 1;
43 return &(mPtr->serverId); 43 return &(mPtr->serverId);
44} 44}
@@ -47,10 +47,10 @@ int* MailList::next()
47{ 47{
48 dList *mPtr; 48 dList *mPtr;
49 49
50 if ( (currentPos) >= sortedList.count()) 50 if ( (currentPos) >= sortedList.count())
51 return NULL; 51 return NULL;
52 52
53 mPtr = sortedList.at(currentPos); 53 mPtr = sortedList.at(currentPos);
54 currentPos++; 54 currentPos++;
55 return &(mPtr->serverId); 55 return &(mPtr->serverId);
56} 56}
@@ -59,41 +59,41 @@ void MailList::sizeInsert(int serverId, uint size)
59{ 59{
60 dList *tempPtr; 60 dList *tempPtr;
61 int x; 61 int x;
62 62
63 dList *newEntry = new dList; 63 dList *newEntry = new dList;
64 newEntry->serverId = serverId; 64 newEntry->serverId = serverId;
65 newEntry->size = size; 65 newEntry->size = size;
66 66
67 for (tempPtr = sortedList.first(); tempPtr != NULL; tempPtr = sortedList.next() ) { 67 for (tempPtr = sortedList.first(); tempPtr != NULL; tempPtr = sortedList.next() ) {
68 if (newEntry->size < tempPtr->size) { 68 if (newEntry->size < tempPtr->size) {
69 x = sortedList.at(); 69 x = sortedList.at();
70 sortedList.insert(x, newEntry); 70 sortedList.insert(x, newEntry);
71 return; 71 return;
72 } 72 }
73 } 73 }
74 sortedList.append(newEntry); 74 sortedList.append(newEntry);
75} 75}
76 76
77void MailList::moveFront(int serverId, uint size) 77void MailList::moveFront(int serverId, uint/* size*/)
78{ 78{
79 dList *currentPtr; 79 dList *currentPtr;
80 uint tempPos; 80 uint tempPos;
81 QString temp; 81 QString temp;
82 82
83 tempPos = currentPos; 83 tempPos = currentPos;
84 if ( tempPos >= sortedList.count() ) 84 if ( tempPos >= sortedList.count() )
85 return; 85 return;
86 currentPtr = sortedList.at(tempPos); 86 currentPtr = sortedList.at(tempPos);
87 while ( ((tempPos+1) < sortedList.count()) && ( currentPtr->serverId != serverId) ) { 87 while ( ((tempPos+1) < sortedList.count()) && ( currentPtr->serverId != serverId) ) {
88 tempPos++; 88 tempPos++;
89 currentPtr = sortedList.at(tempPos); 89 currentPtr = sortedList.at(tempPos);
90 } 90 }
91 91
92 if ( (currentPtr != NULL) && (currentPtr->serverId == serverId) ) { 92 if ( (currentPtr != NULL) && (currentPtr->serverId == serverId) ) {
93 temp.setNum(currentPtr->serverId); 93 temp.setNum(currentPtr->serverId);
94 qWarning("moved to front, message: " + temp); 94 qWarning("moved to front, message: " + temp);
95 95
96 dList *itemPtr = sortedList.take(tempPos); 96 dList *itemPtr = sortedList.take(tempPos);
97 sortedList.insert(currentPos, itemPtr); 97 sortedList.insert(currentPos, itemPtr);
98 } 98 }
99 99
@@ -102,30 +102,30 @@ void MailList::moveFront(int serverId, uint size)
102//only works if mail is not already in download 102//only works if mail is not already in download
103bool MailList::remove(int serverId, uint size) 103bool MailList::remove(int serverId, uint /*size*/)
104{ 104{
105 dList *currentPtr; 105 dList *currentPtr;
106 uint tempPos; 106 uint tempPos;
107 QString temp; 107 QString temp;
108 108
109 tempPos = currentPos; 109 tempPos = currentPos;
110 if ( tempPos >=sortedList.count() ) 110 if ( tempPos >=sortedList.count() )
111 return FALSE; 111 return FALSE;
112 currentPtr = sortedList.at(tempPos); 112 currentPtr = sortedList.at(tempPos);
113 while ( ((tempPos + 1) < sortedList.count()) && ( currentPtr->serverId != serverId) ) { 113 while ( ((tempPos + 1) < sortedList.count()) && ( currentPtr->serverId != serverId) ) {
114 tempPos++; 114 tempPos++;
115 currentPtr = sortedList.at(tempPos); 115 currentPtr = sortedList.at(tempPos);
116 } 116 }
117 117
118 if ( (currentPtr != NULL) && (currentPtr->serverId == serverId) ) { 118 if ( (currentPtr != NULL) && (currentPtr->serverId == serverId) ) {
119 temp.setNum(currentPtr->serverId); 119 temp.setNum(currentPtr->serverId);
120 qWarning("deleted message: " + temp); 120 qWarning("deleted message: " + temp);
121 sortedList.remove(tempPos); 121 sortedList.remove(tempPos);
122 122
123 return TRUE; 123 return TRUE;
124 } 124 }
125 return FALSE; 125 return FALSE;
126} 126}
127 127
128void MailList::insert(int pos, int serverId, uint size) 128void MailList::insert(int /*pos*/, int /*serverId*/, uint/* size*/)
129{ 129{
130 //sortedList.insert(pos, mPtr); 130// sortedList.insert(pos, mPtr);
131} 131}
diff --git a/noncore/net/mailit/popclient.cpp b/noncore/net/mailit/popclient.cpp
index dc0116d..5da3bcb 100644
--- a/noncore/net/mailit/popclient.cpp
+++ b/noncore/net/mailit/popclient.cpp
@@ -65,3 +65,3 @@ void PopClient::newConnection(const QString &target, int port)
65 65
66 emit updateStatus("DNS lookup"); 66 emit updateStatus(tr("DNS lookup"));
67} 67}
@@ -105,4 +105,8 @@ void PopClient::errorHandling(int status)
105{ 105{
106 errorHandlingWithMsg( status, QString::null );
107}
108void PopClient::errorHandlingWithMsg(int status, const QString & Msg )
109{
106 emit updateStatus(tr("Error Occured")); 110 emit updateStatus(tr("Error Occured"));
107 emit errorOccurred(status); 111 emit errorOccurred(status, Msg);
108 socket->close(); 112 socket->close();
@@ -169,3 +173,3 @@ void PopClient::incomingData()
169 status = Mcnt; 173 status = Mcnt;
170 } else errorHandling(ErrLoginFailed); 174 } else errorHandlingWithMsg(ErrLoginFailed, response);
171 break; 175 break;
@@ -197,3 +201,3 @@ void PopClient::incomingData()
197 201
198 } else errorHandling(ErrUnknownResponse); 202 } else errorHandlingWithMsg(ErrUnknownResponse, response);
199 } 203 }
@@ -236,3 +240,3 @@ void PopClient::incomingData()
236 //qWarning(response); 240 //qWarning(response);
237 errorHandling(ErrUnknownResponse); 241 errorHandlingWithMsg(ErrUnknownResponse, response);
238 } 242 }
@@ -261,3 +265,3 @@ void PopClient::incomingData()
261 response = socket->readLine(); 265 response = socket->readLine();
262 } else errorHandling(ErrUnknownResponse); 266 } else errorHandlingWithMsg(ErrUnknownResponse, response);
263 } 267 }
diff --git a/noncore/net/mailit/popclient.h b/noncore/net/mailit/popclient.h
index c58bc48..6774ceb 100644
--- a/noncore/net/mailit/popclient.h
+++ b/noncore/net/mailit/popclient.h
@@ -46,3 +46,3 @@ signals:
46 void newMessage(const QString &, int, uint, bool); 46 void newMessage(const QString &, int, uint, bool);
47 void errorOccurred(int status); 47 void errorOccurred(int status, const QString & Msg );
48 void updateStatus(const QString &); 48 void updateStatus(const QString &);
@@ -55,2 +55,3 @@ public slots:
55 void errorHandling(int); 55 void errorHandling(int);
56 void errorHandlingWithMsg(int, const QString & );
56 57
diff --git a/noncore/net/mailit/smtpclient.cpp b/noncore/net/mailit/smtpclient.cpp
index 2916f45..5b5ef52 100644
--- a/noncore/net/mailit/smtpclient.cpp
+++ b/noncore/net/mailit/smtpclient.cpp
@@ -75,3 +75,8 @@ void SmtpClient::errorHandling(int status)
75{ 75{
76 emit errorOccurred(status); 76 errorHandlingWithMsg( status, QString::null );
77}
78
79void SmtpClient::errorHandlingWithMsg(int status, const QString & EMsg )
80{
81 emit errorOccurred(status, EMsg );
77 socket->close(); 82 socket->close();
@@ -89,3 +94,2 @@ void SmtpClient::incomingData()
89 response = socket->readLine(); 94 response = socket->readLine();
90
91 switch(status) { 95 switch(status) {
@@ -96,3 +100,3 @@ void SmtpClient::incomingData()
96 *stream << "HELO there\r\n"; 100 *stream << "HELO there\r\n";
97 } else errorHandling(ErrUnknownResponse); 101 } else errorHandlingWithMsg(ErrUnknownResponse,response);
98 break; 102 break;
@@ -101,5 +105,6 @@ void SmtpClient::incomingData()
101 if (response[0] == '2') { 105 if (response[0] == '2') {
102 *stream << "MAIL FROM: " << mailPtr->from << "\r\n"; 106 qDebug(mailPtr->from);
107 *stream << "MAIL FROM: <" << mailPtr->from << ">\r\n";
103 status = Recv; 108 status = Recv;
104 } else errorHandling(ErrUnknownResponse); 109 } else errorHandlingWithMsg(ErrUnknownResponse, response );
105 break; 110 break;
@@ -107,9 +112,10 @@ void SmtpClient::incomingData()
107 case Recv: { 112 case Recv: {
108 if (response[0] == '2') { 113 if (response[0] == '2') {
109 it = mailPtr->to.begin(); 114 it = mailPtr->to.begin();
110 if (it == NULL) 115 if (it == NULL) {
111 errorHandling(ErrUnknownResponse); 116 errorHandlingWithMsg(ErrUnknownResponse,response);
112 *stream << "RCPT TO: " << *it << ">\r\n"; 117 }
118 *stream << "RCPT TO: <" << *it << ">\r\n";
113 status = MRcv; 119 status = MRcv;
114 } else errorHandling(ErrUnknownResponse); 120 } else errorHandlingWithMsg(ErrUnknownResponse,response);
115 break; 121 break;
@@ -125,3 +131,3 @@ void SmtpClient::incomingData()
125 } 131 }
126 } else errorHandling(ErrUnknownResponse); 132 } else errorHandlingWithMsg(ErrUnknownResponse,response);
127 } 133 }
@@ -132,3 +138,4 @@ void SmtpClient::incomingData()
132 emit updateStatus(tr("Sending: ") + mailPtr->subject); 138 emit updateStatus(tr("Sending: ") + mailPtr->subject);
133 } else errorHandling(ErrUnknownResponse); 139
140 } else errorHandlingWithMsg(ErrUnknownResponse,response);
134 break; 141 break;
@@ -144,3 +151,3 @@ void SmtpClient::incomingData()
144 } 151 }
145 } else errorHandling(ErrUnknownResponse); 152 } else errorHandlingWithMsg(ErrUnknownResponse,response);
146 break; 153 break;
@@ -158,3 +165,3 @@ void SmtpClient::incomingData()
158 socket->close(); 165 socket->close();
159 } else errorHandling(ErrUnknownResponse); 166 } else errorHandlingWithMsg(ErrUnknownResponse,response);
160 break; 167 break;
diff --git a/noncore/net/mailit/smtpclient.h b/noncore/net/mailit/smtpclient.h
index 45c0703..554ba3f 100644
--- a/noncore/net/mailit/smtpclient.h
+++ b/noncore/net/mailit/smtpclient.h
@@ -49,3 +49,3 @@ public:
49signals: 49signals:
50 void errorOccurred(int); 50 void errorOccurred(int, const QString & LR );
51 void updateStatus(const QString &); 51 void updateStatus(const QString &);
@@ -55,2 +55,3 @@ public slots:
55 void errorHandling(int); 55 void errorHandling(int);
56 void errorHandlingWithMsg(int, const QString & LastResponse );
56 57
diff --git a/noncore/net/mailit/viewatt.cpp b/noncore/net/mailit/viewatt.cpp
index 21885c2..293e137 100644
--- a/noncore/net/mailit/viewatt.cpp
+++ b/noncore/net/mailit/viewatt.cpp
@@ -28,3 +28,3 @@ ViewAtt::ViewAtt(QWidget *parent, const char *name, WFlags f)
28{ 28{
29 setCaption("Exploring attatchments"); 29 setCaption(tr("Exploring attatchments"));
30 30
@@ -37,5 +37,5 @@ ViewAtt::ViewAtt(QWidget *parent, const char *name, WFlags f)
37 listView = new QListView(this, "AttView"); 37 listView = new QListView(this, "AttView");
38 listView->addColumn( "Attatchment" ); 38 listView->addColumn( tr("Attatchment") );
39 listView->addColumn( "Type" ); 39 listView->addColumn( tr("Type") );
40 listView->addColumn( "Installed" ); 40 listView->addColumn( tr("Installed") );
41 setCentralWidget(listView); 41 setCentralWidget(listView);
@@ -63,5 +63,5 @@ void ViewAtt::update(Email *mailIn, bool inbox)
63 63
64 QString isInstalled = "No"; 64 QString isInstalled = tr("No");
65 if (ePtr->installed) 65 if (ePtr->installed)
66 isInstalled = "Yes"; 66 isInstalled = tr("Yes");
67 item = new QListViewItem(listView, ePtr->originalName, ePtr->contentType, isInstalled); 67 item = new QListViewItem(listView, ePtr->originalName, ePtr->contentType, isInstalled);
@@ -118,3 +118,3 @@ void ViewAtt::install()
118 selPtr->installed = TRUE; 118 selPtr->installed = TRUE;
119 item->setText(2, "Yes"); 119 item->setText(2, tr("Yes"));
120 } 120 }
diff --git a/noncore/net/mailit/writemail.cpp b/noncore/net/mailit/writemail.cpp
index 0298cb3..26b9660 100644
--- a/noncore/net/mailit/writemail.cpp
+++ b/noncore/net/mailit/writemail.cpp
@@ -26,6 +26,6 @@ WriteMail::WriteMail( QWidget* parent, const char* name, WFlags fl ):QMainWindo
26{ 26{
27 showingAddressList = FALSE; 27 showingAddressList = FALSE;
28 init(); 28 init();
29 29
30 addAtt = new AddAtt(0, "Add Attachments"); 30 addAtt = new AddAtt(0, "Add Attachments");
31} 31}
@@ -34,3 +34,3 @@ WriteMail::~WriteMail()
34{ 34{
35 delete addAtt; 35 delete addAtt;
36} 36}
@@ -39,12 +39,12 @@ void WriteMail::setAddressList(AddressList *list)
39{ 39{
40 AContact *cPtr; 40 AContact *cPtr;
41 41
42 addressList = list; 42 addressList = list;
43 43
44 addressView->clear(); 44 addressView->clear();
45 QList<AContact> *cListPtr = addressList->getContactList(); 45 QList<AContact> *cListPtr = addressList->getContactList();
46 QListViewItem *item; 46 QListViewItem *item;
47 for (cPtr = cListPtr->first(); cPtr != 0; cPtr = cListPtr->next() ) { 47 for (cPtr = cListPtr->first(); cPtr != 0; cPtr = cListPtr->next() ) {
48 item = new QListViewItem(addressView, cPtr->name, cPtr->email); 48 item = new QListViewItem(addressView, cPtr->name, cPtr->email);
49 } 49 }
50} 50}
@@ -53,91 +53,91 @@ void WriteMail::init()
53{ 53{
54 setToolBarsMovable(FALSE); 54 setToolBarsMovable(FALSE);
55 55
56 bar = new QToolBar(this); 56 bar = new QToolBar(this);
57 bar->setHorizontalStretchable( TRUE ); 57 bar->setHorizontalStretchable( TRUE );
58 58
59 menu = new QMenuBar( bar ); 59 menu = new QMenuBar( bar );
60 60
61 mailMenu = new QPopupMenu(menu); 61 mailMenu = new QPopupMenu(menu);
62 menu->insertItem( tr( "&Mail" ), mailMenu); 62 menu->insertItem( tr( "&Mail" ), mailMenu);
63 addMenu = new QPopupMenu(menu); 63 addMenu = new QPopupMenu(menu);
64 menu->insertItem( tr( "&Add" ), addMenu); 64 menu->insertItem( tr( "&Add" ), addMenu);
65 65
66 bar = new QToolBar(this); 66 bar = new QToolBar(this);
67 attachButton = new QAction(tr("Attachment"), Resource::loadPixmap("mailit/attach"), QString::null, 0, this, 0); 67 attachButton = new QAction(tr("Attachment"), Resource::loadPixmap("mailit/attach"), QString::null, 0, this, 0);
68 attachButton->addTo(bar); 68 attachButton->addTo(bar);
69 attachButton->addTo(addMenu); 69 attachButton->addTo(addMenu);
70 connect( attachButton, SIGNAL( activated() ), this, SLOT( attachFile() ) ); 70 connect( attachButton, SIGNAL( activated() ), this, SLOT( attachFile() ) );
71 attachButton->setWhatsThis(tr("Click here to attach files to your mail")); 71 attachButton->setWhatsThis(tr("Click here to attach files to your mail"));
72 72
73 confirmButton = new QAction(tr("Enque mail"), Resource::loadPixmap("OKButton"), QString::null, 0, this, 0); 73 confirmButton = new QAction(tr("Enque mail"), Resource::loadPixmap("OKButton"), QString::null, 0, this, 0);
74 confirmButton->addTo(bar); 74 confirmButton->addTo(bar);
75 confirmButton->addTo(mailMenu); 75 confirmButton->addTo(mailMenu);
76 connect( confirmButton, SIGNAL( activated() ), this, SLOT( accept() ) ); 76 connect( confirmButton, SIGNAL( activated() ), this, SLOT( accept() ) );
77 confirmButton->setWhatsThis(tr("This button puts your mail in the send queue")); 77 confirmButton->setWhatsThis(tr("This button puts your mail in the send queue"));
78 78
79 newButton = new QAction(tr("New mail"), Resource::loadPixmap("new"), QString::null, 0, this, 0); 79 newButton = new QAction(tr("New mail"), Resource::loadPixmap("new"), QString::null, 0, this, 0);
80 newButton->addTo(mailMenu); 80 newButton->addTo(mailMenu);
81 connect( newButton, SIGNAL( activated() ), this, SLOT( newMail() ) ); 81 connect( newButton, SIGNAL( activated() ), this, SLOT( newMail() ) );
82 newButton->setWhatsThis(tr("Click here to create a new mail")); 82 newButton->setWhatsThis(tr("Click here to create a new mail"));
83 83
84 widget = new QWidget(this, "widget"); 84 widget = new QWidget(this, "widget");
85 grid = new QGridLayout( widget ); 85 grid = new QGridLayout( widget );
86 86
87 recipientsBox = new QComboBox( FALSE, widget, "toLabel" ); 87 recipientsBox = new QComboBox( FALSE, widget, "toLabel" );
88 recipientsBox->insertItem( tr( "To:" ) ); 88 recipientsBox->insertItem( tr( "To:" ) );
89 recipientsBox->insertItem( tr( "CC:" ) ); 89 recipientsBox->insertItem( tr( "CC:" ) );
90 recipientsBox->setCurrentItem(0); 90 recipientsBox->setCurrentItem(0);
91 grid->addWidget( recipientsBox, 0, 0 ); 91 grid->addWidget( recipientsBox, 0, 0 );
92 connect(recipientsBox,SIGNAL(activated(int)),this, SLOT(changeRecipients(int))); 92 connect(recipientsBox,SIGNAL(activated(int)),this, SLOT(changeRecipients(int)));
93 93
94 subjetLabel = new QLabel( widget, "subjetLabel" ); 94 subjetLabel = new QLabel( widget, "subjetLabel" );
95 subjetLabel->setText( tr( "Subject:" ) ); 95 subjetLabel->setText( tr( "Subject:" ) );
96 96
97 grid->addWidget( subjetLabel, 1, 0 ); 97 grid->addWidget( subjetLabel, 1, 0 );
98 98
99 ToolButton13_2 = new QToolButton( widget, "ToolButton13_2" ); 99 ToolButton13_2 = new QToolButton( widget, "ToolButton13_2" );
100 ToolButton13_2->setText( tr( "..." ) ); 100 ToolButton13_2->setText( tr( "..." ) );
101 grid->addWidget( ToolButton13_2, 1, 2 ); 101 grid->addWidget( ToolButton13_2, 1, 2 );
102 102
103 subjectInput = new QLineEdit( widget, "subjectInput" ); 103 subjectInput = new QLineEdit( widget, "subjectInput" );
104 grid->addWidget( subjectInput, 1, 1 ); 104 grid->addWidget( subjectInput, 1, 1 );
105 QWhatsThis::add(subjectInput,QWidget::tr("The mail subject should be entered here")); 105 QWhatsThis::add(subjectInput,QWidget::tr("The mail subject should be entered here"));
106 106
107 toInput = new QLineEdit( widget, "toInput" ); 107 toInput = new QLineEdit( widget, "toInput" );
108 grid->addWidget( toInput, 0, 1 ); 108 grid->addWidget( toInput, 0, 1 );
109 QWhatsThis::add(recipientsBox,QWidget::tr("Recipients can be entered here")); 109 QWhatsThis::add(recipientsBox,QWidget::tr("Recipients can be entered here"));
110 110
111 ccInput = new QLineEdit( widget, "ccInput" ); 111 ccInput = new QLineEdit( widget, "ccInput" );
112 ccInput->hide(); 112 ccInput->hide();
113 grid->addWidget( ccInput, 0, 1 ); 113 grid->addWidget( ccInput, 0, 1 );
114 QWhatsThis::add(ccInput,QWidget::tr("If you would like to send copies of your mail they can be entered here")); 114 QWhatsThis::add(ccInput,QWidget::tr("If you would like to send copies of your mail they can be entered here"));
115 115
116 addressButton = new QToolButton( widget, "addressButton" ); 116 addressButton = new QToolButton( widget, "addressButton" );
117 addressButton->setPixmap( Resource::loadPixmap("AddressBook") ); 117 addressButton->setPixmap( Resource::loadPixmap("AddressBook") );
118 addressButton->setToggleButton(TRUE); 118 addressButton->setToggleButton(TRUE);
119 grid->addWidget( addressButton, 0, 2 ); 119 grid->addWidget( addressButton, 0, 2 );
120 connect(addressButton, SIGNAL(clicked()), this, SLOT(getAddress()) ); 120 connect(addressButton, SIGNAL(clicked()), this, SLOT(getAddress()) );
121 QWhatsThis::add(addressButton,QWidget::tr("This button opens the address selector with all mail adresses from your OPIE addressbook")); 121 QWhatsThis::add(addressButton,QWidget::tr("This button opens the address selector with all mail adresses from your Opie addressbook"));
122 122
123 emailInput = new QMultiLineEdit( widget, "emailInput" ); 123 emailInput = new QMultiLineEdit( widget, "emailInput" );
124 grid->addMultiCellWidget( emailInput, 2, 2, 0, 2); 124 grid->addMultiCellWidget( emailInput, 2, 2, 0, 2);
125 QWhatsThis::add(emailInput,QWidget::tr("Enter your mail text here")); 125 QWhatsThis::add(emailInput,QWidget::tr("Enter your mail text here"));
126 126
127 addressView = new QListView( widget, "addressView"); 127 addressView = new QListView( widget, "addressView");
128 addressView->addColumn("Name"); 128 addressView->addColumn(tr("Name"));
129 addressView->addColumn("EMail"); 129 addressView->addColumn(tr("EMail") );
130 addressView->setAllColumnsShowFocus(TRUE); 130 addressView->setAllColumnsShowFocus(TRUE);
131 addressView->setMultiSelection(TRUE); 131 addressView->setMultiSelection(TRUE);
132 addressView->hide(); 132 addressView->hide();
133 grid->addMultiCellWidget( addressView, 3, 3, 0, 2); 133 grid->addMultiCellWidget( addressView, 3, 3, 0, 2);
134 QWhatsThis::add(recipientsBox,QWidget::tr("Choose the recipients from this list")); 134 QWhatsThis::add(recipientsBox,QWidget::tr("Choose the recipients from this list"));
135 135
136 okButton = new QToolButton(bar, "ok"); 136 okButton = new QToolButton(bar, "ok");
137 okButton->setPixmap( Resource::loadPixmap("enter") ); 137 okButton->setPixmap( Resource::loadPixmap("enter") );
138 okButton->hide(); 138 okButton->hide();
139 connect(okButton, SIGNAL(clicked()), this, SLOT(addRecipients()) ); 139 connect(okButton, SIGNAL(clicked()), this, SLOT(addRecipients()) );
140 QWhatsThis::add(okButton,QWidget::tr("Queue your mail by clicking here")); 140 QWhatsThis::add(okButton,QWidget::tr("Queue your mail by clicking here"));
141 141
142 setCentralWidget(widget); 142 setCentralWidget(widget);
143} 143}
@@ -146,3 +146,3 @@ void WriteMail::reject()
146{ 146{
147 emit cancelMail(); 147 emit cancelMail();
148} 148}
@@ -151,77 +151,77 @@ void WriteMail::accept()
151{ 151{
152 QStringList attachedFiles, attachmentsType; 152 QStringList attachedFiles, attachmentsType;
153 int idCount = 0; 153 int idCount = 0;
154 154
155 if (toInput->text() == "") 155 if (toInput->text() == "")
156 { 156 {
157 QMessageBox::warning(this,tr("No recipient"), tr("Send mail to whom?"), tr("OK\n")); 157 QMessageBox::warning(this,tr("No recipient"), tr("Send mail to whom?"), tr("OK\n"));
158 return; 158 return;
159 } 159 }
160 160
161 if (! getRecipients(false) ) 161 if (! getRecipients(false) )
162 { 162 {
163 QMessageBox::warning(this,tr("Incorrect recipient separator"), 163 QMessageBox::warning(this,tr("Incorrect recipient separator"),
164 tr("Recipients must be separated by ;\nand be valid emailaddresses"), tr("OK\n")); 164 tr("Recipients must be separated by ;\nand be valid emailaddresses"), tr("OK\n"));
165 return; 165 return;
166 } 166 }
167 167
168 if ((ccInput->text()!="") && (! getRecipients(true) )) 168 if ((ccInput->text()!="") && (! getRecipients(true) ))
169 { 169 {
170 QMessageBox::warning(this,tr("Incorrect carbon copy separator"), 170 QMessageBox::warning(this,tr("Incorrect carbon copy separator"),
171 tr("CC Recipients must be separated by ;\nand be valid emailaddresses"), tr("OK\n")); 171 tr("CC Recipients must be separated by ;\nand be valid emailaddresses"), tr("OK\n"));
172 return; 172 return;
173 } 173 }
174 174
175 mail.subject = subjectInput->text(); 175 mail.subject = subjectInput->text();
176 mail.body = emailInput->text(); 176 mail.body = emailInput->text();
177 mail.sent = false; 177 mail.sent = false;
178 mail.received = false; 178 mail.received = false;
179 179
180 mail.rawMail = "To: "; 180 mail.rawMail = "To: ";
181 181
182 for (QStringList::Iterator it = mail.recipients.begin(); 182 for (QStringList::Iterator it = mail.recipients.begin();
183 it != mail.recipients.end(); ++it) { 183 it != mail.recipients.end(); ++it) {
184 184
185 mail.rawMail += (*it); 185 mail.rawMail += (*it);
186 mail.rawMail += ",\n"; 186 mail.rawMail += ",\n";
187 } 187 }
188 188
189 mail.rawMail.truncate(mail.rawMail.length()-2); 189 mail.rawMail.truncate(mail.rawMail.length()-2);
190 190
191 mail.rawMail += "\nCC: "; 191 mail.rawMail += "\nCC: ";
192 192
193 for (QStringList::Iterator it = mail.carbonCopies.begin(); 193 for (QStringList::Iterator it = mail.carbonCopies.begin();
194 it != mail.carbonCopies.end(); ++it) { 194 it != mail.carbonCopies.end(); ++it) {
195 195
196 mail.rawMail += (*it); 196 mail.rawMail += (*it);
197 mail.rawMail += ",\n"; 197 mail.rawMail += ",\n";
198 } 198 }
199 199
200 mail.rawMail += mail.from; 200 mail.rawMail += mail.from;
201 mail.rawMail += "\nSubject: "; 201 mail.rawMail += "\nSubject: ";
202 mail.rawMail += mail.subject; 202 mail.rawMail += mail.subject;
203 mail.rawMail += "\n\n"; 203 mail.rawMail += "\n\n";
204 204
205 attachedFiles = addAtt->returnattachedFiles(); 205 attachedFiles = addAtt->returnattachedFiles();
206 attachmentsType = addAtt->returnFileTypes(); 206 attachmentsType = addAtt->returnFileTypes();
207 207
208 QStringList::Iterator itType = attachmentsType.begin(); 208 QStringList::Iterator itType = attachmentsType.begin();
209 209
210 Enclosure e; 210 Enclosure e;
211 for ( QStringList::Iterator it = attachedFiles.begin(); it != attachedFiles.end(); ++it ) { 211 for ( QStringList::Iterator it = attachedFiles.begin(); it != attachedFiles.end(); ++it ) {
212 e.id = idCount; 212 e.id = idCount;
213 e.originalName = (*it).latin1(); 213 e.originalName = (*it).latin1();
214 e.contentType = (*itType).latin1(); 214 e.contentType = (*itType).latin1();
215 e.contentAttribute = (*itType).latin1(); 215 e.contentAttribute = (*itType).latin1();
216 e.saved = TRUE; 216 e.saved = TRUE;
217 mail.addEnclosure(&e); 217 mail.addEnclosure(&e);
218 218
219 itType++; 219 itType++;
220 idCount++; 220 idCount++;
221 } 221 }
222 mail.rawMail += mail.body; 222 mail.rawMail += mail.body;
223 mail.rawMail += "\n"; 223 mail.rawMail += "\n";
224 mail.rawMail += ".\n"; 224 mail.rawMail += ".\n";
225 emit sendMailRequested(mail); 225 emit sendMailRequested(mail);
226 addAtt->clear(); 226 addAtt->clear();
227} 227}
@@ -230,14 +230,14 @@ void WriteMail::getAddress()
230{ 230{
231 showingAddressList = !showingAddressList; 231 showingAddressList = !showingAddressList;
232 232
233 if (showingAddressList) { 233 if (showingAddressList) {
234 emailInput->hide(); 234 emailInput->hide();
235 addressView->show(); 235 addressView->show();
236 okButton->show(); 236 okButton->show();
237 237
238 } else { 238 } else {
239 addressView->hide(); 239 addressView->hide();
240 okButton->hide(); 240 okButton->hide();
241 emailInput->show(); 241 emailInput->show();
242 } 242 }
243} 243}
@@ -246,3 +246,3 @@ void WriteMail::attachFile()
246{ 246{
247 addAtt->showMaximized(); 247 addAtt->showMaximized();
248} 248}
@@ -251,40 +251,40 @@ void WriteMail::reply(Email replyMail, bool replyAll)
251{ 251{
252 int pos; 252 int pos;
253 QString ccRecipients; 253 QString ccRecipients;
254 254
255 mail = replyMail; 255 mail = replyMail;
256 mail.files.clear(); 256 mail.files.clear();
257 257
258 toInput->setText(mail.fromMail); 258 toInput->setText(mail.fromMail);
259 259
260 if (replyAll) 260 if (replyAll)
261 { 261 {
262 for (QStringList::Iterator it = mail.carbonCopies.begin();it != mail.carbonCopies.end(); ++it) 262 for (QStringList::Iterator it = mail.carbonCopies.begin();it != mail.carbonCopies.end(); ++it)
263 { 263 {
264 ccRecipients.append(*it); 264 ccRecipients.append(*it);
265 ccRecipients.append(";"); 265 ccRecipients.append(";");
266 } 266 }
267 ccRecipients.truncate(ccRecipients.length()-1); //no ; at the end 267 ccRecipients.truncate(ccRecipients.length()-1); //no ; at the end
268 ccInput->setText(ccRecipients); 268 ccInput->setText(ccRecipients);
269 } 269 }
270 else ccInput->clear(); 270 else ccInput->clear();
271 271
272 subjectInput->setText(tr("Re: ") + mail.subject); 272 subjectInput->setText(tr("Re: ") + mail.subject);
273 273
274 QString citation=mail.fromMail; 274 QString citation=mail.fromMail;
275 citation.append(tr(" wrote on ")); 275 citation.append(tr(" wrote on "));
276 citation.append(mail.date); 276 citation.append(mail.date);
277 citation.append(":\n"); 277 citation.append(":\n");
278 278
279 279
280 //mail.body.insert(0,tr("On")); 280 //mail.body.insert(0,tr("On"));
281 pos = 0; 281 pos = 0;
282 mail.body.insert(pos, ">"); 282 mail.body.insert(pos, ">");
283 while (pos != -1) { 283 while (pos != -1) {
284 pos = mail.body.find('\n', pos); 284 pos = mail.body.find('\n', pos);
285 if (pos != -1) 285 if (pos != -1)
286 mail.body.insert(++pos, ">>"); 286 mail.body.insert(++pos, ">");
287 } 287 }
288 mail.body.insert(0,citation); 288 mail.body.insert(0,citation);
289 emailInput->setText(mail.body); 289 emailInput->setText(mail.body);
290} 290}
@@ -293,17 +293,17 @@ void WriteMail::forward(Email forwMail)
293{ 293{
294 int pos=0; 294 // int pos=0;
295 295
296 QString fwdBody=tr("======forwarded message from "); 296 QString fwdBody=tr("======forwarded message from ");
297 fwdBody.append(forwMail.fromMail); 297 fwdBody.append(forwMail.fromMail);
298 fwdBody.append(tr(" starts======\n\n")); 298 fwdBody.append(tr(" starts======\n\n"));
299 299
300 mail=forwMail; 300 mail=forwMail;
301 toInput->setText(""); 301 toInput->setText("");
302 ccInput->setText(""); 302 ccInput->setText("");
303 subjectInput->setText(tr("FWD: ") + mail.subject); 303 subjectInput->setText(tr("FWD: ") + mail.subject);
304 304
305 fwdBody+=mail.body; 305 fwdBody+=mail.body;
306 fwdBody+=QString(tr("======end of forwarded message======\n\n")); 306 fwdBody+=QString(tr("======end of forwarded message======\n\n"));
307 307
308 emailInput->setText(fwdBody); 308 emailInput->setText(fwdBody);
309} 309}
@@ -312,31 +312,31 @@ bool WriteMail::getRecipients(bool ccField)
312{ 312{
313 QString str, temp; 313 QString str, temp;
314 int pos = 0; 314 int pos = 0;
315 315
316 if (ccField) 316 if (ccField)
317 { 317 {
318 mail.carbonCopies.clear(); 318 mail.carbonCopies.clear();
319 temp = ccInput->text(); 319 temp = ccInput->text();
320 } 320 }
321 else 321 else
322 { 322 {
323 mail.recipients.clear(); 323 mail.recipients.clear();
324 temp=toInput->text() ; 324 temp=toInput->text() ;
325 } 325 }
326 326
327 while ( (pos = temp.find(';')) != -1) { 327 while ( (pos = temp.find(';')) != -1) {
328 str = temp.left(pos).stripWhiteSpace(); 328 str = temp.left(pos).stripWhiteSpace();
329 temp = temp.right(temp.length() - (pos + 1)); 329 temp = temp.right(temp.length() - (pos + 1));
330 if ( str.find('@') == -1) 330 if ( str.find('@') == -1)
331 return false; 331 return false;
332 ccField ? mail.carbonCopies.append(str) : mail.recipients.append(str); 332 ccField ? mail.carbonCopies.append(str) : mail.recipients.append(str);
333 //addressList->addContact(str, ""); 333 //addressList->addContact(str, "");
334 } 334 }
335 temp = temp.stripWhiteSpace(); 335 temp = temp.stripWhiteSpace();
336 if ( temp.find('@') == -1) 336 if ( temp.find('@') == -1)
337 return false; 337 return false;
338 ccField ? mail.carbonCopies.append(temp) : mail.recipients.append(temp); 338 ccField ? mail.carbonCopies.append(temp) : mail.recipients.append(temp);
339 //addressList->addContact(temp, ""); 339 //addressList->addContact(temp, "");
340 340
341 return TRUE; 341 return TRUE;
342} 342}
@@ -345,4 +345,4 @@ void WriteMail::addRecipients()
345{ 345{
346 toInput->isVisible() ? addRecipients(false) : addRecipients(true); 346 toInput->isVisible() ? addRecipients(false) : addRecipients(true);
347 } 347}
348 348
@@ -350,25 +350,25 @@ void WriteMail::addRecipients(bool ccField)
350{ 350{
351 QString recipients = ""; 351 QString recipients = "";
352 352
353 mail.recipients.clear(); 353 mail.recipients.clear();
354 354
355 QListViewItem *item = addressView->firstChild(); 355 QListViewItem *item = addressView->firstChild();
356 while (item != NULL) { 356 while (item != NULL) {
357 if ( item->isSelected() ) { 357 if ( item->isSelected() ) {
358 if (recipients == "") { 358 if (recipients == "") {
359 recipients = item->text(1); 359 recipients = item->text(1);
360 } else { 360 } else {
361 recipients += "; " + item->text(1); 361 recipients += "; " + item->text(1);
362 } 362 }
363 } 363 }
364 item = item->nextSibling(); 364 item = item->nextSibling();
365 } 365 }
366 366
367 ccField ? ccInput->setText(recipients):toInput->setText(recipients); 367 ccField ? ccInput->setText(recipients):toInput->setText(recipients);
368 368
369 addressView->hide(); 369 addressView->hide();
370 okButton->hide(); 370 okButton->hide();
371 emailInput->show(); 371 emailInput->show();
372 addressButton->setOn(FALSE); 372 addressButton->setOn(FALSE);
373 showingAddressList = !showingAddressList; 373 showingAddressList = !showingAddressList;
374} 374}
@@ -377,12 +377,12 @@ void WriteMail::changeRecipients(int selection)
377{ 377{
378 if (selection==0) 378 if (selection==0)
379 { 379 {
380 toInput->show(); 380 toInput->show();
381 ccInput->hide(); 381 ccInput->hide();
382 } 382 }
383 else if (selection==1) 383 else if (selection==1)
384 { 384 {
385 toInput->hide(); 385 toInput->hide();
386 ccInput->show(); 386 ccInput->show();
387 } 387 }
388} 388}
@@ -396,7 +396,7 @@ void WriteMail::newMail()
396{ 396{
397 toInput->clear(); 397 toInput->clear();
398 ccInput->clear(); 398 ccInput->clear();
399 subjectInput->clear(); 399 subjectInput->clear();
400 emailInput->clear(); 400 emailInput->clear();
401 setAddressList(addressList); 401 setAddressList(addressList);
402} 402}
diff --git a/noncore/unsupported/mailit/addatt.cpp b/noncore/unsupported/mailit/addatt.cpp
index daefac6..19ac58f 100644
--- a/noncore/unsupported/mailit/addatt.cpp
+++ b/noncore/unsupported/mailit/addatt.cpp
@@ -58,3 +58,3 @@ AddAtt::AddAtt(QWidget *parent, const char *name, WFlags f)
58{ 58{
59 setCaption("Adding attachments"); 59 setCaption(tr("Adding attachments") );
60 60
@@ -124,3 +124,3 @@ void AddAtt::clear()
124void AddAtt::addattachment() 124void AddAtt::addattachment()
125 { 125 {// ### FIXME wrong use -zecke
126 OFileDialog ofs("Attachments",this,0,0,"/root/Documents"); 126 OFileDialog ofs("Attachments",this,0,0,"/root/Documents");
diff --git a/noncore/unsupported/mailit/emailclient.cpp b/noncore/unsupported/mailit/emailclient.cpp
index da1226c..749a4e9 100644
--- a/noncore/unsupported/mailit/emailclient.cpp
+++ b/noncore/unsupported/mailit/emailclient.cpp
@@ -61,6 +61,6 @@ EmailClient::EmailClient( QWidget* parent, const char* name, WFlags fl )
61 61
62 connect(emailHandler, SIGNAL(smtpError(int)), this, 62 connect(emailHandler, SIGNAL(smtpError(int,const QString &)), this,
63 SLOT(smtpError(int)) ); 63 SLOT(smtpError(int,const QString &)) );
64 connect(emailHandler, SIGNAL(popError(int)), this, 64 connect(emailHandler, SIGNAL(popError(int,const QString &)), this,
65 SLOT(popError(int)) ); 65 SLOT(popError(int,const QString &)) );
66 66
@@ -482,3 +482,3 @@ void EmailClient::mailArrived(const Email &mail, bool fromDisk)
482 482
483void EmailClient::allMailArrived(int count) 483void EmailClient::allMailArrived(int /*count*/)
484{ 484{
@@ -520,3 +520,3 @@ void EmailClient::moveMailFront(Email *mailPtr)
520 520
521void EmailClient::smtpError(int code) 521void EmailClient::smtpError(int code, const QString & Msg)
522{ 522{
@@ -524,11 +524,13 @@ void EmailClient::smtpError(int code)
524 524
525 if (code == ErrUnknownResponse) 525 if (code == ErrUnknownResponse) {
526 temp = "Unknown response from server"; 526 temp = tr("<qt>Unknown response from server</qt>");
527 527 if( ! Msg.isEmpty() )
528 if (code == QSocket::ErrHostNotFound) 528 temp += Msg;
529 temp = "host not found"; 529 } else if (code == QSocket::ErrHostNotFound) {
530 if (code == QSocket::ErrConnectionRefused) 530 temp = tr("<qt>host not found</qt>");
531 temp = "connection refused"; 531 } else if (code == QSocket::ErrConnectionRefused) {
532 if (code == QSocket::ErrSocketRead) 532 temp = tr("<qt>connection refused</qt>");
533 temp = "socket packet error"; 533 } else if (code == QSocket::ErrSocketRead) {
534 temp = tr("<qt>socket packet error</qt>");
535 }
534 536
@@ -546,3 +548,3 @@ void EmailClient::smtpError(int code)
546 548
547void EmailClient::popError(int code) 549void EmailClient::popError(int code, const QString & Msg)
548{ 550{
@@ -550,16 +552,19 @@ void EmailClient::popError(int code)
550 552
551 if (code == ErrUnknownResponse) 553 if (code == ErrUnknownResponse) {
552 temp = "Unknown response from server"; 554 temp = tr("<qt>Unknown response from server</qt>");
553 if (code == ErrLoginFailed) 555 if( ! Msg.isEmpty() )
554 temp = "Login failed\nCheck user name and password"; 556 temp += Msg;
555 557 } else if (code == ErrLoginFailed) {
556 if (code == QSocket::ErrHostNotFound) 558 temp = tr("<qt>Login failed\nCheck user name and password</qt>");
557 temp = "host not found"; 559 } else if (code == QSocket::ErrHostNotFound) {
558 if (code == QSocket::ErrConnectionRefused) 560 temp = tr("<qt>host not found</qt>");
559 temp = "connection refused"; 561 } else if (code == QSocket::ErrConnectionRefused) {
560 if (code == QSocket::ErrSocketRead) 562 temp = tr("<qt>connection refused</qt>");
561 temp = "socket packet error"; 563 } else if (code == QSocket::ErrSocketRead) {
562 564 temp = tr("<qt>socket packet error</qt>");
565 }
566
563 if (code != ErrCancel) { 567 if (code != ErrCancel) {
564 QMessageBox::warning(qApp->activeWindow(), "Receiving error", temp, "OK\n"); 568 QMessageBox::warning(qApp->activeWindow(), tr("Receiving error"), temp, tr("OK\n"));
569
565 } else { 570 } else {
@@ -900,3 +905,3 @@ void EmailClient::setMailSize(int size)
900 905
901void EmailClient::setTotalSize(int size) 906void EmailClient::setTotalSize(int /*size*/)
902{ 907{
@@ -922,3 +927,3 @@ void EmailClient::deleteItem()
922 EmailListItem* eli; 927 EmailListItem* eli;
923 int pos; 928 // int pos;
924 929
@@ -948,3 +953,3 @@ void EmailClient::inboxItemReleased()
948{ 953{
949 /*killTimer(timerID); 954 //killTimer(timerID);
950 955
@@ -993,3 +998,3 @@ void EmailClient::download(Email* mail)
993 998
994void EmailClient::receive(const QCString& msg, const QByteArray& data) 999void EmailClient::receive(const QCString& /*msg*/, const QByteArray& /*data*/)
995{ 1000{
@@ -997,3 +1002,3 @@ void EmailClient::receive(const QCString& msg, const QByteArray& data)
997 { 1002 {
998 /*QDialog qd(qApp->activeWindow(),"Getting mail",true); 1003 //QDialog qd(qApp->activeWindow(),"Getting mail",true);
999 QVBoxLayout *vbProg = new QVBoxLayout( &qd ); 1004 QVBoxLayout *vbProg = new QVBoxLayout( &qd );
diff --git a/noncore/unsupported/mailit/emailclient.h b/noncore/unsupported/mailit/emailclient.h
index c98cfce..80c6d31 100644
--- a/noncore/unsupported/mailit/emailclient.h
+++ b/noncore/unsupported/mailit/emailclient.h
@@ -100,4 +100,4 @@ public slots:
100 void getAllNewMail(); 100 void getAllNewMail();
101 void smtpError(int code); 101 void smtpError(int code, const QString & Msg );
102 void popError(int code); 102 void popError(int code, const QString & Msg);
103 void inboxItemSelected(); 103 void inboxItemSelected();
diff --git a/noncore/unsupported/mailit/emailhandler.cpp b/noncore/unsupported/mailit/emailhandler.cpp
index 39f693d..5b8bda1 100644
--- a/noncore/unsupported/mailit/emailhandler.cpp
+++ b/noncore/unsupported/mailit/emailhandler.cpp
@@ -46,4 +46,4 @@ EmailHandler::EmailHandler()
46 46
47 connect(smtpClient, SIGNAL(errorOccurred(int)), this, 47 connect(smtpClient, SIGNAL(errorOccurred(int, const QString &)), this,
48 SIGNAL(smtpError(int)) ); 48 SIGNAL(smtpError(int, const QString &)) );
49 connect(smtpClient, SIGNAL(mailSent()), this, SIGNAL(mailSent()) ); 49 connect(smtpClient, SIGNAL(mailSent()), this, SIGNAL(mailSent()) );
@@ -52,4 +52,4 @@ EmailHandler::EmailHandler()
52 52
53 connect(popClient, SIGNAL(errorOccurred(int)), this, 53 connect(popClient, SIGNAL(errorOccurred(int, const QString &)), this,
54 SIGNAL(popError(int)) ); 54 SIGNAL(popError(int, const QString &)) );
55 connect(popClient, SIGNAL(newMessage(const QString &, int, uint, bool)), 55 connect(popClient, SIGNAL(newMessage(const QString &, int, uint, bool)),
@@ -164,3 +164,3 @@ bool EmailHandler::parse(const QString &in, const QString &lineShift, Email *mai
164 temp = lineShift + "." + lineShift; 164 temp = lineShift + "." + lineShift;
165 165
166 if (in.right(temp.length()) != temp) { 166 if (in.right(temp.length()) != temp) {
diff --git a/noncore/unsupported/mailit/emailhandler.h b/noncore/unsupported/mailit/emailhandler.h
index e4e7f46..74a8e4c 100644
--- a/noncore/unsupported/mailit/emailhandler.h
+++ b/noncore/unsupported/mailit/emailhandler.h
@@ -129,4 +129,4 @@ signals:
129 void mailSent(); 129 void mailSent();
130 void smtpError(int); 130 void smtpError(int, const QString & Msg );
131 void popError(int); 131 void popError(int, const QString & Msg );
132 void mailArrived(const Email &, bool); 132 void mailArrived(const Email &, bool);
diff --git a/noncore/unsupported/mailit/mailit.pro b/noncore/unsupported/mailit/mailit.pro
index cfbda36..5e9a83a 100644
--- a/noncore/unsupported/mailit/mailit.pro
+++ b/noncore/unsupported/mailit/mailit.pro
@@ -1,2 +1,3 @@
1TEMPLATE = app 1TEMPLATE = app
2TARGET = mailit
2CONFIG = qt warn_on release 3CONFIG = qt warn_on release
diff --git a/noncore/unsupported/mailit/mailitwindow.cpp b/noncore/unsupported/mailit/mailitwindow.cpp
index f945a0f..6e298c7 100644
--- a/noncore/unsupported/mailit/mailitwindow.cpp
+++ b/noncore/unsupported/mailit/mailitwindow.cpp
@@ -23,6 +23,6 @@
23 23
24MailItWindow::MailItWindow(QWidget *parent, const char *name, WFlags fl) 24MailItWindow::MailItWindow(QWidget *parent, const char *name, WFlags /*fl*/)
25 : QMainWindow(parent, name, WStyle_ContextHelp) 25 : QMainWindow(parent, name, WStyle_ContextHelp)
26{ 26{
27 currentCaption = "Mailit"; 27 currentCaption = tr("Mailit");
28 setCaption(tr(currentCaption)); 28 setCaption(tr(currentCaption));
diff --git a/noncore/unsupported/mailit/maillist.cpp b/noncore/unsupported/mailit/maillist.cpp
index b5325a9..8c34295 100644
--- a/noncore/unsupported/mailit/maillist.cpp
+++ b/noncore/unsupported/mailit/maillist.cpp
@@ -23,5 +23,5 @@ void MailList::clear()
23{ 23{
24 sortedList.setAutoDelete(TRUE); 24 sortedList.setAutoDelete(TRUE);
25 sortedList.clear(); 25 sortedList.clear();
26 currentPos = 0; 26 currentPos = 0;
27} 27}
@@ -30,3 +30,3 @@ int MailList::count()
30{ 30{
31 return sortedList.count(); 31 return sortedList.count();
32} 32}
@@ -35,10 +35,10 @@ int* MailList::first()
35{ 35{
36 dList *mPtr; 36 dList *mPtr;
37 37
38 if (sortedList.count() == 0) 38 if (sortedList.count() == 0)
39 return NULL; 39 return NULL;
40 40
41 mPtr = sortedList.at(0); 41 mPtr = sortedList.at(0);
42 currentPos = 1; 42 currentPos = 1;
43 return &(mPtr->serverId); 43 return &(mPtr->serverId);
44} 44}
@@ -47,10 +47,10 @@ int* MailList::next()
47{ 47{
48 dList *mPtr; 48 dList *mPtr;
49 49
50 if ( (currentPos) >= sortedList.count()) 50 if ( (currentPos) >= sortedList.count())
51 return NULL; 51 return NULL;
52 52
53 mPtr = sortedList.at(currentPos); 53 mPtr = sortedList.at(currentPos);
54 currentPos++; 54 currentPos++;
55 return &(mPtr->serverId); 55 return &(mPtr->serverId);
56} 56}
@@ -59,41 +59,41 @@ void MailList::sizeInsert(int serverId, uint size)
59{ 59{
60 dList *tempPtr; 60 dList *tempPtr;
61 int x; 61 int x;
62 62
63 dList *newEntry = new dList; 63 dList *newEntry = new dList;
64 newEntry->serverId = serverId; 64 newEntry->serverId = serverId;
65 newEntry->size = size; 65 newEntry->size = size;
66 66
67 for (tempPtr = sortedList.first(); tempPtr != NULL; tempPtr = sortedList.next() ) { 67 for (tempPtr = sortedList.first(); tempPtr != NULL; tempPtr = sortedList.next() ) {
68 if (newEntry->size < tempPtr->size) { 68 if (newEntry->size < tempPtr->size) {
69 x = sortedList.at(); 69 x = sortedList.at();
70 sortedList.insert(x, newEntry); 70 sortedList.insert(x, newEntry);
71 return; 71 return;
72 } 72 }
73 } 73 }
74 sortedList.append(newEntry); 74 sortedList.append(newEntry);
75} 75}
76 76
77void MailList::moveFront(int serverId, uint size) 77void MailList::moveFront(int serverId, uint/* size*/)
78{ 78{
79 dList *currentPtr; 79 dList *currentPtr;
80 uint tempPos; 80 uint tempPos;
81 QString temp; 81 QString temp;
82 82
83 tempPos = currentPos; 83 tempPos = currentPos;
84 if ( tempPos >= sortedList.count() ) 84 if ( tempPos >= sortedList.count() )
85 return; 85 return;
86 currentPtr = sortedList.at(tempPos); 86 currentPtr = sortedList.at(tempPos);
87 while ( ((tempPos+1) < sortedList.count()) && ( currentPtr->serverId != serverId) ) { 87 while ( ((tempPos+1) < sortedList.count()) && ( currentPtr->serverId != serverId) ) {
88 tempPos++; 88 tempPos++;
89 currentPtr = sortedList.at(tempPos); 89 currentPtr = sortedList.at(tempPos);
90 } 90 }
91 91
92 if ( (currentPtr != NULL) && (currentPtr->serverId == serverId) ) { 92 if ( (currentPtr != NULL) && (currentPtr->serverId == serverId) ) {
93 temp.setNum(currentPtr->serverId); 93 temp.setNum(currentPtr->serverId);
94 qWarning("moved to front, message: " + temp); 94 qWarning("moved to front, message: " + temp);
95 95
96 dList *itemPtr = sortedList.take(tempPos); 96 dList *itemPtr = sortedList.take(tempPos);
97 sortedList.insert(currentPos, itemPtr); 97 sortedList.insert(currentPos, itemPtr);
98 } 98 }
99 99
@@ -102,30 +102,30 @@ void MailList::moveFront(int serverId, uint size)
102//only works if mail is not already in download 102//only works if mail is not already in download
103bool MailList::remove(int serverId, uint size) 103bool MailList::remove(int serverId, uint /*size*/)
104{ 104{
105 dList *currentPtr; 105 dList *currentPtr;
106 uint tempPos; 106 uint tempPos;
107 QString temp; 107 QString temp;
108 108
109 tempPos = currentPos; 109 tempPos = currentPos;
110 if ( tempPos >=sortedList.count() ) 110 if ( tempPos >=sortedList.count() )
111 return FALSE; 111 return FALSE;
112 currentPtr = sortedList.at(tempPos); 112 currentPtr = sortedList.at(tempPos);
113 while ( ((tempPos + 1) < sortedList.count()) && ( currentPtr->serverId != serverId) ) { 113 while ( ((tempPos + 1) < sortedList.count()) && ( currentPtr->serverId != serverId) ) {
114 tempPos++; 114 tempPos++;
115 currentPtr = sortedList.at(tempPos); 115 currentPtr = sortedList.at(tempPos);
116 } 116 }
117 117
118 if ( (currentPtr != NULL) && (currentPtr->serverId == serverId) ) { 118 if ( (currentPtr != NULL) && (currentPtr->serverId == serverId) ) {
119 temp.setNum(currentPtr->serverId); 119 temp.setNum(currentPtr->serverId);
120 qWarning("deleted message: " + temp); 120 qWarning("deleted message: " + temp);
121 sortedList.remove(tempPos); 121 sortedList.remove(tempPos);
122 122
123 return TRUE; 123 return TRUE;
124 } 124 }
125 return FALSE; 125 return FALSE;
126} 126}
127 127
128void MailList::insert(int pos, int serverId, uint size) 128void MailList::insert(int /*pos*/, int /*serverId*/, uint/* size*/)
129{ 129{
130 //sortedList.insert(pos, mPtr); 130// sortedList.insert(pos, mPtr);
131} 131}
diff --git a/noncore/unsupported/mailit/popclient.cpp b/noncore/unsupported/mailit/popclient.cpp
index dc0116d..5da3bcb 100644
--- a/noncore/unsupported/mailit/popclient.cpp
+++ b/noncore/unsupported/mailit/popclient.cpp
@@ -65,3 +65,3 @@ void PopClient::newConnection(const QString &target, int port)
65 65
66 emit updateStatus("DNS lookup"); 66 emit updateStatus(tr("DNS lookup"));
67} 67}
@@ -105,4 +105,8 @@ void PopClient::errorHandling(int status)
105{ 105{
106 errorHandlingWithMsg( status, QString::null );
107}
108void PopClient::errorHandlingWithMsg(int status, const QString & Msg )
109{
106 emit updateStatus(tr("Error Occured")); 110 emit updateStatus(tr("Error Occured"));
107 emit errorOccurred(status); 111 emit errorOccurred(status, Msg);
108 socket->close(); 112 socket->close();
@@ -169,3 +173,3 @@ void PopClient::incomingData()
169 status = Mcnt; 173 status = Mcnt;
170 } else errorHandling(ErrLoginFailed); 174 } else errorHandlingWithMsg(ErrLoginFailed, response);
171 break; 175 break;
@@ -197,3 +201,3 @@ void PopClient::incomingData()
197 201
198 } else errorHandling(ErrUnknownResponse); 202 } else errorHandlingWithMsg(ErrUnknownResponse, response);
199 } 203 }
@@ -236,3 +240,3 @@ void PopClient::incomingData()
236 //qWarning(response); 240 //qWarning(response);
237 errorHandling(ErrUnknownResponse); 241 errorHandlingWithMsg(ErrUnknownResponse, response);
238 } 242 }
@@ -261,3 +265,3 @@ void PopClient::incomingData()
261 response = socket->readLine(); 265 response = socket->readLine();
262 } else errorHandling(ErrUnknownResponse); 266 } else errorHandlingWithMsg(ErrUnknownResponse, response);
263 } 267 }
diff --git a/noncore/unsupported/mailit/popclient.h b/noncore/unsupported/mailit/popclient.h
index c58bc48..6774ceb 100644
--- a/noncore/unsupported/mailit/popclient.h
+++ b/noncore/unsupported/mailit/popclient.h
@@ -46,3 +46,3 @@ signals:
46 void newMessage(const QString &, int, uint, bool); 46 void newMessage(const QString &, int, uint, bool);
47 void errorOccurred(int status); 47 void errorOccurred(int status, const QString & Msg );
48 void updateStatus(const QString &); 48 void updateStatus(const QString &);
@@ -55,2 +55,3 @@ public slots:
55 void errorHandling(int); 55 void errorHandling(int);
56 void errorHandlingWithMsg(int, const QString & );
56 57
diff --git a/noncore/unsupported/mailit/smtpclient.cpp b/noncore/unsupported/mailit/smtpclient.cpp
index 2916f45..5b5ef52 100644
--- a/noncore/unsupported/mailit/smtpclient.cpp
+++ b/noncore/unsupported/mailit/smtpclient.cpp
@@ -75,3 +75,8 @@ void SmtpClient::errorHandling(int status)
75{ 75{
76 emit errorOccurred(status); 76 errorHandlingWithMsg( status, QString::null );
77}
78
79void SmtpClient::errorHandlingWithMsg(int status, const QString & EMsg )
80{
81 emit errorOccurred(status, EMsg );
77 socket->close(); 82 socket->close();
@@ -89,3 +94,2 @@ void SmtpClient::incomingData()
89 response = socket->readLine(); 94 response = socket->readLine();
90
91 switch(status) { 95 switch(status) {
@@ -96,3 +100,3 @@ void SmtpClient::incomingData()
96 *stream << "HELO there\r\n"; 100 *stream << "HELO there\r\n";
97 } else errorHandling(ErrUnknownResponse); 101 } else errorHandlingWithMsg(ErrUnknownResponse,response);
98 break; 102 break;
@@ -101,5 +105,6 @@ void SmtpClient::incomingData()
101 if (response[0] == '2') { 105 if (response[0] == '2') {
102 *stream << "MAIL FROM: " << mailPtr->from << "\r\n"; 106 qDebug(mailPtr->from);
107 *stream << "MAIL FROM: <" << mailPtr->from << ">\r\n";
103 status = Recv; 108 status = Recv;
104 } else errorHandling(ErrUnknownResponse); 109 } else errorHandlingWithMsg(ErrUnknownResponse, response );
105 break; 110 break;
@@ -107,9 +112,10 @@ void SmtpClient::incomingData()
107 case Recv: { 112 case Recv: {
108 if (response[0] == '2') { 113 if (response[0] == '2') {
109 it = mailPtr->to.begin(); 114 it = mailPtr->to.begin();
110 if (it == NULL) 115 if (it == NULL) {
111 errorHandling(ErrUnknownResponse); 116 errorHandlingWithMsg(ErrUnknownResponse,response);
112 *stream << "RCPT TO: " << *it << ">\r\n"; 117 }
118 *stream << "RCPT TO: <" << *it << ">\r\n";
113 status = MRcv; 119 status = MRcv;
114 } else errorHandling(ErrUnknownResponse); 120 } else errorHandlingWithMsg(ErrUnknownResponse,response);
115 break; 121 break;
@@ -125,3 +131,3 @@ void SmtpClient::incomingData()
125 } 131 }
126 } else errorHandling(ErrUnknownResponse); 132 } else errorHandlingWithMsg(ErrUnknownResponse,response);
127 } 133 }
@@ -132,3 +138,4 @@ void SmtpClient::incomingData()
132 emit updateStatus(tr("Sending: ") + mailPtr->subject); 138 emit updateStatus(tr("Sending: ") + mailPtr->subject);
133 } else errorHandling(ErrUnknownResponse); 139
140 } else errorHandlingWithMsg(ErrUnknownResponse,response);
134 break; 141 break;
@@ -144,3 +151,3 @@ void SmtpClient::incomingData()
144 } 151 }
145 } else errorHandling(ErrUnknownResponse); 152 } else errorHandlingWithMsg(ErrUnknownResponse,response);
146 break; 153 break;
@@ -158,3 +165,3 @@ void SmtpClient::incomingData()
158 socket->close(); 165 socket->close();
159 } else errorHandling(ErrUnknownResponse); 166 } else errorHandlingWithMsg(ErrUnknownResponse,response);
160 break; 167 break;
diff --git a/noncore/unsupported/mailit/smtpclient.h b/noncore/unsupported/mailit/smtpclient.h
index 45c0703..554ba3f 100644
--- a/noncore/unsupported/mailit/smtpclient.h
+++ b/noncore/unsupported/mailit/smtpclient.h
@@ -49,3 +49,3 @@ public:
49signals: 49signals:
50 void errorOccurred(int); 50 void errorOccurred(int, const QString & LR );
51 void updateStatus(const QString &); 51 void updateStatus(const QString &);
@@ -55,2 +55,3 @@ public slots:
55 void errorHandling(int); 55 void errorHandling(int);
56 void errorHandlingWithMsg(int, const QString & LastResponse );
56 57
diff --git a/noncore/unsupported/mailit/viewatt.cpp b/noncore/unsupported/mailit/viewatt.cpp
index 21885c2..293e137 100644
--- a/noncore/unsupported/mailit/viewatt.cpp
+++ b/noncore/unsupported/mailit/viewatt.cpp
@@ -28,3 +28,3 @@ ViewAtt::ViewAtt(QWidget *parent, const char *name, WFlags f)
28{ 28{
29 setCaption("Exploring attatchments"); 29 setCaption(tr("Exploring attatchments"));
30 30
@@ -37,5 +37,5 @@ ViewAtt::ViewAtt(QWidget *parent, const char *name, WFlags f)
37 listView = new QListView(this, "AttView"); 37 listView = new QListView(this, "AttView");
38 listView->addColumn( "Attatchment" ); 38 listView->addColumn( tr("Attatchment") );
39 listView->addColumn( "Type" ); 39 listView->addColumn( tr("Type") );
40 listView->addColumn( "Installed" ); 40 listView->addColumn( tr("Installed") );
41 setCentralWidget(listView); 41 setCentralWidget(listView);
@@ -63,5 +63,5 @@ void ViewAtt::update(Email *mailIn, bool inbox)
63 63
64 QString isInstalled = "No"; 64 QString isInstalled = tr("No");
65 if (ePtr->installed) 65 if (ePtr->installed)
66 isInstalled = "Yes"; 66 isInstalled = tr("Yes");
67 item = new QListViewItem(listView, ePtr->originalName, ePtr->contentType, isInstalled); 67 item = new QListViewItem(listView, ePtr->originalName, ePtr->contentType, isInstalled);
@@ -118,3 +118,3 @@ void ViewAtt::install()
118 selPtr->installed = TRUE; 118 selPtr->installed = TRUE;
119 item->setText(2, "Yes"); 119 item->setText(2, tr("Yes"));
120 } 120 }
diff --git a/noncore/unsupported/mailit/writemail.cpp b/noncore/unsupported/mailit/writemail.cpp
index 0298cb3..26b9660 100644
--- a/noncore/unsupported/mailit/writemail.cpp
+++ b/noncore/unsupported/mailit/writemail.cpp
@@ -26,6 +26,6 @@ WriteMail::WriteMail( QWidget* parent, const char* name, WFlags fl ):QMainWindo
26{ 26{
27 showingAddressList = FALSE; 27 showingAddressList = FALSE;
28 init(); 28 init();
29 29
30 addAtt = new AddAtt(0, "Add Attachments"); 30 addAtt = new AddAtt(0, "Add Attachments");
31} 31}
@@ -34,3 +34,3 @@ WriteMail::~WriteMail()
34{ 34{
35 delete addAtt; 35 delete addAtt;
36} 36}
@@ -39,12 +39,12 @@ void WriteMail::setAddressList(AddressList *list)
39{ 39{
40 AContact *cPtr; 40 AContact *cPtr;
41 41
42 addressList = list; 42 addressList = list;
43 43
44 addressView->clear(); 44 addressView->clear();
45 QList<AContact> *cListPtr = addressList->getContactList(); 45 QList<AContact> *cListPtr = addressList->getContactList();
46 QListViewItem *item; 46 QListViewItem *item;
47 for (cPtr = cListPtr->first(); cPtr != 0; cPtr = cListPtr->next() ) { 47 for (cPtr = cListPtr->first(); cPtr != 0; cPtr = cListPtr->next() ) {
48 item = new QListViewItem(addressView, cPtr->name, cPtr->email); 48 item = new QListViewItem(addressView, cPtr->name, cPtr->email);
49 } 49 }
50} 50}
@@ -53,91 +53,91 @@ void WriteMail::init()
53{ 53{
54 setToolBarsMovable(FALSE); 54 setToolBarsMovable(FALSE);
55 55
56 bar = new QToolBar(this); 56 bar = new QToolBar(this);
57 bar->setHorizontalStretchable( TRUE ); 57 bar->setHorizontalStretchable( TRUE );
58 58
59 menu = new QMenuBar( bar ); 59 menu = new QMenuBar( bar );
60 60
61 mailMenu = new QPopupMenu(menu); 61 mailMenu = new QPopupMenu(menu);
62 menu->insertItem( tr( "&Mail" ), mailMenu); 62 menu->insertItem( tr( "&Mail" ), mailMenu);
63 addMenu = new QPopupMenu(menu); 63 addMenu = new QPopupMenu(menu);
64 menu->insertItem( tr( "&Add" ), addMenu); 64 menu->insertItem( tr( "&Add" ), addMenu);
65 65
66 bar = new QToolBar(this); 66 bar = new QToolBar(this);
67 attachButton = new QAction(tr("Attachment"), Resource::loadPixmap("mailit/attach"), QString::null, 0, this, 0); 67 attachButton = new QAction(tr("Attachment"), Resource::loadPixmap("mailit/attach"), QString::null, 0, this, 0);
68 attachButton->addTo(bar); 68 attachButton->addTo(bar);
69 attachButton->addTo(addMenu); 69 attachButton->addTo(addMenu);
70 connect( attachButton, SIGNAL( activated() ), this, SLOT( attachFile() ) ); 70 connect( attachButton, SIGNAL( activated() ), this, SLOT( attachFile() ) );
71 attachButton->setWhatsThis(tr("Click here to attach files to your mail")); 71 attachButton->setWhatsThis(tr("Click here to attach files to your mail"));
72 72
73 confirmButton = new QAction(tr("Enque mail"), Resource::loadPixmap("OKButton"), QString::null, 0, this, 0); 73 confirmButton = new QAction(tr("Enque mail"), Resource::loadPixmap("OKButton"), QString::null, 0, this, 0);
74 confirmButton->addTo(bar); 74 confirmButton->addTo(bar);
75 confirmButton->addTo(mailMenu); 75 confirmButton->addTo(mailMenu);
76 connect( confirmButton, SIGNAL( activated() ), this, SLOT( accept() ) ); 76 connect( confirmButton, SIGNAL( activated() ), this, SLOT( accept() ) );
77 confirmButton->setWhatsThis(tr("This button puts your mail in the send queue")); 77 confirmButton->setWhatsThis(tr("This button puts your mail in the send queue"));
78 78
79 newButton = new QAction(tr("New mail"), Resource::loadPixmap("new"), QString::null, 0, this, 0); 79 newButton = new QAction(tr("New mail"), Resource::loadPixmap("new"), QString::null, 0, this, 0);
80 newButton->addTo(mailMenu); 80 newButton->addTo(mailMenu);
81 connect( newButton, SIGNAL( activated() ), this, SLOT( newMail() ) ); 81 connect( newButton, SIGNAL( activated() ), this, SLOT( newMail() ) );
82 newButton->setWhatsThis(tr("Click here to create a new mail")); 82 newButton->setWhatsThis(tr("Click here to create a new mail"));
83 83
84 widget = new QWidget(this, "widget"); 84 widget = new QWidget(this, "widget");
85 grid = new QGridLayout( widget ); 85 grid = new QGridLayout( widget );
86 86
87 recipientsBox = new QComboBox( FALSE, widget, "toLabel" ); 87 recipientsBox = new QComboBox( FALSE, widget, "toLabel" );
88 recipientsBox->insertItem( tr( "To:" ) ); 88 recipientsBox->insertItem( tr( "To:" ) );
89 recipientsBox->insertItem( tr( "CC:" ) ); 89 recipientsBox->insertItem( tr( "CC:" ) );
90 recipientsBox->setCurrentItem(0); 90 recipientsBox->setCurrentItem(0);
91 grid->addWidget( recipientsBox, 0, 0 ); 91 grid->addWidget( recipientsBox, 0, 0 );
92 connect(recipientsBox,SIGNAL(activated(int)),this, SLOT(changeRecipients(int))); 92 connect(recipientsBox,SIGNAL(activated(int)),this, SLOT(changeRecipients(int)));
93 93
94 subjetLabel = new QLabel( widget, "subjetLabel" ); 94 subjetLabel = new QLabel( widget, "subjetLabel" );
95 subjetLabel->setText( tr( "Subject:" ) ); 95 subjetLabel->setText( tr( "Subject:" ) );
96 96
97 grid->addWidget( subjetLabel, 1, 0 ); 97 grid->addWidget( subjetLabel, 1, 0 );
98 98
99 ToolButton13_2 = new QToolButton( widget, "ToolButton13_2" ); 99 ToolButton13_2 = new QToolButton( widget, "ToolButton13_2" );
100 ToolButton13_2->setText( tr( "..." ) ); 100 ToolButton13_2->setText( tr( "..." ) );
101 grid->addWidget( ToolButton13_2, 1, 2 ); 101 grid->addWidget( ToolButton13_2, 1, 2 );
102 102
103 subjectInput = new QLineEdit( widget, "subjectInput" ); 103 subjectInput = new QLineEdit( widget, "subjectInput" );
104 grid->addWidget( subjectInput, 1, 1 ); 104 grid->addWidget( subjectInput, 1, 1 );
105 QWhatsThis::add(subjectInput,QWidget::tr("The mail subject should be entered here")); 105 QWhatsThis::add(subjectInput,QWidget::tr("The mail subject should be entered here"));
106 106
107 toInput = new QLineEdit( widget, "toInput" ); 107 toInput = new QLineEdit( widget, "toInput" );
108 grid->addWidget( toInput, 0, 1 ); 108 grid->addWidget( toInput, 0, 1 );
109 QWhatsThis::add(recipientsBox,QWidget::tr("Recipients can be entered here")); 109 QWhatsThis::add(recipientsBox,QWidget::tr("Recipients can be entered here"));
110 110
111 ccInput = new QLineEdit( widget, "ccInput" ); 111 ccInput = new QLineEdit( widget, "ccInput" );
112 ccInput->hide(); 112 ccInput->hide();
113 grid->addWidget( ccInput, 0, 1 ); 113 grid->addWidget( ccInput, 0, 1 );
114 QWhatsThis::add(ccInput,QWidget::tr("If you would like to send copies of your mail they can be entered here")); 114 QWhatsThis::add(ccInput,QWidget::tr("If you would like to send copies of your mail they can be entered here"));
115 115
116 addressButton = new QToolButton( widget, "addressButton" ); 116 addressButton = new QToolButton( widget, "addressButton" );
117 addressButton->setPixmap( Resource::loadPixmap("AddressBook") ); 117 addressButton->setPixmap( Resource::loadPixmap("AddressBook") );
118 addressButton->setToggleButton(TRUE); 118 addressButton->setToggleButton(TRUE);
119 grid->addWidget( addressButton, 0, 2 ); 119 grid->addWidget( addressButton, 0, 2 );
120 connect(addressButton, SIGNAL(clicked()), this, SLOT(getAddress()) ); 120 connect(addressButton, SIGNAL(clicked()), this, SLOT(getAddress()) );
121 QWhatsThis::add(addressButton,QWidget::tr("This button opens the address selector with all mail adresses from your OPIE addressbook")); 121 QWhatsThis::add(addressButton,QWidget::tr("This button opens the address selector with all mail adresses from your Opie addressbook"));
122 122
123 emailInput = new QMultiLineEdit( widget, "emailInput" ); 123 emailInput = new QMultiLineEdit( widget, "emailInput" );
124 grid->addMultiCellWidget( emailInput, 2, 2, 0, 2); 124 grid->addMultiCellWidget( emailInput, 2, 2, 0, 2);
125 QWhatsThis::add(emailInput,QWidget::tr("Enter your mail text here")); 125 QWhatsThis::add(emailInput,QWidget::tr("Enter your mail text here"));
126 126
127 addressView = new QListView( widget, "addressView"); 127 addressView = new QListView( widget, "addressView");
128 addressView->addColumn("Name"); 128 addressView->addColumn(tr("Name"));
129 addressView->addColumn("EMail"); 129 addressView->addColumn(tr("EMail") );
130 addressView->setAllColumnsShowFocus(TRUE); 130 addressView->setAllColumnsShowFocus(TRUE);
131 addressView->setMultiSelection(TRUE); 131 addressView->setMultiSelection(TRUE);
132 addressView->hide(); 132 addressView->hide();
133 grid->addMultiCellWidget( addressView, 3, 3, 0, 2); 133 grid->addMultiCellWidget( addressView, 3, 3, 0, 2);
134 QWhatsThis::add(recipientsBox,QWidget::tr("Choose the recipients from this list")); 134 QWhatsThis::add(recipientsBox,QWidget::tr("Choose the recipients from this list"));
135 135
136 okButton = new QToolButton(bar, "ok"); 136 okButton = new QToolButton(bar, "ok");
137 okButton->setPixmap( Resource::loadPixmap("enter") ); 137 okButton->setPixmap( Resource::loadPixmap("enter") );
138 okButton->hide(); 138 okButton->hide();
139 connect(okButton, SIGNAL(clicked()), this, SLOT(addRecipients()) ); 139 connect(okButton, SIGNAL(clicked()), this, SLOT(addRecipients()) );
140 QWhatsThis::add(okButton,QWidget::tr("Queue your mail by clicking here")); 140 QWhatsThis::add(okButton,QWidget::tr("Queue your mail by clicking here"));
141 141
142 setCentralWidget(widget); 142 setCentralWidget(widget);
143} 143}
@@ -146,3 +146,3 @@ void WriteMail::reject()
146{ 146{
147 emit cancelMail(); 147 emit cancelMail();
148} 148}
@@ -151,77 +151,77 @@ void WriteMail::accept()
151{ 151{
152 QStringList attachedFiles, attachmentsType; 152 QStringList attachedFiles, attachmentsType;
153 int idCount = 0; 153 int idCount = 0;
154 154
155 if (toInput->text() == "") 155 if (toInput->text() == "")
156 { 156 {
157 QMessageBox::warning(this,tr("No recipient"), tr("Send mail to whom?"), tr("OK\n")); 157 QMessageBox::warning(this,tr("No recipient"), tr("Send mail to whom?"), tr("OK\n"));
158 return; 158 return;
159 } 159 }
160 160
161 if (! getRecipients(false) ) 161 if (! getRecipients(false) )
162 { 162 {
163 QMessageBox::warning(this,tr("Incorrect recipient separator"), 163 QMessageBox::warning(this,tr("Incorrect recipient separator"),
164 tr("Recipients must be separated by ;\nand be valid emailaddresses"), tr("OK\n")); 164 tr("Recipients must be separated by ;\nand be valid emailaddresses"), tr("OK\n"));
165 return; 165 return;
166 } 166 }
167 167
168 if ((ccInput->text()!="") && (! getRecipients(true) )) 168 if ((ccInput->text()!="") && (! getRecipients(true) ))
169 { 169 {
170 QMessageBox::warning(this,tr("Incorrect carbon copy separator"), 170 QMessageBox::warning(this,tr("Incorrect carbon copy separator"),
171 tr("CC Recipients must be separated by ;\nand be valid emailaddresses"), tr("OK\n")); 171 tr("CC Recipients must be separated by ;\nand be valid emailaddresses"), tr("OK\n"));
172 return; 172 return;
173 } 173 }
174 174
175 mail.subject = subjectInput->text(); 175 mail.subject = subjectInput->text();
176 mail.body = emailInput->text(); 176 mail.body = emailInput->text();
177 mail.sent = false; 177 mail.sent = false;
178 mail.received = false; 178 mail.received = false;
179 179
180 mail.rawMail = "To: "; 180 mail.rawMail = "To: ";
181 181
182 for (QStringList::Iterator it = mail.recipients.begin(); 182 for (QStringList::Iterator it = mail.recipients.begin();
183 it != mail.recipients.end(); ++it) { 183 it != mail.recipients.end(); ++it) {
184 184
185 mail.rawMail += (*it); 185 mail.rawMail += (*it);
186 mail.rawMail += ",\n"; 186 mail.rawMail += ",\n";
187 } 187 }
188 188
189 mail.rawMail.truncate(mail.rawMail.length()-2); 189 mail.rawMail.truncate(mail.rawMail.length()-2);
190 190
191 mail.rawMail += "\nCC: "; 191 mail.rawMail += "\nCC: ";
192 192
193 for (QStringList::Iterator it = mail.carbonCopies.begin(); 193 for (QStringList::Iterator it = mail.carbonCopies.begin();
194 it != mail.carbonCopies.end(); ++it) { 194 it != mail.carbonCopies.end(); ++it) {
195 195
196 mail.rawMail += (*it); 196 mail.rawMail += (*it);
197 mail.rawMail += ",\n"; 197 mail.rawMail += ",\n";
198 } 198 }
199 199
200 mail.rawMail += mail.from; 200 mail.rawMail += mail.from;
201 mail.rawMail += "\nSubject: "; 201 mail.rawMail += "\nSubject: ";
202 mail.rawMail += mail.subject; 202 mail.rawMail += mail.subject;
203 mail.rawMail += "\n\n"; 203 mail.rawMail += "\n\n";
204 204
205 attachedFiles = addAtt->returnattachedFiles(); 205 attachedFiles = addAtt->returnattachedFiles();
206 attachmentsType = addAtt->returnFileTypes(); 206 attachmentsType = addAtt->returnFileTypes();
207 207
208 QStringList::Iterator itType = attachmentsType.begin(); 208 QStringList::Iterator itType = attachmentsType.begin();
209 209
210 Enclosure e; 210 Enclosure e;
211 for ( QStringList::Iterator it = attachedFiles.begin(); it != attachedFiles.end(); ++it ) { 211 for ( QStringList::Iterator it = attachedFiles.begin(); it != attachedFiles.end(); ++it ) {
212 e.id = idCount; 212 e.id = idCount;
213 e.originalName = (*it).latin1(); 213 e.originalName = (*it).latin1();
214 e.contentType = (*itType).latin1(); 214 e.contentType = (*itType).latin1();
215 e.contentAttribute = (*itType).latin1(); 215 e.contentAttribute = (*itType).latin1();
216 e.saved = TRUE; 216 e.saved = TRUE;
217 mail.addEnclosure(&e); 217 mail.addEnclosure(&e);
218 218
219 itType++; 219 itType++;
220 idCount++; 220 idCount++;
221 } 221 }
222 mail.rawMail += mail.body; 222 mail.rawMail += mail.body;
223 mail.rawMail += "\n"; 223 mail.rawMail += "\n";
224 mail.rawMail += ".\n"; 224 mail.rawMail += ".\n";
225 emit sendMailRequested(mail); 225 emit sendMailRequested(mail);
226 addAtt->clear(); 226 addAtt->clear();
227} 227}
@@ -230,14 +230,14 @@ void WriteMail::getAddress()
230{ 230{
231 showingAddressList = !showingAddressList; 231 showingAddressList = !showingAddressList;
232 232
233 if (showingAddressList) { 233 if (showingAddressList) {
234 emailInput->hide(); 234 emailInput->hide();
235 addressView->show(); 235 addressView->show();
236 okButton->show(); 236 okButton->show();
237 237
238 } else { 238 } else {
239 addressView->hide(); 239 addressView->hide();
240 okButton->hide(); 240 okButton->hide();
241 emailInput->show(); 241 emailInput->show();
242 } 242 }
243} 243}
@@ -246,3 +246,3 @@ void WriteMail::attachFile()
246{ 246{
247 addAtt->showMaximized(); 247 addAtt->showMaximized();
248} 248}
@@ -251,40 +251,40 @@ void WriteMail::reply(Email replyMail, bool replyAll)
251{ 251{
252 int pos; 252 int pos;
253 QString ccRecipients; 253 QString ccRecipients;
254 254
255 mail = replyMail; 255 mail = replyMail;
256 mail.files.clear(); 256 mail.files.clear();
257 257
258 toInput->setText(mail.fromMail); 258 toInput->setText(mail.fromMail);
259 259
260 if (replyAll) 260 if (replyAll)
261 { 261 {
262 for (QStringList::Iterator it = mail.carbonCopies.begin();it != mail.carbonCopies.end(); ++it) 262 for (QStringList::Iterator it = mail.carbonCopies.begin();it != mail.carbonCopies.end(); ++it)
263 { 263 {
264 ccRecipients.append(*it); 264 ccRecipients.append(*it);
265 ccRecipients.append(";"); 265 ccRecipients.append(";");
266 } 266 }
267 ccRecipients.truncate(ccRecipients.length()-1); //no ; at the end 267 ccRecipients.truncate(ccRecipients.length()-1); //no ; at the end
268 ccInput->setText(ccRecipients); 268 ccInput->setText(ccRecipients);
269 } 269 }
270 else ccInput->clear(); 270 else ccInput->clear();
271 271
272 subjectInput->setText(tr("Re: ") + mail.subject); 272 subjectInput->setText(tr("Re: ") + mail.subject);
273 273
274 QString citation=mail.fromMail; 274 QString citation=mail.fromMail;
275 citation.append(tr(" wrote on ")); 275 citation.append(tr(" wrote on "));
276 citation.append(mail.date); 276 citation.append(mail.date);
277 citation.append(":\n"); 277 citation.append(":\n");
278 278
279 279
280 //mail.body.insert(0,tr("On")); 280 //mail.body.insert(0,tr("On"));
281 pos = 0; 281 pos = 0;
282 mail.body.insert(pos, ">"); 282 mail.body.insert(pos, ">");
283 while (pos != -1) { 283 while (pos != -1) {
284 pos = mail.body.find('\n', pos); 284 pos = mail.body.find('\n', pos);
285 if (pos != -1) 285 if (pos != -1)
286 mail.body.insert(++pos, ">>"); 286 mail.body.insert(++pos, ">");
287 } 287 }
288 mail.body.insert(0,citation); 288 mail.body.insert(0,citation);
289 emailInput->setText(mail.body); 289 emailInput->setText(mail.body);
290} 290}
@@ -293,17 +293,17 @@ void WriteMail::forward(Email forwMail)
293{ 293{
294 int pos=0; 294 // int pos=0;
295 295
296 QString fwdBody=tr("======forwarded message from "); 296 QString fwdBody=tr("======forwarded message from ");
297 fwdBody.append(forwMail.fromMail); 297 fwdBody.append(forwMail.fromMail);
298 fwdBody.append(tr(" starts======\n\n")); 298 fwdBody.append(tr(" starts======\n\n"));
299 299
300 mail=forwMail; 300 mail=forwMail;
301 toInput->setText(""); 301 toInput->setText("");
302 ccInput->setText(""); 302 ccInput->setText("");
303 subjectInput->setText(tr("FWD: ") + mail.subject); 303 subjectInput->setText(tr("FWD: ") + mail.subject);
304 304
305 fwdBody+=mail.body; 305 fwdBody+=mail.body;
306 fwdBody+=QString(tr("======end of forwarded message======\n\n")); 306 fwdBody+=QString(tr("======end of forwarded message======\n\n"));
307 307
308 emailInput->setText(fwdBody); 308 emailInput->setText(fwdBody);
309} 309}
@@ -312,31 +312,31 @@ bool WriteMail::getRecipients(bool ccField)
312{ 312{
313 QString str, temp; 313 QString str, temp;
314 int pos = 0; 314 int pos = 0;
315 315
316 if (ccField) 316 if (ccField)
317 { 317 {
318 mail.carbonCopies.clear(); 318 mail.carbonCopies.clear();
319 temp = ccInput->text(); 319 temp = ccInput->text();
320 } 320 }
321 else 321 else
322 { 322 {
323 mail.recipients.clear(); 323 mail.recipients.clear();
324 temp=toInput->text() ; 324 temp=toInput->text() ;
325 } 325 }
326 326
327 while ( (pos = temp.find(';')) != -1) { 327 while ( (pos = temp.find(';')) != -1) {
328 str = temp.left(pos).stripWhiteSpace(); 328 str = temp.left(pos).stripWhiteSpace();
329 temp = temp.right(temp.length() - (pos + 1)); 329 temp = temp.right(temp.length() - (pos + 1));
330 if ( str.find('@') == -1) 330 if ( str.find('@') == -1)
331 return false; 331 return false;
332 ccField ? mail.carbonCopies.append(str) : mail.recipients.append(str); 332 ccField ? mail.carbonCopies.append(str) : mail.recipients.append(str);
333 //addressList->addContact(str, ""); 333 //addressList->addContact(str, "");
334 } 334 }
335 temp = temp.stripWhiteSpace(); 335 temp = temp.stripWhiteSpace();
336 if ( temp.find('@') == -1) 336 if ( temp.find('@') == -1)
337 return false; 337 return false;
338 ccField ? mail.carbonCopies.append(temp) : mail.recipients.append(temp); 338 ccField ? mail.carbonCopies.append(temp) : mail.recipients.append(temp);
339 //addressList->addContact(temp, ""); 339 //addressList->addContact(temp, "");
340 340
341 return TRUE; 341 return TRUE;
342} 342}
@@ -345,4 +345,4 @@ void WriteMail::addRecipients()
345{ 345{
346 toInput->isVisible() ? addRecipients(false) : addRecipients(true); 346 toInput->isVisible() ? addRecipients(false) : addRecipients(true);
347 } 347}
348 348
@@ -350,25 +350,25 @@ void WriteMail::addRecipients(bool ccField)
350{ 350{
351 QString recipients = ""; 351 QString recipients = "";
352 352
353 mail.recipients.clear(); 353 mail.recipients.clear();
354 354
355 QListViewItem *item = addressView->firstChild(); 355 QListViewItem *item = addressView->firstChild();
356 while (item != NULL) { 356 while (item != NULL) {
357 if ( item->isSelected() ) { 357 if ( item->isSelected() ) {
358 if (recipients == "") { 358 if (recipients == "") {
359 recipients = item->text(1); 359 recipients = item->text(1);
360 } else { 360 } else {
361 recipients += "; " + item->text(1); 361 recipients += "; " + item->text(1);
362 } 362 }
363 } 363 }
364 item = item->nextSibling(); 364 item = item->nextSibling();
365 } 365 }
366 366
367 ccField ? ccInput->setText(recipients):toInput->setText(recipients); 367 ccField ? ccInput->setText(recipients):toInput->setText(recipients);
368 368
369 addressView->hide(); 369 addressView->hide();
370 okButton->hide(); 370 okButton->hide();
371 emailInput->show(); 371 emailInput->show();
372 addressButton->setOn(FALSE); 372 addressButton->setOn(FALSE);
373 showingAddressList = !showingAddressList; 373 showingAddressList = !showingAddressList;
374} 374}
@@ -377,12 +377,12 @@ void WriteMail::changeRecipients(int selection)
377{ 377{
378 if (selection==0) 378 if (selection==0)
379 { 379 {
380 toInput->show(); 380 toInput->show();
381 ccInput->hide(); 381 ccInput->hide();
382 } 382 }
383 else if (selection==1) 383 else if (selection==1)
384 { 384 {
385 toInput->hide(); 385 toInput->hide();
386 ccInput->show(); 386 ccInput->show();
387 } 387 }
388} 388}
@@ -396,7 +396,7 @@ void WriteMail::newMail()
396{ 396{
397 toInput->clear(); 397 toInput->clear();
398 ccInput->clear(); 398 ccInput->clear();
399 subjectInput->clear(); 399 subjectInput->clear();
400 emailInput->clear(); 400 emailInput->clear();
401 setAddressList(addressList); 401 setAddressList(addressList);
402} 402}