-rw-r--r-- | kmicromail/accountitem.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kmicromail/accountitem.cpp b/kmicromail/accountitem.cpp index 59c8abb..12d047a 100644 --- a/kmicromail/accountitem.cpp +++ b/kmicromail/accountitem.cpp | |||
@@ -114,769 +114,769 @@ void POP3viewItem::disconnect() | |||
114 | child = child->nextSibling(); | 114 | child = child->nextSibling(); |
115 | delete tmp; | 115 | delete tmp; |
116 | } | 116 | } |
117 | wrapper->logout(); | 117 | wrapper->logout(); |
118 | } | 118 | } |
119 | 119 | ||
120 | void POP3viewItem::setOnOffline() | 120 | void POP3viewItem::setOnOffline() |
121 | { | 121 | { |
122 | if (!account->getOffline()) | 122 | if (!account->getOffline()) |
123 | { | 123 | { |
124 | disconnect(); | 124 | disconnect(); |
125 | } | 125 | } |
126 | account->setOffline(!account->getOffline()); | 126 | account->setOffline(!account->getOffline()); |
127 | account->save(); | 127 | account->save(); |
128 | SETPIX(PIXMAP_POP3FOLDER); | 128 | SETPIX(PIXMAP_POP3FOLDER); |
129 | refresh(); | 129 | refresh(); |
130 | } | 130 | } |
131 | 131 | ||
132 | void POP3viewItem::contextMenuSelected(int which) | 132 | void POP3viewItem::contextMenuSelected(int which) |
133 | { | 133 | { |
134 | switch (which) | 134 | switch (which) |
135 | { | 135 | { |
136 | case 0: | 136 | case 0: |
137 | disconnect(); | 137 | disconnect(); |
138 | break; | 138 | break; |
139 | case 1: | 139 | case 1: |
140 | setOnOffline(); | 140 | setOnOffline(); |
141 | break; | 141 | break; |
142 | case GET_NEW_MAILS: // daunlood | 142 | case GET_NEW_MAILS: // daunlood |
143 | if (account->getOffline()) | 143 | if (account->getOffline()) |
144 | setOnOffline(); | 144 | setOnOffline(); |
145 | AccountView*bl = accountView(); | 145 | AccountView*bl = accountView(); |
146 | if (!bl) return; | 146 | if (!bl) return; |
147 | AccountViewItem* in = findSubItem( "inbox" , 0); | 147 | AccountViewItem* in = findSubItem( "inbox" , 0); |
148 | if ( ! in ) | 148 | if ( ! in ) |
149 | return; | 149 | return; |
150 | bl->downloadMailsInbox(in->getFolder() ,getWrapper()); | 150 | bl->downloadMailsInbox(in->getFolder() ,getWrapper()); |
151 | setOnOffline(); | 151 | setOnOffline(); |
152 | break; | 152 | break; |
153 | } | 153 | } |
154 | } | 154 | } |
155 | 155 | ||
156 | POP3folderItem::~POP3folderItem() | 156 | POP3folderItem::~POP3folderItem() |
157 | {} | 157 | {} |
158 | 158 | ||
159 | POP3folderItem::POP3folderItem( const FolderP&folderInit, POP3viewItem *parent , QListViewItem*after ) | 159 | POP3folderItem::POP3folderItem( const FolderP&folderInit, POP3viewItem *parent , QListViewItem*after ) |
160 | : AccountViewItem(folderInit,parent,after ) | 160 | : AccountViewItem(folderInit,parent,after ) |
161 | { | 161 | { |
162 | pop3 = parent; | 162 | pop3 = parent; |
163 | if (folder->getDisplayName().lower()!="inbox") | 163 | if (folder->getDisplayName().lower()!="inbox") |
164 | { | 164 | { |
165 | setPixmap( 0, PIXMAP_POP3FOLDER ); | 165 | setPixmap( 0, PIXMAP_POP3FOLDER ); |
166 | } | 166 | } |
167 | else | 167 | else |
168 | { | 168 | { |
169 | setPixmap( 0, PIXMAP_INBOXFOLDER); | 169 | setPixmap( 0, PIXMAP_INBOXFOLDER); |
170 | } | 170 | } |
171 | setText( 0, folder->getDisplayName() ); | 171 | setText( 0, folder->getDisplayName() ); |
172 | } | 172 | } |
173 | 173 | ||
174 | void POP3folderItem::refresh(QValueList<RecMailP>&target) | 174 | void POP3folderItem::refresh(QValueList<RecMailP>&target) |
175 | { | 175 | { |
176 | if (folder->may_select()) | 176 | if (folder->may_select()) |
177 | pop3->getWrapper()->listMessages( folder->getName(),target ); | 177 | pop3->getWrapper()->listMessages( folder->getName(),target ); |
178 | } | 178 | } |
179 | 179 | ||
180 | RECBODYP POP3folderItem::fetchBody(const RecMailP&aMail) | 180 | RECBODYP POP3folderItem::fetchBody(const RecMailP&aMail) |
181 | { | 181 | { |
182 | return pop3->getWrapper()->fetchBody(aMail); | 182 | return pop3->getWrapper()->fetchBody(aMail); |
183 | } | 183 | } |
184 | 184 | ||
185 | QPopupMenu * POP3folderItem::getContextMenu() | 185 | QPopupMenu * POP3folderItem::getContextMenu() |
186 | { | 186 | { |
187 | QPopupMenu *m = new QPopupMenu(0); | 187 | QPopupMenu *m = new QPopupMenu(0); |
188 | if (m) | 188 | if (m) |
189 | { | 189 | { |
190 | m->insertItem(QObject::tr("Refresh header list",contextName),0); | 190 | m->insertItem(QObject::tr("Refresh header list",contextName),0); |
191 | m->insertItem(QObject::tr("Delete all mails",contextName),1); | 191 | m->insertItem(QObject::tr("Delete all mails",contextName),1); |
192 | m->insertItem(QObject::tr("Move/Copie all mails",contextName),2); | 192 | m->insertItem(QObject::tr("Move/Copie all mails",contextName),2); |
193 | } | 193 | } |
194 | return m; | 194 | return m; |
195 | } | 195 | } |
196 | 196 | ||
197 | void POP3folderItem::downloadMails() | 197 | void POP3folderItem::downloadMails() |
198 | { | 198 | { |
199 | AccountView*bl = pop3->accountView(); | 199 | AccountView*bl = pop3->accountView(); |
200 | if (!bl) return; | 200 | if (!bl) return; |
201 | bl->downloadMails(folder,pop3->getWrapper()); | 201 | bl->downloadMails(folder,pop3->getWrapper()); |
202 | } | 202 | } |
203 | 203 | ||
204 | void POP3folderItem::contextMenuSelected(int which) | 204 | void POP3folderItem::contextMenuSelected(int which) |
205 | { | 205 | { |
206 | AccountView * view = (AccountView*)listView(); | 206 | AccountView * view = (AccountView*)listView(); |
207 | switch (which) | 207 | switch (which) |
208 | { | 208 | { |
209 | case 0: | 209 | case 0: |
210 | /* must be 'cause pop3 lists are cached */ | 210 | /* must be 'cause pop3 lists are cached */ |
211 | pop3->getWrapper()->logout(); | 211 | pop3->getWrapper()->logout(); |
212 | view->refreshCurrent(); | 212 | view->refreshCurrent(); |
213 | break; | 213 | break; |
214 | case 1: | 214 | case 1: |
215 | deleteAllMail(pop3->getWrapper(),folder); | 215 | deleteAllMail(pop3->getWrapper(),folder); |
216 | break; | 216 | break; |
217 | case 2: | 217 | case 2: |
218 | downloadMails(); | 218 | downloadMails(); |
219 | break; | 219 | break; |
220 | default: | 220 | default: |
221 | break; | 221 | break; |
222 | } | 222 | } |
223 | } | 223 | } |
224 | 224 | ||
225 | /** | 225 | /** |
226 | * NNTP Account stuff | 226 | * NNTP Account stuff |
227 | */ | 227 | */ |
228 | NNTPviewItem::NNTPviewItem( NNTPaccount *a, AccountView *parent ) | 228 | NNTPviewItem::NNTPviewItem( NNTPaccount *a, AccountView *parent ) |
229 | : AccountViewItem( parent ) | 229 | : AccountViewItem( parent ) |
230 | { | 230 | { |
231 | account = a; | 231 | account = a; |
232 | wrapper = AbstractMail::getWrapper( account ); | 232 | wrapper = AbstractMail::getWrapper( account ); |
233 | //FIXME | 233 | //FIXME |
234 | SETPIX(PIXMAP_POP3FOLDER); | 234 | SETPIX(PIXMAP_POP3FOLDER); |
235 | #if 0 | 235 | #if 0 |
236 | if (!account->getOffline()) | 236 | if (!account->getOffline()) |
237 | { | 237 | { |
238 | setPixmap( 0, ); | 238 | setPixmap( 0, ); |
239 | } | 239 | } |
240 | else | 240 | else |
241 | { | 241 | { |
242 | setPixmap( 0, PIXMAP_OFFLINE ); | 242 | setPixmap( 0, PIXMAP_OFFLINE ); |
243 | } | 243 | } |
244 | #endif | 244 | #endif |
245 | setText( 0, account->getAccountName() ); | 245 | setText( 0, account->getAccountName() ); |
246 | setOpen( true ); | 246 | setOpen( true ); |
247 | } | 247 | } |
248 | 248 | ||
249 | NNTPviewItem::~NNTPviewItem() | 249 | NNTPviewItem::~NNTPviewItem() |
250 | { | 250 | { |
251 | delete wrapper; | 251 | delete wrapper; |
252 | } | 252 | } |
253 | 253 | ||
254 | AbstractMail *NNTPviewItem::getWrapper() | 254 | AbstractMail *NNTPviewItem::getWrapper() |
255 | { | 255 | { |
256 | return wrapper; | 256 | return wrapper; |
257 | } | 257 | } |
258 | 258 | ||
259 | void NNTPviewItem::refresh( QValueList<RecMailP> & ) | 259 | void NNTPviewItem::refresh( QValueList<RecMailP> & ) |
260 | { | 260 | { |
261 | refresh(); | 261 | refresh(); |
262 | } | 262 | } |
263 | 263 | ||
264 | void NNTPviewItem::refresh() | 264 | void NNTPviewItem::refresh() |
265 | { | 265 | { |
266 | if (account->getOffline()) return; | 266 | if (account->getOffline()) return; |
267 | QValueList<FolderP> *folders = wrapper->listFolders(); | 267 | QValueList<FolderP> *folders = wrapper->listFolders(); |
268 | 268 | ||
269 | QListViewItem *child = firstChild(); | 269 | QListViewItem *child = firstChild(); |
270 | while ( child ) | 270 | while ( child ) |
271 | { | 271 | { |
272 | QListViewItem *tmp = child; | 272 | QListViewItem *tmp = child; |
273 | child = child->nextSibling(); | 273 | child = child->nextSibling(); |
274 | delete tmp; | 274 | delete tmp; |
275 | } | 275 | } |
276 | QValueList<FolderP>::ConstIterator it; | 276 | QValueList<FolderP>::ConstIterator it; |
277 | QListViewItem*item = 0; | 277 | QListViewItem*item = 0; |
278 | for ( it = folders->begin(); it!=folders->end(); ++it) | 278 | for ( it = folders->begin(); it!=folders->end(); ++it) |
279 | { | 279 | { |
280 | item = new NNTPfolderItem( (*it), this , item ); | 280 | item = new NNTPfolderItem( (*it), this , item ); |
281 | item->setSelectable( (*it)->may_select()); | 281 | item->setSelectable( (*it)->may_select()); |
282 | } | 282 | } |
283 | delete folders; | 283 | delete folders; |
284 | } | 284 | } |
285 | 285 | ||
286 | RECBODYP NNTPviewItem::fetchBody( const RecMailP &mail ) | 286 | RECBODYP NNTPviewItem::fetchBody( const RecMailP &mail ) |
287 | { | 287 | { |
288 | 288 | ||
289 | return wrapper->fetchBody( mail ); | 289 | return wrapper->fetchBody( mail ); |
290 | } | 290 | } |
291 | 291 | ||
292 | QPopupMenu * NNTPviewItem::getContextMenu() | 292 | QPopupMenu * NNTPviewItem::getContextMenu() |
293 | { | 293 | { |
294 | QPopupMenu *m = new QPopupMenu(0); | 294 | QPopupMenu *m = new QPopupMenu(0); |
295 | if (m) | 295 | if (m) |
296 | { | 296 | { |
297 | if (!account->getOffline()) | 297 | if (!account->getOffline()) |
298 | { | 298 | { |
299 | m->insertItem(QObject::tr("Disconnect",contextName),0); | 299 | m->insertItem(QObject::tr("Disconnect",contextName),0); |
300 | m->insertItem(QObject::tr("Set offline",contextName),1); | 300 | m->insertItem(QObject::tr("Set offline",contextName),1); |
301 | m->insertItem(QObject::tr("(Un-)Subscribe groups",contextName),2); | 301 | m->insertItem(QObject::tr("(Un-)Subscribe groups",contextName),2); |
302 | } | 302 | } |
303 | else | 303 | else |
304 | { | 304 | { |
305 | m->insertItem(QObject::tr("Set online",contextName),1); | 305 | m->insertItem(QObject::tr("Set online",contextName),1); |
306 | } | 306 | } |
307 | } | 307 | } |
308 | return m; | 308 | return m; |
309 | } | 309 | } |
310 | 310 | ||
311 | void NNTPviewItem::subscribeGroups() | 311 | void NNTPviewItem::subscribeGroups() |
312 | { | 312 | { |
313 | NNTPGroupsDlg dlg(account); | 313 | NNTPGroupsDlg dlg(account); |
314 | dlg.showMaximized(); | 314 | dlg.showMaximized(); |
315 | if ( dlg.exec()== QDialog::Accepted ){ | 315 | if ( dlg.exec()== QDialog::Accepted ){ |
316 | refresh(); | 316 | refresh(); |
317 | } | 317 | } |
318 | } | 318 | } |
319 | 319 | ||
320 | void NNTPviewItem::disconnect() | 320 | void NNTPviewItem::disconnect() |
321 | { | 321 | { |
322 | QListViewItem *child = firstChild(); | 322 | QListViewItem *child = firstChild(); |
323 | while ( child ) | 323 | while ( child ) |
324 | { | 324 | { |
325 | QListViewItem *tmp = child; | 325 | QListViewItem *tmp = child; |
326 | child = child->nextSibling(); | 326 | child = child->nextSibling(); |
327 | delete tmp; | 327 | delete tmp; |
328 | } | 328 | } |
329 | wrapper->logout(); | 329 | wrapper->logout(); |
330 | } | 330 | } |
331 | 331 | ||
332 | void NNTPviewItem::setOnOffline() | 332 | void NNTPviewItem::setOnOffline() |
333 | { | 333 | { |
334 | if (!account->getOffline()) | 334 | if (!account->getOffline()) |
335 | { | 335 | { |
336 | disconnect(); | 336 | disconnect(); |
337 | } | 337 | } |
338 | account->setOffline(!account->getOffline()); | 338 | account->setOffline(!account->getOffline()); |
339 | account->save(); | 339 | account->save(); |
340 | //FIXME | 340 | //FIXME |
341 | SETPIX(PIXMAP_POP3FOLDER); | 341 | SETPIX(PIXMAP_POP3FOLDER); |
342 | refresh(); | 342 | refresh(); |
343 | } | 343 | } |
344 | 344 | ||
345 | void NNTPviewItem::contextMenuSelected(int which) | 345 | void NNTPviewItem::contextMenuSelected(int which) |
346 | { | 346 | { |
347 | switch (which) | 347 | switch (which) |
348 | { | 348 | { |
349 | case 0: | 349 | case 0: |
350 | disconnect(); | 350 | disconnect(); |
351 | break; | 351 | break; |
352 | case 1: | 352 | case 1: |
353 | setOnOffline(); | 353 | setOnOffline(); |
354 | break; | 354 | break; |
355 | case 2: | 355 | case 2: |
356 | subscribeGroups(); | 356 | subscribeGroups(); |
357 | break; | 357 | break; |
358 | } | 358 | } |
359 | } | 359 | } |
360 | 360 | ||
361 | NNTPfolderItem::~NNTPfolderItem() | 361 | NNTPfolderItem::~NNTPfolderItem() |
362 | {} | 362 | {} |
363 | 363 | ||
364 | NNTPfolderItem::NNTPfolderItem( const FolderP &folderInit, NNTPviewItem *parent , QListViewItem*after ) | 364 | NNTPfolderItem::NNTPfolderItem( const FolderP &folderInit, NNTPviewItem *parent , QListViewItem*after ) |
365 | : AccountViewItem( folderInit, parent,after ) | 365 | : AccountViewItem( folderInit, parent,after ) |
366 | { | 366 | { |
367 | nntp = parent; | 367 | nntp = parent; |
368 | if (folder->getDisplayName().lower()!="inbox") | 368 | if (folder->getDisplayName().lower()!="inbox") |
369 | { | 369 | { |
370 | setPixmap( 0, PIXMAP_POP3FOLDER ); | 370 | setPixmap( 0, PIXMAP_POP3FOLDER ); |
371 | } | 371 | } |
372 | else | 372 | else |
373 | { | 373 | { |
374 | setPixmap( 0, PIXMAP_INBOXFOLDER); | 374 | setPixmap( 0, PIXMAP_INBOXFOLDER); |
375 | } | 375 | } |
376 | setText( 0, folder->getDisplayName() ); | 376 | setText( 0, folder->getDisplayName() ); |
377 | } | 377 | } |
378 | 378 | ||
379 | void NNTPfolderItem::refresh(QValueList<RecMailP>&target) | 379 | void NNTPfolderItem::refresh(QValueList<RecMailP>&target) |
380 | { | 380 | { |
381 | if (folder->may_select()) | 381 | if (folder->may_select()) |
382 | nntp->getWrapper()->listMessages( folder->getName(),target ); | 382 | nntp->getWrapper()->listMessages( folder->getName(),target ); |
383 | } | 383 | } |
384 | 384 | ||
385 | RECBODYP NNTPfolderItem::fetchBody(const RecMailP&aMail) | 385 | RECBODYP NNTPfolderItem::fetchBody(const RecMailP&aMail) |
386 | { | 386 | { |
387 | return nntp->getWrapper()->fetchBody(aMail); | 387 | return nntp->getWrapper()->fetchBody(aMail); |
388 | } | 388 | } |
389 | 389 | ||
390 | QPopupMenu * NNTPfolderItem::getContextMenu() | 390 | QPopupMenu * NNTPfolderItem::getContextMenu() |
391 | { | 391 | { |
392 | QPopupMenu *m = new QPopupMenu(0); | 392 | QPopupMenu *m = new QPopupMenu(0); |
393 | if (m) | 393 | if (m) |
394 | { | 394 | { |
395 | m->insertItem(QObject::tr("Refresh header list",contextName),0); | 395 | m->insertItem(QObject::tr("Refresh header list",contextName),0); |
396 | m->insertItem(QObject::tr("Copy all postings",contextName),1); | 396 | m->insertItem(QObject::tr("Copy all postings",contextName),1); |
397 | } | 397 | } |
398 | return m; | 398 | return m; |
399 | } | 399 | } |
400 | 400 | ||
401 | void NNTPfolderItem::downloadMails() | 401 | void NNTPfolderItem::downloadMails() |
402 | { | 402 | { |
403 | AccountView*bl = nntp->accountView(); | 403 | AccountView*bl = nntp->accountView(); |
404 | if (!bl) return; | 404 | if (!bl) return; |
405 | bl->downloadMails(folder,nntp->getWrapper()); | 405 | bl->downloadMails(folder,nntp->getWrapper()); |
406 | } | 406 | } |
407 | 407 | ||
408 | void NNTPfolderItem::contextMenuSelected(int which) | 408 | void NNTPfolderItem::contextMenuSelected(int which) |
409 | { | 409 | { |
410 | AccountView * view = (AccountView*)listView(); | 410 | AccountView * view = (AccountView*)listView(); |
411 | switch (which) | 411 | switch (which) |
412 | { | 412 | { |
413 | case 0: | 413 | case 0: |
414 | /* must be 'cause pop3 lists are cached */ | 414 | /* must be 'cause pop3 lists are cached */ |
415 | nntp->getWrapper()->logout(); | 415 | nntp->getWrapper()->logout(); |
416 | view->refreshCurrent(); | 416 | view->refreshCurrent(); |
417 | break; | 417 | break; |
418 | case 1: | 418 | case 1: |
419 | downloadMails(); | 419 | downloadMails(); |
420 | break; | 420 | break; |
421 | default: | 421 | default: |
422 | break; | 422 | break; |
423 | } | 423 | } |
424 | } | 424 | } |
425 | 425 | ||
426 | /** | 426 | /** |
427 | * IMAP Account stuff | 427 | * IMAP Account stuff |
428 | */ | 428 | */ |
429 | IMAPviewItem::IMAPviewItem( IMAPaccount *a, AccountView *parent ) | 429 | IMAPviewItem::IMAPviewItem( IMAPaccount *a, AccountView *parent ) |
430 | : AccountViewItem( parent ) | 430 | : AccountViewItem( parent ) |
431 | { | 431 | { |
432 | account = a; | 432 | account = a; |
433 | wrapper = AbstractMail::getWrapper( account ); | 433 | wrapper = AbstractMail::getWrapper( account ); |
434 | SETPIX(PIXMAP_IMAPFOLDER); | 434 | SETPIX(PIXMAP_IMAPFOLDER); |
435 | setText( 0, account->getAccountName() ); | 435 | setText( 0, account->getAccountName() ); |
436 | setOpen( true ); | 436 | setOpen( true ); |
437 | } | 437 | } |
438 | 438 | ||
439 | IMAPviewItem::~IMAPviewItem() | 439 | IMAPviewItem::~IMAPviewItem() |
440 | { | 440 | { |
441 | delete wrapper; | 441 | delete wrapper; |
442 | } | 442 | } |
443 | 443 | ||
444 | AbstractMail *IMAPviewItem::getWrapper() | 444 | AbstractMail *IMAPviewItem::getWrapper() |
445 | { | 445 | { |
446 | return wrapper; | 446 | return wrapper; |
447 | } | 447 | } |
448 | 448 | ||
449 | void IMAPviewItem::refresh(QValueList<RecMailP>&) | 449 | void IMAPviewItem::refresh(QValueList<RecMailP>&) |
450 | { | 450 | { |
451 | refreshFolders(false); | 451 | refreshFolders(false); |
452 | } | 452 | } |
453 | 453 | ||
454 | const QStringList&IMAPviewItem::subFolders() | 454 | const QStringList&IMAPviewItem::subFolders() |
455 | { | 455 | { |
456 | return currentFolders; | 456 | return currentFolders; |
457 | } | 457 | } |
458 | 458 | ||
459 | void IMAPviewItem::refreshFolders(bool force) | 459 | void IMAPviewItem::refreshFolders(bool force) |
460 | { | 460 | { |
461 | if (childCount()>0 && force==false) return; | 461 | if (childCount()>0 && force==false) return; |
462 | if (account->getOffline()) return; | 462 | if (account->getOffline()) return; |
463 | 463 | ||
464 | removeChilds(); | 464 | removeChilds(); |
465 | currentFolders.clear(); | 465 | currentFolders.clear(); |
466 | QValueList<FolderP> * folders = wrapper->listFolders(); | 466 | QValueList<FolderP> * folders = wrapper->listFolders(); |
467 | 467 | ||
468 | QValueList<FolderP>::Iterator it; | 468 | QValueList<FolderP>::Iterator it; |
469 | QListViewItem*item = 0; | 469 | QListViewItem*item = 0; |
470 | QListViewItem*titem = 0; | 470 | QListViewItem*titem = 0; |
471 | QString fname,del,search; | 471 | QString fname,del,search; |
472 | int pos; | 472 | int pos; |
473 | 473 | ||
474 | for ( it = folders->begin(); it!=folders->end(); ++it) | 474 | for ( it = folders->begin(); it!=folders->end(); ++it) |
475 | { | 475 | { |
476 | if ((*it)->getDisplayName().lower()=="inbox") | 476 | if ((*it)->getDisplayName().lower()=="inbox") |
477 | { | 477 | { |
478 | item = new IMAPfolderItem( (*it), this , item ); | 478 | item = new IMAPfolderItem( (*it), this , item ); |
479 | folders->remove(it); | 479 | folders->remove(it); |
480 | break; | 480 | break; |
481 | } | 481 | } |
482 | } | 482 | } |
483 | for ( it = folders->begin(); it!=folders->end(); ++it) | 483 | for ( it = folders->begin(); it!=folders->end(); ++it) |
484 | { | 484 | { |
485 | fname = (*it)->getDisplayName(); | 485 | fname = (*it)->getDisplayName(); |
486 | currentFolders.append((*it)->getName()); | 486 | currentFolders.append((*it)->getName()); |
487 | pos = fname.findRev((*it)->Separator()); | 487 | pos = fname.findRev((*it)->Separator()); |
488 | if (pos != -1) | 488 | if (pos != -1) |
489 | { | 489 | { |
490 | fname = fname.left(pos); | 490 | fname = fname.left(pos); |
491 | } | 491 | } |
492 | IMAPfolderItem*pitem = (IMAPfolderItem*)findSubItem(fname); | 492 | IMAPfolderItem*pitem = (IMAPfolderItem*)findSubItem(fname); |
493 | if (pitem) | 493 | if (pitem) |
494 | { | 494 | { |
495 | titem = item; | 495 | titem = item; |
496 | item = new IMAPfolderItem( (*it),pitem,pitem->firstChild(),this); | 496 | item = new IMAPfolderItem( (*it),pitem,pitem->firstChild(),this); |
497 | /* setup the short name */ | 497 | /* setup the short name */ |
498 | item->setText(0,(*it)->getDisplayName().right((*it)->getDisplayName().length()-pos-1)); | 498 | item->setText(0,(*it)->getDisplayName().mid(pos+1)); |
499 | item = titem; | 499 | item = titem; |
500 | } | 500 | } |
501 | else | 501 | else |
502 | { | 502 | { |
503 | item = new IMAPfolderItem( (*it), this , item ); | 503 | item = new IMAPfolderItem( (*it), this , item ); |
504 | } | 504 | } |
505 | } | 505 | } |
506 | delete folders; | 506 | delete folders; |
507 | } | 507 | } |
508 | 508 | ||
509 | QPopupMenu * IMAPviewItem::getContextMenu() | 509 | QPopupMenu * IMAPviewItem::getContextMenu() |
510 | { | 510 | { |
511 | QPopupMenu *m = new QPopupMenu(0); | 511 | QPopupMenu *m = new QPopupMenu(0); |
512 | if (m) | 512 | if (m) |
513 | { | 513 | { |
514 | if (!account->getOffline()) | 514 | if (!account->getOffline()) |
515 | { | 515 | { |
516 | m->insertItem(QObject::tr("Refresh folder list",contextName),0); | 516 | m->insertItem(QObject::tr("Refresh folder list",contextName),0); |
517 | m->insertItem(QObject::tr("Create new folder",contextName),1); | 517 | m->insertItem(QObject::tr("Create new folder",contextName),1); |
518 | m->insertSeparator(); | 518 | m->insertSeparator(); |
519 | m->insertItem(QObject::tr("Disconnect",contextName),2); | 519 | m->insertItem(QObject::tr("Disconnect",contextName),2); |
520 | m->insertItem(QObject::tr("Set offline",contextName),3); | 520 | m->insertItem(QObject::tr("Set offline",contextName),3); |
521 | m->insertSeparator(); | 521 | m->insertSeparator(); |
522 | m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS); | 522 | m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS); |
523 | } | 523 | } |
524 | else | 524 | else |
525 | { | 525 | { |
526 | m->insertItem(QObject::tr("Set online",contextName),3); | 526 | m->insertItem(QObject::tr("Set online",contextName),3); |
527 | m->insertSeparator(); | 527 | m->insertSeparator(); |
528 | m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS); | 528 | m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS); |
529 | } | 529 | } |
530 | } | 530 | } |
531 | return m; | 531 | return m; |
532 | } | 532 | } |
533 | 533 | ||
534 | void IMAPviewItem::createNewFolder() | 534 | void IMAPviewItem::createNewFolder() |
535 | { | 535 | { |
536 | Newmdirdlg ndirdlg; | 536 | Newmdirdlg ndirdlg; |
537 | 537 | ||
538 | ndirdlg.showMaximized(); | 538 | ndirdlg.showMaximized(); |
539 | if ( ndirdlg.exec() ) | 539 | if ( ndirdlg.exec() ) |
540 | { | 540 | { |
541 | QString ndir = ndirdlg.Newdir(); | 541 | QString ndir = ndirdlg.Newdir(); |
542 | bool makesubs = ndirdlg.subpossible(); | 542 | bool makesubs = ndirdlg.subpossible(); |
543 | QString delemiter = "/"; | 543 | QString delemiter = "/"; |
544 | IMAPfolderItem*item = (IMAPfolderItem*)firstChild(); | 544 | IMAPfolderItem*item = (IMAPfolderItem*)firstChild(); |
545 | if (item) | 545 | if (item) |
546 | { | 546 | { |
547 | delemiter = item->Delemiter(); | 547 | delemiter = item->Delemiter(); |
548 | } | 548 | } |
549 | if (wrapper->createMbox(ndir,0,delemiter,makesubs)) | 549 | if (wrapper->createMbox(ndir,0,delemiter,makesubs)) |
550 | { | 550 | { |
551 | refreshFolders(true); | 551 | refreshFolders(true); |
552 | } | 552 | } |
553 | } | 553 | } |
554 | } | 554 | } |
555 | 555 | ||
556 | void IMAPviewItem::contextMenuSelected(int id) | 556 | void IMAPviewItem::contextMenuSelected(int id) |
557 | { | 557 | { |
558 | 558 | ||
559 | switch (id) | 559 | switch (id) |
560 | { | 560 | { |
561 | case 0: | 561 | case 0: |
562 | refreshFolders(true); | 562 | refreshFolders(true); |
563 | break; | 563 | break; |
564 | case 1: | 564 | case 1: |
565 | createNewFolder(); | 565 | createNewFolder(); |
566 | break; | 566 | break; |
567 | case 2: | 567 | case 2: |
568 | removeChilds(); | 568 | removeChilds(); |
569 | wrapper->logout(); | 569 | wrapper->logout(); |
570 | break; | 570 | break; |
571 | case 3: | 571 | case 3: |
572 | if (account->getOffline()==false) | 572 | if (account->getOffline()==false) |
573 | { | 573 | { |
574 | removeChilds(); | 574 | removeChilds(); |
575 | wrapper->logout(); | 575 | wrapper->logout(); |
576 | } | 576 | } |
577 | account->setOffline(!account->getOffline()); | 577 | account->setOffline(!account->getOffline()); |
578 | account->save(); | 578 | account->save(); |
579 | SETPIX(PIXMAP_IMAPFOLDER); | 579 | SETPIX(PIXMAP_IMAPFOLDER); |
580 | refreshFolders(false); | 580 | refreshFolders(false); |
581 | break; | 581 | break; |
582 | case GET_NEW_MAILS: // daunlood | 582 | case GET_NEW_MAILS: // daunlood |
583 | { | 583 | { |
584 | if (account->getOffline()) { | 584 | if (account->getOffline()) { |
585 | contextMenuSelected( 3 ); | 585 | contextMenuSelected( 3 ); |
586 | } | 586 | } |
587 | AccountView*bl = accountView(); | 587 | AccountView*bl = accountView(); |
588 | if (!bl) return; | 588 | if (!bl) return; |
589 | AccountViewItem* in = findSubItem( "inbox" , 0); | 589 | AccountViewItem* in = findSubItem( "inbox" , 0); |
590 | if ( ! in ) | 590 | if ( ! in ) |
591 | return; | 591 | return; |
592 | bl->downloadMailsInbox(in->getFolder(),getWrapper()); | 592 | bl->downloadMailsInbox(in->getFolder(),getWrapper()); |
593 | } | 593 | } |
594 | break; | 594 | break; |
595 | default: | 595 | default: |
596 | break; | 596 | break; |
597 | } | 597 | } |
598 | } | 598 | } |
599 | 599 | ||
600 | RECBODYP IMAPviewItem::fetchBody(const RecMailP&) | 600 | RECBODYP IMAPviewItem::fetchBody(const RecMailP&) |
601 | { | 601 | { |
602 | return new RecBody(); | 602 | return new RecBody(); |
603 | } | 603 | } |
604 | 604 | ||
605 | bool IMAPviewItem::offline() | 605 | bool IMAPviewItem::offline() |
606 | { | 606 | { |
607 | return account->getOffline(); | 607 | return account->getOffline(); |
608 | } | 608 | } |
609 | 609 | ||
610 | IMAPfolderItem::IMAPfolderItem( const FolderP& folderInit, IMAPviewItem *parent , QListViewItem*after ) | 610 | IMAPfolderItem::IMAPfolderItem( const FolderP& folderInit, IMAPviewItem *parent , QListViewItem*after ) |
611 | : AccountViewItem( folderInit, parent , after ) | 611 | : AccountViewItem( folderInit, parent , after ) |
612 | { | 612 | { |
613 | imap = parent; | 613 | imap = parent; |
614 | if (folder->getDisplayName().lower()!="inbox") | 614 | if (folder->getDisplayName().lower()!="inbox") |
615 | { | 615 | { |
616 | setPixmap( 0, PIXMAP_IMAPFOLDER ); | 616 | setPixmap( 0, PIXMAP_IMAPFOLDER ); |
617 | } | 617 | } |
618 | else | 618 | else |
619 | { | 619 | { |
620 | setPixmap( 0, PIXMAP_INBOXFOLDER); | 620 | setPixmap( 0, PIXMAP_INBOXFOLDER); |
621 | } | 621 | } |
622 | setText( 0, folder->getDisplayName() ); | 622 | setText( 0, folder->getDisplayName() ); |
623 | } | 623 | } |
624 | 624 | ||
625 | IMAPfolderItem::IMAPfolderItem(const FolderP &folderInit, IMAPfolderItem *parent , QListViewItem*after, IMAPviewItem *master ) | 625 | IMAPfolderItem::IMAPfolderItem(const FolderP &folderInit, IMAPfolderItem *parent , QListViewItem*after, IMAPviewItem *master ) |
626 | : AccountViewItem(folderInit, parent,after ) | 626 | : AccountViewItem(folderInit, parent,after ) |
627 | { | 627 | { |
628 | imap = master; | 628 | imap = master; |
629 | if (folder->getDisplayName().lower()!="inbox") | 629 | if (folder->getDisplayName().lower()!="inbox") |
630 | { | 630 | { |
631 | setPixmap( 0, PIXMAP_IMAPFOLDER ); | 631 | setPixmap( 0, PIXMAP_IMAPFOLDER ); |
632 | } | 632 | } |
633 | else | 633 | else |
634 | { | 634 | { |
635 | setPixmap( 0, PIXMAP_INBOXFOLDER); | 635 | setPixmap( 0, PIXMAP_INBOXFOLDER); |
636 | } | 636 | } |
637 | setText( 0, folder->getDisplayName() ); | 637 | setText( 0, folder->getDisplayName() ); |
638 | } | 638 | } |
639 | 639 | ||
640 | IMAPfolderItem::~IMAPfolderItem() | 640 | IMAPfolderItem::~IMAPfolderItem() |
641 | {} | 641 | {} |
642 | 642 | ||
643 | const QString& IMAPfolderItem::Delemiter()const | 643 | const QString& IMAPfolderItem::Delemiter()const |
644 | { | 644 | { |
645 | return folder->Separator(); | 645 | return folder->Separator(); |
646 | } | 646 | } |
647 | 647 | ||
648 | void IMAPfolderItem::refresh(QValueList<RecMailP>&target) | 648 | void IMAPfolderItem::refresh(QValueList<RecMailP>&target) |
649 | { | 649 | { |
650 | if (folder->may_select()) | 650 | if (folder->may_select()) |
651 | { | 651 | { |
652 | imap->getWrapper()->listMessages( folder->getName(),target ); | 652 | imap->getWrapper()->listMessages( folder->getName(),target ); |
653 | } | 653 | } |
654 | else | 654 | else |
655 | { | 655 | { |
656 | target.clear(); | 656 | target.clear(); |
657 | } | 657 | } |
658 | } | 658 | } |
659 | 659 | ||
660 | RECBODYP IMAPfolderItem::fetchBody(const RecMailP&aMail) | 660 | RECBODYP IMAPfolderItem::fetchBody(const RecMailP&aMail) |
661 | { | 661 | { |
662 | return imap->getWrapper()->fetchBody(aMail); | 662 | return imap->getWrapper()->fetchBody(aMail); |
663 | } | 663 | } |
664 | 664 | ||
665 | QPopupMenu * IMAPfolderItem::getContextMenu() | 665 | QPopupMenu * IMAPfolderItem::getContextMenu() |
666 | { | 666 | { |
667 | QPopupMenu *m = new QPopupMenu(0); | 667 | QPopupMenu *m = new QPopupMenu(0); |
668 | if (m) | 668 | if (m) |
669 | { | 669 | { |
670 | if (folder->may_select()) | 670 | if (folder->may_select()) |
671 | { | 671 | { |
672 | m->insertItem(QObject::tr("Refresh header list",contextName),0); | 672 | m->insertItem(QObject::tr("Refresh header list",contextName),0); |
673 | m->insertItem(QObject::tr("Move/Copie all mails",contextName),4); | 673 | m->insertItem(QObject::tr("Move/Copie all mails",contextName),4); |
674 | m->insertItem(QObject::tr("Delete all mails",contextName),1); | 674 | m->insertItem(QObject::tr("Delete all mails",contextName),1); |
675 | } | 675 | } |
676 | if (folder->no_inferior()==false) | 676 | if (folder->no_inferior()==false) |
677 | { | 677 | { |
678 | m->insertItem(QObject::tr("Create new subfolder",contextName),2); | 678 | m->insertItem(QObject::tr("Create new subfolder",contextName),2); |
679 | } | 679 | } |
680 | if (folder->getDisplayName().lower()!="inbox") | 680 | if (folder->getDisplayName().lower()!="inbox") |
681 | { | 681 | { |
682 | m->insertItem(QObject::tr("Delete folder",contextName),3); | 682 | m->insertItem(QObject::tr("Delete folder",contextName),3); |
683 | } | 683 | } |
684 | } | 684 | } |
685 | return m; | 685 | return m; |
686 | } | 686 | } |
687 | 687 | ||
688 | void IMAPfolderItem::createNewFolder() | 688 | void IMAPfolderItem::createNewFolder() |
689 | { | 689 | { |
690 | Newmdirdlg ndirdlg; | 690 | Newmdirdlg ndirdlg; |
691 | ndirdlg.showMaximized(); | 691 | ndirdlg.showMaximized(); |
692 | if ( ndirdlg.exec() ) | 692 | if ( ndirdlg.exec() ) |
693 | { | 693 | { |
694 | QString ndir = ndirdlg.Newdir(); | 694 | QString ndir = ndirdlg.Newdir(); |
695 | bool makesubs = ndirdlg.subpossible(); | 695 | bool makesubs = ndirdlg.subpossible(); |
696 | QString delemiter = Delemiter(); | 696 | QString delemiter = Delemiter(); |
697 | if (imap->wrapper->createMbox(ndir,folder,delemiter,makesubs)) | 697 | if (imap->wrapper->createMbox(ndir,folder,delemiter,makesubs)) |
698 | { | 698 | { |
699 | imap->refreshFolders(true); | 699 | imap->refreshFolders(true); |
700 | } | 700 | } |
701 | } | 701 | } |
702 | } | 702 | } |
703 | 703 | ||
704 | void IMAPfolderItem::deleteFolder() | 704 | void IMAPfolderItem::deleteFolder() |
705 | { | 705 | { |
706 | int yesno = QMessageBox::warning(0,QObject::tr("Delete folder",contextName), | 706 | int yesno = QMessageBox::warning(0,QObject::tr("Delete folder",contextName), |
707 | QObject::tr("<center>Realy delete folder <br><b>%1</b><br>and all if it content?</center>",contextName).arg(folder->getDisplayName()), | 707 | QObject::tr("<center>Realy delete folder <br><b>%1</b><br>and all if it content?</center>",contextName).arg(folder->getDisplayName()), |
708 | QObject::tr("Yes",contextName), | 708 | QObject::tr("Yes",contextName), |
709 | QObject::tr("No",contextName),QString::null,1,1); | 709 | QObject::tr("No",contextName),QString::null,1,1); |
710 | 710 | ||
711 | if (yesno == 0) | 711 | if (yesno == 0) |
712 | { | 712 | { |
713 | if (imap->getWrapper()->deleteMbox(folder)) | 713 | if (imap->getWrapper()->deleteMbox(folder)) |
714 | { | 714 | { |
715 | QListView*v=listView(); | 715 | QListView*v=listView(); |
716 | IMAPviewItem * box = imap; | 716 | IMAPviewItem * box = imap; |
717 | /* be carefull - after that this object is destroyd so don't use | 717 | /* be carefull - after that this object is destroyd so don't use |
718 | * any member of it after that call!!*/ | 718 | * any member of it after that call!!*/ |
719 | imap->refreshFolders(true); | 719 | imap->refreshFolders(true); |
720 | if (v) | 720 | if (v) |
721 | { | 721 | { |
722 | v->setSelected(box,true); | 722 | v->setSelected(box,true); |
723 | } | 723 | } |
724 | } | 724 | } |
725 | } | 725 | } |
726 | } | 726 | } |
727 | 727 | ||
728 | void IMAPfolderItem::downloadMails() | 728 | void IMAPfolderItem::downloadMails() |
729 | { | 729 | { |
730 | AccountView*bl = imap->accountView(); | 730 | AccountView*bl = imap->accountView(); |
731 | if (!bl) return; | 731 | if (!bl) return; |
732 | bl->downloadMails(folder,imap->getWrapper()); | 732 | bl->downloadMails(folder,imap->getWrapper()); |
733 | } | 733 | } |
734 | 734 | ||
735 | void IMAPfolderItem::contextMenuSelected(int id) | 735 | void IMAPfolderItem::contextMenuSelected(int id) |
736 | { | 736 | { |
737 | 737 | ||
738 | AccountView * view = (AccountView*)listView(); | 738 | AccountView * view = (AccountView*)listView(); |
739 | switch(id) | 739 | switch(id) |
740 | { | 740 | { |
741 | case 0: | 741 | case 0: |
742 | view->refreshCurrent(); | 742 | view->refreshCurrent(); |
743 | break; | 743 | break; |
744 | case 1: | 744 | case 1: |
745 | deleteAllMail(imap->getWrapper(),folder); | 745 | deleteAllMail(imap->getWrapper(),folder); |
746 | break; | 746 | break; |
747 | case 2: | 747 | case 2: |
748 | createNewFolder(); | 748 | createNewFolder(); |
749 | break; | 749 | break; |
750 | case 3: | 750 | case 3: |
751 | deleteFolder(); | 751 | deleteFolder(); |
752 | break; | 752 | break; |
753 | case 4: | 753 | case 4: |
754 | downloadMails(); | 754 | downloadMails(); |
755 | break; | 755 | break; |
756 | default: | 756 | default: |
757 | break; | 757 | break; |
758 | } | 758 | } |
759 | } | 759 | } |
760 | 760 | ||
761 | /** | 761 | /** |
762 | * MH Account stuff | 762 | * MH Account stuff |
763 | */ | 763 | */ |
764 | /* MH is a little bit different - the top folder can contains messages other than in IMAP and | 764 | /* MH is a little bit different - the top folder can contains messages other than in IMAP and |
765 | POP3 and MBOX */ | 765 | POP3 and MBOX */ |
766 | MHviewItem::MHviewItem( const QString&aPath, AccountView *parent ) | 766 | MHviewItem::MHviewItem( const QString&aPath, AccountView *parent ) |
767 | : AccountViewItem( parent ) | 767 | : AccountViewItem( parent ) |
768 | { | 768 | { |
769 | m_Path = aPath; | 769 | m_Path = aPath; |
770 | /* be carefull - the space within settext is wanted - thats why the string twice */ | 770 | /* be carefull - the space within settext is wanted - thats why the string twice */ |
771 | wrapper = AbstractMail::getWrapper( m_Path,"Local Folders"); | 771 | wrapper = AbstractMail::getWrapper( m_Path,"Local Folders"); |
772 | setPixmap( 0, PIXMAP_LOCALFOLDER ); | 772 | setPixmap( 0, PIXMAP_LOCALFOLDER ); |
773 | setText( 0, " Local Folders" ); | 773 | setText( 0, " Local Folders" ); |
774 | setOpen( true ); | 774 | setOpen( true ); |
775 | folder = 0; | 775 | folder = 0; |
776 | } | 776 | } |
777 | 777 | ||
778 | MHviewItem::~MHviewItem() | 778 | MHviewItem::~MHviewItem() |
779 | { | 779 | { |
780 | delete wrapper; | 780 | delete wrapper; |
781 | } | 781 | } |
782 | 782 | ||
783 | AbstractMail *MHviewItem::getWrapper() | 783 | AbstractMail *MHviewItem::getWrapper() |
784 | { | 784 | { |
785 | return wrapper; | 785 | return wrapper; |
786 | } | 786 | } |
787 | 787 | ||
788 | void MHviewItem::refresh( QValueList<RecMailP> & target) | 788 | void MHviewItem::refresh( QValueList<RecMailP> & target) |
789 | { | 789 | { |
790 | refresh(false); | 790 | refresh(false); |
791 | getWrapper()->listMessages( "",target ); | 791 | getWrapper()->listMessages( "",target ); |
792 | } | 792 | } |
793 | 793 | ||
794 | void MHviewItem::refresh(bool force) | 794 | void MHviewItem::refresh(bool force) |
795 | { | 795 | { |
796 | if (childCount()>0 && force==false) return; | 796 | if (childCount()>0 && force==false) return; |
797 | removeChilds(); | 797 | removeChilds(); |
798 | currentFolders.clear(); | 798 | currentFolders.clear(); |
799 | QValueList<FolderP> *folders = wrapper->listFolders(); | 799 | QValueList<FolderP> *folders = wrapper->listFolders(); |
800 | QValueList<FolderP>::ConstIterator it; | 800 | QValueList<FolderP>::ConstIterator it; |
801 | MHfolderItem*item = 0; | 801 | MHfolderItem*item = 0; |
802 | MHfolderItem*pmaster = 0; | 802 | MHfolderItem*pmaster = 0; |
803 | QString fname = ""; | 803 | QString fname = ""; |
804 | int pos; | 804 | int pos; |
805 | for ( it = folders->begin(); it!=folders->end(); ++it) | 805 | for ( it = folders->begin(); it!=folders->end(); ++it) |
806 | { | 806 | { |
807 | fname = (*it)->getDisplayName(); | 807 | fname = (*it)->getDisplayName(); |
808 | /* this folder itself */ | 808 | /* this folder itself */ |
809 | if (fname=="/") | 809 | if (fname=="/") |
810 | { | 810 | { |
811 | currentFolders.append(fname); | 811 | currentFolders.append(fname); |
812 | folder = (*it); | 812 | folder = (*it); |
813 | continue; | 813 | continue; |
814 | } | 814 | } |
815 | currentFolders.append(fname); | 815 | currentFolders.append(fname); |
816 | pos = fname.findRev("/"); | 816 | pos = fname.findRev("/"); |
817 | if (pos > 0) | 817 | if (pos > 0) |
818 | { | 818 | { |
819 | fname = fname.left(pos); | 819 | fname = fname.left(pos); |
820 | pmaster = (MHfolderItem*)findSubItem(fname); | 820 | pmaster = (MHfolderItem*)findSubItem(fname); |
821 | } | 821 | } |
822 | else | 822 | else |
823 | { | 823 | { |
824 | pmaster = 0; | 824 | pmaster = 0; |
825 | } | 825 | } |
826 | if (pmaster) | 826 | if (pmaster) |
827 | { | 827 | { |
828 | item = new MHfolderItem( (*it), pmaster, item, this ); | 828 | item = new MHfolderItem( (*it), pmaster, item, this ); |
829 | } | 829 | } |
830 | else | 830 | else |
831 | { | 831 | { |
832 | item = new MHfolderItem( (*it), this , item ); | 832 | item = new MHfolderItem( (*it), this , item ); |
833 | } | 833 | } |
834 | item->setSelectable((*it)->may_select()); | 834 | item->setSelectable((*it)->may_select()); |
835 | } | 835 | } |
836 | delete folders; | 836 | delete folders; |
837 | } | 837 | } |
838 | 838 | ||
839 | RECBODYP MHviewItem::fetchBody( const RecMailP &mail ) | 839 | RECBODYP MHviewItem::fetchBody( const RecMailP &mail ) |
840 | { | 840 | { |
841 | 841 | ||
842 | return wrapper->fetchBody( mail ); | 842 | return wrapper->fetchBody( mail ); |
843 | } | 843 | } |
844 | 844 | ||
845 | QPopupMenu * MHviewItem::getContextMenu() | 845 | QPopupMenu * MHviewItem::getContextMenu() |
846 | { | 846 | { |
847 | QPopupMenu *m = new QPopupMenu(0); | 847 | QPopupMenu *m = new QPopupMenu(0); |
848 | if (m) | 848 | if (m) |
849 | { | 849 | { |
850 | m->insertItem(QObject::tr("Refresh folder list",contextName),0); | 850 | m->insertItem(QObject::tr("Refresh folder list",contextName),0); |
851 | m->insertItem(QObject::tr("Create new folder",contextName),1); | 851 | m->insertItem(QObject::tr("Create new folder",contextName),1); |
852 | m->insertItem(QObject::tr("Delete all mails",contextName),2); | 852 | m->insertItem(QObject::tr("Delete all mails",contextName),2); |
853 | m->insertItem(QObject::tr("Move/Copie all mails",contextName),3); | 853 | m->insertItem(QObject::tr("Move/Copie all mails",contextName),3); |
854 | } | 854 | } |
855 | return m; | 855 | return m; |
856 | } | 856 | } |
857 | 857 | ||
858 | void MHviewItem::createFolder() | 858 | void MHviewItem::createFolder() |
859 | { | 859 | { |
860 | Newmdirdlg ndirdlg(0,0,true); | 860 | Newmdirdlg ndirdlg(0,0,true); |
861 | ndirdlg.showMaximized(); | 861 | ndirdlg.showMaximized(); |
862 | if ( ndirdlg.exec() ) | 862 | if ( ndirdlg.exec() ) |
863 | { | 863 | { |
864 | QString ndir = ndirdlg.Newdir(); | 864 | QString ndir = ndirdlg.Newdir(); |
865 | if (wrapper->createMbox(ndir)) | 865 | if (wrapper->createMbox(ndir)) |
866 | { | 866 | { |
867 | refresh(true); | 867 | refresh(true); |
868 | } | 868 | } |
869 | } | 869 | } |
870 | } | 870 | } |
871 | 871 | ||
872 | void MHviewItem::downloadMails() | 872 | void MHviewItem::downloadMails() |
873 | { | 873 | { |
874 | AccountView*bl = accountView(); | 874 | AccountView*bl = accountView(); |
875 | if (!bl) return; | 875 | if (!bl) return; |
876 | bl->downloadMails(folder,getWrapper()); | 876 | bl->downloadMails(folder,getWrapper()); |
877 | } | 877 | } |
878 | 878 | ||
879 | QStringList MHviewItem::subFolders() | 879 | QStringList MHviewItem::subFolders() |
880 | { | 880 | { |
881 | return currentFolders; | 881 | return currentFolders; |
882 | } | 882 | } |