summaryrefslogtreecommitdiff
authorharlekin <harlekin>2003-12-14 02:03:25 (UTC)
committer harlekin <harlekin>2003-12-14 02:03:25 (UTC)
commit568f23df5f4d5b1835c3b89ad54eeb6fc53157e6 (patch) (side-by-side diff)
tree944c4745d4cdb642e873e480b45479d5116ea33a
parent154e03927d2b97f3f76f807fe104ac9d74035215 (diff)
downloadopie-568f23df5f4d5b1835c3b89ad54eeb6fc53157e6.zip
opie-568f23df5f4d5b1835c3b89ad54eeb6fc53157e6.tar.gz
opie-568f23df5f4d5b1835c3b89ad54eeb6fc53157e6.tar.bz2
check back before deleting a mail
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/mainwindow.cpp7
-rw-r--r--noncore/net/mail/viewmail.cpp10
2 files changed, 11 insertions, 6 deletions
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp
index 391b55e..e466d9b 100644
--- a/noncore/net/mail/mainwindow.cpp
+++ b/noncore/net/mail/mainwindow.cpp
@@ -1,13 +1,14 @@
#include <qlabel.h>
#include <qvbox.h>
#include <qheader.h>
#include <qtimer.h>
#include <qlayout.h>
+#include <qmessagebox.h>
#include <qpe/qpeapplication.h>
#include <qpe/resource.h>
#include "defines.h"
#include "mainwindow.h"
#include "viewmail.h"
#include "mailtypes.h"
@@ -176,18 +177,20 @@ void MainWindow::displayMail(QListViewItem*item)
( (MailListViewItem*)item )->setPixmap( 0, Resource::loadPixmap( "opiemail/kmmsgunseen") );
}
}
void MainWindow::slotDeleteMail()
{
if (!mailView->currentItem()) return;
RecMail mail = ((MailListViewItem*)mailView->currentItem() )->data();
- mail.Wrapper()->deleteMail( mail );
- folderView->refreshCurrent();
+ 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 ) {
+ mail.Wrapper()->deleteMail( mail );
+ folderView->refreshCurrent();
+ }
}
MailListViewItem::MailListViewItem(QListView * parent, MailListViewItem * item )
:QListViewItem(parent,item),mail_data()
{
}
diff --git a/noncore/net/mail/viewmail.cpp b/noncore/net/mail/viewmail.cpp
index 163ffb7..2415c82 100644
--- a/noncore/net/mail/viewmail.cpp
+++ b/noncore/net/mail/viewmail.cpp
@@ -1,10 +1,10 @@
#include <qtextbrowser.h>
-#include <qmessagebox.h>
+#include <qmessagebox.h>?
#include <qtextstream.h>
#include <qaction.h>
#include <qpopupmenu.h>
#include <qapplication.h>
#include <opie/ofiledialog.h>
#include "settings.h"
@@ -314,12 +314,14 @@ void ViewMail::slotForward()
composer.setSubject( "Fwd: " + m_mail[1] );
composer.setMessage( ftext );
composer.showMaximized();
composer.exec();
}
void ViewMail::slotDeleteMail( )
{
- m_recMail.Wrapper()->deleteMail( m_recMail );
- hide();
- deleted = true;
+ if ( QMessageBox::warning(this, tr("Delete Mail"), QString( tr("<p>Do you really want to delete this mail? <br><br>" ) + m_mail[0] + " - " + m_mail[1] ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) {
+ m_recMail.Wrapper()->deleteMail( m_recMail );
+ hide();
+ deleted = true;
+ }
}