From 1b41a0e3bf63364940daf132446939e3570c57ad Mon Sep 17 00:00:00 2001 From: zautrix Date: Fri, 10 Sep 2004 22:52:50 +0000 Subject: Added pop3 settings --- (limited to 'kmicromail') diff --git a/kmicromail/editaccounts.cpp b/kmicromail/editaccounts.cpp index d272c3b..e7d2750 100644 --- a/kmicromail/editaccounts.cpp +++ b/kmicromail/editaccounts.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include @@ -420,6 +421,15 @@ void POP3config::fillValues() ComboBox1->setCurrentItem( data->ConnectionType() ); userLine->setText( data->getUser() ); passLine->setText( data->getPassword() ); + localFolder->setText( data->getLocalFolder() ); + int max = data->getMaxMailSize() ; + if ( max ) { + CheckBoxDown->setChecked( true ); + SpinBoxDown->setValue ( max ); + } else { + CheckBoxDown->setChecked( false ); + SpinBoxDown->setValue ( 5 ); + } } void POP3config::accept() @@ -430,6 +440,8 @@ void POP3config::accept() data->setConnectionType( ComboBox1->currentItem() ); data->setUser( userLine->text() ); data->setPassword( passLine->text() ); + data->setLocalFolder( localFolder->text() ); + data->setMaxMailSize( CheckBoxDown->isChecked()?SpinBoxDown->value():0 ) ; QDialog::accept(); } diff --git a/kmicromail/libmailwrapper/pop3wrapper.cpp b/kmicromail/libmailwrapper/pop3wrapper.cpp index 8d2f778..1edec9e 100644 --- a/kmicromail/libmailwrapper/pop3wrapper.cpp +++ b/kmicromail/libmailwrapper/pop3wrapper.cpp @@ -122,7 +122,7 @@ void POP3wrapper::login() uint16_t port; int err = MAILPOP3_NO_ERROR; - server = account->getServer().latin1(); + server = account->getServer(); port = account->getPort().toUInt(); if ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) { diff --git a/kmicromail/libmailwrapper/settings.cpp b/kmicromail/libmailwrapper/settings.cpp index b0a539e..90e32fa 100644 --- a/kmicromail/libmailwrapper/settings.cpp +++ b/kmicromail/libmailwrapper/settings.cpp @@ -255,6 +255,11 @@ void POP3account::read() user = conf->readEntry( "User" ); password = conf->readEntryCrypt( "Password" ); offline = conf->readBoolEntry("Offline",false); + localFolder = conf->readEntry( "LocalFolder" ); + maxMailSize = conf->readNumEntry( "MaxSize",0 ); + int lf = conf->readNumEntry( "LastFetch",0 ); + QDateTime dt ( QDate ( 2004, 1, 1 ), QTime( 0,0,0) ); + lastFetch = dt.addSecs( lf ); delete conf; } @@ -272,6 +277,11 @@ void POP3account::save() conf->writeEntry( "User", user ); conf->writeEntryCrypt( "Password", password ); conf->writeEntry( "Offline",offline); + conf->writeEntry( "LocalFolder", localFolder ); + conf->writeEntry( "MaxSize", maxMailSize ); + QDateTime dt ( QDate ( 2004, 1, 1 ), QTime( 0,0,0) ); + int lf = dt.secsTo ( lastFetch ); + conf->writeEntry( "LastFetch", lf ); conf->write(); delete conf; } diff --git a/kmicromail/libmailwrapper/settings.h b/kmicromail/libmailwrapper/settings.h index ba3ec89..c33c403 100644 --- a/kmicromail/libmailwrapper/settings.h +++ b/kmicromail/libmailwrapper/settings.h @@ -8,6 +8,7 @@ /* QT */ #include #include +#include class Account { @@ -24,6 +25,9 @@ public: void setServer(const QString&str){ server = str; } const QString&getServer()const{ return server; } + void setLocalFolder( QString name ) { localFolder = name; } + const QString& getLocalFolder()const{ return localFolder; } + void setPort(const QString&str) { port = str; } const QString&getPort()const{ return port; } @@ -39,6 +43,8 @@ public: void setConnectionType( int x ) { connectionType = x; } int ConnectionType() { return connectionType; } + void setMaxMailSize( int x ) { maxMailSize = x; } + int getMaxMailSize() { return maxMailSize; } void setOffline(bool b) {offline = b;} bool getOffline()const{return offline;} @@ -53,6 +59,9 @@ protected: int connectionType; bool offline; MAILLIB::ATYPE type; + QString localFolder; + int maxMailSize; + QDateTime lastFetch; }; class IMAPaccount : public Account diff --git a/kmicromail/pop3configui.ui b/kmicromail/pop3configui.ui index 1014ef4..a2d43bd 100644 --- a/kmicromail/pop3configui.ui +++ b/kmicromail/pop3configui.ui @@ -11,8 +11,8 @@ 0 0 - 314 - 410 + 322 + 404 @@ -28,11 +28,11 @@ margin - 3 + 11 spacing - 3 + 6 QLayoutWidget @@ -319,6 +319,92 @@ + + QLayoutWidget + + name + Layout9 + + + + margin + 0 + + + spacing + 6 + + + QLabel + + name + TextLabel1_2 + + + text + Local storage folder: + + + + QLineEdit + + name + localFolder + + + text + + + + + + + QLayoutWidget + + name + Layout10 + + + + margin + 0 + + + spacing + 6 + + + QCheckBox + + name + CheckBoxDown + + + text + Download only messages smaller + + + + QSpinBox + + name + SpinBoxDown + + + suffix + kB + + + maxValue + 99999 + + + minValue + 1 + + + + name -- cgit v0.9.0.2