author | groucho <groucho> | 2003-04-14 08:22:55 (UTC) |
---|---|---|
committer | groucho <groucho> | 2003-04-14 08:22:55 (UTC) |
commit | 4624a73cd100f860371fb01facea442737e9336e (patch) (side-by-side diff) | |
tree | ae06cfd24013ca39816a5ca035605988f4033dcd | |
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
24 files changed, 156 insertions, 86 deletions
diff --git a/noncore/net/mailit/addatt.cpp b/noncore/net/mailit/addatt.cpp index c8be865..d268f1f 100644 --- a/noncore/net/mailit/addatt.cpp +++ b/noncore/net/mailit/addatt.cpp @@ -23,3 +23,3 @@ #include <qstringlist.h> -#include "resource.h" +#include <qpe/resource.h> #include "addatt.h" @@ -64,4 +64,4 @@ AddAtt::AddAtt(QWidget *parent, const char *name, WFlags f) /*fileCategoryButton = new QPushButton(this);*/ - attatchButton = new QPushButton("Attatch ->", buttons); - removeButton = new QPushButton("Remove", buttons); + attatchButton = new QPushButton(tr("Attatch..."), buttons); + removeButton = new QPushButton(tr("Remove"), buttons); diff --git a/noncore/net/mailit/addresslist.cpp b/noncore/net/mailit/addresslist.cpp index 43e3830..9fe558a 100644 --- a/noncore/net/mailit/addresslist.cpp +++ b/noncore/net/mailit/addresslist.cpp @@ -26,6 +26,5 @@ -AddressList::AddressList(QString file) +AddressList::AddressList() { addresses.setAutoDelete(TRUE); - filename = file; read(); @@ -36,3 +35,2 @@ AddressList::~AddressList() { - write(); addresses.clear(); @@ -122,3 +120,2 @@ void AddressList::read() - //QFile f(filename); QString lineEmail, lineName, email, name; @@ -164,18 +161 @@ QString AddressList::getRightString(QString in) -void AddressList::write() -{ - if ( (addresses.count() == 0) || (!dirty) ) - return; - - QFile f(filename); - if (! f.open(IO_WriteOnly) ) - return; - - QTextStream stream(&f); - Contact *ptr; - for (ptr = addresses.first(); ptr != 0; ptr = addresses.next() ) { - stream << "email = " + ptr->email + "\n"; - stream << "name = " + ptr->name + "\n"; - } - f.close(); -} diff --git a/noncore/net/mailit/addresslist.h b/noncore/net/mailit/addresslist.h index e87d6f1..99cef9a 100644 --- a/noncore/net/mailit/addresslist.h +++ b/noncore/net/mailit/addresslist.h @@ -36,3 +36,3 @@ class AddressList : public QObject public: - AddressList(QString file); + AddressList(); ~AddressList(); @@ -44,3 +44,2 @@ public: QList<Contact>* getContactList(); - void write(); diff --git a/noncore/net/mailit/editaccount.cpp b/noncore/net/mailit/editaccount.cpp index c4f95ea..c0afbb2 100644 --- a/noncore/net/mailit/editaccount.cpp +++ b/noncore/net/mailit/editaccount.cpp @@ -20,2 +20,3 @@ +#include <qhbox.h> #include "editaccount.h" @@ -42,2 +43,3 @@ void EditAccount::setAccount(MailAccount *in, bool newOne) syncCheckBox->setChecked(TRUE); + syncLimitInput->setValue(2); @@ -53,2 +55,3 @@ void EditAccount::setAccount(MailAccount *in, bool newOne) syncCheckBox->setChecked(account->synchronize); + syncLimitInput->setValue(account->syncLimit/1000); } @@ -72,3 +75,3 @@ void EditAccount::init() - emailInputLabel = new QLabel("Email", this); + emailInputLabel = new QLabel(tr("Email"), this); grid->addWidget(emailInputLabel, 2, 0 ); @@ -77,3 +80,3 @@ void EditAccount::init() - popUserInputLabel = new QLabel("POP username", this); + popUserInputLabel = new QLabel(tr("POP username"), this); grid->addWidget( popUserInputLabel, 3, 0 ); @@ -82,3 +85,3 @@ void EditAccount::init() - popPasswInputLabel = new QLabel( "POP password", this); + popPasswInputLabel = new QLabel( tr("POP password"), this); grid->addWidget( popPasswInputLabel, 4, 0 ); @@ -87,3 +90,3 @@ void EditAccount::init() - popServerInputLabel = new QLabel("POP server", this); + popServerInputLabel = new QLabel(tr("POP server"), this); grid->addWidget( popServerInputLabel, 5, 0 ); @@ -92,3 +95,3 @@ void EditAccount::init() - smtpServerInputLabel = new QLabel("SMTP server", this ); + smtpServerInputLabel = new QLabel(tr("SMTP server"), this ); grid->addWidget( smtpServerInputLabel, 6, 0 ); @@ -97,5 +100,14 @@ void EditAccount::init() - syncCheckBox = new QCheckBox( tr( "Synchronize with server" ), this); + QHBox* syncBox=new QHBox(this); + grid->addWidget( syncBox, 7, 1 ); + + syncCheckBox = new QCheckBox( tr( "Synchronize" ), this); syncCheckBox->setChecked( TRUE ); - grid->addMultiCellWidget( syncCheckBox, 7, 7, 0, 1 ); + grid->addWidget( syncCheckBox,7,0); + + syncLimitInputLabel = new QLabel(tr("Mail Size (k)"), syncBox); + //syncBox->addWidget( syncLimitInputLabel); + syncLimitInput = new QSpinBox( syncBox, "syncSize" ); + //syncBox->addWidget(syncLimitInput); + } @@ -113,2 +125,3 @@ void EditAccount::accept() account->synchronize = syncCheckBox->isChecked(); + account->syncLimit = syncLimitInput->value()*1000; //Display in kB diff --git a/noncore/net/mailit/editaccount.h b/noncore/net/mailit/editaccount.h index 7a90e50..1e15047 100644 --- a/noncore/net/mailit/editaccount.h +++ b/noncore/net/mailit/editaccount.h @@ -27,2 +27,3 @@ #include <qlayout.h> +#include <qspinbox.h> #include "emailhandler.h" @@ -52,3 +53,4 @@ private: QLabel *smtpServerInputLabel; - + QLabel *syncLimitInputLabel; + QLineEdit *accountNameInput; @@ -60,2 +62,3 @@ private: QLineEdit *smtpServerInput; + QSpinBox *syncLimitInput; QCheckBox *syncCheckBox; diff --git a/noncore/net/mailit/emailclient.cpp b/noncore/net/mailit/emailclient.cpp index 2943986..6612541 100644 --- a/noncore/net/mailit/emailclient.cpp +++ b/noncore/net/mailit/emailclient.cpp @@ -25,3 +25,3 @@ #include <qaction.h> -#include "resource.h" +#include <qpe/resource.h> #include "emailclient.h" @@ -43,3 +43,3 @@ EmailClient::EmailClient( QWidget* parent, const char* name, WFlags fl ) emailHandler = new EmailHandler(); - addressList = new AddressList( getPath(FALSE) + "mail_adr"); + addressList = new AddressList(); @@ -673,2 +673,8 @@ void EmailClient::readSettings() } + + if ( (pos = p->find("SYNCLIMIT",':', accountPos, TRUE)) != -1) { + account.syncLimit = p->getString(& ++pos, 'z', TRUE).toInt(); + } + + accountList.append(&account); @@ -718,2 +724,4 @@ void EmailClient::saveSettings() } + t << "SyncLimit: "; + t << accountPtr->syncLimit << "\n"; t << "accountEnd;\n"; diff --git a/noncore/net/mailit/emailhandler.cpp b/noncore/net/mailit/emailhandler.cpp index 1be16d4..9c1c814 100644 --- a/noncore/net/mailit/emailhandler.cpp +++ b/noncore/net/mailit/emailhandler.cpp @@ -120,3 +120,3 @@ void EmailHandler::getMailHeaders() headers = TRUE; - popClient->headersOnly(headers, 2000); //less than 2000, download all + popClient->headersOnly(headers, mailAccount.syncLimit); //less than requested syncLimit, download all popClient->newConnection(mailAccount.popServer, 110); @@ -202,2 +202,12 @@ bool EmailHandler::parse(QString in, QString lineShift, Email *mail) } + + //@@@ToDo: Rewrite the parser as To: stops at the first occurence- which is Delivered-To: + if (pos = p.find("TO",':', pos, TRUE) != -1) + { + pos++; + mail->recipients.append (p.getString(&pos, 'z', TRUE) ); + } + + + if ((pos = p.find("SUBJECT",':', 0, TRUE)) != -1) { @@ -210,6 +220,5 @@ bool EmailHandler::parse(QString in, QString lineShift, Email *mail) } - if ((pos = p.find("TO",':', 0, TRUE)) != -1) { - pos++; - mail->recipients.append (p.getString(&pos, 'z', TRUE) ); - } + + + if ((pos = p.find("MESSAGE",'-', 0, TRUE)) != -1) { diff --git a/noncore/net/mailit/emailhandler.h b/noncore/net/mailit/emailhandler.h index 17c4414..e47fd9a 100644 --- a/noncore/net/mailit/emailhandler.h +++ b/noncore/net/mailit/emailhandler.h @@ -96,2 +96,3 @@ struct MailAccount bool synchronize; + int syncLimit; int lastServerMailCount; diff --git a/noncore/net/mailit/emaillistitem.cpp b/noncore/net/mailit/emaillistitem.cpp index d47b0b7..a325766 100644 --- a/noncore/net/mailit/emaillistitem.cpp +++ b/noncore/net/mailit/emaillistitem.cpp @@ -20,2 +20,3 @@ #include <qstring.h> +#include <qpe/resource.h> #include "emaillistitem.h" @@ -40,2 +41,6 @@ EmailListItem::EmailListItem(QListView *parent, Email mailIn, bool inbox) + if (mailIn.files.count()>0) + { + setPixmap(0, Resource::loadPixmap("mailit/attach")); + } selected = FALSE; diff --git a/noncore/net/mailit/mailit.pro b/noncore/net/mailit/mailit.pro index a404884..b262f9a 100644 --- a/noncore/net/mailit/mailit.pro +++ b/noncore/net/mailit/mailit.pro @@ -42,2 +42,19 @@ DESTDIR=$(OPIEDIR)/bin +TRANSLATIONS = ../../../i18n/de/mailit.ts \ + ../../../i18n/da/mailit.ts \ + ../../../i18n/xx/mailit.ts \ + ../../../i18n/en/mailit.ts \ + ../../../i18n/es/mailit.ts \ + ../../../i18n/fr/mailit.ts \ + ../../../i18n/hu/mailit.ts \ + ../../../i18n/ja/mailit.ts \ + ../../../i18n/ko/mailit.ts \ + ../../../i18n/no/mailit.ts \ + ../../../i18n/pl/mailit.ts \ + ../../../i18n/pt/mailit.ts \ + ../../../i18n/pt_BR/mailit.ts \ + ../../../i18n/sl/mailit.ts \ + ../../../i18n/zh_CN/mailit.ts \ + ../../../i18n/zh_TW/mailit.ts + include ( $(OPIEDIR)/include.pro ) diff --git a/noncore/net/mailit/readmail.cpp b/noncore/net/mailit/readmail.cpp index 2011ecf..a5e7147 100644 --- a/noncore/net/mailit/readmail.cpp +++ b/noncore/net/mailit/readmail.cpp @@ -23,3 +23,3 @@ #include <qaction.h> -#include "resource.h" +#include <qpe/resource.h> diff --git a/noncore/net/mailit/writemail.cpp b/noncore/net/mailit/writemail.cpp index a45cfd2..38a2596 100644 --- a/noncore/net/mailit/writemail.cpp +++ b/noncore/net/mailit/writemail.cpp @@ -21,3 +21,3 @@ #include "writemail.h" -#include "resource.h" +#include <qpe/resource.h> 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 @@ #include <qstringlist.h> -#include "resource.h" +#include <qpe/resource.h> #include "addatt.h" @@ -64,4 +64,4 @@ AddAtt::AddAtt(QWidget *parent, const char *name, WFlags f) /*fileCategoryButton = new QPushButton(this);*/ - attatchButton = new QPushButton("Attatch ->", buttons); - removeButton = new QPushButton("Remove", buttons); + attatchButton = new QPushButton(tr("Attatch..."), buttons); + removeButton = new QPushButton(tr("Remove"), buttons); 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 @@ -AddressList::AddressList(QString file) +AddressList::AddressList() { addresses.setAutoDelete(TRUE); - filename = file; read(); @@ -36,3 +35,2 @@ AddressList::~AddressList() { - write(); addresses.clear(); @@ -122,3 +120,2 @@ void AddressList::read() - //QFile f(filename); QString lineEmail, lineName, email, name; @@ -164,18 +161 @@ QString AddressList::getRightString(QString in) -void AddressList::write() -{ - if ( (addresses.count() == 0) || (!dirty) ) - return; - - QFile f(filename); - if (! f.open(IO_WriteOnly) ) - return; - - QTextStream stream(&f); - Contact *ptr; - for (ptr = addresses.first(); ptr != 0; ptr = addresses.next() ) { - stream << "email = " + ptr->email + "\n"; - stream << "name = " + ptr->name + "\n"; - } - f.close(); -} 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 public: - AddressList(QString file); + AddressList(); ~AddressList(); @@ -44,3 +44,2 @@ public: QList<Contact>* getContactList(); - void write(); 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 @@ +#include <qhbox.h> #include "editaccount.h" @@ -42,2 +43,3 @@ void EditAccount::setAccount(MailAccount *in, bool newOne) syncCheckBox->setChecked(TRUE); + syncLimitInput->setValue(2); @@ -53,2 +55,3 @@ void EditAccount::setAccount(MailAccount *in, bool newOne) syncCheckBox->setChecked(account->synchronize); + syncLimitInput->setValue(account->syncLimit/1000); } @@ -72,3 +75,3 @@ void EditAccount::init() - emailInputLabel = new QLabel("Email", this); + emailInputLabel = new QLabel(tr("Email"), this); grid->addWidget(emailInputLabel, 2, 0 ); @@ -77,3 +80,3 @@ void EditAccount::init() - popUserInputLabel = new QLabel("POP username", this); + popUserInputLabel = new QLabel(tr("POP username"), this); grid->addWidget( popUserInputLabel, 3, 0 ); @@ -82,3 +85,3 @@ void EditAccount::init() - popPasswInputLabel = new QLabel( "POP password", this); + popPasswInputLabel = new QLabel( tr("POP password"), this); grid->addWidget( popPasswInputLabel, 4, 0 ); @@ -87,3 +90,3 @@ void EditAccount::init() - popServerInputLabel = new QLabel("POP server", this); + popServerInputLabel = new QLabel(tr("POP server"), this); grid->addWidget( popServerInputLabel, 5, 0 ); @@ -92,3 +95,3 @@ void EditAccount::init() - smtpServerInputLabel = new QLabel("SMTP server", this ); + smtpServerInputLabel = new QLabel(tr("SMTP server"), this ); grid->addWidget( smtpServerInputLabel, 6, 0 ); @@ -97,5 +100,14 @@ void EditAccount::init() - syncCheckBox = new QCheckBox( tr( "Synchronize with server" ), this); + QHBox* syncBox=new QHBox(this); + grid->addWidget( syncBox, 7, 1 ); + + syncCheckBox = new QCheckBox( tr( "Synchronize" ), this); syncCheckBox->setChecked( TRUE ); - grid->addMultiCellWidget( syncCheckBox, 7, 7, 0, 1 ); + grid->addWidget( syncCheckBox,7,0); + + syncLimitInputLabel = new QLabel(tr("Mail Size (k)"), syncBox); + //syncBox->addWidget( syncLimitInputLabel); + syncLimitInput = new QSpinBox( syncBox, "syncSize" ); + //syncBox->addWidget(syncLimitInput); + } @@ -113,2 +125,3 @@ void EditAccount::accept() account->synchronize = syncCheckBox->isChecked(); + account->syncLimit = syncLimitInput->value()*1000; //Display in kB 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 @@ #include <qlayout.h> +#include <qspinbox.h> #include "emailhandler.h" @@ -52,3 +53,4 @@ private: QLabel *smtpServerInputLabel; - + QLabel *syncLimitInputLabel; + QLineEdit *accountNameInput; @@ -60,2 +62,3 @@ private: QLineEdit *smtpServerInput; + QSpinBox *syncLimitInput; 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 @@ #include <qaction.h> -#include "resource.h" +#include <qpe/resource.h> #include "emailclient.h" @@ -43,3 +43,3 @@ EmailClient::EmailClient( QWidget* parent, const char* name, WFlags fl ) emailHandler = new EmailHandler(); - addressList = new AddressList( getPath(FALSE) + "mail_adr"); + addressList = new AddressList(); @@ -673,2 +673,8 @@ void EmailClient::readSettings() } + + if ( (pos = p->find("SYNCLIMIT",':', accountPos, TRUE)) != -1) { + account.syncLimit = p->getString(& ++pos, 'z', TRUE).toInt(); + } + + accountList.append(&account); @@ -718,2 +724,4 @@ void EmailClient::saveSettings() } + t << "SyncLimit: "; + t << accountPtr->syncLimit << "\n"; 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() headers = TRUE; - popClient->headersOnly(headers, 2000); //less than 2000, download all + popClient->headersOnly(headers, mailAccount.syncLimit); //less than requested syncLimit, download all popClient->newConnection(mailAccount.popServer, 110); @@ -202,2 +202,12 @@ bool EmailHandler::parse(QString in, QString lineShift, Email *mail) } + + //@@@ToDo: Rewrite the parser as To: stops at the first occurence- which is Delivered-To: + if (pos = p.find("TO",':', pos, TRUE) != -1) + { + pos++; + mail->recipients.append (p.getString(&pos, 'z', TRUE) ); + } + + + if ((pos = p.find("SUBJECT",':', 0, TRUE)) != -1) { @@ -210,6 +220,5 @@ bool EmailHandler::parse(QString in, QString lineShift, Email *mail) } - if ((pos = p.find("TO",':', 0, TRUE)) != -1) { - pos++; - mail->recipients.append (p.getString(&pos, 'z', TRUE) ); - } + + + 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 bool synchronize; + int syncLimit; 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 @@ #include <qstring.h> +#include <qpe/resource.h> #include "emaillistitem.h" @@ -40,2 +41,6 @@ EmailListItem::EmailListItem(QListView *parent, Email mailIn, bool inbox) + if (mailIn.files.count()>0) + { + setPixmap(0, Resource::loadPixmap("mailit/attach")); + } 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 +TRANSLATIONS = ../../../i18n/de/mailit.ts \ + ../../../i18n/da/mailit.ts \ + ../../../i18n/xx/mailit.ts \ + ../../../i18n/en/mailit.ts \ + ../../../i18n/es/mailit.ts \ + ../../../i18n/fr/mailit.ts \ + ../../../i18n/hu/mailit.ts \ + ../../../i18n/ja/mailit.ts \ + ../../../i18n/ko/mailit.ts \ + ../../../i18n/no/mailit.ts \ + ../../../i18n/pl/mailit.ts \ + ../../../i18n/pt/mailit.ts \ + ../../../i18n/pt_BR/mailit.ts \ + ../../../i18n/sl/mailit.ts \ + ../../../i18n/zh_CN/mailit.ts \ + ../../../i18n/zh_TW/mailit.ts + 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 @@ #include <qaction.h> -#include "resource.h" +#include <qpe/resource.h> 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 @@ #include "writemail.h" -#include "resource.h" +#include <qpe/resource.h> |