-rw-r--r-- | noncore/unsupported/mailit/emailclient.cpp | 12 | ||||
-rw-r--r-- | noncore/unsupported/mailit/emaillistitem.cpp | 61 | ||||
-rw-r--r-- | noncore/unsupported/mailit/emaillistitem.h | 1 | ||||
-rw-r--r-- | noncore/unsupported/mailit/mailit.pro | 6 | ||||
-rw-r--r-- | noncore/unsupported/mailit/mailitwindow.h | 1 | ||||
-rw-r--r-- | noncore/unsupported/mailit/main.cpp | 10 |
6 files changed, 72 insertions, 19 deletions
diff --git a/noncore/unsupported/mailit/emailclient.cpp b/noncore/unsupported/mailit/emailclient.cpp index 90664bb..8359acf 100644 --- a/noncore/unsupported/mailit/emailclient.cpp +++ b/noncore/unsupported/mailit/emailclient.cpp | |||
@@ -260,90 +260,90 @@ void EmailClient::enqueMail(const Email &mail) | |||
260 | tr("No account selected"), tr("You must create an account"), "OK\n"); | 260 | tr("No account selected"), tr("You must create an account"), "OK\n"); |
261 | return; | 261 | return; |
262 | } | 262 | } |
263 | 263 | ||
264 | if (accountList.count() > 0) { | 264 | if (accountList.count() > 0) { |
265 | currentAccount = accountList.first(); | 265 | currentAccount = accountList.first(); |
266 | qWarning("using account " + currentAccount->name); | 266 | qWarning("using account " + currentAccount->name); |
267 | } | 267 | } |
268 | 268 | ||
269 | Email addMail = mail; | 269 | Email addMail = mail; |
270 | addMail.from = currentAccount->name; | 270 | addMail.from = currentAccount->name; |
271 | addMail.fromMail = currentAccount->emailAddress; | 271 | addMail.fromMail = currentAccount->emailAddress; |
272 | addMail.rawMail.prepend("From: \"" + addMail.from + "\" <" + addMail.fromMail + ">\n"); | 272 | addMail.rawMail.prepend("From: \"" + addMail.from + "\" <" + addMail.fromMail + ">\n"); |
273 | item = new EmailListItem(outboxView, addMail, false); | 273 | item = new EmailListItem(outboxView, addMail, false); |
274 | 274 | ||
275 | mailboxView->setCurrentTab(1); | 275 | mailboxView->setCurrentTab(1); |
276 | 276 | ||
277 | } | 277 | } |
278 | 278 | ||
279 | void EmailClient::sendQuedMail() | 279 | void EmailClient::sendQuedMail() |
280 | { | 280 | { |
281 | int count = 0; | 281 | int count = 0; |
282 | 282 | ||
283 | if (accountList.count() == 0) { | 283 | if (accountList.count() == 0) { |
284 | QMessageBox::warning(qApp->activeWindow(), "No account selected", "You must create an account", "OK\n"); | 284 | QMessageBox::warning(qApp->activeWindow(), tr("No account selected"), tr("You must create an account"), "OK\n"); |
285 | return; | 285 | return; |
286 | } | 286 | } |
287 | //traverse listview, find messages to send | 287 | //traverse listview, find messages to send |
288 | if (! sending) { | 288 | if (! sending) { |
289 | item = (EmailListItem *) outboxView->firstChild(); | 289 | item = (EmailListItem *) outboxView->firstChild(); |
290 | if (item != NULL) { | 290 | if (item != NULL) { |
291 | while (item != NULL) { | 291 | while (item != NULL) { |
292 | quedMessages.append(item->getMail()); | 292 | quedMessages.append(item->getMail()); |
293 | item = (EmailListItem *) item->nextSibling(); | 293 | item = (EmailListItem *) item->nextSibling(); |
294 | count++; | 294 | count++; |
295 | } | 295 | } |
296 | setMailAccount(); | 296 | setMailAccount(); |
297 | emailHandler->sendMail(&quedMessages); | 297 | emailHandler->sendMail(&quedMessages); |
298 | sending = TRUE; | 298 | sending = TRUE; |
299 | sendMailButton->setEnabled(FALSE); | 299 | sendMailButton->setEnabled(FALSE); |
300 | cancelButton->setEnabled(TRUE); | 300 | cancelButton->setEnabled(TRUE); |
301 | } else { | 301 | } else { |
302 | qWarning("sendQuedMail(): no messages to send"); | 302 | qWarning("sendQuedMail(): no messages to send"); |
303 | } | 303 | } |
304 | } | 304 | } |
305 | } | 305 | } |
306 | 306 | ||
307 | void EmailClient::setMailAccount() | 307 | void EmailClient::setMailAccount() |
308 | { | 308 | { |
309 | emailHandler->setAccount(*currentAccount); | 309 | emailHandler->setAccount(*currentAccount); |
310 | } | 310 | } |
311 | 311 | ||
312 | void EmailClient::mailSent() | 312 | void EmailClient::mailSent() |
313 | { | 313 | { |
314 | sending = FALSE; | 314 | sending = FALSE; |
315 | sendMailButton->setEnabled(TRUE); | 315 | sendMailButton->setEnabled(TRUE); |
316 | 316 | ||
317 | quedMessages.clear(); | 317 | quedMessages.clear(); |
318 | outboxView->clear(); //should be moved to an sentBox | 318 | outboxView->clear(); //should be moved to an sentBox |
319 | } | 319 | } |
320 | 320 | ||
321 | void EmailClient::getNewMail() { | 321 | void EmailClient::getNewMail() { |
322 | 322 | ||
323 | if (accountList.count() == 0) { | 323 | if (accountList.count() == 0) { |
324 | QMessageBox::warning(qApp->activeWindow(),"No account selected", | 324 | QMessageBox::warning(qApp->activeWindow(),tr("No account selected"), |
325 | "You must create an account", "OK\n"); | 325 | tr("You must create an account"), "OK\n"); |
326 | return; | 326 | return; |
327 | } | 327 | } |
328 | 328 | ||
329 | setMailAccount(); | 329 | setMailAccount(); |
330 | 330 | ||
331 | receiving = TRUE; | 331 | receiving = TRUE; |
332 | previewingMail = TRUE; | 332 | previewingMail = TRUE; |
333 | getMailButton->setEnabled(FALSE); | 333 | getMailButton->setEnabled(FALSE); |
334 | cancelButton->setEnabled(TRUE); | 334 | cancelButton->setEnabled(TRUE); |
335 | selectAccountMenu->setEnabled(FALSE); | 335 | selectAccountMenu->setEnabled(FALSE); |
336 | 336 | ||
337 | status1Label->setText(currentAccount->accountName + " headers"); | 337 | status1Label->setText(currentAccount->accountName + " headers"); |
338 | progressBar->reset(); | 338 | progressBar->reset(); |
339 | 339 | ||
340 | //get any previous mails not downloaded and add to queue | 340 | //get any previous mails not downloaded and add to queue |
341 | /*mailDownloadList.clear(); | 341 | /*mailDownloadList.clear(); |
342 | Email *mailPtr; | 342 | Email *mailPtr; |
343 | item = (EmailListItem *) inboxView->firstChild(); | 343 | item = (EmailListItem *) inboxView->firstChild(); |
344 | while (item != NULL) { | 344 | while (item != NULL) { |
345 | mailPtr = item->getMail(); | 345 | mailPtr = item->getMail(); |
346 | if ( (!mailPtr->downloaded) && (mailPtr->fromAccountId == currentAccount->id) ) { | 346 | if ( (!mailPtr->downloaded) && (mailPtr->fromAccountId == currentAccount->id) ) { |
347 | mailDownloadList.sizeInsert(mailPtr->serverId, mailPtr->size); | 347 | mailDownloadList.sizeInsert(mailPtr->serverId, mailPtr->size); |
348 | } | 348 | } |
349 | item = (EmailListItem *) item->nextSibling(); | 349 | item = (EmailListItem *) item->nextSibling(); |
@@ -764,110 +764,110 @@ void EmailClient::saveSettings() | |||
764 | { | 764 | { |
765 | mailconf->writeEntry("Synchronize","Yes"); | 765 | mailconf->writeEntry("Synchronize","Yes"); |
766 | mailconf->writeEntry("HeaderLimit",accountPtr->syncLimit); | 766 | mailconf->writeEntry("HeaderLimit",accountPtr->syncLimit); |
767 | mailconf->writeEntry("LastServerMailCount",accountPtr->lastServerMailCount); | 767 | mailconf->writeEntry("LastServerMailCount",accountPtr->lastServerMailCount); |
768 | } | 768 | } |
769 | else | 769 | else |
770 | { | 770 | { |
771 | mailconf->writeEntry("Synchronize", "No"); | 771 | mailconf->writeEntry("Synchronize", "No"); |
772 | } | 772 | } |
773 | } | 773 | } |
774 | 774 | ||
775 | mailconf->setGroup("mailitglobal"); | 775 | mailconf->setGroup("mailitglobal"); |
776 | mailconf->writeEntry("Accounts",acc_count); | 776 | mailconf->writeEntry("Accounts",acc_count); |
777 | mailconf->writeEntry("mailidcount", mailIdCount); | 777 | mailconf->writeEntry("mailidcount", mailIdCount); |
778 | mailconf->writeEntry("accountidcount", accountIdCount); | 778 | mailconf->writeEntry("accountidcount", accountIdCount); |
779 | } | 779 | } |
780 | 780 | ||
781 | void EmailClient::selectAccount(int id) | 781 | void EmailClient::selectAccount(int id) |
782 | { | 782 | { |
783 | if (accountList.count() > 0) { | 783 | if (accountList.count() > 0) { |
784 | currentAccount = accountList.at(id); | 784 | currentAccount = accountList.at(id); |
785 | emit newCaption("Mailit - " + currentAccount->accountName); | 785 | emit newCaption("Mailit - " + currentAccount->accountName); |
786 | getNewMail(); | 786 | getNewMail(); |
787 | } else { | 787 | } else { |
788 | emit newCaption("Mailit ! No account defined"); | 788 | emit newCaption( tr("Mailit ! No account defined") ); |
789 | } | 789 | } |
790 | } | 790 | } |
791 | 791 | ||
792 | void EmailClient::editAccount(int id) | 792 | void EmailClient::editAccount(int id) |
793 | { | 793 | { |
794 | MailAccount *newAccount; | 794 | MailAccount *newAccount; |
795 | 795 | ||
796 | editAccountView = new EditAccount(this, "account", TRUE); | 796 | editAccountView = new EditAccount(this, "account", TRUE); |
797 | if (id == newAccountId) { //new account | 797 | if (id == newAccountId) { //new account |
798 | newAccount = new MailAccount; | 798 | newAccount = new MailAccount; |
799 | editAccountView->setAccount(newAccount); | 799 | editAccountView->setAccount(newAccount); |
800 | } else { | 800 | } else { |
801 | newAccount = accountList.at(id); | 801 | newAccount = accountList.at(id); |
802 | editAccountView->setAccount(newAccount, FALSE); | 802 | editAccountView->setAccount(newAccount, FALSE); |
803 | } | 803 | } |
804 | 804 | ||
805 | editAccountView->showMaximized(); | 805 | editAccountView->showMaximized(); |
806 | editAccountView->exec(); | 806 | editAccountView->exec(); |
807 | 807 | ||
808 | if (editAccountView->result() == QDialog::Accepted) { | 808 | if (editAccountView->result() == QDialog::Accepted) { |
809 | if (id == newAccountId) { | 809 | if (id == newAccountId) { |
810 | newAccount->id = accountIdCount; | 810 | newAccount->id = accountIdCount; |
811 | accountIdCount++; | 811 | accountIdCount++; |
812 | accountList.append(newAccount); | 812 | accountList.append(newAccount); |
813 | updateAccounts(); | 813 | updateAccounts(); |
814 | } else { | 814 | } else { |
815 | updateAccounts(); | 815 | updateAccounts(); |
816 | } | 816 | } |
817 | } | 817 | } |
818 | 818 | ||
819 | delete editAccountView; | 819 | delete editAccountView; |
820 | } | 820 | } |
821 | 821 | ||
822 | void EmailClient::deleteAccount(int id) | 822 | void EmailClient::deleteAccount(int id) |
823 | { | 823 | { |
824 | MailAccount *newAccount; | 824 | MailAccount *newAccount; |
825 | QString message; | 825 | QString message; |
826 | 826 | ||
827 | newAccount = accountList.at(id); | 827 | newAccount = accountList.at(id); |
828 | message = "Delete account:\n" + newAccount->accountName; | 828 | message = tr("Delete account:\n") + newAccount->accountName; |
829 | switch( QMessageBox::warning( this, "Mailit", message, | 829 | switch( QMessageBox::warning( this, "Mailit", message, |
830 | "Yes", "No", 0, 0, 1 ) ) { | 830 | "Yes", "No", 0, 0, 1 ) ) { |
831 | 831 | ||
832 | case 0: accountList.remove(id); | 832 | case 0: accountList.remove(id); |
833 | updateAccounts(); | 833 | updateAccounts(); |
834 | break; | 834 | break; |
835 | case 1: | 835 | case 1: |
836 | break; | 836 | break; |
837 | } | 837 | } |
838 | } | 838 | } |
839 | 839 | ||
840 | void EmailClient::updateAccounts() | 840 | void EmailClient::updateAccounts() |
841 | { | 841 | { |
842 | MailAccount *accountPtr; | 842 | MailAccount *accountPtr; |
843 | 843 | ||
844 | //rebuild menus, clear all first | 844 | //rebuild menus, clear all first |
845 | editAccountMenu->clear(); | 845 | editAccountMenu->clear(); |
846 | selectAccountMenu->clear(); | 846 | selectAccountMenu->clear(); |
847 | deleteAccountMenu->clear(); | 847 | deleteAccountMenu->clear(); |
848 | 848 | ||
849 | newAccountId = editAccountMenu->insertItem("New", this, | 849 | newAccountId = editAccountMenu->insertItem( tr("New"), this, |
850 | SLOT(editAccount(int)) ); | 850 | SLOT(editAccount(int)) ); |
851 | editAccountMenu->insertSeparator(); | 851 | editAccountMenu->insertSeparator(); |
852 | 852 | ||
853 | idCount = 0; | 853 | idCount = 0; |
854 | for (accountPtr = accountList.first(); accountPtr != 0; | 854 | for (accountPtr = accountList.first(); accountPtr != 0; |
855 | accountPtr = accountList.next()) { | 855 | accountPtr = accountList.next()) { |
856 | 856 | ||
857 | editAccountMenu->insertItem(accountPtr->accountName, | 857 | editAccountMenu->insertItem(accountPtr->accountName, |
858 | this, SLOT(editAccount(int)), 0, idCount); | 858 | this, SLOT(editAccount(int)), 0, idCount); |
859 | selectAccountMenu->insertItem(accountPtr->accountName, | 859 | selectAccountMenu->insertItem(accountPtr->accountName, |
860 | this, SLOT(selectAccount(int)), 0, idCount); | 860 | this, SLOT(selectAccount(int)), 0, idCount); |
861 | deleteAccountMenu->insertItem(accountPtr->accountName, | 861 | deleteAccountMenu->insertItem(accountPtr->accountName, |
862 | this, SLOT(deleteAccount(int)), 0, idCount); | 862 | this, SLOT(deleteAccount(int)), 0, idCount); |
863 | idCount++; | 863 | idCount++; |
864 | } | 864 | } |
865 | } | 865 | } |
866 | 866 | ||
867 | void EmailClient::deleteMail(EmailListItem *mailItem, bool &inbox) | 867 | void EmailClient::deleteMail(EmailListItem *mailItem, bool &inbox) |
868 | { | 868 | { |
869 | Email *mPtr; | 869 | Email *mPtr; |
870 | Enclosure *ePtr; | 870 | Enclosure *ePtr; |
871 | 871 | ||
872 | if (inbox) | 872 | if (inbox) |
873 | { | 873 | { |
diff --git a/noncore/unsupported/mailit/emaillistitem.cpp b/noncore/unsupported/mailit/emaillistitem.cpp index fc9f766..a25f93a 100644 --- a/noncore/unsupported/mailit/emaillistitem.cpp +++ b/noncore/unsupported/mailit/emaillistitem.cpp | |||
@@ -17,49 +17,50 @@ | |||
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include <qstring.h> | 20 | #include <qstring.h> |
21 | #include <qpe/resource.h> | 21 | #include <qpe/resource.h> |
22 | #include "emaillistitem.h" | 22 | #include "emaillistitem.h" |
23 | 23 | ||
24 | EmailListItem::EmailListItem(QListView *parent, Email mailIn, bool inbox) | 24 | EmailListItem::EmailListItem(QListView *parent, Email mailIn, bool inbox) |
25 | : QListViewItem(parent) | 25 | : QListViewItem(parent) |
26 | { | 26 | { |
27 | QString temp; | 27 | QString temp; |
28 | 28 | ||
29 | mail = mailIn; | 29 | mail = mailIn; |
30 | 30 | ||
31 | if (inbox) { | 31 | if (inbox) { |
32 | setText(0, mail.from); | 32 | setText(0, mail.from); |
33 | } else { | 33 | } else { |
34 | QStringList::Iterator it = mail.recipients.begin(); | 34 | QStringList::Iterator it = mail.recipients.begin(); |
35 | temp = *it; | 35 | temp = *it; |
36 | if (mail.recipients.count() > 1) | 36 | if (mail.recipients.count() > 1) |
37 | temp += "..."; | 37 | temp += "..."; |
38 | setText(0, temp); | 38 | setText(0, temp); |
39 | } | 39 | } |
40 | setText(1, mail.subject); | 40 | setText(1, mail.subject); |
41 | setText(2,mail.date); | 41 | // setText(2,mail.date); |
42 | setText(2,dateFromULCString(mail.date)); | ||
42 | 43 | ||
43 | if (mailIn.files.count()>0) | 44 | if (mailIn.files.count()>0) |
44 | { | 45 | { |
45 | setPixmap(0, Resource::loadPixmap("mailit/attach")); | 46 | setPixmap(0, Resource::loadPixmap("mailit/attach")); |
46 | } | 47 | } |
47 | 48 | ||
48 | selected = FALSE; | 49 | selected = FALSE; |
49 | } | 50 | } |
50 | 51 | ||
51 | Email* EmailListItem::getMail() | 52 | Email* EmailListItem::getMail() |
52 | { | 53 | { |
53 | return &mail; | 54 | return &mail; |
54 | } | 55 | } |
55 | 56 | ||
56 | void EmailListItem::setMail(Email newMail) | 57 | void EmailListItem::setMail(Email newMail) |
57 | { | 58 | { |
58 | mail = newMail; | 59 | mail = newMail; |
59 | repaint(); | 60 | repaint(); |
60 | } | 61 | } |
61 | 62 | ||
62 | void EmailListItem::setItemSelected(bool enable) | 63 | void EmailListItem::setItemSelected(bool enable) |
63 | { | 64 | { |
64 | selected = enable; | 65 | selected = enable; |
65 | setSelected(enable); | 66 | setSelected(enable); |
@@ -76,24 +77,82 @@ void EmailListItem::paintCell( QPainter *p, const QColorGroup &cg, | |||
76 | { | 77 | { |
77 | 78 | ||
78 | QColorGroup _cg( cg ); | 79 | QColorGroup _cg( cg ); |
79 | QColor c = _cg.text(); | 80 | QColor c = _cg.text(); |
80 | 81 | ||
81 | if ( (! mail.read) && (mail.received) ) | 82 | if ( (! mail.read) && (mail.received) ) |
82 | _cg.setColor( QColorGroup::Text, Qt::blue); | 83 | _cg.setColor( QColorGroup::Text, Qt::blue); |
83 | if (!mail.downloaded) | 84 | if (!mail.downloaded) |
84 | _cg.setColor( QColorGroup::Text, Qt::red); | 85 | _cg.setColor( QColorGroup::Text, Qt::red); |
85 | 86 | ||
86 | /* if (selected) { | 87 | /* if (selected) { |
87 | _cg.setColor(QColorGroup::Base, Qt::blue); | 88 | _cg.setColor(QColorGroup::Base, Qt::blue); |
88 | _cg.setColor(QColorGroup::Text, Qt::yellow); | 89 | _cg.setColor(QColorGroup::Text, Qt::yellow); |
89 | if (isSelected()) { | 90 | if (isSelected()) { |
90 | _cg.setColor(QColorGroup::HighlightedText, Qt::yellow); | 91 | _cg.setColor(QColorGroup::HighlightedText, Qt::yellow); |
91 | } else { | 92 | } else { |
92 | _cg.setColor(QColorGroup::Highlight, Qt::blue); | 93 | _cg.setColor(QColorGroup::Highlight, Qt::blue); |
93 | } | 94 | } |
94 | } | 95 | } |
95 | */ | 96 | */ |
96 | QListViewItem::paintCell( p, _cg, column, width, alignment ); | 97 | QListViewItem::paintCell( p, _cg, column, width, alignment ); |
97 | 98 | ||
98 | _cg.setColor( QColorGroup::Text, c ); | 99 | _cg.setColor( QColorGroup::Text, c ); |
99 | } | 100 | } |
101 | |||
102 | /* | ||
103 | * Converts an E-Mail date (ULC) RFC 2822 conform to a QDateTime. | ||
104 | * Returning a QString with formatting of "YYYY-MM-DD HH:MM:SS" | ||
105 | * (zodiac: This method was tested with more than 300 inbox mails, | ||
106 | * it didn't slow down the loading of mail-it.) | ||
107 | */ | ||
108 | QString EmailListItem::dateFromULCString( QString ulcDate ) | ||
109 | { | ||
110 | QString sTemp, sTime; | ||
111 | int iPos, iDay, iMon=1, iYear; | ||
112 | |||
113 | iPos=ulcDate.find(','); | ||
114 | if (iPos) { // it has a day-of-week | ||
115 | ulcDate=ulcDate.remove(0,++iPos); //.stripWhiteSpace(); | ||
116 | } | ||
117 | |||
118 | QStringList dateEntries = QStringList::split(" ",ulcDate,FALSE); | ||
119 | QStringList::Iterator iter = dateEntries.begin(); | ||
120 | |||
121 | // Get day as DD | ||
122 | iDay = (*iter++).toInt(); | ||
123 | |||
124 | // Get month as string Mmm | ||
125 | sTemp = (*iter++); | ||
126 | if (sTemp =="Jan") {iMon=1;} else | ||
127 | if (sTemp =="Feb") {iMon=2;} else | ||
128 | if (sTemp =="Mar") {iMon=3;} else | ||
129 | if (sTemp =="Apr") {iMon=4;} else | ||
130 | if (sTemp =="May") {iMon=5;} else | ||
131 | if (sTemp =="Jun") {iMon=6;} else | ||
132 | if (sTemp =="Jul") {iMon=7;} else | ||
133 | if (sTemp =="Aug") {iMon=8;} else | ||
134 | if (sTemp =="Sep") {iMon=9;} else | ||
135 | if (sTemp =="Oct") {iMon=10;} else | ||
136 | if (sTemp =="Nov") {iMon=11;} else | ||
137 | if (sTemp =="Dec") {iMon=12;} | ||
138 | |||
139 | // Get year as YYYY or YY | ||
140 | iYear = (*iter++).toInt(); | ||
141 | |||
142 | QDate date = QDate(iYear, iMon, iDay); | ||
143 | |||
144 | // Convert timestring into a QTime | ||
145 | QStringList timeEntries = QStringList::split(":",(*iter++),FALSE); | ||
146 | QStringList::Iterator iterTime = timeEntries.begin(); | ||
147 | iYear=(*iterTime++).toInt(); // var reuse.. *cough* | ||
148 | iMon=(*iterTime++).toInt(); | ||
149 | iDay=(*iterTime++).toInt(); | ||
150 | QTime time = QTime(iYear,iMon,iDay); | ||
151 | |||
152 | return QString::number(date.year())+"-" | ||
153 | +QString::number(date.month()).rightJustify(2,'0')+"-" | ||
154 | +QString::number(date.day()).rightJustify(2,'0')+" " | ||
155 | +time.toString(); | ||
156 | } | ||
157 | |||
158 | |||
diff --git a/noncore/unsupported/mailit/emaillistitem.h b/noncore/unsupported/mailit/emaillistitem.h index 642932c..129a774 100644 --- a/noncore/unsupported/mailit/emaillistitem.h +++ b/noncore/unsupported/mailit/emaillistitem.h | |||
@@ -18,27 +18,28 @@ | |||
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #ifndef EMAILLISTITEM_H | 20 | #ifndef EMAILLISTITEM_H |
21 | #define EMAILLISTITEM_H | 21 | #define EMAILLISTITEM_H |
22 | 22 | ||
23 | #include <qlistview.h> | 23 | #include <qlistview.h> |
24 | #include "emailhandler.h" | 24 | #include "emailhandler.h" |
25 | 25 | ||
26 | class EmailListItem: public QListViewItem | 26 | class EmailListItem: public QListViewItem |
27 | { | 27 | { |
28 | public: | 28 | public: |
29 | EmailListItem(QListView *parent, Email mailIn, bool inbox); | 29 | EmailListItem(QListView *parent, Email mailIn, bool inbox); |
30 | Email* getMail(); | 30 | Email* getMail(); |
31 | void setMail(Email newMail); | 31 | void setMail(Email newMail); |
32 | void setItemSelected(bool enable); | 32 | void setItemSelected(bool enable); |
33 | bool isItemSelected(); | 33 | bool isItemSelected(); |
34 | bool itemSelected(); | 34 | bool itemSelected(); |
35 | 35 | ||
36 | protected: | 36 | protected: |
37 | void paintCell( QPainter *p, const QColorGroup &cg, | 37 | void paintCell( QPainter *p, const QColorGroup &cg, |
38 | int column, int width, int alignment ); | 38 | int column, int width, int alignment ); |
39 | private: | 39 | private: |
40 | Email mail; | 40 | Email mail; |
41 | bool selected; | 41 | bool selected; |
42 | QString dateFromULCString( QString ulc ); | ||
42 | }; | 43 | }; |
43 | 44 | ||
44 | #endif | 45 | #endif |
diff --git a/noncore/unsupported/mailit/mailit.pro b/noncore/unsupported/mailit/mailit.pro index 5e9a83a..0224886 100644 --- a/noncore/unsupported/mailit/mailit.pro +++ b/noncore/unsupported/mailit/mailit.pro | |||
@@ -1,63 +1,59 @@ | |||
1 | TEMPLATE = app | ||
2 | TARGET = mailit | 1 | TARGET = mailit |
3 | CONFIG = qt warn_on release | 2 | CONFIG = qt warn_on release quick-app |
4 | HEADERS = emailclient.h \ | 3 | HEADERS = emailclient.h \ |
5 | emailhandler.h \ | 4 | emailhandler.h \ |
6 | emaillistitem.h \ | 5 | emaillistitem.h \ |
7 | mailitwindow.h \ | 6 | mailitwindow.h \ |
8 | md5.h \ | 7 | md5.h \ |
9 | popclient.h \ | 8 | popclient.h \ |
10 | readmail.h \ | 9 | readmail.h \ |
11 | smtpclient.h \ | 10 | smtpclient.h \ |
12 | writemail.h \ | 11 | writemail.h \ |
13 | textparser.h \ | 12 | textparser.h \ |
14 | viewatt.h \ | 13 | viewatt.h \ |
15 | addatt.h \ | 14 | addatt.h \ |
16 | editaccount.h \ | 15 | editaccount.h \ |
17 | maillist.h \ | 16 | maillist.h \ |
18 | addresslist.h | 17 | addresslist.h |
19 | SOURCES = emailclient.cpp \ | 18 | SOURCES = emailclient.cpp \ |
20 | emailhandler.cpp \ | 19 | emailhandler.cpp \ |
21 | emaillistitem.cpp \ | 20 | emaillistitem.cpp \ |
22 | mailitwindow.cpp \ | 21 | mailitwindow.cpp \ |
23 | main.cpp \ | 22 | main.cpp \ |
24 | md5.c \ | 23 | md5.c \ |
25 | popclient.cpp \ | 24 | popclient.cpp \ |
26 | readmail.cpp \ | 25 | readmail.cpp \ |
27 | smtpclient.cpp \ | 26 | smtpclient.cpp \ |
28 | writemail.cpp \ | 27 | writemail.cpp \ |
29 | textparser.cpp \ | 28 | textparser.cpp \ |
30 | viewatt.cpp \ | 29 | viewatt.cpp \ |
31 | addatt.cpp \ | 30 | addatt.cpp \ |
32 | editaccount.cpp \ | 31 | editaccount.cpp \ |
33 | maillist.cpp \ | 32 | maillist.cpp \ |
34 | addresslist.cpp | 33 | addresslist.cpp |
35 | 34 | ||
36 | INCLUDEPATH += $(OPIEDIR)/include | 35 | INCLUDEPATH += $(OPIEDIR)/include |
37 | DEPENDPATH += $(OPIEDIR)/include | 36 | DEPENDPATH += $(OPIEDIR)/include |
38 | LIBS += -lqpe -lopie | 37 | LIBS += -lqpe -lopie |
39 | # -lssl | 38 | # -lssl |
40 | MOC_DIR=qpeobj | ||
41 | OBJECTS_DIR=qpeobj | ||
42 | DESTDIR=$(OPIEDIR)/bin | ||
43 | 39 | ||
44 | TRANSLATIONS = ../../../i18n/de/mailit.ts \ | 40 | TRANSLATIONS = ../../../i18n/de/mailit.ts \ |
45 | ../../../i18n/nl/mailit.ts \ | 41 | ../../../i18n/nl/mailit.ts \ |
46 | ../../../i18n/da/mailit.ts \ | 42 | ../../../i18n/da/mailit.ts \ |
47 | ../../../i18n/xx/mailit.ts \ | 43 | ../../../i18n/xx/mailit.ts \ |
48 | ../../../i18n/it/mailit.ts \ | 44 | ../../../i18n/it/mailit.ts \ |
49 | ../../../i18n/en/mailit.ts \ | 45 | ../../../i18n/en/mailit.ts \ |
50 | ../../../i18n/es/mailit.ts \ | 46 | ../../../i18n/es/mailit.ts \ |
51 | ../../../i18n/fr/mailit.ts \ | 47 | ../../../i18n/fr/mailit.ts \ |
52 | ../../../i18n/hu/mailit.ts \ | 48 | ../../../i18n/hu/mailit.ts \ |
53 | ../../../i18n/ja/mailit.ts \ | 49 | ../../../i18n/ja/mailit.ts \ |
54 | ../../../i18n/ko/mailit.ts \ | 50 | ../../../i18n/ko/mailit.ts \ |
55 | ../../../i18n/no/mailit.ts \ | 51 | ../../../i18n/no/mailit.ts \ |
56 | ../../../i18n/pl/mailit.ts \ | 52 | ../../../i18n/pl/mailit.ts \ |
57 | ../../../i18n/pt/mailit.ts \ | 53 | ../../../i18n/pt/mailit.ts \ |
58 | ../../../i18n/pt_BR/mailit.ts \ | 54 | ../../../i18n/pt_BR/mailit.ts \ |
59 | ../../../i18n/sl/mailit.ts \ | 55 | ../../../i18n/sl/mailit.ts \ |
60 | ../../../i18n/zh_CN/mailit.ts \ | 56 | ../../../i18n/zh_CN/mailit.ts \ |
61 | ../../../i18n/zh_TW/mailit.ts | 57 | ../../../i18n/zh_TW/mailit.ts |
62 | 58 | ||
63 | include ( $(OPIEDIR)/include.pro ) | 59 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/noncore/unsupported/mailit/mailitwindow.h b/noncore/unsupported/mailit/mailitwindow.h index e818d32..11e56b9 100644 --- a/noncore/unsupported/mailit/mailitwindow.h +++ b/noncore/unsupported/mailit/mailitwindow.h | |||
@@ -12,48 +12,49 @@ | |||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #ifndef MailItWindow_H | 20 | #ifndef MailItWindow_H |
21 | #define MailItWindow_H | 21 | #define MailItWindow_H |
22 | 22 | ||
23 | #include <qmainwindow.h> | 23 | #include <qmainwindow.h> |
24 | #include <qwidgetstack.h> | 24 | #include <qwidgetstack.h> |
25 | #include <qevent.h> | 25 | #include <qevent.h> |
26 | //#include <qlayout.h> | 26 | //#include <qlayout.h> |
27 | #include "emailclient.h" | 27 | #include "emailclient.h" |
28 | #include "writemail.h" | 28 | #include "writemail.h" |
29 | #include "readmail.h" | 29 | #include "readmail.h" |
30 | #include "addresslist.h" | 30 | #include "addresslist.h" |
31 | 31 | ||
32 | class MailItWindow: public QMainWindow | 32 | class MailItWindow: public QMainWindow |
33 | { | 33 | { |
34 | Q_OBJECT | 34 | Q_OBJECT |
35 | public: | 35 | public: |
36 | static QString appName() { return QString::fromLatin1("mailit"); } | ||
36 | MailItWindow(QWidget *parent = 0, const char *name = 0, WFlags fl = 0); | 37 | MailItWindow(QWidget *parent = 0, const char *name = 0, WFlags fl = 0); |
37 | ~MailItWindow(); | 38 | ~MailItWindow(); |
38 | 39 | ||
39 | signals: | 40 | signals: |
40 | public slots: | 41 | public slots: |
41 | void compose(); | 42 | void compose(); |
42 | void composeReply(Email &, bool&); | 43 | void composeReply(Email &, bool&); |
43 | void composeForward(Email &); | 44 | void composeForward(Email &); |
44 | void showEmailClient(); | 45 | void showEmailClient(); |
45 | void viewMail(QListView *, Email *mail); | 46 | void viewMail(QListView *, Email *mail); |
46 | void updateMailView(Email *mail); | 47 | void updateMailView(Email *mail); |
47 | void closeEvent(QCloseEvent *e); | 48 | void closeEvent(QCloseEvent *e); |
48 | void updateCaption(const QString &); | 49 | void updateCaption(const QString &); |
49 | void setDocument(const QString &); | 50 | void setDocument(const QString &); |
50 | /*void reply(Email&); | 51 | /*void reply(Email&); |
51 | void replyAll(Email&); | 52 | void replyAll(Email&); |
52 | void forward(Email&); | 53 | void forward(Email&); |
53 | void remove(Email&);*/ | 54 | void remove(Email&);*/ |
54 | 55 | ||
55 | private: | 56 | private: |
56 | EmailClient *emailClient; | 57 | EmailClient *emailClient; |
57 | WriteMail *writeMail; | 58 | WriteMail *writeMail; |
58 | ReadMail *readMail; | 59 | ReadMail *readMail; |
59 | QWidgetStack *views; | 60 | QWidgetStack *views; |
diff --git a/noncore/unsupported/mailit/main.cpp b/noncore/unsupported/mailit/main.cpp index 3a3e1fc..71f8877 100644 --- a/noncore/unsupported/mailit/main.cpp +++ b/noncore/unsupported/mailit/main.cpp | |||
@@ -1,29 +1,25 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2001 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2001 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qt Palmtop Environment. | 4 | ** This file is part of Qt Palmtop Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include <qpe/qpeapplication.h> | 20 | #include <qpe/qpeapplication.h> |
21 | #include "mailitwindow.h" | 21 | #include "mailitwindow.h" |
22 | 22 | ||
23 | int main(int argc, char* argv[]) | 23 | #include <opie/oapplicationfactory.h> |
24 | { | 24 | |
25 | QPEApplication a( argc, argv ); | 25 | OPIE_EXPORT_APP( OApplicationFactory<MailItWindow> ) \ No newline at end of file |
26 | MailItWindow mw(0, 0); | ||
27 | a.showMainDocumentWidget(&mw); | ||
28 | return a.exec(); | ||
29 | } | ||