summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (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
@@ -71,91 +71,101 @@ void POP3viewItem::refresh()
71 QListViewItem*item = 0; 71 QListViewItem*item = 0;
72 for ( it = folders->begin(); it!=folders->end(); ++it) 72 for ( it = folders->begin(); it!=folders->end(); ++it)
73 { 73 {
74 item = new POP3folderItem( (*it), this , item ); 74 item = new POP3folderItem( (*it), this , item );
75 item->setSelectable( (*it)->may_select()); 75 item->setSelectable( (*it)->may_select());
76 } 76 }
77 delete folders; 77 delete folders;
78} 78}
79 79
80RECBODYP POP3viewItem::fetchBody( const RecMailP &mail ) 80RECBODYP POP3viewItem::fetchBody( const RecMailP &mail )
81{ 81{
82 82
83 return wrapper->fetchBody( mail ); 83 return wrapper->fetchBody( mail );
84} 84}
85 85
86QPopupMenu * POP3viewItem::getContextMenu() 86QPopupMenu * POP3viewItem::getContextMenu()
87{ 87{
88 QPopupMenu *m = new QPopupMenu(0); 88 QPopupMenu *m = new QPopupMenu(0);
89 if (m) 89 if (m)
90 { 90 {
91 if (!account->getOffline()) 91 if (!account->getOffline())
92 { 92 {
93 m->insertItem(QObject::tr("Disconnect",contextName),0); 93 m->insertItem(QObject::tr("Disconnect",contextName),0);
94 m->insertItem(QObject::tr("Set offline",contextName),1); 94 m->insertItem(QObject::tr("Set offline",contextName),1);
95 m->insertItem(QObject::tr("Download messages",contextName),2);
95 } 96 }
96 else 97 else
97 { 98 {
98 m->insertItem(QObject::tr("Set online",contextName),1); 99 m->insertItem(QObject::tr("Set online",contextName),1);
99 } 100 }
100 } 101 }
101 return m; 102 return m;
102} 103}
103 104
104void POP3viewItem::disconnect() 105void POP3viewItem::disconnect()
105{ 106{
106 QListViewItem *child = firstChild(); 107 QListViewItem *child = firstChild();
107 while ( child ) 108 while ( child )
108 { 109 {
109 QListViewItem *tmp = child; 110 QListViewItem *tmp = child;
110 child = child->nextSibling(); 111 child = child->nextSibling();
111 delete tmp; 112 delete tmp;
112 } 113 }
113 wrapper->logout(); 114 wrapper->logout();
114} 115}
115 116
116void POP3viewItem::setOnOffline() 117void POP3viewItem::setOnOffline()
117{ 118{
118 if (!account->getOffline()) 119 if (!account->getOffline())
119 { 120 {
120 disconnect(); 121 disconnect();
121 } 122 }
122 account->setOffline(!account->getOffline()); 123 account->setOffline(!account->getOffline());
123 account->save(); 124 account->save();
124 SETPIX(PIXMAP_POP3FOLDER); 125 SETPIX(PIXMAP_POP3FOLDER);
125 refresh(); 126 refresh();
126} 127}
127 128
128void POP3viewItem::contextMenuSelected(int which) 129void POP3viewItem::contextMenuSelected(int which)
129{ 130{
130 switch (which) 131 switch (which)
131 { 132 {
132 case 0: 133 case 0:
133 disconnect(); 134 disconnect();
134 break; 135 break;
135 case 1: 136 case 1:
136 setOnOffline(); 137 setOnOffline();
137 break; 138 break;
139 case 2: // daunlood
140 AccountView*bl = accountView();
141 if (!bl) return;
142 AccountViewItem* in = findSubItem( "inbox" , 0);
143 if ( ! in )
144 return;
145 bl->downloadMailsInbox(in->getFolder() ,getWrapper());
146 setOnOffline();
147 break;
138 } 148 }
139} 149}
140 150
141POP3folderItem::~POP3folderItem() 151POP3folderItem::~POP3folderItem()
142{} 152{}
143 153
144POP3folderItem::POP3folderItem( const FolderP&folderInit, POP3viewItem *parent , QListViewItem*after ) 154POP3folderItem::POP3folderItem( const FolderP&folderInit, POP3viewItem *parent , QListViewItem*after )
145 : AccountViewItem(folderInit,parent,after ) 155 : AccountViewItem(folderInit,parent,after )
146{ 156{
147 pop3 = parent; 157 pop3 = parent;
148 if (folder->getDisplayName().lower()!="inbox") 158 if (folder->getDisplayName().lower()!="inbox")
149 { 159 {
150 setPixmap( 0, PIXMAP_POP3FOLDER ); 160 setPixmap( 0, PIXMAP_POP3FOLDER );
151 } 161 }
152 else 162 else
153 { 163 {
154 setPixmap( 0, PIXMAP_INBOXFOLDER); 164 setPixmap( 0, PIXMAP_INBOXFOLDER);
155 } 165 }
156 setText( 0, folder->getDisplayName() ); 166 setText( 0, folder->getDisplayName() );
157} 167}
158 168
159void POP3folderItem::refresh(QValueList<RecMailP>&target) 169void POP3folderItem::refresh(QValueList<RecMailP>&target)
160{ 170{
161 if (folder->may_select()) 171 if (folder->may_select())
@@ -1084,49 +1094,49 @@ void AccountViewItem::deleteAllMail(AbstractMail*wrapper,const FolderP&folder)
1084 if (yesno == 0) 1094 if (yesno == 0)
1085 { 1095 {
1086 if (wrapper->deleteAllMail(folder)) 1096 if (wrapper->deleteAllMail(folder))
1087 { 1097 {
1088 AccountView * view = (AccountView*)listView(); 1098 AccountView * view = (AccountView*)listView();
1089 if (view) view->refreshCurrent(); 1099 if (view) view->refreshCurrent();
1090 } 1100 }
1091 } 1101 }
1092} 1102}
1093 1103
1094void AccountViewItem::removeChilds() 1104void AccountViewItem::removeChilds()
1095{ 1105{
1096 QListViewItem *child = firstChild(); 1106 QListViewItem *child = firstChild();
1097 while ( child ) 1107 while ( child )
1098 { 1108 {
1099 QListViewItem *tmp = child; 1109 QListViewItem *tmp = child;
1100 child = child->nextSibling(); 1110 child = child->nextSibling();
1101 delete tmp; 1111 delete tmp;
1102 } 1112 }
1103} 1113}
1104 1114
1105bool AccountViewItem::matchName(const QString&name)const 1115bool AccountViewItem::matchName(const QString&name)const
1106{ 1116{
1107 if (!folder) return false; 1117 if (!folder) return false;
1108 return folder->getDisplayName()==name; 1118 return folder->getDisplayName().lower()==name.lower();
1109} 1119}
1110 1120
1111 1121
1112AccountViewItem*AccountViewItem::findSubItem(const QString&path,AccountViewItem*start) 1122AccountViewItem*AccountViewItem::findSubItem(const QString&path,AccountViewItem*start)
1113{ 1123{
1114 AccountViewItem*pitem,*sitem; 1124 AccountViewItem*pitem,*sitem;
1115 if (!start) pitem = (AccountViewItem*)firstChild(); 1125 if (!start) pitem = (AccountViewItem*)firstChild();
1116 else pitem = (AccountViewItem*)start->firstChild(); 1126 else pitem = (AccountViewItem*)start->firstChild();
1117 while (pitem) 1127 while (pitem)
1118 { 1128 {
1119 if (pitem->matchName(path)) 1129 if (pitem->matchName(path))
1120 { 1130 {
1121 break; 1131 break;
1122 } 1132 }
1123 if (pitem->childCount()>0) 1133 if (pitem->childCount()>0)
1124 { 1134 {
1125 sitem = findSubItem(path,pitem); 1135 sitem = findSubItem(path,pitem);
1126 if (sitem) 1136 if (sitem)
1127 { 1137 {
1128 pitem = sitem; 1138 pitem = sitem;
1129 break; 1139 break;
1130 } 1140 }
1131 } 1141 }
1132 pitem=(AccountViewItem*)pitem->nextSibling(); 1142 pitem=(AccountViewItem*)pitem->nextSibling();
diff --git a/kmicromail/accountitem.h b/kmicromail/accountitem.h
index f125eeb..faf919d 100644
--- a/kmicromail/accountitem.h
+++ b/kmicromail/accountitem.h
@@ -15,48 +15,49 @@ class POP3account;
15class NNTPaccount; 15class NNTPaccount;
16class IMAPaccount; 16class IMAPaccount;
17class AbstractMail; 17class AbstractMail;
18class Folder; 18class Folder;
19 19
20#define RECBODYP Opie::Core::OSmartPointer<RecBody> 20#define RECBODYP Opie::Core::OSmartPointer<RecBody>
21 21
22class AccountViewItem : public QListViewItem 22class AccountViewItem : public QListViewItem
23{ 23{
24 24
25public: 25public:
26 AccountViewItem( AccountView *parent ); 26 AccountViewItem( AccountView *parent );
27 AccountViewItem( QListViewItem *parent); 27 AccountViewItem( QListViewItem *parent);
28 AccountViewItem( QListViewItem *parent , QListViewItem*after ); 28 AccountViewItem( QListViewItem *parent , QListViewItem*after );
29 AccountViewItem( const Opie::Core::OSmartPointer<Folder>&folderInit,QListViewItem *parent , QListViewItem*after ); 29 AccountViewItem( const Opie::Core::OSmartPointer<Folder>&folderInit,QListViewItem *parent , QListViewItem*after );
30 30
31 virtual ~AccountViewItem(); 31 virtual ~AccountViewItem();
32 virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&)=0; 32 virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&)=0;
33 virtual RECBODYP fetchBody(const Opie::Core::OSmartPointer<RecMail>&)=0; 33 virtual RECBODYP fetchBody(const Opie::Core::OSmartPointer<RecMail>&)=0;
34 virtual QPopupMenu * getContextMenu(){return 0;}; 34 virtual QPopupMenu * getContextMenu(){return 0;};
35 virtual void contextMenuSelected(int){} 35 virtual void contextMenuSelected(int){}
36 virtual AccountView*accountView(); 36 virtual AccountView*accountView();
37 virtual bool matchName(const QString&name)const; 37 virtual bool matchName(const QString&name)const;
38 virtual bool isDraftfolder(); 38 virtual bool isDraftfolder();
39 Opie::Core::OSmartPointer<Folder> getFolder() { return folder; };
39 40
40protected: 41protected:
41 AccountViewItem*findSubItem(const QString&path,AccountViewItem*start=0); 42 AccountViewItem*findSubItem(const QString&path,AccountViewItem*start=0);
42 virtual void init(); 43 virtual void init();
43 virtual void removeChilds(); 44 virtual void removeChilds();
44 virtual void deleteAllMail(AbstractMail*wrapper,const Opie::Core::OSmartPointer<Folder>&f); 45 virtual void deleteAllMail(AbstractMail*wrapper,const Opie::Core::OSmartPointer<Folder>&f);
45 static const QString contextName; 46 static const QString contextName;
46 AccountView*m_Backlink; 47 AccountView*m_Backlink;
47 Opie::Core::OSmartPointer<Folder> folder; 48 Opie::Core::OSmartPointer<Folder> folder;
48}; 49};
49 50
50class POP3viewItem : public AccountViewItem 51class POP3viewItem : public AccountViewItem
51{ 52{
52 53
53public: 54public:
54 POP3viewItem( POP3account *a, AccountView *parent ); 55 POP3viewItem( POP3account *a, AccountView *parent );
55 virtual ~POP3viewItem(); 56 virtual ~POP3viewItem();
56 virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&target ); 57 virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&target );
57 virtual RECBODYP fetchBody( const Opie::Core::OSmartPointer<RecMail> &mail ); 58 virtual RECBODYP fetchBody( const Opie::Core::OSmartPointer<RecMail> &mail );
58 AbstractMail *getWrapper(); 59 AbstractMail *getWrapper();
59 virtual QPopupMenu * getContextMenu(); 60 virtual QPopupMenu * getContextMenu();
60 virtual void contextMenuSelected(int); 61 virtual void contextMenuSelected(int);
61 62
62protected: 63protected:
diff --git a/kmicromail/accountview.cpp b/kmicromail/accountview.cpp
index 4ead545..85523b1 100644
--- a/kmicromail/accountview.cpp
+++ b/kmicromail/accountview.cpp
@@ -118,48 +118,75 @@ RecBodyP AccountView::fetchBody(const RecMailP&aMail)
118 if (!item) return new RecBody(); 118 if (!item) return new RecBody();
119 AccountViewItem *view = static_cast<AccountViewItem *>(item); 119 AccountViewItem *view = static_cast<AccountViewItem *>(item);
120 return view->fetchBody(aMail); 120 return view->fetchBody(aMail);
121} 121}
122 122
123void AccountView::setupFolderselect(Selectstore*sels) 123void AccountView::setupFolderselect(Selectstore*sels)
124{ 124{
125 sels->showMaximized(); 125 sels->showMaximized();
126 QStringList sFolders; 126 QStringList sFolders;
127 unsigned int i = 0; 127 unsigned int i = 0;
128 for (i=0; i < mhAccounts.count();++i) 128 for (i=0; i < mhAccounts.count();++i)
129 { 129 {
130 mhAccounts[i]->refresh(false); 130 mhAccounts[i]->refresh(false);
131 sFolders = mhAccounts[i]->subFolders(); 131 sFolders = mhAccounts[i]->subFolders();
132 sels->addAccounts(mhAccounts[i]->getWrapper(),sFolders); 132 sels->addAccounts(mhAccounts[i]->getWrapper(),sFolders);
133 } 133 }
134 for (i=0; i < imapAccounts.count();++i) 134 for (i=0; i < imapAccounts.count();++i)
135 { 135 {
136 if (imapAccounts[i]->offline()) 136 if (imapAccounts[i]->offline())
137 continue; 137 continue;
138 imapAccounts[i]->refreshFolders(false); 138 imapAccounts[i]->refreshFolders(false);
139 sels->addAccounts(imapAccounts[i]->getWrapper(),imapAccounts[i]->subFolders()); 139 sels->addAccounts(imapAccounts[i]->getWrapper(),imapAccounts[i]->subFolders());
140 } 140 }
141} 141}
142void AccountView::downloadMailsInbox(const FolderP&fromFolder,AbstractMail*fromWrapper)
143{
144 AbstractMail*targetMail = 0;
145 QString targetFolder = "";
146 Selectstore sels;
147 setupFolderselect(&sels);
148 if (!sels.exec()) return;
149 targetMail = sels.currentMail();
150 targetFolder = sels.currentFolder();
151 if ( (fromWrapper==targetMail && fromFolder->getName()==targetFolder) ||
152 targetFolder.isEmpty())
153 {
154 return;
155 }
156 if (sels.newFolder() && !targetMail->createMbox(targetFolder))
157 {
158 QMessageBox::critical(0,tr("Error creating new Folder"),
159 tr("<center>Error while creating<br>new folder - breaking.</center>"));
160 return;
161 }
162 int maxsize = 0;
163 if ( sels.useSize->isChecked())
164 maxsize = sels.sizeSpinBox->value();
165
166 fromWrapper->mvcpAllMails(fromFolder,targetFolder,targetMail,sels.moveMails(), maxsize);
167 refreshCurrent();
168}
142 169
143void AccountView::downloadMails(const FolderP&fromFolder,AbstractMail*fromWrapper) 170void AccountView::downloadMails(const FolderP&fromFolder,AbstractMail*fromWrapper)
144{ 171{
145 AbstractMail*targetMail = 0; 172 AbstractMail*targetMail = 0;
146 QString targetFolder = ""; 173 QString targetFolder = "";
147 Selectstore sels; 174 Selectstore sels;
148 setupFolderselect(&sels); 175 setupFolderselect(&sels);
149 if (!sels.exec()) return; 176 if (!sels.exec()) return;
150 targetMail = sels.currentMail(); 177 targetMail = sels.currentMail();
151 targetFolder = sels.currentFolder(); 178 targetFolder = sels.currentFolder();
152 if ( (fromWrapper==targetMail && fromFolder->getName()==targetFolder) || 179 if ( (fromWrapper==targetMail && fromFolder->getName()==targetFolder) ||
153 targetFolder.isEmpty()) 180 targetFolder.isEmpty())
154 { 181 {
155 return; 182 return;
156 } 183 }
157 if (sels.newFolder() && !targetMail->createMbox(targetFolder)) 184 if (sels.newFolder() && !targetMail->createMbox(targetFolder))
158 { 185 {
159 QMessageBox::critical(0,tr("Error creating new Folder"), 186 QMessageBox::critical(0,tr("Error creating new Folder"),
160 tr("<center>Error while creating<br>new folder - breaking.</center>")); 187 tr("<center>Error while creating<br>new folder - breaking.</center>"));
161 return; 188 return;
162 } 189 }
163 int maxsize = 0; 190 int maxsize = 0;
164 if ( sels.useSize->isChecked()) 191 if ( sels.useSize->isChecked())
165 maxsize = sels.sizeSpinBox->value(); 192 maxsize = sels.sizeSpinBox->value();
diff --git a/kmicromail/accountview.h b/kmicromail/accountview.h
index 787b0b0..fcf33d1 100644
--- a/kmicromail/accountview.h
+++ b/kmicromail/accountview.h
@@ -2,44 +2,45 @@
2#define ACCOUNTVIEW_H 2#define ACCOUNTVIEW_H
3 3
4#include <qlistview.h> 4#include <qlistview.h>
5#include <qlist.h> 5#include <qlist.h>
6#include <opie2/osmartpointer.h> 6#include <opie2/osmartpointer.h>
7#include <libmailwrapper/mailtypes.h> 7#include <libmailwrapper/mailtypes.h>
8 8
9class Selectstore; 9class Selectstore;
10class Folder; 10class Folder;
11class AbstractMail; 11class AbstractMail;
12class Account; 12class Account;
13class IMAPviewItem; 13class IMAPviewItem;
14class MHviewItem; 14class MHviewItem;
15 15
16class AccountView : public QListView 16class AccountView : public QListView
17{ 17{
18 Q_OBJECT 18 Q_OBJECT
19 19
20public: 20public:
21 AccountView( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); 21 AccountView( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 );
22 virtual ~AccountView(); 22 virtual ~AccountView();
23 virtual void populate( QList<Account> list ); 23 virtual void populate( QList<Account> list );
24 virtual RecBodyP fetchBody(const Opie::Core::OSmartPointer<RecMail>&aMail); 24 virtual RecBodyP fetchBody(const Opie::Core::OSmartPointer<RecMail>&aMail);
25 virtual void downloadMails(const Opie::Core::OSmartPointer<Folder>&fromFolder,AbstractMail*fromWrapper); 25 virtual void downloadMails(const Opie::Core::OSmartPointer<Folder>&fromFolder,AbstractMail*fromWrapper);
26 virtual void downloadMailsInbox(const Opie::Core::OSmartPointer<Folder>&fromFolder,AbstractMail*fromWrapper);
26 virtual bool currentisDraft(); 27 virtual bool currentisDraft();
27 28
28public slots: 29public slots:
29 virtual void refreshAll(); 30 virtual void refreshAll();
30 virtual void refresh(QListViewItem *item); 31 virtual void refresh(QListViewItem *item);
31 virtual void refreshCurrent(); 32 virtual void refreshCurrent();
32 virtual void slotHold(int, QListViewItem *,const QPoint&,int); 33 virtual void slotHold(int, QListViewItem *,const QPoint&,int);
33 virtual void slotContextMenu(int id); 34 virtual void slotContextMenu(int id);
34 void setupFolderselect(Selectstore*sels); 35 void setupFolderselect(Selectstore*sels);
35 36
36signals: 37signals:
37 void refreshMailview(const QValueList<RecMailP>& ); 38 void refreshMailview(const QValueList<RecMailP>& );
38 39
39protected: 40protected:
40 QListViewItem* m_currentItem; 41 QListViewItem* m_currentItem;
41 QValueList<IMAPviewItem*> imapAccounts; 42 QValueList<IMAPviewItem*> imapAccounts;
42 QValueList<MHviewItem*> mhAccounts; 43 QValueList<MHviewItem*> mhAccounts;
43}; 44};
44 45
45#endif 46#endif
diff --git a/kmicromail/imapconfigui.ui b/kmicromail/imapconfigui.ui
index a96c1a2..2e4c9ca 100644
--- a/kmicromail/imapconfigui.ui
+++ b/kmicromail/imapconfigui.ui
@@ -1,259 +1,475 @@
1<!DOCTYPE UI><UI> 1<!DOCTYPE UI><UI>
2<class>IMAPconfigUI</class> 2<class>IMAPconfigUI</class>
3<widget> 3<widget>
4 <class>QDialog</class> 4 <class>QDialog</class>
5 <property stdset="1"> 5 <property stdset="1">
6 <name>name</name> 6 <name>name</name>
7 <cstring>IMAPconfigUI</cstring> 7 <cstring>IMAPconfigUI</cstring>
8 </property> 8 </property>
9 <property stdset="1"> 9 <property stdset="1">
10 <name>geometry</name> 10 <name>geometry</name>
11 <rect> 11 <rect>
12 <x>0</x> 12 <x>0</x>
13 <y>0</y> 13 <y>0</y>
14 <width>425</width> 14 <width>306</width>
15 <height>428</height> 15 <height>396</height>
16 </rect> 16 </rect>
17 </property> 17 </property>
18 <property stdset="1"> 18 <property stdset="1">
19 <name>caption</name> 19 <name>caption</name>
20 <string>Configure IMAP</string> 20 <string>Configure IMAP</string>
21 </property> 21 </property>
22 <property> 22 <property>
23 <name>layoutMargin</name> 23 <name>layoutMargin</name>
24 </property> 24 </property>
25 <property> 25 <property>
26 <name>layoutSpacing</name> 26 <name>layoutSpacing</name>
27 </property> 27 </property>
28 <grid> 28 <vbox>
29 <property stdset="1"> 29 <property stdset="1">
30 <name>margin</name> 30 <name>margin</name>
31 <number>3</number> 31 <number>3</number>
32 </property> 32 </property>
33 <property stdset="1"> 33 <property stdset="1">
34 <name>spacing</name> 34 <name>spacing</name>
35 <number>3</number> 35 <number>1</number>
36 </property> 36 </property>
37 <widget row="2" column="1" > 37 <widget>
38 <class>QLineEdit</class> 38 <class>QLayoutWidget</class>
39 <property stdset="1"> 39 <property stdset="1">
40 <name>name</name> 40 <name>name</name>
41 <cstring>serverLine</cstring> 41 <cstring>Layout22</cstring>
42 </property> 42 </property>
43 </widget> 43 <hbox>
44 <widget row="3" column="0" > 44 <property stdset="1">
45 <class>QLabel</class> 45 <name>margin</name>
46 <property stdset="1"> 46 <number>0</number>
47 <name>name</name> 47 </property>
48 <cstring>portLabel</cstring> 48 <property stdset="1">
49 </property> 49 <name>spacing</name>
50 <property stdset="1"> 50 <number>6</number>
51 <name>text</name> 51 </property>
52 <string>Port</string> 52 <widget>
53 </property> 53 <class>QLabel</class>
54 <property stdset="1">
55 <name>name</name>
56 <cstring>accountLabel</cstring>
57 </property>
58 <property stdset="1">
59 <name>text</name>
60 <string>Account</string>
61 </property>
62 </widget>
63 <widget>
64 <class>QLineEdit</class>
65 <property stdset="1">
66 <name>name</name>
67 <cstring>accountLine</cstring>
68 </property>
69 <property>
70 <name>toolTip</name>
71 <string>Name of the Account</string>
72 </property>
73 </widget>
74 </hbox>
54 </widget> 75 </widget>
55 <widget row="2" column="0" > 76 <widget>
56 <class>QLabel</class>
57 <property stdset="1">
58 <name>name</name>
59 <cstring>serverLabel</cstring>
60 </property>
61 <property stdset="1">
62 <name>text</name>
63 <string>Server</string>
64 </property>
65 </widget>
66 <widget row="3" column="1" >
67 <class>QLineEdit</class>
68 <property stdset="1">
69 <name>name</name>
70 <cstring>portLine</cstring>
71 </property>
72 </widget>
73 <widget row="0" column="1" >
74 <class>QLineEdit</class>
75 <property stdset="1">
76 <name>name</name>
77 <cstring>accountLine</cstring>
78 </property>
79 <property>
80 <name>toolTip</name>
81 <string>Name of the Account</string>
82 </property>
83 </widget>
84 <widget row="0" column="0" >
85 <class>QLabel</class>
86 <property stdset="1">
87 <name>name</name>
88 <cstring>accountLabel</cstring>
89 </property>
90 <property stdset="1">
91 <name>text</name>
92 <string>Account</string>
93 </property>
94 </widget>
95 <widget row="1" column="0" rowspan="1" colspan="2" >
96 <class>Line</class> 77 <class>Line</class>
97 <property stdset="1"> 78 <property stdset="1">
98 <name>name</name> 79 <name>name</name>
99 <cstring>line1</cstring> 80 <cstring>line1</cstring>
100 </property> 81 </property>
101 <property stdset="1"> 82 <property stdset="1">
102 <name>orientation</name> 83 <name>orientation</name>
103 <enum>Horizontal</enum> 84 <enum>Horizontal</enum>
104 </property> 85 </property>
105 </widget> 86 </widget>
106 <spacer row="12" column="1" > 87 <widget>
107 <property> 88 <class>QLayoutWidget</class>
108 <name>name</name>
109 <cstring>spacer</cstring>
110 </property>
111 <property stdset="1">
112 <name>orientation</name>
113 <enum>Vertical</enum>
114 </property>
115 <property stdset="1">
116 <name>sizeType</name>
117 <enum>Expanding</enum>
118 </property>
119 <property>
120 <name>sizeHint</name>
121 <size>
122 <width>20</width>
123 <height>20</height>
124 </size>
125 </property>
126 </spacer>
127 <widget row="8" column="1" >
128 <class>QLineEdit</class>
129 <property stdset="1"> 89 <property stdset="1">
130 <name>name</name> 90 <name>name</name>
131 <cstring>userLine</cstring> 91 <cstring>Layout23</cstring>
132 </property> 92 </property>
133 </widget> 93 <hbox>
134 <widget row="9" column="1" > 94 <property stdset="1">
135 <class>QLineEdit</class> 95 <name>margin</name>
136 <property stdset="1"> 96 <number>0</number>
137 <name>name</name> 97 </property>
138 <cstring>passLine</cstring> 98 <property stdset="1">
139 </property> 99 <name>spacing</name>
140 <property stdset="1"> 100 <number>6</number>
141 <name>echoMode</name> 101 </property>
142 <enum>Password</enum> 102 <widget>
143 </property> 103 <class>QLabel</class>
144 </widget> 104 <property stdset="1">
145 <widget row="11" column="0" > 105 <name>name</name>
146 <class>QLabel</class> 106 <cstring>serverLabel</cstring>
147 <property stdset="1"> 107 </property>
148 <name>name</name> 108 <property stdset="1">
149 <cstring>prefixLabel</cstring> 109 <name>text</name>
150 </property> 110 <string>Server</string>
151 <property stdset="1"> 111 </property>
152 <name>text</name> 112 </widget>
153 <string>Prefix</string> 113 <widget>
154 </property> 114 <class>QLineEdit</class>
115 <property stdset="1">
116 <name>name</name>
117 <cstring>serverLine</cstring>
118 </property>
119 </widget>
120 </hbox>
155 </widget> 121 </widget>
156 <widget row="11" column="1" > 122 <widget>
157 <class>QLineEdit</class> 123 <class>QLayoutWidget</class>
158 <property stdset="1"> 124 <property stdset="1">
159 <name>name</name> 125 <name>name</name>
160 <cstring>prefixLine</cstring> 126 <cstring>Layout24</cstring>
161 </property> 127 </property>
128 <hbox>
129 <property stdset="1">
130 <name>margin</name>
131 <number>0</number>
132 </property>
133 <property stdset="1">
134 <name>spacing</name>
135 <number>6</number>
136 </property>
137 <widget>
138 <class>QLabel</class>
139 <property stdset="1">
140 <name>name</name>
141 <cstring>portLabel</cstring>
142 </property>
143 <property stdset="1">
144 <name>text</name>
145 <string>Port</string>
146 </property>
147 </widget>
148 <widget>
149 <class>QLineEdit</class>
150 <property stdset="1">
151 <name>name</name>
152 <cstring>portLine</cstring>
153 </property>
154 </widget>
155 </hbox>
162 </widget> 156 </widget>
163 <widget row="8" column="0" > 157 <widget>
164 <class>QLabel</class> 158 <class>QLayoutWidget</class>
165 <property stdset="1"> 159 <property stdset="1">
166 <name>name</name> 160 <name>name</name>
167 <cstring>userLabel</cstring> 161 <cstring>Layout16</cstring>
168 </property> 162 </property>
169 <property stdset="1"> 163 <vbox>
170 <name>text</name> 164 <property stdset="1">
171 <string>User</string> 165 <name>margin</name>
172 </property> 166 <number>0</number>
167 </property>
168 <property stdset="1">
169 <name>spacing</name>
170 <number>6</number>
171 </property>
172 <widget>
173 <class>QLabel</class>
174 <property stdset="1">
175 <name>name</name>
176 <cstring>TextLabel1</cstring>
177 </property>
178 <property stdset="1">
179 <name>text</name>
180 <string>Use secure sockets:</string>
181 </property>
182 </widget>
183 <widget>
184 <class>QComboBox</class>
185 <property stdset="1">
186 <name>name</name>
187 <cstring>ComboBox1</cstring>
188 </property>
189 </widget>
190 <widget>
191 <class>QLineEdit</class>
192 <property stdset="1">
193 <name>name</name>
194 <cstring>CommandEdit</cstring>
195 </property>
196 <property stdset="1">
197 <name>text</name>
198 <string>ssh $SERVER exec</string>
199 </property>
200 </widget>
201 </vbox>
173 </widget> 202 </widget>
174 <widget row="7" column="0" rowspan="1" colspan="2" > 203 <widget>
175 <class>Line</class> 204 <class>Line</class>
176 <property stdset="1"> 205 <property stdset="1">
177 <name>name</name> 206 <name>name</name>
178 <cstring>line2</cstring> 207 <cstring>line2</cstring>
179 </property> 208 </property>
180 <property stdset="1"> 209 <property stdset="1">
181 <name>enabled</name> 210 <name>enabled</name>
182 <bool>true</bool> 211 <bool>true</bool>
183 </property> 212 </property>
184 <property stdset="1"> 213 <property stdset="1">
185 <name>caption</name> 214 <name>caption</name>
186 <string></string> 215 <string></string>
187 </property> 216 </property>
188 <property stdset="1"> 217 <property stdset="1">
189 <name>orientation</name> 218 <name>orientation</name>
190 <enum>Horizontal</enum> 219 <enum>Horizontal</enum>
191 </property> 220 </property>
192 <property> 221 <property>
193 <name>layoutMargin</name> 222 <name>layoutMargin</name>
194 </property> 223 </property>
195 <property> 224 <property>
196 <name>layoutSpacing</name> 225 <name>layoutSpacing</name>
197 </property> 226 </property>
198 </widget> 227 </widget>
199 <widget row="10" column="0" rowspan="1" colspan="2" > 228 <widget>
229 <class>QLayoutWidget</class>
230 <property stdset="1">
231 <name>name</name>
232 <cstring>Layout25</cstring>
233 </property>
234 <hbox>
235 <property stdset="1">
236 <name>margin</name>
237 <number>0</number>
238 </property>
239 <property stdset="1">
240 <name>spacing</name>
241 <number>6</number>
242 </property>
243 <widget>
244 <class>QLabel</class>
245 <property stdset="1">
246 <name>name</name>
247 <cstring>userLabel</cstring>
248 </property>
249 <property stdset="1">
250 <name>text</name>
251 <string>User</string>
252 </property>
253 </widget>
254 <widget>
255 <class>QLineEdit</class>
256 <property stdset="1">
257 <name>name</name>
258 <cstring>userLine</cstring>
259 </property>
260 </widget>
261 </hbox>
262 </widget>
263 <widget>
264 <class>QLayoutWidget</class>
265 <property stdset="1">
266 <name>name</name>
267 <cstring>Layout26</cstring>
268 </property>
269 <hbox>
270 <property stdset="1">
271 <name>margin</name>
272 <number>0</number>
273 </property>
274 <property stdset="1">
275 <name>spacing</name>
276 <number>6</number>
277 </property>
278 <widget>
279 <class>QLabel</class>
280 <property stdset="1">
281 <name>name</name>
282 <cstring>passLabel</cstring>
283 </property>
284 <property stdset="1">
285 <name>text</name>
286 <string>Password</string>
287 </property>
288 </widget>
289 <widget>
290 <class>QLineEdit</class>
291 <property stdset="1">
292 <name>name</name>
293 <cstring>passLine</cstring>
294 </property>
295 <property stdset="1">
296 <name>echoMode</name>
297 <enum>Password</enum>
298 </property>
299 </widget>
300 </hbox>
301 </widget>
302 <widget>
200 <class>Line</class> 303 <class>Line</class>
201 <property stdset="1"> 304 <property stdset="1">
202 <name>name</name> 305 <name>name</name>
203 <cstring>Line3</cstring> 306 <cstring>Line3</cstring>
204 </property> 307 </property>
205 <property stdset="1"> 308 <property stdset="1">
206 <name>orientation</name> 309 <name>orientation</name>
207 <enum>Horizontal</enum> 310 <enum>Horizontal</enum>
208 </property> 311 </property>
209 </widget> 312 </widget>
210 <widget row="9" column="0" > 313 <widget>
211 <class>QLabel</class> 314 <class>QLayoutWidget</class>
212 <property stdset="1"> 315 <property stdset="1">
213 <name>name</name> 316 <name>name</name>
214 <cstring>passLabel</cstring> 317 <cstring>Layout27</cstring>
215 </property> 318 </property>
319 <hbox>
320 <property stdset="1">
321 <name>margin</name>
322 <number>0</number>
323 </property>
324 <property stdset="1">
325 <name>spacing</name>
326 <number>6</number>
327 </property>
328 <widget>
329 <class>QLabel</class>
330 <property stdset="1">
331 <name>name</name>
332 <cstring>prefixLabel</cstring>
333 </property>
334 <property stdset="1">
335 <name>text</name>
336 <string>Prefix</string>
337 </property>
338 </widget>
339 <widget>
340 <class>QLineEdit</class>
341 <property stdset="1">
342 <name>name</name>
343 <cstring>prefixLine</cstring>
344 </property>
345 </widget>
346 </hbox>
347 </widget>
348 <widget>
349 <class>QLayoutWidget</class>
216 <property stdset="1"> 350 <property stdset="1">
217 <name>text</name> 351 <name>name</name>
218 <string>Password</string> 352 <cstring>Layout11</cstring>
219 </property> 353 </property>
354 <hbox>
355 <property stdset="1">
356 <name>margin</name>
357 <number>0</number>
358 </property>
359 <property stdset="1">
360 <name>spacing</name>
361 <number>6</number>
362 </property>
363 <widget>
364 <class>QLabel</class>
365 <property stdset="1">
366 <name>name</name>
367 <cstring>TextLabel1_2</cstring>
368 </property>
369 <property stdset="1">
370 <name>text</name>
371 <string>Local storage folder:</string>
372 </property>
373 </widget>
374 <widget>
375 <class>QLineEdit</class>
376 <property stdset="1">
377 <name>name</name>
378 <cstring>localFolder</cstring>
379 </property>
380 <property stdset="1">
381 <name>text</name>
382 <string></string>
383 </property>
384 </widget>
385 </hbox>
386 </widget>
387 <widget>
388 <class>QLayoutWidget</class>
389 <property stdset="1">
390 <name>name</name>
391 <cstring>Layout12</cstring>
392 </property>
393 <hbox>
394 <property stdset="1">
395 <name>margin</name>
396 <number>0</number>
397 </property>
398 <property stdset="1">
399 <name>spacing</name>
400 <number>6</number>
401 </property>
402 <widget>
403 <class>QCheckBox</class>
404 <property stdset="1">
405 <name>name</name>
406 <cstring>CheckBoxDown</cstring>
407 </property>
408 <property stdset="1">
409 <name>text</name>
410 <string>Download only messages smaller</string>
411 </property>
412 </widget>
413 <widget>
414 <class>QSpinBox</class>
415 <property stdset="1">
416 <name>name</name>
417 <cstring>SpinBoxDown</cstring>
418 </property>
419 <property stdset="1">
420 <name>suffix</name>
421 <string>kB</string>
422 </property>
423 <property stdset="1">
424 <name>maxValue</name>
425 <number>99999</number>
426 </property>
427 <property stdset="1">
428 <name>minValue</name>
429 <number>1</number>
430 </property>
431 </widget>
432 </hbox>
220 </widget> 433 </widget>
221 <widget row="6" column="0" rowspan="1" colspan="2" > 434 <widget>
222 <class>QLineEdit</class> 435 <class>QCheckBox</class>
223 <property stdset="1"> 436 <property stdset="1">
224 <name>name</name> 437 <name>name</name>
225 <cstring>CommandEdit</cstring> 438 <cstring>CheckBoxLeaveOn</cstring>
226 </property> 439 </property>
227 <property stdset="1"> 440 <property stdset="1">
228 <name>text</name> 441 <name>text</name>
229 <string>ssh $SERVER exec</string> 442 <string>Leave Messages on Server</string>
230 </property> 443 </property>
231 </widget> 444 </widget>
232 <widget row="5" column="0" rowspan="1" colspan="2" > 445 <spacer>
233 <class>QComboBox</class> 446 <property>
234 <property stdset="1">
235 <name>name</name> 447 <name>name</name>
236 <cstring>ComboBox1</cstring> 448 <cstring>spacer</cstring>
237 </property> 449 </property>
238 </widget>
239 <widget row="4" column="0" rowspan="1" colspan="2" >
240 <class>QLabel</class>
241 <property stdset="1"> 450 <property stdset="1">
242 <name>name</name> 451 <name>orientation</name>
243 <cstring>TextLabel1</cstring> 452 <enum>Vertical</enum>
244 </property> 453 </property>
245 <property stdset="1"> 454 <property stdset="1">
246 <name>text</name> 455 <name>sizeType</name>
247 <string>Use secure sockets:</string> 456 <enum>Expanding</enum>
248 </property> 457 </property>
249 </widget> 458 <property>
250 </grid> 459 <name>sizeHint</name>
460 <size>
461 <width>20</width>
462 <height>20</height>
463 </size>
464 </property>
465 </spacer>
466 </vbox>
251</widget> 467</widget>
252<tabstops> 468<tabstops>
253 <tabstop>accountLine</tabstop> 469 <tabstop>accountLine</tabstop>
254 <tabstop>serverLine</tabstop> 470 <tabstop>serverLine</tabstop>
255 <tabstop>portLine</tabstop> 471 <tabstop>portLine</tabstop>
256 <tabstop>userLine</tabstop> 472 <tabstop>userLine</tabstop>
257 <tabstop>passLine</tabstop> 473 <tabstop>passLine</tabstop>
258</tabstops> 474</tabstops>
259</UI> 475</UI>
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
@@ -156,67 +156,79 @@ QString IMAPaccount::getUniqueFileName()
156 } while ( imap.contains( "imap-" + unique ) > 0 ); 156 } while ( imap.contains( "imap-" + unique ) > 0 );
157 157
158 return unique; 158 return unique;
159} 159}
160 160
161void IMAPaccount::read() 161void IMAPaccount::read()
162{ 162{
163 Config *conf = new Config( getFileName(), Config::File ); 163 Config *conf = new Config( getFileName(), Config::File );
164 conf->setGroup( "IMAP Account" ); 164 conf->setGroup( "IMAP Account" );
165 accountName = conf->readEntry( "Account","" ); 165 accountName = conf->readEntry( "Account","" );
166 if (accountName.isNull()) accountName = ""; 166 if (accountName.isNull()) accountName = "";
167 server = conf->readEntry( "Server","" ); 167 server = conf->readEntry( "Server","" );
168 if (server.isNull()) server=""; 168 if (server.isNull()) server="";
169 port = conf->readEntry( "Port","" ); 169 port = conf->readEntry( "Port","" );
170 if (port.isNull()) port="143"; 170 if (port.isNull()) port="143";
171 connectionType = conf->readNumEntry( "ConnectionType" ); 171 connectionType = conf->readNumEntry( "ConnectionType" );
172 ssl = conf->readBoolEntry( "SSL",false ); 172 ssl = conf->readBoolEntry( "SSL",false );
173 user = conf->readEntry( "User","" ); 173 user = conf->readEntry( "User","" );
174 if (user.isNull()) user = ""; 174 if (user.isNull()) user = "";
175 password = conf->readEntryCrypt( "Password","" ); 175 password = conf->readEntryCrypt( "Password","" );
176 if (password.isNull()) password = ""; 176 if (password.isNull()) password = "";
177 prefix = conf->readEntry("MailPrefix",""); 177 prefix = conf->readEntry("MailPrefix","");
178 if (prefix.isNull()) prefix = ""; 178 if (prefix.isNull()) prefix = "";
179 offline = conf->readBoolEntry("Offline",false); 179 offline = conf->readBoolEntry("Offline",false);
180 localFolder = conf->readEntry( "LocalFolder" );
181 maxMailSize = conf->readNumEntry( "MaxSize",0 );
182 int lf = conf->readNumEntry( "LastFetch",0 );
183 QDateTime dt ( QDate ( 2004, 1, 1 ), QTime( 0,0,0) );
184 leaveOnServer = conf->readBoolEntry("LeaveOnServer",false);
185 lastFetch = dt.addSecs( lf );
180 delete conf; 186 delete conf;
181} 187}
182 188
183void IMAPaccount::save() 189void IMAPaccount::save()
184{ 190{
185 qDebug("saving %s ",getFileName().latin1() ); 191 qDebug("saving %s ",getFileName().latin1() );
186 Settings::checkDirectory(); 192 Settings::checkDirectory();
187 193
188 Config *conf = new Config( getFileName(), Config::File ); 194 Config *conf = new Config( getFileName(), Config::File );
189 conf->setGroup( "IMAP Account" ); 195 conf->setGroup( "IMAP Account" );
190 conf->writeEntry( "Account", accountName ); 196 conf->writeEntry( "Account", accountName );
191 conf->writeEntry( "Server", server ); 197 conf->writeEntry( "Server", server );
192 conf->writeEntry( "Port", port ); 198 conf->writeEntry( "Port", port );
193 conf->writeEntry( "SSL", ssl ); 199 conf->writeEntry( "SSL", ssl );
194 conf->writeEntry( "ConnectionType", connectionType ); 200 conf->writeEntry( "ConnectionType", connectionType );
195 conf->writeEntry( "User", user ); 201 conf->writeEntry( "User", user );
196 conf->writeEntryCrypt( "Password", password ); 202 conf->writeEntryCrypt( "Password", password );
197 conf->writeEntry( "MailPrefix",prefix); 203 conf->writeEntry( "MailPrefix",prefix);
198 conf->writeEntry( "Offline",offline); 204 conf->writeEntry( "Offline",offline);
205 conf->writeEntry( "LocalFolder", localFolder );
206 conf->writeEntry( "MaxSize", maxMailSize );
207 QDateTime dt ( QDate ( 2004, 1, 1 ), QTime( 0,0,0) );
208 int lf = dt.secsTo ( lastFetch );
209 conf->writeEntry( "LastFetch", lf );
210 conf->writeEntry( "LeaveOnServer", leaveOnServer);
199 conf->write(); 211 conf->write();
200 delete conf; 212 delete conf;
201} 213}
202 214
203 215
204QString IMAPaccount::getFileName() 216QString IMAPaccount::getFileName()
205{ 217{
206 return locateLocal("data", "kopiemail" ) +"/imap-" + file; 218 return locateLocal("data", "kopiemail" ) +"/imap-" + file;
207} 219}
208 220
209POP3account::POP3account() 221POP3account::POP3account()
210 : Account() 222 : Account()
211{ 223{
212 file = POP3account::getUniqueFileName(); 224 file = POP3account::getUniqueFileName();
213 accountName = "New POP3 Account"; 225 accountName = "New POP3 Account";
214 ssl = false; 226 ssl = false;
215 connectionType = 1; 227 connectionType = 1;
216 type = MAILLIB::A_POP3; 228 type = MAILLIB::A_POP3;
217 port = POP3_PORT; 229 port = POP3_PORT;
218} 230}
219 231
220POP3account::POP3account( QString filename ) 232POP3account::POP3account( QString filename )
221 : Account() 233 : Account()
222{ 234{
@@ -238,71 +250,73 @@ QString POP3account::getUniqueFileName()
238 QStringList imap = dir.entryList( "pop3-*" ); 250 QStringList imap = dir.entryList( "pop3-*" );
239 do { 251 do {
240 unique.setNum( num++ ); 252 unique.setNum( num++ );
241 } while ( imap.contains( "pop3-" + unique ) > 0 ); 253 } while ( imap.contains( "pop3-" + unique ) > 0 );
242 254
243 return unique; 255 return unique;
244} 256}
245 257
246void POP3account::read() 258void POP3account::read()
247{ 259{
248 Config *conf = new Config( getFileName(), Config::File ); 260 Config *conf = new Config( getFileName(), Config::File );
249 conf->setGroup( "POP3 Account" ); 261 conf->setGroup( "POP3 Account" );
250 accountName = conf->readEntry( "Account" ); 262 accountName = conf->readEntry( "Account" );
251 server = conf->readEntry( "Server" ); 263 server = conf->readEntry( "Server" );
252 port = conf->readEntry( "Port" ); 264 port = conf->readEntry( "Port" );
253 ssl = conf->readBoolEntry( "SSL" ); 265 ssl = conf->readBoolEntry( "SSL" );
254 connectionType = conf->readNumEntry( "ConnectionType" ); 266 connectionType = conf->readNumEntry( "ConnectionType" );
255 user = conf->readEntry( "User" ); 267 user = conf->readEntry( "User" );
256 password = conf->readEntryCrypt( "Password" ); 268 password = conf->readEntryCrypt( "Password" );
257 offline = conf->readBoolEntry("Offline",false); 269 offline = conf->readBoolEntry("Offline",false);
258 localFolder = conf->readEntry( "LocalFolder" ); 270 localFolder = conf->readEntry( "LocalFolder" );
259 maxMailSize = conf->readNumEntry( "MaxSize",0 ); 271 maxMailSize = conf->readNumEntry( "MaxSize",0 );
260 int lf = conf->readNumEntry( "LastFetch",0 ); 272 int lf = conf->readNumEntry( "LastFetch",0 );
261 QDateTime dt ( QDate ( 2004, 1, 1 ), QTime( 0,0,0) ); 273 QDateTime dt ( QDate ( 2004, 1, 1 ), QTime( 0,0,0) );
274 leaveOnServer = conf->readBoolEntry("LeaveOnServer",false);
262 lastFetch = dt.addSecs( lf ); 275 lastFetch = dt.addSecs( lf );
263 delete conf; 276 delete conf;
264} 277}
265 278
266void POP3account::save() 279void POP3account::save()
267{ 280{
268 Settings::checkDirectory(); 281 Settings::checkDirectory();
269 282
270 Config *conf = new Config( getFileName(), Config::File ); 283 Config *conf = new Config( getFileName(), Config::File );
271 conf->setGroup( "POP3 Account" ); 284 conf->setGroup( "POP3 Account" );
272 conf->writeEntry( "Account", accountName ); 285 conf->writeEntry( "Account", accountName );
273 conf->writeEntry( "Server", server ); 286 conf->writeEntry( "Server", server );
274 conf->writeEntry( "Port", port ); 287 conf->writeEntry( "Port", port );
275 conf->writeEntry( "SSL", ssl ); 288 conf->writeEntry( "SSL", ssl );
276 conf->writeEntry( "ConnectionType", connectionType ); 289 conf->writeEntry( "ConnectionType", connectionType );
277 conf->writeEntry( "User", user ); 290 conf->writeEntry( "User", user );
278 conf->writeEntryCrypt( "Password", password ); 291 conf->writeEntryCrypt( "Password", password );
279 conf->writeEntry( "Offline",offline); 292 conf->writeEntry( "Offline",offline);
280 conf->writeEntry( "LocalFolder", localFolder ); 293 conf->writeEntry( "LocalFolder", localFolder );
281 conf->writeEntry( "MaxSize", maxMailSize ); 294 conf->writeEntry( "MaxSize", maxMailSize );
282 QDateTime dt ( QDate ( 2004, 1, 1 ), QTime( 0,0,0) ); 295 QDateTime dt ( QDate ( 2004, 1, 1 ), QTime( 0,0,0) );
283 int lf = dt.secsTo ( lastFetch ); 296 int lf = dt.secsTo ( lastFetch );
284 conf->writeEntry( "LastFetch", lf ); 297 conf->writeEntry( "LastFetch", lf );
298 conf->writeEntry( "LeaveOnServer", leaveOnServer);
285 conf->write(); 299 conf->write();
286 delete conf; 300 delete conf;
287} 301}
288 302
289 303
290QString POP3account::getFileName() 304QString POP3account::getFileName()
291{ 305{
292 return locateLocal("data", "kopiemail" ) +"/pop3-" + file; 306 return locateLocal("data", "kopiemail" ) +"/pop3-" + file;
293} 307}
294 308
295SMTPaccount::SMTPaccount() 309SMTPaccount::SMTPaccount()
296 : Account() 310 : Account()
297{ 311{
298 file = SMTPaccount::getUniqueFileName(); 312 file = SMTPaccount::getUniqueFileName();
299 accountName = "New SMTP Account"; 313 accountName = "New SMTP Account";
300 ssl = false; 314 ssl = false;
301 connectionType = 1; 315 connectionType = 1;
302 login = false; 316 login = false;
303 useCC = false; 317 useCC = false;
304 useBCC = false; 318 useBCC = false;
305 useReply = false; 319 useReply = false;
306 type = MAILLIB::A_SMTP; 320 type = MAILLIB::A_SMTP;
307 port = SMTP_PORT; 321 port = SMTP_PORT;
308} 322}
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
@@ -28,61 +28,65 @@ public:
28 void setLocalFolder( QString name ) { localFolder = name; } 28 void setLocalFolder( QString name ) { localFolder = name; }
29 const QString& getLocalFolder()const{ return localFolder; } 29 const QString& getLocalFolder()const{ return localFolder; }
30 30
31 void setPort(const QString&str) { port = str; } 31 void setPort(const QString&str) { port = str; }
32 const QString&getPort()const{ return port; } 32 const QString&getPort()const{ return port; }
33 33
34 void setUser(const QString&str){ user = str; } 34 void setUser(const QString&str){ user = str; }
35 const QString&getUser()const{ return user; } 35 const QString&getUser()const{ return user; }
36 36
37 void setPassword(const QString&str) { password = str; } 37 void setPassword(const QString&str) { password = str; }
38 const QString&getPassword()const { return password; } 38 const QString&getPassword()const { return password; }
39 39
40 void setSSL( bool b ) { ssl = b; } 40 void setSSL( bool b ) { ssl = b; }
41 bool getSSL() { return ssl; } 41 bool getSSL() { return ssl; }
42 42
43 void setConnectionType( int x ) { connectionType = x; } 43 void setConnectionType( int x ) { connectionType = x; }
44 int ConnectionType() { return connectionType; } 44 int ConnectionType() { return connectionType; }
45 45
46 void setMaxMailSize( int x ) { maxMailSize = x; } 46 void setMaxMailSize( int x ) { maxMailSize = x; }
47 int getMaxMailSize() { return maxMailSize; } 47 int getMaxMailSize() { return maxMailSize; }
48 48
49 void setOffline(bool b) {offline = b;} 49 void setOffline(bool b) {offline = b;}
50 bool getOffline()const{return offline;} 50 bool getOffline()const{return offline;}
51 51
52 bool getLeaveOnServer(){ return leaveOnServer;}
53 void setLeaveOnServer(bool b){ leaveOnServer = b;}
54
52 virtual QString getFileName() { return accountName; } 55 virtual QString getFileName() { return accountName; }
53 virtual void read() { ; } 56 virtual void read() { ; }
54 virtual void save() { ; } 57 virtual void save() { ; }
55 58
56protected: 59protected:
57 QString accountName, server, port, user, password; 60 QString accountName, server, port, user, password;
58 bool ssl; 61 bool ssl;
59 int connectionType; 62 int connectionType;
60 bool offline; 63 bool offline;
61 MAILLIB::ATYPE type; 64 MAILLIB::ATYPE type;
62 QString localFolder; 65 QString localFolder;
63 int maxMailSize; 66 int maxMailSize;
64 QDateTime lastFetch; 67 QDateTime lastFetch;
68 bool leaveOnServer;
65}; 69};
66 70
67class IMAPaccount : public Account 71class IMAPaccount : public Account
68{ 72{
69 73
70public: 74public:
71 IMAPaccount(); 75 IMAPaccount();
72 IMAPaccount( QString filename ); 76 IMAPaccount( QString filename );
73 77
74 static QString getUniqueFileName(); 78 static QString getUniqueFileName();
75 79
76 virtual void read(); 80 virtual void read();
77 virtual void save(); 81 virtual void save();
78 virtual QString getFileName(); 82 virtual QString getFileName();
79 83
80 void setPrefix(const QString&str) {prefix=str;} 84 void setPrefix(const QString&str) {prefix=str;}
81 const QString&getPrefix()const{return prefix;} 85 const QString&getPrefix()const{return prefix;}
82 86
83private: 87private:
84 QString file,prefix; 88 QString file,prefix;
85 89
86}; 90};
87 91
88class POP3account : public Account 92class POP3account : public Account
diff --git a/kmicromail/pop3configui.ui b/kmicromail/pop3configui.ui
index a2d43bd..6acd394 100644
--- a/kmicromail/pop3configui.ui
+++ b/kmicromail/pop3configui.ui
@@ -1,59 +1,59 @@
1<!DOCTYPE UI><UI> 1<!DOCTYPE UI><UI>
2<class>POP3configUI</class> 2<class>POP3configUI</class>
3<widget> 3<widget>
4 <class>QDialog</class> 4 <class>QDialog</class>
5 <property stdset="1"> 5 <property stdset="1">
6 <name>name</name> 6 <name>name</name>
7 <cstring>POP3configUI</cstring> 7 <cstring>POP3configUI</cstring>
8 </property> 8 </property>
9 <property stdset="1"> 9 <property stdset="1">
10 <name>geometry</name> 10 <name>geometry</name>
11 <rect> 11 <rect>
12 <x>0</x> 12 <x>0</x>
13 <y>0</y> 13 <y>0</y>
14 <width>322</width> 14 <width>306</width>
15 <height>404</height> 15 <height>371</height>
16 </rect> 16 </rect>
17 </property> 17 </property>
18 <property stdset="1"> 18 <property stdset="1">
19 <name>caption</name> 19 <name>caption</name>
20 <string>Configure POP3</string> 20 <string>Configure POP3</string>
21 </property> 21 </property>
22 <property> 22 <property>
23 <name>layoutMargin</name> 23 <name>layoutMargin</name>
24 </property> 24 </property>
25 <property> 25 <property>
26 <name>layoutSpacing</name> 26 <name>layoutSpacing</name>
27 </property> 27 </property>
28 <vbox> 28 <vbox>
29 <property stdset="1"> 29 <property stdset="1">
30 <name>margin</name> 30 <name>margin</name>
31 <number>11</number> 31 <number>3</number>
32 </property> 32 </property>
33 <property stdset="1"> 33 <property stdset="1">
34 <name>spacing</name> 34 <name>spacing</name>
35 <number>6</number> 35 <number>1</number>
36 </property> 36 </property>
37 <widget> 37 <widget>
38 <class>QLayoutWidget</class> 38 <class>QLayoutWidget</class>
39 <property stdset="1"> 39 <property stdset="1">
40 <name>name</name> 40 <name>name</name>
41 <cstring>Layout12</cstring> 41 <cstring>Layout12</cstring>
42 </property> 42 </property>
43 <hbox> 43 <hbox>
44 <property stdset="1"> 44 <property stdset="1">
45 <name>margin</name> 45 <name>margin</name>
46 <number>0</number> 46 <number>0</number>
47 </property> 47 </property>
48 <property stdset="1"> 48 <property stdset="1">
49 <name>spacing</name> 49 <name>spacing</name>
50 <number>6</number> 50 <number>6</number>
51 </property> 51 </property>
52 <widget> 52 <widget>
53 <class>QLabel</class> 53 <class>QLabel</class>
54 <property stdset="1"> 54 <property stdset="1">
55 <name>name</name> 55 <name>name</name>
56 <cstring>accountLabel</cstring> 56 <cstring>accountLabel</cstring>
57 </property> 57 </property>
58 <property stdset="1"> 58 <property stdset="1">
59 <name>text</name> 59 <name>text</name>
@@ -384,48 +384,59 @@
384 <string>Download only messages smaller</string> 384 <string>Download only messages smaller</string>
385 </property> 385 </property>
386 </widget> 386 </widget>
387 <widget> 387 <widget>
388 <class>QSpinBox</class> 388 <class>QSpinBox</class>
389 <property stdset="1"> 389 <property stdset="1">
390 <name>name</name> 390 <name>name</name>
391 <cstring>SpinBoxDown</cstring> 391 <cstring>SpinBoxDown</cstring>
392 </property> 392 </property>
393 <property stdset="1"> 393 <property stdset="1">
394 <name>suffix</name> 394 <name>suffix</name>
395 <string>kB</string> 395 <string>kB</string>
396 </property> 396 </property>
397 <property stdset="1"> 397 <property stdset="1">
398 <name>maxValue</name> 398 <name>maxValue</name>
399 <number>99999</number> 399 <number>99999</number>
400 </property> 400 </property>
401 <property stdset="1"> 401 <property stdset="1">
402 <name>minValue</name> 402 <name>minValue</name>
403 <number>1</number> 403 <number>1</number>
404 </property> 404 </property>
405 </widget> 405 </widget>
406 </hbox> 406 </hbox>
407 </widget> 407 </widget>
408 <widget>
409 <class>QCheckBox</class>
410 <property stdset="1">
411 <name>name</name>
412 <cstring>CheckBoxLeaveOn</cstring>
413 </property>
414 <property stdset="1">
415 <name>text</name>
416 <string>Leave Messages on Server</string>
417 </property>
418 </widget>
408 <spacer> 419 <spacer>
409 <property> 420 <property>
410 <name>name</name> 421 <name>name</name>
411 <cstring>spacer</cstring> 422 <cstring>spacer</cstring>
412 </property> 423 </property>
413 <property stdset="1"> 424 <property stdset="1">
414 <name>orientation</name> 425 <name>orientation</name>
415 <enum>Vertical</enum> 426 <enum>Vertical</enum>
416 </property> 427 </property>
417 <property stdset="1"> 428 <property stdset="1">
418 <name>sizeType</name> 429 <name>sizeType</name>
419 <enum>Expanding</enum> 430 <enum>Expanding</enum>
420 </property> 431 </property>
421 <property> 432 <property>
422 <name>sizeHint</name> 433 <name>sizeHint</name>
423 <size> 434 <size>
424 <width>20</width> 435 <width>20</width>
425 <height>20</height> 436 <height>20</height>
426 </size> 437 </size>
427 </property> 438 </property>
428 </spacer> 439 </spacer>
429 </vbox> 440 </vbox>
430</widget> 441</widget>
431<tabstops> 442<tabstops>