Diffstat (limited to 'noncore/net/mail/accountview.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mail/accountview.cpp | 40 |
1 files changed, 27 insertions, 13 deletions
diff --git a/noncore/net/mail/accountview.cpp b/noncore/net/mail/accountview.cpp index d9792d4..2ddf834 100644 --- a/noncore/net/mail/accountview.cpp +++ b/noncore/net/mail/accountview.cpp | |||
@@ -1,12 +1,17 @@ | |||
1 | |||
1 | #include "accountview.h" | 2 | #include "accountview.h" |
2 | #include "accountitem.h" | 3 | #include "accountitem.h" |
3 | #include "selectstore.h" | 4 | #include "selectstore.h" |
4 | #include <qmessagebox.h> | 5 | |
5 | #include <qpopupmenu.h> | 6 | /* OPIE */ |
6 | #include <libmailwrapper/settings.h> | 7 | #include <libmailwrapper/settings.h> |
7 | #include <libmailwrapper/mailwrapper.h> | 8 | #include <libmailwrapper/mailwrapper.h> |
8 | #include <libmailwrapper/mailtypes.h> | 9 | #include <libmailwrapper/mailtypes.h> |
9 | #include <libmailwrapper/abstractmail.h> | 10 | #include <libmailwrapper/abstractmail.h> |
11 | #include <qpe/qpeapplication.h> | ||
10 | 12 | ||
13 | /* QT */ | ||
14 | #include <qmessagebox.h> | ||
15 | #include <qpopupmenu.h> | ||
11 | 16 | ||
12 | AccountView::AccountView( QWidget *parent, const char *name, WFlags flags ) | 17 | AccountView::AccountView( QWidget *parent, const char *name, WFlags flags ) |
@@ -56,10 +61,14 @@ void AccountView::populate( QList<Account> list ) | |||
56 | 61 | ||
57 | Account *it; | 62 | Account *it; |
58 | for ( it = list.first(); it; it = list.next() ) { | 63 | for ( it = list.first(); it; it = list.next() ) |
59 | if ( it->getType().compare( "IMAP" ) == 0 ) { | 64 | { |
65 | if ( it->getType().compare( "IMAP" ) == 0 ) | ||
66 | { | ||
60 | IMAPaccount *imap = static_cast<IMAPaccount *>(it); | 67 | IMAPaccount *imap = static_cast<IMAPaccount *>(it); |
61 | qDebug( "added IMAP " + imap->getAccountName() ); | 68 | qDebug( "added IMAP " + imap->getAccountName() ); |
62 | imapAccounts.append(new IMAPviewItem( imap, this )); | 69 | imapAccounts.append(new IMAPviewItem( imap, this )); |
63 | } else if ( it->getType().compare( "POP3" ) == 0 ) { | 70 | } |
71 | else if ( it->getType().compare( "POP3" ) == 0 ) | ||
72 | { | ||
64 | POP3account *pop3 = static_cast<POP3account *>(it); | 73 | POP3account *pop3 = static_cast<POP3account *>(it); |
65 | qDebug( "added POP3 " + pop3->getAccountName() ); | 74 | qDebug( "added POP3 " + pop3->getAccountName() ); |
@@ -70,8 +79,10 @@ void AccountView::populate( QList<Account> list ) | |||
70 | } | 79 | } |
71 | 80 | ||
72 | void AccountView::refresh(QListViewItem *item) { | 81 | void AccountView::refresh(QListViewItem *item) |
82 | { | ||
73 | 83 | ||
74 | qDebug("AccountView refresh..."); | 84 | qDebug("AccountView refresh..."); |
75 | if ( item ) { | 85 | if ( item ) |
86 | { | ||
76 | m_currentItem = item; | 87 | m_currentItem = item; |
77 | QList<RecMail> headerlist; | 88 | QList<RecMail> headerlist; |
@@ -96,5 +107,4 @@ void AccountView::refreshCurrent() | |||
96 | void AccountView::refreshAll() | 107 | void AccountView::refreshAll() |
97 | { | 108 | { |
98 | |||
99 | } | 109 | } |
100 | 110 | ||
@@ -109,13 +119,15 @@ RecBody AccountView::fetchBody(const RecMail&aMail) | |||
109 | void AccountView::setupFolderselect(Selectstore*sels) | 119 | void AccountView::setupFolderselect(Selectstore*sels) |
110 | { | 120 | { |
111 | sels->showMaximized(); | 121 | QPEApplication::showDialog( sels ); |
112 | QStringList sFolders; | 122 | QStringList sFolders; |
113 | unsigned int i = 0; | 123 | unsigned int i = 0; |
114 | for (i=0; i < mhAccounts.count();++i) { | 124 | for (i=0; i < mhAccounts.count();++i) |
125 | { | ||
115 | mhAccounts[i]->refresh(false); | 126 | mhAccounts[i]->refresh(false); |
116 | sFolders = mhAccounts[i]->subFolders(); | 127 | sFolders = mhAccounts[i]->subFolders(); |
117 | sels->addAccounts(mhAccounts[i]->getWrapper(),sFolders); | 128 | sels->addAccounts(mhAccounts[i]->getWrapper(),sFolders); |
118 | } | 129 | } |
119 | for (i=0; i < imapAccounts.count();++i) { | 130 | for (i=0; i < imapAccounts.count();++i) |
131 | { | ||
120 | if (imapAccounts[i]->offline()) | 132 | if (imapAccounts[i]->offline()) |
121 | continue; | 133 | continue; |
@@ -135,8 +147,10 @@ void AccountView::downloadMails(Folder*fromFolder,AbstractMail*fromWrapper) | |||
135 | targetFolder = sels.currentFolder(); | 147 | targetFolder = sels.currentFolder(); |
136 | if ( (fromWrapper==targetMail && fromFolder->getName()==targetFolder) || | 148 | if ( (fromWrapper==targetMail && fromFolder->getName()==targetFolder) || |
137 | targetFolder.isEmpty()) { | 149 | targetFolder.isEmpty()) |
150 | { | ||
138 | return; | 151 | return; |
139 | } | 152 | } |
140 | if (sels.newFolder() && !targetMail->createMbox(targetFolder)) { | 153 | if (sels.newFolder() && !targetMail->createMbox(targetFolder)) |
154 | { | ||
141 | QMessageBox::critical(0,tr("Error creating new Folder"), | 155 | QMessageBox::critical(0,tr("Error creating new Folder"), |
142 | tr("<center>Error while creating<br>new folder - breaking.</center>")); | 156 | tr("<center>Error while creating<br>new folder - breaking.</center>")); |