author | zautrix <zautrix> | 2004-09-16 23:05:56 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-16 23:05:56 (UTC) |
commit | af411746b1480e7b331ea7d163f39d2507cf7264 (patch) (unidiff) | |
tree | bc839893f0bd002a34368987bdda3e71aad630c4 /kmicromail/opiemail.cpp | |
parent | b44edfb21be0eee91c4f47401e3fe6ff37e4c16c (diff) | |
download | kdepimpi-af411746b1480e7b331ea7d163f39d2507cf7264.zip kdepimpi-af411746b1480e7b331ea7d163f39d2507cf7264.tar.gz kdepimpi-af411746b1480e7b331ea7d163f39d2507cf7264.tar.bz2 |
Fixed timezone problems in ompi
-rw-r--r-- | kmicromail/opiemail.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp index 7ccfb65..3cbac8e 100644 --- a/kmicromail/opiemail.cpp +++ b/kmicromail/opiemail.cpp | |||
@@ -228,193 +228,196 @@ void OpieMail::slotEditAccounts() | |||
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() | 256 | void OpieMail::slotGetAllMail() |
257 | { | 257 | { |
258 | QListViewItem * item = folderView->firstChild(); | 258 | QListViewItem * item = folderView->firstChild(); |
259 | while ( item ){ | 259 | while ( item ){ |
260 | ((AccountViewItem *)item)->contextMenuSelected( 101 ); | 260 | ((AccountViewItem *)item)->contextMenuSelected( 101 ); |
261 | item = item->nextSibling (); | 261 | item = item->nextSibling (); |
262 | } | 262 | } |
263 | } | 263 | } |
264 | void OpieMail::slotGetMail() | 264 | void OpieMail::slotGetMail() |
265 | { | 265 | { |
266 | QListViewItem * item = folderView->currentItem(); | 266 | QListViewItem * item = folderView->currentItem(); |
267 | if ( ! item ) return; | 267 | if ( ! item ) return; |
268 | while ( item->parent () ) | 268 | while ( item->parent () ) |
269 | item = item->parent (); | 269 | item = item->parent (); |
270 | ((AccountViewItem *)item)->contextMenuSelected( 101 ); | 270 | ((AccountViewItem *)item)->contextMenuSelected( 101 ); |
271 | } | 271 | } |
272 | void OpieMail::slotDeleteMail() | 272 | void OpieMail::slotDeleteMail() |
273 | { | 273 | { |
274 | if (!mailView->currentItem()) return; | 274 | if (!mailView->currentItem()) return; |
275 | RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); | 275 | RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); |
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 ) | 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 ) |
277 | { | 277 | { |
278 | mail->Wrapper()->deleteMail( mail ); | 278 | mail->Wrapper()->deleteMail( mail ); |
279 | folderView->refreshCurrent(); | 279 | folderView->refreshCurrent(); |
280 | } | 280 | } |
281 | } | 281 | } |
282 | void OpieMail::slotDeleteAllMail() | 282 | void OpieMail::slotDeleteAllMail() |
283 | { | 283 | { |
284 | 284 | ||
285 | QValueList<RecMailP> t; | 285 | QValueList<RecMailP> t; |
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 ) | 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 ) |
287 | { | 287 | { |
288 | MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); | 288 | MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); |
289 | while ( item ) { | 289 | while ( item ) { |
290 | if ( item->isSelected() ) { | 290 | if ( item->isSelected() ) { |
291 | t.append( item->data() ); | 291 | t.append( item->data() ); |
292 | } | 292 | } |
293 | item = (MailListViewItem*)item->nextSibling(); | 293 | item = (MailListViewItem*)item->nextSibling(); |
294 | } | 294 | } |
295 | } | 295 | } |
296 | else | 296 | else |
297 | return; | 297 | return; |
298 | if ( t.count() == 0 ) | 298 | if ( t.count() == 0 ) |
299 | return; | 299 | return; |
300 | RecMailP mail = t.first(); | 300 | RecMailP mail = t.first(); |
301 | mail->Wrapper()->deleteMailList(t); | 301 | mail->Wrapper()->deleteMailList(t); |
302 | folderView->refreshCurrent(); | 302 | folderView->refreshCurrent(); |
303 | 303 | ||
304 | 304 | ||
305 | } | 305 | } |
306 | void OpieMail::clearSelection() | 306 | void OpieMail::clearSelection() |
307 | { | 307 | { |
308 | mailView->clearSelection(); | 308 | mailView->clearSelection(); |
309 | 309 | ||
310 | } | 310 | } |
311 | 311 | ||
312 | void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int ) | 312 | void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int ) |
313 | { | 313 | { |
314 | if (!mailView->currentItem()) return; | 314 | if (!mailView->currentItem()) return; |
315 | MAILLIB::ATYPE mailtype = ((MailListViewItem*)mailView->currentItem() )->wrapperType(); | 315 | MAILLIB::ATYPE mailtype = ((MailListViewItem*)mailView->currentItem() )->wrapperType(); |
316 | /* just the RIGHT button - or hold on pda */ | 316 | /* just the RIGHT button - or hold on pda */ |
317 | if (button!=2) {return;} | 317 | if (button!=2) {return;} |
318 | if (!item) return; | 318 | if (!item) return; |
319 | QPopupMenu *m = new QPopupMenu(0); | 319 | QPopupMenu *m = new QPopupMenu(0); |
320 | if (m) | 320 | if (m) |
321 | { | 321 | { |
322 | if (mailtype==MAILLIB::A_NNTP) { | 322 | if (mailtype==MAILLIB::A_NNTP) { |
323 | m->insertItem(tr("Read this posting"),this,SLOT(displayMail())); | 323 | m->insertItem(tr("Read this posting"),this,SLOT(displayMail())); |
324 | // m->insertItem(tr("Copy this posting"),this,SLOT(slotMoveCopyMail())); | 324 | m->insertItem(tr("Copy this posting"),this,SLOT(slotMoveCopyMail())); |
325 | m->insertSeparator(); | ||
326 | m->insertItem(tr("Copy all selected postings"),this,SLOT(slotMoveCopyAllMail())); | ||
327 | m->insertItem(tr("Clear selection"),this,SLOT(clearSelection())); | ||
325 | } else { | 328 | } else { |
326 | if (folderView->currentisDraft()) { | 329 | if (folderView->currentisDraft()) { |
327 | m->insertItem(tr("Edit this mail"),this,SLOT(reEditMail())); | 330 | m->insertItem(tr("Edit this mail"),this,SLOT(reEditMail())); |
328 | } | 331 | } |
329 | m->insertItem(tr("Read this mail"),this,SLOT(displayMail())); | 332 | m->insertItem(tr("Read this mail"),this,SLOT(displayMail())); |
330 | m->insertItem(tr("Move/Copy this mail"),this,SLOT(slotMoveCopyMail())); | 333 | m->insertItem(tr("Move/Copy this mail"),this,SLOT(slotMoveCopyMail())); |
331 | m->insertItem(tr("Delete this mail"),this,SLOT(slotDeleteMail())); | 334 | m->insertItem(tr("Delete this mail"),this,SLOT(slotDeleteMail())); |
332 | m->insertSeparator(); | 335 | m->insertSeparator(); |
333 | m->insertItem(tr("Move/Copy all selected mail"),this,SLOT(slotMoveCopyAllMail())); | 336 | m->insertItem(tr("Move/Copy all selected mail"),this,SLOT(slotMoveCopyAllMail())); |
334 | m->insertItem(tr("Delete all selected mails"),this,SLOT(slotDeleteAllMail())); | 337 | m->insertItem(tr("Delete all selected mails"),this,SLOT(slotDeleteAllMail())); |
335 | m->insertItem(tr("Clear selection"),this,SLOT(clearSelection())); | 338 | m->insertItem(tr("Clear selection"),this,SLOT(clearSelection())); |
336 | } | 339 | } |
337 | m->setFocus(); | 340 | m->setFocus(); |
338 | m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); | 341 | m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); |
339 | delete m; | 342 | delete m; |
340 | } | 343 | } |
341 | } | 344 | } |
342 | 345 | ||
343 | void OpieMail::slotShowFolders( bool show ) | 346 | void OpieMail::slotShowFolders( bool show ) |
344 | { | 347 | { |
345 | if ( show && folderView->isHidden() ) | 348 | if ( show && folderView->isHidden() ) |
346 | { | 349 | { |
347 | folderView->show(); | 350 | folderView->show(); |
348 | } | 351 | } |
349 | else if ( !show && !folderView->isHidden() ) | 352 | else if ( !show && !folderView->isHidden() ) |
350 | { | 353 | { |
351 | folderView->hide(); | 354 | folderView->hide(); |
352 | } | 355 | } |
353 | } | 356 | } |
354 | 357 | ||
355 | void OpieMail::refreshMailView(const QValueList<RecMailP>&list) | 358 | void OpieMail::refreshMailView(const QValueList<RecMailP>&list) |
356 | { | 359 | { |
357 | MailListViewItem*item = 0; | 360 | MailListViewItem*item = 0; |
358 | mailView->clear(); | 361 | mailView->clear(); |
359 | 362 | ||
360 | QValueList<RecMailP>::ConstIterator it; | 363 | QValueList<RecMailP>::ConstIterator it; |
361 | for (it = list.begin(); it != list.end();++it) | 364 | for (it = list.begin(); it != list.end();++it) |
362 | { | 365 | { |
363 | item = new MailListViewItem(mailView,item); | 366 | item = new MailListViewItem(mailView,item); |
364 | item->storeData((*it)); | 367 | item->storeData((*it)); |
365 | item->showEntry(); | 368 | item->showEntry(); |
366 | } | 369 | } |
367 | } | 370 | } |
368 | 371 | ||
369 | void OpieMail::mailLeftClicked( QListViewItem *item ) | 372 | void OpieMail::mailLeftClicked( QListViewItem *item ) |
370 | { | 373 | { |
371 | mailView->clearSelection(); | 374 | mailView->clearSelection(); |
372 | /* just LEFT button - or tap with stylus on pda */ | 375 | /* just LEFT button - or tap with stylus on pda */ |
373 | //if (button!=1) return; | 376 | //if (button!=1) return; |
374 | if (!item) return; | 377 | if (!item) return; |
375 | if (folderView->currentisDraft()) { | 378 | if (folderView->currentisDraft()) { |
376 | reEditMail(); | 379 | reEditMail(); |
377 | } else { | 380 | } else { |
378 | displayMail(); | 381 | displayMail(); |
379 | } | 382 | } |
380 | } | 383 | } |
381 | 384 | ||
382 | void OpieMail::slotMoveCopyMail() | 385 | void OpieMail::slotMoveCopyMail() |
383 | { | 386 | { |
384 | if (!mailView->currentItem()) return; | 387 | if (!mailView->currentItem()) return; |
385 | RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); | 388 | RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); |
386 | AbstractMail*targetMail = 0; | 389 | AbstractMail*targetMail = 0; |
387 | QString targetFolder = ""; | 390 | QString targetFolder = ""; |
388 | Selectstore sels; | 391 | Selectstore sels; |
389 | folderView->setupFolderselect(&sels); | 392 | folderView->setupFolderselect(&sels); |
390 | if (!sels.exec()) return; | 393 | if (!sels.exec()) return; |
391 | targetMail = sels.currentMail(); | 394 | targetMail = sels.currentMail(); |
392 | targetFolder = sels.currentFolder(); | 395 | targetFolder = sels.currentFolder(); |
393 | if ( (mail->Wrapper()==targetMail && mail->getMbox()==targetFolder) || | 396 | if ( (mail->Wrapper()==targetMail && mail->getMbox()==targetFolder) || |
394 | targetFolder.isEmpty()) | 397 | targetFolder.isEmpty()) |
395 | { | 398 | { |
396 | return; | 399 | return; |
397 | } | 400 | } |
398 | if (sels.newFolder() && !targetMail->createMbox(targetFolder)) | 401 | if (sels.newFolder() && !targetMail->createMbox(targetFolder)) |
399 | { | 402 | { |
400 | QMessageBox::critical(0,tr("Error creating new Folder"), | 403 | QMessageBox::critical(0,tr("Error creating new Folder"), |
401 | tr("<center>Error while creating<br>new folder - breaking.</center>")); | 404 | tr("<center>Error while creating<br>new folder - breaking.</center>")); |
402 | return; | 405 | return; |
403 | } | 406 | } |
404 | sels.hide(); | 407 | sels.hide(); |
405 | qApp->processEvents(); | 408 | qApp->processEvents(); |
406 | // qDebug("hiding sels "); | 409 | // qDebug("hiding sels "); |
407 | mail->Wrapper()->mvcpMail(mail,targetFolder,targetMail,sels.moveMails()); | 410 | mail->Wrapper()->mvcpMail(mail,targetFolder,targetMail,sels.moveMails()); |
408 | folderView->refreshCurrent(); | 411 | folderView->refreshCurrent(); |
409 | } | 412 | } |
410 | 413 | ||
411 | void OpieMail::slotMoveCopyAllMail() | 414 | void OpieMail::slotMoveCopyAllMail() |
412 | { | 415 | { |
413 | 416 | ||
414 | if (!mailView->currentItem()) return; | 417 | if (!mailView->currentItem()) return; |
415 | QValueList<RecMailP> t; | 418 | QValueList<RecMailP> t; |
416 | // if ( QMessageBox::warning(this, tr("Move/Copy all selected mails"), tr("Do you really want to copy/move\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) | 419 | // if ( QMessageBox::warning(this, tr("Move/Copy all selected mails"), tr("Do you really want to copy/move\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) |
417 | { | 420 | { |
418 | MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); | 421 | MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); |
419 | while ( item ) { | 422 | while ( item ) { |
420 | if ( item->isSelected() ) { | 423 | if ( item->isSelected() ) { |