From 0f45c977d7530b6ca827b7a7c7da7469f01800ca Mon Sep 17 00:00:00 2001 From: zautrix Date: Sat, 11 Sep 2004 08:56:57 +0000 Subject: More config changes --- diff --git a/kmicromail/accountitem.cpp b/kmicromail/accountitem.cpp index d0321ef..1698b40 100644 --- a/kmicromail/accountitem.cpp +++ b/kmicromail/accountitem.cpp @@ -92,6 +92,7 @@ QPopupMenu * POP3viewItem::getContextMenu() { m->insertItem(QObject::tr("Disconnect",contextName),0); m->insertItem(QObject::tr("Set offline",contextName),1); + m->insertItem(QObject::tr("Download messages",contextName),2); } else { @@ -135,6 +136,15 @@ void POP3viewItem::contextMenuSelected(int which) case 1: setOnOffline(); break; + case 2: // daunlood + AccountView*bl = accountView(); + if (!bl) return; + AccountViewItem* in = findSubItem( "inbox" , 0); + if ( ! in ) + return; + bl->downloadMailsInbox(in->getFolder() ,getWrapper()); + setOnOffline(); + break; } } @@ -1105,7 +1115,7 @@ void AccountViewItem::removeChilds() bool AccountViewItem::matchName(const QString&name)const { if (!folder) return false; - return folder->getDisplayName()==name; + return folder->getDisplayName().lower()==name.lower(); } diff --git a/kmicromail/accountitem.h b/kmicromail/accountitem.h index f125eeb..faf919d 100644 --- a/kmicromail/accountitem.h +++ b/kmicromail/accountitem.h @@ -36,6 +36,7 @@ public: virtual AccountView*accountView(); virtual bool matchName(const QString&name)const; virtual bool isDraftfolder(); + Opie::Core::OSmartPointer getFolder() { return folder; }; protected: AccountViewItem*findSubItem(const QString&path,AccountViewItem*start=0); diff --git a/kmicromail/accountview.cpp b/kmicromail/accountview.cpp index 4ead545..85523b1 100644 --- a/kmicromail/accountview.cpp +++ b/kmicromail/accountview.cpp @@ -139,6 +139,33 @@ void AccountView::setupFolderselect(Selectstore*sels) sels->addAccounts(imapAccounts[i]->getWrapper(),imapAccounts[i]->subFolders()); } } +void AccountView::downloadMailsInbox(const FolderP&fromFolder,AbstractMail*fromWrapper) +{ + AbstractMail*targetMail = 0; + QString targetFolder = ""; + Selectstore sels; + setupFolderselect(&sels); + if (!sels.exec()) return; + targetMail = sels.currentMail(); + targetFolder = sels.currentFolder(); + if ( (fromWrapper==targetMail && fromFolder->getName()==targetFolder) || + targetFolder.isEmpty()) + { + return; + } + if (sels.newFolder() && !targetMail->createMbox(targetFolder)) + { + QMessageBox::critical(0,tr("Error creating new Folder"), + tr("
Error while creating
new folder - breaking.
")); + return; + } + int maxsize = 0; + if ( sels.useSize->isChecked()) + maxsize = sels.sizeSpinBox->value(); + + fromWrapper->mvcpAllMails(fromFolder,targetFolder,targetMail,sels.moveMails(), maxsize); + refreshCurrent(); +} void AccountView::downloadMails(const FolderP&fromFolder,AbstractMail*fromWrapper) { diff --git a/kmicromail/accountview.h b/kmicromail/accountview.h index 787b0b0..fcf33d1 100644 --- a/kmicromail/accountview.h +++ b/kmicromail/accountview.h @@ -23,6 +23,7 @@ public: virtual void populate( QList list ); virtual RecBodyP fetchBody(const Opie::Core::OSmartPointer&aMail); virtual void downloadMails(const Opie::Core::OSmartPointer&fromFolder,AbstractMail*fromWrapper); + virtual void downloadMailsInbox(const Opie::Core::OSmartPointer&fromFolder,AbstractMail*fromWrapper); virtual bool currentisDraft(); public slots: diff --git a/kmicromail/imapconfigui.ui b/kmicromail/imapconfigui.ui index a96c1a2..2e4c9ca 100644 --- a/kmicromail/imapconfigui.ui +++ b/kmicromail/imapconfigui.ui @@ -11,8 +11,8 @@ 0 0 - 425 - 428 + 306 + 396 @@ -25,74 +25,55 @@ layoutSpacing - + margin 3 spacing - 3 + 1 - - QLineEdit + + QLayoutWidget name - serverLine - - - - QLabel - - name - portLabel - - - text - Port - + Layout22 + + + + margin + 0 + + + spacing + 6 + + + QLabel + + name + accountLabel + + + text + Account + + + + QLineEdit + + name + accountLine + + + toolTip + Name of the Account + + + - - QLabel - - name - serverLabel - - - text - Server - - - - QLineEdit - - name - portLine - - - - QLineEdit - - name - accountLine - - - toolTip - Name of the Account - - - - QLabel - - name - accountLabel - - - text - Account - - - + Line name @@ -103,75 +84,123 @@ Horizontal - - - name - spacer - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QLineEdit + + QLayoutWidget name - userLine - - - - QLineEdit - - name - passLine - - - echoMode - Password - - - - QLabel - - name - prefixLabel - - - text - Prefix - + Layout23 + + + + margin + 0 + + + spacing + 6 + + + QLabel + + name + serverLabel + + + text + Server + + + + QLineEdit + + name + serverLine + + + - - QLineEdit + + QLayoutWidget name - prefixLine - + Layout24 + + + + margin + 0 + + + spacing + 6 + + + QLabel + + name + portLabel + + + text + Port + + + + QLineEdit + + name + portLine + + + - - QLabel + + QLayoutWidget name - userLabel - - - text - User - + Layout16 + + + + margin + 0 + + + spacing + 6 + + + QLabel + + name + TextLabel1 + + + text + Use secure sockets: + + + + QComboBox + + name + ComboBox1 + + + + QLineEdit + + name + CommandEdit + + + text + ssh $SERVER exec + + + - + Line name @@ -196,7 +225,81 @@ layoutSpacing - + + QLayoutWidget + + name + Layout25 + + + + margin + 0 + + + spacing + 6 + + + QLabel + + name + userLabel + + + text + User + + + + QLineEdit + + name + userLine + + + + + + QLayoutWidget + + name + Layout26 + + + + margin + 0 + + + spacing + 6 + + + QLabel + + name + passLabel + + + text + Password + + + + QLineEdit + + name + passLine + + + echoMode + Password + + + + + Line name @@ -207,47 +310,160 @@ Horizontal - - QLabel + + QLayoutWidget name - passLabel - + Layout27 + + + + margin + 0 + + + spacing + 6 + + + QLabel + + name + prefixLabel + + + text + Prefix + + + + QLineEdit + + name + prefixLine + + + + + + QLayoutWidget - text - Password - + name + Layout11 + + + + margin + 0 + + + spacing + 6 + + + QLabel + + name + TextLabel1_2 + + + text + Local storage folder: + + + + QLineEdit + + name + localFolder + + + text + + + + + + + QLayoutWidget + + name + Layout12 + + + + margin + 0 + + + spacing + 6 + + + QCheckBox + + name + CheckBoxDown + + + text + Download only messages smaller + + + + QSpinBox + + name + SpinBoxDown + + + suffix + kB + + + maxValue + 99999 + + + minValue + 1 + + + - - QLineEdit + + QCheckBox name - CommandEdit + CheckBoxLeaveOn text - ssh $SERVER exec + Leave Messages on Server - - QComboBox - + + name - ComboBox1 + spacer - - - QLabel - name - TextLabel1 + orientation + Vertical - text - Use secure sockets: + sizeType + Expanding - - + + sizeHint + + 20 + 20 + + + + accountLine diff --git a/kmicromail/libmailwrapper/settings.cpp b/kmicromail/libmailwrapper/settings.cpp index 90e32fa..f996d9c 100644 --- a/kmicromail/libmailwrapper/settings.cpp +++ b/kmicromail/libmailwrapper/settings.cpp @@ -177,6 +177,12 @@ void IMAPaccount::read() prefix = conf->readEntry("MailPrefix",""); if (prefix.isNull()) prefix = ""; 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) ); + leaveOnServer = conf->readBoolEntry("LeaveOnServer",false); + lastFetch = dt.addSecs( lf ); delete conf; } @@ -196,6 +202,12 @@ void IMAPaccount::save() conf->writeEntryCrypt( "Password", password ); conf->writeEntry( "MailPrefix",prefix); 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->writeEntry( "LeaveOnServer", leaveOnServer); conf->write(); delete conf; } @@ -259,6 +271,7 @@ void POP3account::read() maxMailSize = conf->readNumEntry( "MaxSize",0 ); int lf = conf->readNumEntry( "LastFetch",0 ); QDateTime dt ( QDate ( 2004, 1, 1 ), QTime( 0,0,0) ); + leaveOnServer = conf->readBoolEntry("LeaveOnServer",false); lastFetch = dt.addSecs( lf ); delete conf; } @@ -282,6 +295,7 @@ void POP3account::save() QDateTime dt ( QDate ( 2004, 1, 1 ), QTime( 0,0,0) ); int lf = dt.secsTo ( lastFetch ); conf->writeEntry( "LastFetch", lf ); + conf->writeEntry( "LeaveOnServer", leaveOnServer); conf->write(); delete conf; } diff --git a/kmicromail/libmailwrapper/settings.h b/kmicromail/libmailwrapper/settings.h index c33c403..85b817c 100644 --- a/kmicromail/libmailwrapper/settings.h +++ b/kmicromail/libmailwrapper/settings.h @@ -49,6 +49,9 @@ public: void setOffline(bool b) {offline = b;} bool getOffline()const{return offline;} + bool getLeaveOnServer(){ return leaveOnServer;} + void setLeaveOnServer(bool b){ leaveOnServer = b;} + virtual QString getFileName() { return accountName; } virtual void read() { ; } virtual void save() { ; } @@ -62,6 +65,7 @@ protected: QString localFolder; int maxMailSize; QDateTime lastFetch; + bool leaveOnServer; }; class IMAPaccount : public Account diff --git a/kmicromail/pop3configui.ui b/kmicromail/pop3configui.ui index a2d43bd..6acd394 100644 --- a/kmicromail/pop3configui.ui +++ b/kmicromail/pop3configui.ui @@ -11,8 +11,8 @@ 0 0 - 322 - 404 + 306 + 371 @@ -28,11 +28,11 @@ margin - 11 + 3 spacing - 6 + 1 QLayoutWidget @@ -405,6 +405,17 @@ + + QCheckBox + + name + CheckBoxLeaveOn + + + text + Leave Messages on Server + + name -- cgit v0.9.0.2