Diffstat (limited to 'noncore/unsupported/mail2/viewmail.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/unsupported/mail2/viewmail.cpp | 44 |
1 files changed, 35 insertions, 9 deletions
diff --git a/noncore/unsupported/mail2/viewmail.cpp b/noncore/unsupported/mail2/viewmail.cpp index ae1f5f3..3c88d99 100644 --- a/noncore/unsupported/mail2/viewmail.cpp +++ b/noncore/unsupported/mail2/viewmail.cpp @@ -3,2 +3,3 @@ #include <qaction.h> +#include <qapplication.h> @@ -25,3 +26,3 @@ AttachItem::AttachItem(QListViewItem *parent, AttachItemStore &attachItemStore) ViewMail::ViewMail(IMAPResponseFETCH &mail, IMAPHandler *handler, QWidget *parent, const char *name, WFlags fl) - : ViewMailBase(parent, name, fl), _mail(mail), _handler(handler) + : ViewMailBase(parent, name, fl), _inLoop(false), _mail(mail), _handler(handler) { @@ -63,2 +64,27 @@ ViewMail::ViewMail(IMAPResponseFETCH &mail, IMAPHandler *handler, QWidget *paren +ViewMail::~ViewMail() +{ + hide(); +} + +void ViewMail::hide() +{ + QWidget::hide(); + + if (_inLoop) { + _inLoop = false; + qApp->exit_loop(); + } +} + +void ViewMail::exec() +{ + show(); + + if (!_inLoop) { + _inLoop = true; + qApp->enter_loop(); + } +} + QString ViewMail::deHtml(const QString &string) @@ -103,6 +129,6 @@ void ViewMail::slotReply() - Composer *composer = new Composer(0, 0, Qt::WType_Modal); - composer->setSendMail(sendMail); - composer->showMaximized(); - composer->show(); + Composer composer(this, 0, true); + composer.setSendMail(sendMail); + composer.showMaximized(); + composer.exec(); } @@ -147,6 +173,6 @@ void ViewMail::slotForward() - Composer *composer = new Composer(0, 0, Qt::WType_Modal); - composer->setSendMail(sendMail); - composer->showMaximized(); - composer->show(); + Composer composer(this, 0, true); + composer.setSendMail(sendMail); + composer.showMaximized(); + composer.exec(); } |