summaryrefslogtreecommitdiff
path: root/noncore/unsupported/mail2/composer.cpp
Side-by-side diff
Diffstat (limited to 'noncore/unsupported/mail2/composer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/mail2/composer.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/noncore/unsupported/mail2/composer.cpp b/noncore/unsupported/mail2/composer.cpp
index 82ed117..7f65dba 100644
--- a/noncore/unsupported/mail2/composer.cpp
+++ b/noncore/unsupported/mail2/composer.cpp
@@ -3,12 +3,13 @@
#include <qpopupmenu.h>
#include <qcombobox.h>
#include <qlineedit.h>
#include <qaction.h>
#include <qtimer.h>
#include <qlabel.h>
+#include <qapplication.h>
#include <qpe/resource.h>
#include "addresspicker.h"
#include "listviewplus.h"
#include "smtphandler.h"
@@ -22,13 +23,13 @@ AttachViewItem::AttachViewItem(QListView *parent, Attachment &attachment)
setPixmap(0, _attachment.docLnk()->pixmap().isNull() ? Resource::loadPixmap("UnknownDocument-14") : _attachment.docLnk()->pixmap());
setText(0, _attachment.newName().isEmpty() ? _attachment.fileName() : _attachment.newName());
setText(1, _attachment.description());
}
Composer::Composer(QWidget *parent, const char *name, WFlags fl)
- : ComposerBase(parent, name, fl)
+ : ComposerBase(parent, name, fl), _inLoop(false)
{
abort->setEnabled(false);
to->setFocus();
connect(sendmail, SIGNAL(activated()), SLOT(slotSendMail()));
connect(addressbook, SIGNAL(activated()), SLOT(slotOpenAddressPicker()));
@@ -40,12 +41,37 @@ Composer::Composer(QWidget *parent, const char *name, WFlags fl)
connect(attachPopup, SIGNAL(activated(int)), SLOT(slotPopupHandler(int)));
QTimer::singleShot(0, this, SLOT(slotFillStuff()));
QTimer::singleShot(0, this, SLOT(slotResizing()));
}
+Composer::~Composer()
+{
+ hide();
+}
+
+void Composer::hide()
+{
+ QWidget::hide();
+
+ if (_inLoop) {
+ _inLoop = false;
+ qApp->exit_loop();
+ }
+}
+
+void Composer::exec()
+{
+ show();
+
+ if (!_inLoop) {
+ _inLoop = true;
+ qApp->enter_loop();
+ }
+}
+
void Composer::setSendMail(SendMail &sendMail)
{
to->setText(sendMail.to());
cc->setText(sendMail.cc());
bcc->setText(sendMail.bcc());
subject->setText(sendMail.subject());