summaryrefslogtreecommitdiffabout
path: root/kmicromail
Side-by-side diff
Diffstat (limited to 'kmicromail') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/accountitem.cpp12
-rw-r--r--kmicromail/accountitem.h1
-rw-r--r--kmicromail/accountview.cpp27
-rw-r--r--kmicromail/accountview.h1
-rw-r--r--kmicromail/imapconfigui.ui506
-rw-r--r--kmicromail/libmailwrapper/settings.cpp14
-rw-r--r--kmicromail/libmailwrapper/settings.h4
-rw-r--r--kmicromail/pop3configui.ui19
8 files changed, 434 insertions, 150 deletions
diff --git a/kmicromail/accountitem.cpp b/kmicromail/accountitem.cpp
index d0321ef..1698b40 100644
--- a/kmicromail/accountitem.cpp
+++ b/kmicromail/accountitem.cpp
@@ -94,2 +94,3 @@ QPopupMenu * POP3viewItem::getContextMenu()
m->insertItem(QObject::tr("Set offline",contextName),1);
+ m->insertItem(QObject::tr("Download messages",contextName),2);
}
@@ -137,2 +138,11 @@ void POP3viewItem::contextMenuSelected(int which)
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;
}
@@ -1107,3 +1117,3 @@ 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
@@ -38,2 +38,3 @@ public:
virtual bool isDraftfolder();
+ Opie::Core::OSmartPointer<Folder> getFolder() { return folder; };
diff --git a/kmicromail/accountview.cpp b/kmicromail/accountview.cpp
index 4ead545..85523b1 100644
--- a/kmicromail/accountview.cpp
+++ b/kmicromail/accountview.cpp
@@ -141,2 +141,29 @@ void AccountView::setupFolderselect(Selectstore*sels)
}
+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("<center>Error while creating<br>new folder - breaking.</center>"));
+ return;
+ }
+ int maxsize = 0;
+ if ( sels.useSize->isChecked())
+ maxsize = sels.sizeSpinBox->value();
+
+ fromWrapper->mvcpAllMails(fromFolder,targetFolder,targetMail,sels.moveMails(), maxsize);
+ refreshCurrent();
+}
diff --git a/kmicromail/accountview.h b/kmicromail/accountview.h
index 787b0b0..fcf33d1 100644
--- a/kmicromail/accountview.h
+++ b/kmicromail/accountview.h
@@ -25,2 +25,3 @@ public:
virtual void downloadMails(const Opie::Core::OSmartPointer<Folder>&fromFolder,AbstractMail*fromWrapper);
+ virtual void downloadMailsInbox(const Opie::Core::OSmartPointer<Folder>&fromFolder,AbstractMail*fromWrapper);
virtual bool currentisDraft();
diff --git a/kmicromail/imapconfigui.ui b/kmicromail/imapconfigui.ui
index a96c1a2..2e4c9ca 100644
--- a/kmicromail/imapconfigui.ui
+++ b/kmicromail/imapconfigui.ui
@@ -13,4 +13,4 @@
<y>0</y>
- <width>425</width>
- <height>428</height>
+ <width>306</width>
+ <height>396</height>
</rect>
@@ -27,3 +27,3 @@
</property>
- <grid>
+ <vbox>
<property stdset="1">
@@ -34,63 +34,44 @@
<name>spacing</name>
- <number>3</number>
+ <number>1</number>
</property>
- <widget row="2" column="1" >
- <class>QLineEdit</class>
+ <widget>
+ <class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
- <cstring>serverLine</cstring>
- </property>
- </widget>
- <widget row="3" column="0" >
- <class>QLabel</class>
- <property stdset="1">
- <name>name</name>
- <cstring>portLabel</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Port</string>
- </property>
+ <cstring>Layout22</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>accountLabel</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Account</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>accountLine</cstring>
+ </property>
+ <property>
+ <name>toolTip</name>
+ <string>Name of the Account</string>
+ </property>
+ </widget>
+ </hbox>
</widget>
- <widget row="2" column="0" >
- <class>QLabel</class>
- <property stdset="1">
- <name>name</name>
- <cstring>serverLabel</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Server</string>
- </property>
- </widget>
- <widget row="3" column="1" >
- <class>QLineEdit</class>
- <property stdset="1">
- <name>name</name>
- <cstring>portLine</cstring>
- </property>
- </widget>
- <widget row="0" column="1" >
- <class>QLineEdit</class>
- <property stdset="1">
- <name>name</name>
- <cstring>accountLine</cstring>
- </property>
- <property>
- <name>toolTip</name>
- <string>Name of the Account</string>
- </property>
- </widget>
- <widget row="0" column="0" >
- <class>QLabel</class>
- <property stdset="1">
- <name>name</name>
- <cstring>accountLabel</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Account</string>
- </property>
- </widget>
- <widget row="1" column="0" rowspan="1" colspan="2" >
+ <widget>
<class>Line</class>
@@ -105,71 +86,119 @@
</widget>
- <spacer row="12" column="1" >
- <property>
- <name>name</name>
- <cstring>spacer</cstring>
- </property>
- <property stdset="1">
- <name>orientation</name>
- <enum>Vertical</enum>
- </property>
- <property stdset="1">
- <name>sizeType</name>
- <enum>Expanding</enum>
- </property>
- <property>
- <name>sizeHint</name>
- <size>
- <width>20</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- <widget row="8" column="1" >
- <class>QLineEdit</class>
+ <widget>
+ <class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
- <cstring>userLine</cstring>
- </property>
- </widget>
- <widget row="9" column="1" >
- <class>QLineEdit</class>
- <property stdset="1">
- <name>name</name>
- <cstring>passLine</cstring>
- </property>
- <property stdset="1">
- <name>echoMode</name>
- <enum>Password</enum>
- </property>
- </widget>
- <widget row="11" column="0" >
- <class>QLabel</class>
- <property stdset="1">
- <name>name</name>
- <cstring>prefixLabel</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Prefix</string>
- </property>
+ <cstring>Layout23</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>serverLabel</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Server</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>serverLine</cstring>
+ </property>
+ </widget>
+ </hbox>
</widget>
- <widget row="11" column="1" >
- <class>QLineEdit</class>
+ <widget>
+ <class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
- <cstring>prefixLine</cstring>
- </property>
+ <cstring>Layout24</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>portLabel</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Port</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>portLine</cstring>
+ </property>
+ </widget>
+ </hbox>
</widget>
- <widget row="8" column="0" >
- <class>QLabel</class>
+ <widget>
+ <class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
- <cstring>userLabel</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>User</string>
- </property>
+ <cstring>Layout16</cstring>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Use secure sockets:</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QComboBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>ComboBox1</cstring>
+ </property>
+ </widget>
+ <widget>
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>CommandEdit</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>ssh $SERVER exec</string>
+ </property>
+ </widget>
+ </vbox>
</widget>
- <widget row="7" column="0" rowspan="1" colspan="2" >
+ <widget>
<class>Line</class>
@@ -198,3 +227,77 @@
</widget>
- <widget row="10" column="0" rowspan="1" colspan="2" >
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout25</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>userLabel</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>User</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>userLine</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout26</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>passLabel</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Password</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>passLine</cstring>
+ </property>
+ <property stdset="1">
+ <name>echoMode</name>
+ <enum>Password</enum>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget>
<class>Line</class>
@@ -209,18 +312,128 @@
</widget>
- <widget row="9" column="0" >
- <class>QLabel</class>
+ <widget>
+ <class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
- <cstring>passLabel</cstring>
- </property>
+ <cstring>Layout27</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>prefixLabel</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Prefix</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>prefixLine</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
<property stdset="1">
- <name>text</name>
- <string>Password</string>
- </property>
+ <name>name</name>
+ <cstring>Layout11</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Local storage folder:</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>localFolder</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string></string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout12</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>CheckBoxDown</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Download only messages smaller</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QSpinBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>SpinBoxDown</cstring>
+ </property>
+ <property stdset="1">
+ <name>suffix</name>
+ <string>kB</string>
+ </property>
+ <property stdset="1">
+ <name>maxValue</name>
+ <number>99999</number>
+ </property>
+ <property stdset="1">
+ <name>minValue</name>
+ <number>1</number>
+ </property>
+ </widget>
+ </hbox>
</widget>
- <widget row="6" column="0" rowspan="1" colspan="2" >
- <class>QLineEdit</class>
+ <widget>
+ <class>QCheckBox</class>
<property stdset="1">
<name>name</name>
- <cstring>CommandEdit</cstring>
+ <cstring>CheckBoxLeaveOn</cstring>
</property>
@@ -228,24 +441,27 @@
<name>text</name>
- <string>ssh $SERVER exec</string>
+ <string>Leave Messages on Server</string>
</property>
</widget>
- <widget row="5" column="0" rowspan="1" colspan="2" >
- <class>QComboBox</class>
- <property stdset="1">
+ <spacer>
+ <property>
<name>name</name>
- <cstring>ComboBox1</cstring>
+ <cstring>spacer</cstring>
</property>
- </widget>
- <widget row="4" column="0" rowspan="1" colspan="2" >
- <class>QLabel</class>
<property stdset="1">
- <name>name</name>
- <cstring>TextLabel1</cstring>
+ <name>orientation</name>
+ <enum>Vertical</enum>
</property>
<property stdset="1">
- <name>text</name>
- <string>Use secure sockets:</string>
+ <name>sizeType</name>
+ <enum>Expanding</enum>
</property>
- </widget>
- </grid>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
</widget>
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
@@ -179,2 +179,8 @@ void IMAPaccount::read()
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;
@@ -198,2 +204,8 @@ void IMAPaccount::save()
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();
@@ -261,2 +273,3 @@ void POP3account::read()
QDateTime dt ( QDate ( 2004, 1, 1 ), QTime( 0,0,0) );
+ leaveOnServer = conf->readBoolEntry("LeaveOnServer",false);
lastFetch = dt.addSecs( lf );
@@ -284,2 +297,3 @@ void POP3account::save()
conf->writeEntry( "LastFetch", lf );
+ conf->writeEntry( "LeaveOnServer", leaveOnServer);
conf->write();
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
@@ -51,2 +51,5 @@ public:
+ bool getLeaveOnServer(){ return leaveOnServer;}
+ void setLeaveOnServer(bool b){ leaveOnServer = b;}
+
virtual QString getFileName() { return accountName; }
@@ -64,2 +67,3 @@ protected:
QDateTime lastFetch;
+ bool leaveOnServer;
};
diff --git a/kmicromail/pop3configui.ui b/kmicromail/pop3configui.ui
index a2d43bd..6acd394 100644
--- a/kmicromail/pop3configui.ui
+++ b/kmicromail/pop3configui.ui
@@ -13,4 +13,4 @@
<y>0</y>
- <width>322</width>
- <height>404</height>
+ <width>306</width>
+ <height>371</height>
</rect>
@@ -30,3 +30,3 @@
<name>margin</name>
- <number>11</number>
+ <number>3</number>
</property>
@@ -34,3 +34,3 @@
<name>spacing</name>
- <number>6</number>
+ <number>1</number>
</property>
@@ -407,2 +407,13 @@
</widget>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>CheckBoxLeaveOn</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Leave Messages on Server</string>
+ </property>
+ </widget>
<spacer>