Diffstat (limited to 'noncore/unsupported/mail2/composer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/mail2/composer.cpp | 28 |
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 @@ -1,69 +1,95 @@ #include <qmultilineedit.h> #include <qmessagebox.h> #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" #include "attachdiag.h" #include "composer.h" #include "rename.h" AttachViewItem::AttachViewItem(QListView *parent, Attachment &attachment) : QListViewItem(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())); connect(addattach, SIGNAL(activated()), SLOT(slotAddAttach())); connect(delattach, SIGNAL(activated()), SLOT(slotDelAttach())); connect(from, SIGNAL(activated(int)), SLOT(slotFromChanged(int))); 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()); message->setText(sendMail.message()); _inReplyTo = sendMail.inReplyTo(); QValueList<Attachment> attachments = sendMail.attachments(); QValueList<Attachment>::Iterator it; for (it = attachments.begin(); it != attachments.end(); it++) { (void) new AttachViewItem(attachView, *it); if (attachView->isHidden()) attachView->show(); } } void Composer::slotResizing() { from->setMaximumWidth(width() - fromBox->width()); from->resize(width() - fromBox->width(), y()); } void Composer::slotPopupHandler(int itemid) |