Diffstat (limited to 'noncore/net/mailit/emailclient.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mailit/emailclient.cpp | 140 |
1 files changed, 102 insertions, 38 deletions
diff --git a/noncore/net/mailit/emailclient.cpp b/noncore/net/mailit/emailclient.cpp index dff1888..2cedc51 100644 --- a/noncore/net/mailit/emailclient.cpp +++ b/noncore/net/mailit/emailclient.cpp | |||
@@ -21,2 +21,3 @@ | |||
21 | #include <qmessagebox.h> | 21 | #include <qmessagebox.h> |
22 | #include <qvbox.h> | ||
22 | #include <qfile.h> | 23 | #include <qfile.h> |
@@ -28,2 +29,3 @@ | |||
28 | #include "emailclient.h" | 29 | #include "emailclient.h" |
30 | #include "writemail.h" | ||
29 | 31 | ||
@@ -42,3 +44,3 @@ EmailClient::EmailClient( QWidget* parent, const char* name, WFlags fl ) | |||
42 | : QMainWindow( parent, name, fl ) | 44 | : QMainWindow( parent, name, fl ) |
43 | { | 45 | { |
44 | emailHandler = new EmailHandler(); | 46 | emailHandler = new EmailHandler(); |
@@ -55,2 +57,4 @@ EmailClient::EmailClient( QWidget* parent, const char* name, WFlags fl ) | |||
55 | 57 | ||
58 | |||
59 | |||
56 | connect(emailHandler, SIGNAL(mailSent()), this, SLOT(mailSent()) ); | 60 | connect(emailHandler, SIGNAL(mailSent()), this, SLOT(mailSent()) ); |
@@ -67,4 +71,3 @@ EmailClient::EmailClient( QWidget* parent, const char* name, WFlags fl ) | |||
67 | connect(inboxView, SIGNAL(clicked(QListViewItem *)), this, SLOT(inboxItemReleased()) ); | 71 | connect(inboxView, SIGNAL(clicked(QListViewItem *)), this, SLOT(inboxItemReleased()) ); |
68 | 72 | ||
69 | |||
70 | connect(emailHandler, SIGNAL(mailArrived(const Email &, bool)), this, | 73 | connect(emailHandler, SIGNAL(mailArrived(const Email &, bool)), this, |
@@ -86,2 +89,7 @@ EmailClient::EmailClient( QWidget* parent, const char* name, WFlags fl ) | |||
86 | mailboxView->setCurrentTab(0); //ensure that inbox has focus | 89 | mailboxView->setCurrentTab(0); //ensure that inbox has focus |
90 | |||
91 | /*channel = new QCopChannel( "QPE/Application/mailit", this ); | ||
92 | connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), | ||
93 | this, SLOT(receive(const QCString&, const QByteArray&)) );*/ | ||
94 | |||
87 | } | 95 | } |
@@ -106,25 +114,4 @@ void EmailClient::init() | |||
106 | { | 114 | { |
107 | statusBar = new QStatusBar(this); | 115 | initStatusBar(this); |
108 | statusBar->setSizeGripEnabled(FALSE); | 116 | |
109 | |||
110 | status1Label = new QLabel( tr("Idle"), statusBar); | ||
111 | status2Label = new QLabel("", statusBar); | ||
112 | connect(emailHandler, SIGNAL(updatePopStatus(const QString &)), | ||
113 | status2Label, SLOT(setText(const QString &)) ); | ||
114 | connect(emailHandler, SIGNAL(updateSmtpStatus(const QString &)), | ||
115 | status2Label, SLOT(setText(const QString &)) ); | ||
116 | |||
117 | progressBar = new QProgressBar(statusBar); | ||
118 | |||
119 | connect(emailHandler, SIGNAL(mailboxSize(int)), | ||
120 | this, SLOT(setTotalSize(int)) ); | ||
121 | connect(emailHandler, SIGNAL(currentMailSize(int)), | ||
122 | this, SLOT(setMailSize(int)) ); | ||
123 | connect(emailHandler, SIGNAL(downloadedSize(int)), | ||
124 | this, SLOT(setDownloadedSize(int)) ); | ||
125 | |||
126 | statusBar->addWidget(status1Label); | ||
127 | statusBar->addWidget(progressBar); | ||
128 | statusBar->addWidget(status2Label); | ||
129 | |||
130 | setToolBarsMovable(FALSE); | 117 | setToolBarsMovable(FALSE); |
@@ -196,4 +183,7 @@ void EmailClient::init() | |||
196 | inboxView->setAllColumnsShowFocus(TRUE); | 183 | inboxView->setAllColumnsShowFocus(TRUE); |
197 | QWhatsThis::add(inboxView,QWidget::tr("This is the inbox view.\n It keeps the fetched mail which can be viewed by double clicking the entry.\n" | 184 | QWhatsThis::add(inboxView,QWidget::tr("This is the inbox view.\n" |
198 | " A blue attachment icon shows whether this mail has attachments.")); | 185 | "It keeps the fetched mail which can be \n" |
186 | "viewed by double clicking the entry.\n" | ||
187 | "blue attachment icon shows whether this \n" | ||
188 | "mailhas attachments.\n")); | ||
199 | 189 | ||
@@ -212,3 +202,5 @@ void EmailClient::init() | |||
212 | 202 | ||
213 | QWhatsThis::add(outboxView,QWidget::tr("This is the oubox view.\n It keeps the queued mails to send which can be reviewed by double clicking the entry.")); | 203 | QWhatsThis::add(outboxView,QWidget::tr("This is the outbox view.\n" |
204 | "It keeps the queued mails to send which can be \n" | ||
205 | "reviewed by double clicking the entry.")); | ||
214 | grid_3->addWidget( outboxView, 0, 0 ); | 206 | grid_3->addWidget( outboxView, 0, 0 ); |
@@ -220,2 +212,29 @@ void EmailClient::init() | |||
220 | 212 | ||
213 | void EmailClient::initStatusBar(QWidget* parent) | ||
214 | { | ||
215 | statusBar = new QStatusBar(parent); | ||
216 | statusBar->setSizeGripEnabled(FALSE); | ||
217 | |||
218 | status1Label = new QLabel( tr("Idle"), statusBar); | ||
219 | status2Label = new QLabel("", statusBar); | ||
220 | connect(emailHandler, SIGNAL(updatePopStatus(const QString &)), | ||
221 | status2Label, SLOT(setText(const QString &)) ); | ||
222 | connect(emailHandler, SIGNAL(updateSmtpStatus(const QString &)), | ||
223 | status2Label, SLOT(setText(const QString &)) ); | ||
224 | |||
225 | progressBar = new QProgressBar(statusBar); | ||
226 | |||
227 | connect(emailHandler, SIGNAL(mailboxSize(int)), | ||
228 | this, SLOT(setTotalSize(int)) ); | ||
229 | connect(emailHandler, SIGNAL(currentMailSize(int)), | ||
230 | this, SLOT(setMailSize(int)) ); | ||
231 | connect(emailHandler, SIGNAL(downloadedSize(int)), | ||
232 | this, SLOT(setDownloadedSize(int)) ); | ||
233 | |||
234 | statusBar->addWidget(status1Label); | ||
235 | statusBar->addWidget(progressBar); | ||
236 | statusBar->addWidget(status2Label); | ||
237 | |||
238 | } | ||
239 | |||
221 | void EmailClient::compose() | 240 | void EmailClient::compose() |
@@ -321,3 +340,3 @@ void EmailClient::getNewMail() { | |||
321 | //get any previous mails not downloaded and add to queue | 340 | //get any previous mails not downloaded and add to queue |
322 | mailDownloadList.clear(); | 341 | /*mailDownloadList.clear(); |
323 | Email *mailPtr; | 342 | Email *mailPtr; |
@@ -330,3 +349,3 @@ void EmailClient::getNewMail() { | |||
330 | item = (EmailListItem *) item->nextSibling(); | 349 | item = (EmailListItem *) item->nextSibling(); |
331 | } | 350 | }*/ |
332 | 351 | ||
@@ -340,3 +359,3 @@ void EmailClient::getAllNewMail() | |||
340 | currentAccount = accountList.first(); | 359 | currentAccount = accountList.first(); |
341 | getNewMail(); | 360 | getNewMail(); |
342 | } | 361 | } |
@@ -350,5 +369,6 @@ void EmailClient::mailArrived(const Email &mail, bool fromDisk) | |||
350 | mailconf->setGroup(newMail.id); | 369 | mailconf->setGroup(newMail.id); |
351 | 370 | ||
352 | if (fromDisk) | 371 | if (fromDisk) |
353 | { | 372 | { |
373 | |||
354 | newMail.downloaded = mailconf->readBoolEntry("downloaded"); | 374 | newMail.downloaded = mailconf->readBoolEntry("downloaded"); |
@@ -360,2 +380,3 @@ void EmailClient::mailArrived(const Email &mail, bool fromDisk) | |||
360 | { //mail arrived from server | 380 | { //mail arrived from server |
381 | |||
361 | newMail.serverId = mail.serverId; | 382 | newMail.serverId = mail.serverId; |
@@ -920,3 +941,3 @@ void EmailClient::inboxItemReleased() | |||
920 | 941 | ||
921 | void EmailClient::timerEvent(QTimerEvent *e) | 942 | /*void EmailClient::timerEvent(QTimerEvent *e) |
922 | { | 943 | { |
@@ -937,4 +958,4 @@ void EmailClient::timerEvent(QTimerEvent *e) | |||
937 | if (action) delete action; | 958 | if (action) delete action; |
938 | */ | 959 | |
939 | } | 960 | }*/ |
940 | 961 | ||
@@ -955,4 +976,2 @@ void EmailClient::download(Email* mail) | |||
955 | tempMailDownloadList.sizeInsert(mail->serverId, mail->size); | 976 | tempMailDownloadList.sizeInsert(mail->serverId, mail->size); |
956 | if (accountList.count()>0) | ||
957 | qDebug("Accounts present"); | ||
958 | 977 | ||
@@ -968 +987,46 @@ void EmailClient::download(Email* mail) | |||
968 | } | 987 | } |
988 | |||
989 | void EmailClient::receive(const QCString& msg, const QByteArray& data) | ||
990 | { | ||
991 | /*if (msg=="getMail()") | ||
992 | { | ||
993 | /*QDialog qd(qApp->activeWindow(),"Getting mail",true); | ||
994 | QVBoxLayout *vbProg = new QVBoxLayout( &qd ); | ||
995 | |||
996 | initStatusBar(&qd); | ||
997 | |||
998 | if (statusBar==0) | ||
999 | { | ||
1000 | qDebug("No Bar ..."); | ||
1001 | //statusBar=new ProgressBar(&qd); | ||
1002 | } | ||
1003 | statusBar->show(); | ||
1004 | vbProg->addWidget(statusBar); | ||
1005 | qd.showMaximized(); | ||
1006 | qd.show(); | ||
1007 | emit getAllNewMail(); | ||
1008 | //qd.exec(); | ||
1009 | } | ||
1010 | else if (msg=="compose()") | ||
1011 | { | ||
1012 | QDialog qd(qApp->activeWindow(),"Getting mail",true); | ||
1013 | |||
1014 | WriteMail wm(&qd,"write new mail"); | ||
1015 | QVBoxLayout vbProg( &qd ); | ||
1016 | |||
1017 | wm.showMaximized(); | ||
1018 | vbProg.addWidget(&wm); | ||
1019 | |||
1020 | qd.showMaximized(); | ||
1021 | |||
1022 | emit composeRequested(); | ||
1023 | qd.exec(); | ||
1024 | |||
1025 | QMessageBox::warning(qApp->activeWindow(),tr("Info"), tr("Info"), "OK\n"); | ||
1026 | } | ||
1027 | |||
1028 | else if (msg=="dialog()") | ||
1029 | { | ||
1030 | QMessageBox::warning(qApp->activeWindow(),tr("Info"), tr("Info"), "OK\n"); | ||
1031 | }*/ | ||
1032 | } | ||