-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 | |||
@@ -278,13 +278,13 @@ void EmailClient::enqueMail(const Email &mail) | |||
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) { |
@@ -318,14 +318,14 @@ void EmailClient::mailSent() | |||
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; |
@@ -782,13 +782,13 @@ 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; |
@@ -822,13 +822,13 @@ void EmailClient::editAccount(int id) | |||
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; |
@@ -843,13 +843,13 @@ void EmailClient::updateAccounts() | |||
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()) { |
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 | |||
@@ -35,13 +35,14 @@ EmailListItem::EmailListItem(QListView *parent, Email mailIn, bool inbox) | |||
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 | ||
@@ -94,6 +95,64 @@ void EmailListItem::paintCell( QPainter *p, const QColorGroup &cg, | |||
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 | |||
@@ -36,9 +36,10 @@ public: | |||
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,9 +1,8 @@ | |||
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 \ |
@@ -34,15 +33,12 @@ SOURCES = emailclient.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 \ |
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 | |||
@@ -30,12 +30,13 @@ | |||
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(); |
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 | |||
@@ -17,13 +17,9 @@ | |||
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 | } | ||