author | groucho <groucho> | 2003-04-14 08:22:55 (UTC) |
---|---|---|
committer | groucho <groucho> | 2003-04-14 08:22:55 (UTC) |
commit | 4624a73cd100f860371fb01facea442737e9336e (patch) (unidiff) | |
tree | ae06cfd24013ca39816a5ca035605988f4033dcd /noncore/unsupported | |
parent | 6d737040698a9c7ebc6492ba4234b64bf4db6c0b (diff) | |
download | opie-4624a73cd100f860371fb01facea442737e9336e.zip opie-4624a73cd100f860371fb01facea442737e9336e.tar.gz opie-4624a73cd100f860371fb01facea442737e9336e.tar.bz2 |
- Buttonlayout changed in attach dialog
- Removed file access for address list (reduces size)
- Added header size sping box for accounts
- mailit shows an icon in the message list if attachments are present
- Added translations in pro file
- Removed resource.* references in header files, uses qpe/resource.h instead
-rw-r--r-- | noncore/unsupported/mailit/addatt.cpp | 6 | ||||
-rw-r--r-- | noncore/unsupported/mailit/addresslist.cpp | 22 | ||||
-rw-r--r-- | noncore/unsupported/mailit/addresslist.h | 3 | ||||
-rw-r--r-- | noncore/unsupported/mailit/editaccount.cpp | 27 | ||||
-rw-r--r-- | noncore/unsupported/mailit/editaccount.h | 5 | ||||
-rw-r--r-- | noncore/unsupported/mailit/emailclient.cpp | 12 | ||||
-rw-r--r-- | noncore/unsupported/mailit/emailhandler.cpp | 19 | ||||
-rw-r--r-- | noncore/unsupported/mailit/emailhandler.h | 1 | ||||
-rw-r--r-- | noncore/unsupported/mailit/emaillistitem.cpp | 5 | ||||
-rw-r--r-- | noncore/unsupported/mailit/mailit.pro | 17 | ||||
-rw-r--r-- | noncore/unsupported/mailit/readmail.cpp | 2 | ||||
-rw-r--r-- | noncore/unsupported/mailit/writemail.cpp | 2 |
12 files changed, 78 insertions, 43 deletions
diff --git a/noncore/unsupported/mailit/addatt.cpp b/noncore/unsupported/mailit/addatt.cpp index c8be865..d268f1f 100644 --- a/noncore/unsupported/mailit/addatt.cpp +++ b/noncore/unsupported/mailit/addatt.cpp | |||
@@ -23,3 +23,3 @@ | |||
23 | #include <qstringlist.h> | 23 | #include <qstringlist.h> |
24 | #include "resource.h" | 24 | #include <qpe/resource.h> |
25 | #include "addatt.h" | 25 | #include "addatt.h" |
@@ -64,4 +64,4 @@ AddAtt::AddAtt(QWidget *parent, const char *name, WFlags f) | |||
64 | /*fileCategoryButton = new QPushButton(this);*/ | 64 | /*fileCategoryButton = new QPushButton(this);*/ |
65 | attatchButton = new QPushButton("Attatch ->", buttons); | 65 | attatchButton = new QPushButton(tr("Attatch..."), buttons); |
66 | removeButton = new QPushButton("Remove", buttons); | 66 | removeButton = new QPushButton(tr("Remove"), buttons); |
67 | 67 | ||
diff --git a/noncore/unsupported/mailit/addresslist.cpp b/noncore/unsupported/mailit/addresslist.cpp index 43e3830..9fe558a 100644 --- a/noncore/unsupported/mailit/addresslist.cpp +++ b/noncore/unsupported/mailit/addresslist.cpp | |||
@@ -26,6 +26,5 @@ | |||
26 | 26 | ||
27 | AddressList::AddressList(QString file) | 27 | AddressList::AddressList() |
28 | { | 28 | { |
29 | addresses.setAutoDelete(TRUE); | 29 | addresses.setAutoDelete(TRUE); |
30 | filename = file; | ||
31 | read(); | 30 | read(); |
@@ -36,3 +35,2 @@ AddressList::~AddressList() | |||
36 | { | 35 | { |
37 | write(); | ||
38 | addresses.clear(); | 36 | addresses.clear(); |
@@ -122,3 +120,2 @@ void AddressList::read() | |||
122 | 120 | ||
123 | //QFile f(filename); | ||
124 | QString lineEmail, lineName, email, name; | 121 | QString lineEmail, lineName, email, name; |
@@ -164,18 +161 @@ QString AddressList::getRightString(QString in) | |||
164 | |||
165 | void AddressList::write() | ||
166 | { | ||
167 | if ( (addresses.count() == 0) || (!dirty) ) | ||
168 | return; | ||
169 | |||
170 | QFile f(filename); | ||
171 | if (! f.open(IO_WriteOnly) ) | ||
172 | return; | ||
173 | |||
174 | QTextStream stream(&f); | ||
175 | Contact *ptr; | ||
176 | for (ptr = addresses.first(); ptr != 0; ptr = addresses.next() ) { | ||
177 | stream << "email = " + ptr->email + "\n"; | ||
178 | stream << "name = " + ptr->name + "\n"; | ||
179 | } | ||
180 | f.close(); | ||
181 | } | ||
diff --git a/noncore/unsupported/mailit/addresslist.h b/noncore/unsupported/mailit/addresslist.h index e87d6f1..99cef9a 100644 --- a/noncore/unsupported/mailit/addresslist.h +++ b/noncore/unsupported/mailit/addresslist.h | |||
@@ -36,3 +36,3 @@ class AddressList : public QObject | |||
36 | public: | 36 | public: |
37 | AddressList(QString file); | 37 | AddressList(); |
38 | ~AddressList(); | 38 | ~AddressList(); |
@@ -44,3 +44,2 @@ public: | |||
44 | QList<Contact>* getContactList(); | 44 | QList<Contact>* getContactList(); |
45 | void write(); | ||
46 | 45 | ||
diff --git a/noncore/unsupported/mailit/editaccount.cpp b/noncore/unsupported/mailit/editaccount.cpp index c4f95ea..c0afbb2 100644 --- a/noncore/unsupported/mailit/editaccount.cpp +++ b/noncore/unsupported/mailit/editaccount.cpp | |||
@@ -20,2 +20,3 @@ | |||
20 | 20 | ||
21 | #include <qhbox.h> | ||
21 | #include "editaccount.h" | 22 | #include "editaccount.h" |
@@ -42,2 +43,3 @@ void EditAccount::setAccount(MailAccount *in, bool newOne) | |||
42 | syncCheckBox->setChecked(TRUE); | 43 | syncCheckBox->setChecked(TRUE); |
44 | syncLimitInput->setValue(2); | ||
43 | 45 | ||
@@ -53,2 +55,3 @@ void EditAccount::setAccount(MailAccount *in, bool newOne) | |||
53 | syncCheckBox->setChecked(account->synchronize); | 55 | syncCheckBox->setChecked(account->synchronize); |
56 | syncLimitInput->setValue(account->syncLimit/1000); | ||
54 | } | 57 | } |
@@ -72,3 +75,3 @@ void EditAccount::init() | |||
72 | 75 | ||
73 | emailInputLabel = new QLabel("Email", this); | 76 | emailInputLabel = new QLabel(tr("Email"), this); |
74 | grid->addWidget(emailInputLabel, 2, 0 ); | 77 | grid->addWidget(emailInputLabel, 2, 0 ); |
@@ -77,3 +80,3 @@ void EditAccount::init() | |||
77 | 80 | ||
78 | popUserInputLabel = new QLabel("POP username", this); | 81 | popUserInputLabel = new QLabel(tr("POP username"), this); |
79 | grid->addWidget( popUserInputLabel, 3, 0 ); | 82 | grid->addWidget( popUserInputLabel, 3, 0 ); |
@@ -82,3 +85,3 @@ void EditAccount::init() | |||
82 | 85 | ||
83 | popPasswInputLabel = new QLabel( "POP password", this); | 86 | popPasswInputLabel = new QLabel( tr("POP password"), this); |
84 | grid->addWidget( popPasswInputLabel, 4, 0 ); | 87 | grid->addWidget( popPasswInputLabel, 4, 0 ); |
@@ -87,3 +90,3 @@ void EditAccount::init() | |||
87 | 90 | ||
88 | popServerInputLabel = new QLabel("POP server", this); | 91 | popServerInputLabel = new QLabel(tr("POP server"), this); |
89 | grid->addWidget( popServerInputLabel, 5, 0 ); | 92 | grid->addWidget( popServerInputLabel, 5, 0 ); |
@@ -92,3 +95,3 @@ void EditAccount::init() | |||
92 | 95 | ||
93 | smtpServerInputLabel = new QLabel("SMTP server", this ); | 96 | smtpServerInputLabel = new QLabel(tr("SMTP server"), this ); |
94 | grid->addWidget( smtpServerInputLabel, 6, 0 ); | 97 | grid->addWidget( smtpServerInputLabel, 6, 0 ); |
@@ -97,5 +100,14 @@ void EditAccount::init() | |||
97 | 100 | ||
98 | syncCheckBox = new QCheckBox( tr( "Synchronize with server" ), this); | 101 | QHBox* syncBox=new QHBox(this); |
102 | grid->addWidget( syncBox, 7, 1 ); | ||
103 | |||
104 | syncCheckBox = new QCheckBox( tr( "Synchronize" ), this); | ||
99 | syncCheckBox->setChecked( TRUE ); | 105 | syncCheckBox->setChecked( TRUE ); |
100 | grid->addMultiCellWidget( syncCheckBox, 7, 7, 0, 1 ); | 106 | grid->addWidget( syncCheckBox,7,0); |
107 | |||
108 | syncLimitInputLabel = new QLabel(tr("Mail Size (k)"), syncBox); | ||
109 | //syncBox->addWidget( syncLimitInputLabel); | ||
110 | syncLimitInput = new QSpinBox( syncBox, "syncSize" ); | ||
111 | //syncBox->addWidget(syncLimitInput); | ||
112 | |||
101 | } | 113 | } |
@@ -113,2 +125,3 @@ void EditAccount::accept() | |||
113 | account->synchronize = syncCheckBox->isChecked(); | 125 | account->synchronize = syncCheckBox->isChecked(); |
126 | account->syncLimit = syncLimitInput->value()*1000;//Display in kB | ||
114 | 127 | ||
diff --git a/noncore/unsupported/mailit/editaccount.h b/noncore/unsupported/mailit/editaccount.h index 7a90e50..1e15047 100644 --- a/noncore/unsupported/mailit/editaccount.h +++ b/noncore/unsupported/mailit/editaccount.h | |||
@@ -27,2 +27,3 @@ | |||
27 | #include <qlayout.h> | 27 | #include <qlayout.h> |
28 | #include <qspinbox.h> | ||
28 | #include "emailhandler.h" | 29 | #include "emailhandler.h" |
@@ -52,3 +53,4 @@ private: | |||
52 | QLabel *smtpServerInputLabel; | 53 | QLabel *smtpServerInputLabel; |
53 | 54 | QLabel *syncLimitInputLabel; | |
55 | |||
54 | QLineEdit *accountNameInput; | 56 | QLineEdit *accountNameInput; |
@@ -60,2 +62,3 @@ private: | |||
60 | QLineEdit *smtpServerInput; | 62 | QLineEdit *smtpServerInput; |
63 | QSpinBox *syncLimitInput; | ||
61 | QCheckBox *syncCheckBox; | 64 | QCheckBox *syncCheckBox; |
diff --git a/noncore/unsupported/mailit/emailclient.cpp b/noncore/unsupported/mailit/emailclient.cpp index 2943986..6612541 100644 --- a/noncore/unsupported/mailit/emailclient.cpp +++ b/noncore/unsupported/mailit/emailclient.cpp | |||
@@ -25,3 +25,3 @@ | |||
25 | #include <qaction.h> | 25 | #include <qaction.h> |
26 | #include "resource.h" | 26 | #include <qpe/resource.h> |
27 | #include "emailclient.h" | 27 | #include "emailclient.h" |
@@ -43,3 +43,3 @@ EmailClient::EmailClient( QWidget* parent, const char* name, WFlags fl ) | |||
43 | emailHandler = new EmailHandler(); | 43 | emailHandler = new EmailHandler(); |
44 | addressList = new AddressList( getPath(FALSE) + "mail_adr"); | 44 | addressList = new AddressList(); |
45 | 45 | ||
@@ -673,2 +673,8 @@ void EmailClient::readSettings() | |||
673 | } | 673 | } |
674 | |||
675 | if ( (pos = p->find("SYNCLIMIT",':', accountPos, TRUE)) != -1) { | ||
676 | account.syncLimit = p->getString(& ++pos, 'z', TRUE).toInt(); | ||
677 | } | ||
678 | |||
679 | |||
674 | accountList.append(&account); | 680 | accountList.append(&account); |
@@ -718,2 +724,4 @@ void EmailClient::saveSettings() | |||
718 | } | 724 | } |
725 | t << "SyncLimit: "; | ||
726 | t << accountPtr->syncLimit << "\n"; | ||
719 | t << "accountEnd;\n"; | 727 | t << "accountEnd;\n"; |
diff --git a/noncore/unsupported/mailit/emailhandler.cpp b/noncore/unsupported/mailit/emailhandler.cpp index 1be16d4..9c1c814 100644 --- a/noncore/unsupported/mailit/emailhandler.cpp +++ b/noncore/unsupported/mailit/emailhandler.cpp | |||
@@ -120,3 +120,3 @@ void EmailHandler::getMailHeaders() | |||
120 | headers = TRUE; | 120 | headers = TRUE; |
121 | popClient->headersOnly(headers, 2000); //less than 2000, download all | 121 | popClient->headersOnly(headers, mailAccount.syncLimit); //less than requested syncLimit, download all |
122 | popClient->newConnection(mailAccount.popServer, 110); | 122 | popClient->newConnection(mailAccount.popServer, 110); |
@@ -202,2 +202,12 @@ bool EmailHandler::parse(QString in, QString lineShift, Email *mail) | |||
202 | } | 202 | } |
203 | |||
204 | //@@@ToDo: Rewrite the parser as To: stops at the first occurence- which is Delivered-To: | ||
205 | if (pos = p.find("TO",':', pos, TRUE) != -1) | ||
206 | { | ||
207 | pos++; | ||
208 | mail->recipients.append (p.getString(&pos, 'z', TRUE) ); | ||
209 | } | ||
210 | |||
211 | |||
212 | |||
203 | if ((pos = p.find("SUBJECT",':', 0, TRUE)) != -1) { | 213 | if ((pos = p.find("SUBJECT",':', 0, TRUE)) != -1) { |
@@ -210,6 +220,5 @@ bool EmailHandler::parse(QString in, QString lineShift, Email *mail) | |||
210 | } | 220 | } |
211 | if ((pos = p.find("TO",':', 0, TRUE)) != -1) { | 221 | |
212 | pos++; | 222 | |
213 | mail->recipients.append (p.getString(&pos, 'z', TRUE) ); | 223 | |
214 | } | ||
215 | if ((pos = p.find("MESSAGE",'-', 0, TRUE)) != -1) { | 224 | if ((pos = p.find("MESSAGE",'-', 0, TRUE)) != -1) { |
diff --git a/noncore/unsupported/mailit/emailhandler.h b/noncore/unsupported/mailit/emailhandler.h index 17c4414..e47fd9a 100644 --- a/noncore/unsupported/mailit/emailhandler.h +++ b/noncore/unsupported/mailit/emailhandler.h | |||
@@ -96,2 +96,3 @@ struct MailAccount | |||
96 | bool synchronize; | 96 | bool synchronize; |
97 | int syncLimit; | ||
97 | int lastServerMailCount; | 98 | int lastServerMailCount; |
diff --git a/noncore/unsupported/mailit/emaillistitem.cpp b/noncore/unsupported/mailit/emaillistitem.cpp index d47b0b7..a325766 100644 --- a/noncore/unsupported/mailit/emaillistitem.cpp +++ b/noncore/unsupported/mailit/emaillistitem.cpp | |||
@@ -20,2 +20,3 @@ | |||
20 | #include <qstring.h> | 20 | #include <qstring.h> |
21 | #include <qpe/resource.h> | ||
21 | #include "emaillistitem.h" | 22 | #include "emaillistitem.h" |
@@ -40,2 +41,6 @@ EmailListItem::EmailListItem(QListView *parent, Email mailIn, bool inbox) | |||
40 | 41 | ||
42 | if (mailIn.files.count()>0) | ||
43 | { | ||
44 | setPixmap(0, Resource::loadPixmap("mailit/attach")); | ||
45 | } | ||
41 | selected = FALSE; | 46 | selected = FALSE; |
diff --git a/noncore/unsupported/mailit/mailit.pro b/noncore/unsupported/mailit/mailit.pro index a404884..b262f9a 100644 --- a/noncore/unsupported/mailit/mailit.pro +++ b/noncore/unsupported/mailit/mailit.pro | |||
@@ -42,2 +42,19 @@ DESTDIR=$(OPIEDIR)/bin | |||
42 | 42 | ||
43 | TRANSLATIONS = ../../../i18n/de/mailit.ts \ | ||
44 | ../../../i18n/da/mailit.ts \ | ||
45 | ../../../i18n/xx/mailit.ts \ | ||
46 | ../../../i18n/en/mailit.ts \ | ||
47 | ../../../i18n/es/mailit.ts \ | ||
48 | ../../../i18n/fr/mailit.ts \ | ||
49 | ../../../i18n/hu/mailit.ts \ | ||
50 | ../../../i18n/ja/mailit.ts \ | ||
51 | ../../../i18n/ko/mailit.ts \ | ||
52 | ../../../i18n/no/mailit.ts \ | ||
53 | ../../../i18n/pl/mailit.ts \ | ||
54 | ../../../i18n/pt/mailit.ts \ | ||
55 | ../../../i18n/pt_BR/mailit.ts \ | ||
56 | ../../../i18n/sl/mailit.ts \ | ||
57 | ../../../i18n/zh_CN/mailit.ts \ | ||
58 | ../../../i18n/zh_TW/mailit.ts | ||
59 | |||
43 | include ( $(OPIEDIR)/include.pro ) | 60 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/noncore/unsupported/mailit/readmail.cpp b/noncore/unsupported/mailit/readmail.cpp index 2011ecf..a5e7147 100644 --- a/noncore/unsupported/mailit/readmail.cpp +++ b/noncore/unsupported/mailit/readmail.cpp | |||
@@ -23,3 +23,3 @@ | |||
23 | #include <qaction.h> | 23 | #include <qaction.h> |
24 | #include "resource.h" | 24 | #include <qpe/resource.h> |
25 | 25 | ||
diff --git a/noncore/unsupported/mailit/writemail.cpp b/noncore/unsupported/mailit/writemail.cpp index a45cfd2..38a2596 100644 --- a/noncore/unsupported/mailit/writemail.cpp +++ b/noncore/unsupported/mailit/writemail.cpp | |||
@@ -21,3 +21,3 @@ | |||
21 | #include "writemail.h" | 21 | #include "writemail.h" |
22 | #include "resource.h" | 22 | #include <qpe/resource.h> |
23 | 23 | ||