-rw-r--r-- | kmicromail/opiemail.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp index 4e7c6be..7ccfb65 100644 --- a/kmicromail/opiemail.cpp +++ b/kmicromail/opiemail.cpp | |||
@@ -192,128 +192,136 @@ void OpieMail::slotSendQueued() | |||
192 | smtp = selsmtp.selected_smtp(); | 192 | smtp = selsmtp.selected_smtp(); |
193 | } | 193 | } |
194 | } | 194 | } |
195 | if (smtp) | 195 | if (smtp) |
196 | { | 196 | { |
197 | SMTPwrapper * wrap = new SMTPwrapper(smtp); | 197 | SMTPwrapper * wrap = new SMTPwrapper(smtp); |
198 | if ( wrap->flushOutbox() ) | 198 | if ( wrap->flushOutbox() ) |
199 | { | 199 | { |
200 | QMessageBox::information(0,tr("Info"),tr("Mail queue flushed")); | 200 | QMessageBox::information(0,tr("Info"),tr("Mail queue flushed")); |
201 | } | 201 | } |
202 | delete wrap; | 202 | delete wrap; |
203 | } | 203 | } |
204 | } | 204 | } |
205 | 205 | ||
206 | void OpieMail::slotSearchMails() | 206 | void OpieMail::slotSearchMails() |
207 | { | 207 | { |
208 | qDebug("OpieMail::slotSearchMails():not implemented "); | 208 | qDebug("OpieMail::slotSearchMails():not implemented "); |
209 | } | 209 | } |
210 | 210 | ||
211 | void OpieMail::slotEditSettings() | 211 | void OpieMail::slotEditSettings() |
212 | { | 212 | { |
213 | #if 0 | 213 | #if 0 |
214 | SettingsDialog settingsDialog( this, 0, true, WStyle_ContextHelp ); | 214 | SettingsDialog settingsDialog( this, 0, true, WStyle_ContextHelp ); |
215 | settingsDialog.showMaximized(); | 215 | settingsDialog.showMaximized(); |
216 | settingsDialog.exec(); | 216 | settingsDialog.exec(); |
217 | #endif | 217 | #endif |
218 | KOPrefsDialog settingsDialog( this, "koprefs", true ); | 218 | KOPrefsDialog settingsDialog( this, "koprefs", true ); |
219 | settingsDialog.showMaximized(); | 219 | settingsDialog.showMaximized(); |
220 | settingsDialog.exec(); | 220 | settingsDialog.exec(); |
221 | } | 221 | } |
222 | 222 | ||
223 | void OpieMail::slotEditAccounts() | 223 | void OpieMail::slotEditAccounts() |
224 | { | 224 | { |
225 | EditAccounts eaDialog( settings, this, 0, true ); | 225 | EditAccounts eaDialog( settings, this, 0, true ); |
226 | eaDialog.slotAdjustColumns(); | 226 | eaDialog.slotAdjustColumns(); |
227 | eaDialog.showMaximized(); | 227 | eaDialog.showMaximized(); |
228 | eaDialog.exec(); | 228 | eaDialog.exec(); |
229 | if ( settings ) delete settings; | 229 | if ( settings ) delete settings; |
230 | settings = new Settings(); | 230 | settings = new Settings(); |
231 | 231 | ||
232 | folderView->populate( settings->getAccounts() ); | 232 | folderView->populate( settings->getAccounts() ); |
233 | } | 233 | } |
234 | 234 | ||
235 | void OpieMail::displayMail() | 235 | void OpieMail::displayMail() |
236 | { | 236 | { |
237 | QListViewItem*item = mailView->currentItem(); | 237 | QListViewItem*item = mailView->currentItem(); |
238 | if (!item) return; | 238 | if (!item) return; |
239 | RecMailP mail = ((MailListViewItem*)item)->data(); | 239 | RecMailP mail = ((MailListViewItem*)item)->data(); |
240 | RecBodyP body = folderView->fetchBody(mail); | 240 | RecBodyP body = folderView->fetchBody(mail); |
241 | ViewMail readMail( this,"", Qt::WType_Modal ); | 241 | ViewMail readMail( this,"", Qt::WType_Modal ); |
242 | readMail.setBody( body ); | 242 | readMail.setBody( body ); |
243 | readMail.setMail( mail ); | 243 | readMail.setMail( mail ); |
244 | readMail.showMaximized(); | 244 | readMail.showMaximized(); |
245 | readMail.exec(); | 245 | readMail.exec(); |
246 | 246 | ||
247 | if ( readMail.deleted ) | 247 | if ( readMail.deleted ) |
248 | { | 248 | { |
249 | folderView->refreshCurrent(); | 249 | folderView->refreshCurrent(); |
250 | } | 250 | } |
251 | else | 251 | else |
252 | { | 252 | { |
253 | ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); | 253 | ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); |
254 | } | 254 | } |
255 | } | 255 | } |
256 | void OpieMail::slotGetAllMail() | ||
257 | { | ||
258 | QListViewItem * item = folderView->firstChild(); | ||
259 | while ( item ){ | ||
260 | ((AccountViewItem *)item)->contextMenuSelected( 101 ); | ||
261 | item = item->nextSibling (); | ||
262 | } | ||
263 | } | ||
256 | void OpieMail::slotGetMail() | 264 | void OpieMail::slotGetMail() |
257 | { | 265 | { |
258 | QListViewItem * item = folderView->currentItem(); | 266 | QListViewItem * item = folderView->currentItem(); |
259 | if ( ! item ) return; | 267 | if ( ! item ) return; |
260 | while ( item->parent () ) | 268 | while ( item->parent () ) |
261 | item = item->parent (); | 269 | item = item->parent (); |
262 | ((AccountViewItem *)item)->contextMenuSelected( 101 ); | 270 | ((AccountViewItem *)item)->contextMenuSelected( 101 ); |
263 | } | 271 | } |
264 | void OpieMail::slotDeleteMail() | 272 | void OpieMail::slotDeleteMail() |
265 | { | 273 | { |
266 | if (!mailView->currentItem()) return; | 274 | if (!mailView->currentItem()) return; |
267 | RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); | 275 | RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); |
268 | if ( QMessageBox::warning(this, tr("Delete Mail"), QString( tr("<p>Do you really want to delete this mail? <br><br>" ) + mail->getFrom() + " - " + mail->getSubject() ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) | 276 | if ( QMessageBox::warning(this, tr("Delete Mail"), QString( tr("<p>Do you really want to delete this mail? <br><br>" ) + mail->getFrom() + " - " + mail->getSubject() ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) |
269 | { | 277 | { |
270 | mail->Wrapper()->deleteMail( mail ); | 278 | mail->Wrapper()->deleteMail( mail ); |
271 | folderView->refreshCurrent(); | 279 | folderView->refreshCurrent(); |
272 | } | 280 | } |
273 | } | 281 | } |
274 | void OpieMail::slotDeleteAllMail() | 282 | void OpieMail::slotDeleteAllMail() |
275 | { | 283 | { |
276 | 284 | ||
277 | QValueList<RecMailP> t; | 285 | QValueList<RecMailP> t; |
278 | if ( QMessageBox::warning(this, tr("Delete All Mails"), tr("Do you really want to delete\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) | 286 | if ( QMessageBox::warning(this, tr("Delete All Mails"), tr("Do you really want to delete\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) |
279 | { | 287 | { |
280 | MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); | 288 | MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); |
281 | while ( item ) { | 289 | while ( item ) { |
282 | if ( item->isSelected() ) { | 290 | if ( item->isSelected() ) { |
283 | t.append( item->data() ); | 291 | t.append( item->data() ); |
284 | } | 292 | } |
285 | item = (MailListViewItem*)item->nextSibling(); | 293 | item = (MailListViewItem*)item->nextSibling(); |
286 | } | 294 | } |
287 | } | 295 | } |
288 | else | 296 | else |
289 | return; | 297 | return; |
290 | if ( t.count() == 0 ) | 298 | if ( t.count() == 0 ) |
291 | return; | 299 | return; |
292 | RecMailP mail = t.first(); | 300 | RecMailP mail = t.first(); |
293 | mail->Wrapper()->deleteMailList(t); | 301 | mail->Wrapper()->deleteMailList(t); |
294 | folderView->refreshCurrent(); | 302 | folderView->refreshCurrent(); |
295 | 303 | ||
296 | 304 | ||
297 | } | 305 | } |
298 | void OpieMail::clearSelection() | 306 | void OpieMail::clearSelection() |
299 | { | 307 | { |
300 | mailView->clearSelection(); | 308 | mailView->clearSelection(); |
301 | 309 | ||
302 | } | 310 | } |
303 | 311 | ||
304 | void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int ) | 312 | void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int ) |
305 | { | 313 | { |
306 | if (!mailView->currentItem()) return; | 314 | if (!mailView->currentItem()) return; |
307 | MAILLIB::ATYPE mailtype = ((MailListViewItem*)mailView->currentItem() )->wrapperType(); | 315 | MAILLIB::ATYPE mailtype = ((MailListViewItem*)mailView->currentItem() )->wrapperType(); |
308 | /* just the RIGHT button - or hold on pda */ | 316 | /* just the RIGHT button - or hold on pda */ |
309 | if (button!=2) {return;} | 317 | if (button!=2) {return;} |
310 | if (!item) return; | 318 | if (!item) return; |
311 | QPopupMenu *m = new QPopupMenu(0); | 319 | QPopupMenu *m = new QPopupMenu(0); |
312 | if (m) | 320 | if (m) |
313 | { | 321 | { |
314 | if (mailtype==MAILLIB::A_NNTP) { | 322 | if (mailtype==MAILLIB::A_NNTP) { |
315 | m->insertItem(tr("Read this posting"),this,SLOT(displayMail())); | 323 | m->insertItem(tr("Read this posting"),this,SLOT(displayMail())); |
316 | // m->insertItem(tr("Copy this posting"),this,SLOT(slotMoveCopyMail())); | 324 | // m->insertItem(tr("Copy this posting"),this,SLOT(slotMoveCopyMail())); |
317 | } else { | 325 | } else { |
318 | if (folderView->currentisDraft()) { | 326 | if (folderView->currentisDraft()) { |
319 | m->insertItem(tr("Edit this mail"),this,SLOT(reEditMail())); | 327 | m->insertItem(tr("Edit this mail"),this,SLOT(reEditMail())); |