author | zautrix <zautrix> | 2004-09-11 08:56:57 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-11 08:56:57 (UTC) |
commit | 0f45c977d7530b6ca827b7a7c7da7469f01800ca (patch) (unidiff) | |
tree | 0368bbd4865a0b21bb197cfd0a190fd0c2cd9242 /kmicromail/accountview.cpp | |
parent | 1b41a0e3bf63364940daf132446939e3570c57ad (diff) | |
download | kdepimpi-0f45c977d7530b6ca827b7a7c7da7469f01800ca.zip kdepimpi-0f45c977d7530b6ca827b7a7c7da7469f01800ca.tar.gz kdepimpi-0f45c977d7530b6ca827b7a7c7da7469f01800ca.tar.bz2 |
More config changes
-rw-r--r-- | kmicromail/accountview.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/kmicromail/accountview.cpp b/kmicromail/accountview.cpp index 4ead545..85523b1 100644 --- a/kmicromail/accountview.cpp +++ b/kmicromail/accountview.cpp | |||
@@ -110,64 +110,91 @@ void AccountView::refreshCurrent() | |||
110 | 110 | ||
111 | void AccountView::refreshAll() | 111 | void AccountView::refreshAll() |
112 | { | 112 | { |
113 | } | 113 | } |
114 | 114 | ||
115 | RecBodyP AccountView::fetchBody(const RecMailP&aMail) | 115 | RecBodyP AccountView::fetchBody(const RecMailP&aMail) |
116 | { | 116 | { |
117 | QListViewItem*item = selectedItem (); | 117 | QListViewItem*item = selectedItem (); |
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 | ||
123 | void AccountView::setupFolderselect(Selectstore*sels) | 123 | void 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 | } |
142 | void 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 | ||
143 | void AccountView::downloadMails(const FolderP&fromFolder,AbstractMail*fromWrapper) | 170 | void 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(); |
166 | 193 | ||
167 | fromWrapper->mvcpAllMails(fromFolder,targetFolder,targetMail,sels.moveMails(), maxsize); | 194 | fromWrapper->mvcpAllMails(fromFolder,targetFolder,targetMail,sels.moveMails(), maxsize); |
168 | refreshCurrent(); | 195 | refreshCurrent(); |
169 | } | 196 | } |
170 | 197 | ||
171 | bool AccountView::currentisDraft() | 198 | bool AccountView::currentisDraft() |
172 | { | 199 | { |
173 | AccountViewItem *view = static_cast<AccountViewItem *>(currentItem()); | 200 | AccountViewItem *view = static_cast<AccountViewItem *>(currentItem()); |