Diffstat (limited to 'noncore/net/mail/accountview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/accountview.cpp | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/noncore/net/mail/accountview.cpp b/noncore/net/mail/accountview.cpp index 77fa706..faa6982 100644 --- a/noncore/net/mail/accountview.cpp +++ b/noncore/net/mail/accountview.cpp | |||
@@ -3,6 +3,7 @@ | |||
3 | #include <libmailwrapper/abstractmail.h> | 3 | #include <libmailwrapper/abstractmail.h> |
4 | #include "defines.h" | 4 | #include "defines.h" |
5 | #include "newmaildir.h" | 5 | #include "newmaildir.h" |
6 | #include "selectstore.h" | ||
6 | #include <qmessagebox.h> | 7 | #include <qmessagebox.h> |
7 | #include <qpopupmenu.h> | 8 | #include <qpopupmenu.h> |
8 | 9 | ||
@@ -90,20 +91,33 @@ QPopupMenu * POP3folderItem::getContextMenu() | |||
90 | if (m) { | 91 | if (m) { |
91 | m->insertItem(QObject::tr("Refresh header list",contextName),0); | 92 | m->insertItem(QObject::tr("Refresh header list",contextName),0); |
92 | m->insertItem(QObject::tr("Delete all mails",contextName),1); | 93 | m->insertItem(QObject::tr("Delete all mails",contextName),1); |
94 | m->insertItem(QObject::tr("Download all mails",contextName),2); | ||
93 | } | 95 | } |
94 | return m; | 96 | return m; |
95 | } | 97 | } |
96 | 98 | ||
99 | void POP3folderItem::downloadMails() | ||
100 | { | ||
101 | Selectstore sels; | ||
102 | sels.showMaximized(); | ||
103 | sels.exec(); | ||
104 | } | ||
105 | |||
97 | void POP3folderItem::contextMenuSelected(int which) | 106 | void POP3folderItem::contextMenuSelected(int which) |
98 | { | 107 | { |
99 | AccountView * view = (AccountView*)listView(); | 108 | AccountView * view = (AccountView*)listView(); |
100 | switch (which) { | 109 | switch (which) { |
101 | case 0: | 110 | case 0: |
111 | /* must be 'cause pop3 lists are cached */ | ||
112 | pop3->getWrapper()->logout(); | ||
102 | view->refreshCurrent(); | 113 | view->refreshCurrent(); |
103 | break; | 114 | break; |
104 | case 1: | 115 | case 1: |
105 | deleteAllMail(pop3->getWrapper(),folder); | 116 | deleteAllMail(pop3->getWrapper(),folder); |
106 | break; | 117 | break; |
118 | case 2: | ||
119 | downloadMails(); | ||
120 | break; | ||
107 | default: | 121 | default: |
108 | break; | 122 | break; |
109 | } | 123 | } |
@@ -158,11 +172,8 @@ void IMAPviewItem::refresh(QList<RecMail>&) | |||
158 | refreshFolders(false); | 172 | refreshFolders(false); |
159 | } | 173 | } |
160 | 174 | ||
161 | void IMAPviewItem::refreshFolders(bool force) | 175 | void IMAPviewItem::removeChilds() |
162 | { | 176 | { |
163 | if (childCount()>0 && force==false) return; | ||
164 | QList<Folder> *folders = wrapper->listFolders(); | ||
165 | |||
166 | QListViewItem *child = firstChild(); | 177 | QListViewItem *child = firstChild(); |
167 | while ( child ) { | 178 | while ( child ) { |
168 | QListViewItem *tmp = child; | 179 | QListViewItem *tmp = child; |
@@ -170,6 +181,16 @@ void IMAPviewItem::refreshFolders(bool force) | |||
170 | delete tmp; | 181 | delete tmp; |
171 | } | 182 | } |
172 | 183 | ||
184 | } | ||
185 | |||
186 | void IMAPviewItem::refreshFolders(bool force) | ||
187 | { | ||
188 | if (childCount()>0 && force==false) return; | ||
189 | |||
190 | removeChilds(); | ||
191 | |||
192 | QList<Folder> *folders = wrapper->listFolders(); | ||
193 | |||
173 | Folder *it; | 194 | Folder *it; |
174 | QListViewItem*item = 0; | 195 | QListViewItem*item = 0; |
175 | QListViewItem*titem = 0; | 196 | QListViewItem*titem = 0; |
@@ -246,6 +267,10 @@ void IMAPviewItem::contextMenuSelected(int id) | |||
246 | case 1: | 267 | case 1: |
247 | createNewFolder(); | 268 | createNewFolder(); |
248 | break; | 269 | break; |
270 | case 2: | ||
271 | removeChilds(); | ||
272 | wrapper->logout(); | ||
273 | break; | ||
249 | default: | 274 | default: |
250 | break; | 275 | break; |
251 | } | 276 | } |