author | harlekin <harlekin> | 2003-12-14 02:03:25 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2003-12-14 02:03:25 (UTC) |
commit | 568f23df5f4d5b1835c3b89ad54eeb6fc53157e6 (patch) (unidiff) | |
tree | 944c4745d4cdb642e873e480b45479d5116ea33a | |
parent | 154e03927d2b97f3f76f807fe104ac9d74035215 (diff) | |
download | opie-568f23df5f4d5b1835c3b89ad54eeb6fc53157e6.zip opie-568f23df5f4d5b1835c3b89ad54eeb6fc53157e6.tar.gz opie-568f23df5f4d5b1835c3b89ad54eeb6fc53157e6.tar.bz2 |
check back before deleting a mail
-rw-r--r-- | noncore/net/mail/mainwindow.cpp | 7 | ||||
-rw-r--r-- | noncore/net/mail/viewmail.cpp | 10 |
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,17 +1,18 @@ | |||
1 | #include <qlabel.h> | 1 | #include <qlabel.h> |
2 | #include <qvbox.h> | 2 | #include <qvbox.h> |
3 | #include <qheader.h> | 3 | #include <qheader.h> |
4 | #include <qtimer.h> | 4 | #include <qtimer.h> |
5 | #include <qlayout.h> | 5 | #include <qlayout.h> |
6 | #include <qmessagebox.h> | ||
6 | 7 | ||
7 | #include <qpe/qpeapplication.h> | 8 | #include <qpe/qpeapplication.h> |
8 | #include <qpe/resource.h> | 9 | #include <qpe/resource.h> |
9 | 10 | ||
10 | #include "defines.h" | 11 | #include "defines.h" |
11 | #include "mainwindow.h" | 12 | #include "mainwindow.h" |
12 | #include "viewmail.h" | 13 | #include "viewmail.h" |
13 | #include "mailtypes.h" | 14 | #include "mailtypes.h" |
14 | #include "mailistviewitem.h" | 15 | #include "mailistviewitem.h" |
15 | 16 | ||
16 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | 17 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) |
17 | : QMainWindow( parent, name, flags ) | 18 | : QMainWindow( parent, name, flags ) |
@@ -172,26 +173,28 @@ void MainWindow::displayMail(QListViewItem*item) | |||
172 | 173 | ||
173 | if ( readMail.deleted ) { | 174 | if ( readMail.deleted ) { |
174 | folderView->refreshCurrent(); | 175 | folderView->refreshCurrent(); |
175 | } else { | 176 | } else { |
176 | ( (MailListViewItem*)item )->setPixmap( 0, Resource::loadPixmap( "opiemail/kmmsgunseen") ); | 177 | ( (MailListViewItem*)item )->setPixmap( 0, Resource::loadPixmap( "opiemail/kmmsgunseen") ); |
177 | } | 178 | } |
178 | } | 179 | } |
179 | 180 | ||
180 | void MainWindow::slotDeleteMail() | 181 | void MainWindow::slotDeleteMail() |
181 | { | 182 | { |
182 | if (!mailView->currentItem()) return; | 183 | if (!mailView->currentItem()) return; |
183 | RecMail mail = ((MailListViewItem*)mailView->currentItem() )->data(); | 184 | RecMail mail = ((MailListViewItem*)mailView->currentItem() )->data(); |
184 | mail.Wrapper()->deleteMail( mail ); | 185 | 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 ) { |
185 | folderView->refreshCurrent(); | 186 | mail.Wrapper()->deleteMail( mail ); |
187 | folderView->refreshCurrent(); | ||
188 | } | ||
186 | } | 189 | } |
187 | 190 | ||
188 | 191 | ||
189 | 192 | ||
190 | MailListViewItem::MailListViewItem(QListView * parent, MailListViewItem * item ) | 193 | MailListViewItem::MailListViewItem(QListView * parent, MailListViewItem * item ) |
191 | :QListViewItem(parent,item),mail_data() | 194 | :QListViewItem(parent,item),mail_data() |
192 | { | 195 | { |
193 | } | 196 | } |
194 | 197 | ||
195 | void MailListViewItem::showEntry() | 198 | void MailListViewItem::showEntry() |
196 | { | 199 | { |
197 | if ( mail_data.getFlags().testBit( FLAG_SEEN ) == true ) { | 200 | if ( mail_data.getFlags().testBit( FLAG_SEEN ) == true ) { |
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,14 +1,14 @@ | |||
1 | #include <qtextbrowser.h> | 1 | #include <qtextbrowser.h> |
2 | #include <qmessagebox.h> | 2 | #include <qmessagebox.h>? |
3 | #include <qtextstream.h> | 3 | #include <qtextstream.h> |
4 | #include <qaction.h> | 4 | #include <qaction.h> |
5 | #include <qpopupmenu.h> | 5 | #include <qpopupmenu.h> |
6 | #include <qapplication.h> | 6 | #include <qapplication.h> |
7 | 7 | ||
8 | #include <opie/ofiledialog.h> | 8 | #include <opie/ofiledialog.h> |
9 | 9 | ||
10 | #include "settings.h" | 10 | #include "settings.h" |
11 | #include "composemail.h" | 11 | #include "composemail.h" |
12 | #include "viewmail.h" | 12 | #include "viewmail.h" |
13 | #include "abstractmail.h" | 13 | #include "abstractmail.h" |
14 | #include "accountview.h" | 14 | #include "accountview.h" |
@@ -310,16 +310,18 @@ void ViewMail::slotForward() | |||
310 | ftext += QString("----- End forwarded message -----\n"); | 310 | ftext += QString("----- End forwarded message -----\n"); |
311 | 311 | ||
312 | Settings *settings = new Settings(); | 312 | Settings *settings = new Settings(); |
313 | ComposeMail composer( settings ,this, 0, true); | 313 | ComposeMail composer( settings ,this, 0, true); |
314 | composer.setSubject( "Fwd: " + m_mail[1] ); | 314 | composer.setSubject( "Fwd: " + m_mail[1] ); |
315 | composer.setMessage( ftext ); | 315 | composer.setMessage( ftext ); |
316 | composer.showMaximized(); | 316 | composer.showMaximized(); |
317 | composer.exec(); | 317 | composer.exec(); |
318 | } | 318 | } |
319 | 319 | ||
320 | void ViewMail::slotDeleteMail( ) | 320 | void ViewMail::slotDeleteMail( ) |
321 | { | 321 | { |
322 | m_recMail.Wrapper()->deleteMail( m_recMail ); | 322 | 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 ) { |
323 | hide(); | 323 | m_recMail.Wrapper()->deleteMail( m_recMail ); |
324 | deleted = true; | 324 | hide(); |
325 | deleted = true; | ||
326 | } | ||
325 | } | 327 | } |