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 | |||
@@ -1,6 +1,7 @@ | |||
1 | #include <qtextbrowser.h> | 1 | #include <qtextbrowser.h> |
2 | #include <qmessagebox.h> | 2 | #include <qmessagebox.h> |
3 | #include <qaction.h> | 3 | #include <qaction.h> |
4 | #include <qapplication.h> | ||
4 | 5 | ||
5 | #include "mailfactory.h" | 6 | #include "mailfactory.h" |
6 | #include "composer.h" | 7 | #include "composer.h" |
@@ -23,7 +24,7 @@ AttachItem::AttachItem(QListViewItem *parent, AttachItemStore &attachItemStore) | |||
23 | } | 24 | } |
24 | 25 | ||
25 | ViewMail::ViewMail(IMAPResponseFETCH &mail, IMAPHandler *handler, QWidget *parent, const char *name, WFlags fl) | 26 | ViewMail::ViewMail(IMAPResponseFETCH &mail, IMAPHandler *handler, QWidget *parent, const char *name, WFlags fl) |
26 | : ViewMailBase(parent, name, fl), _mail(mail), _handler(handler) | 27 | : ViewMailBase(parent, name, fl), _inLoop(false), _mail(mail), _handler(handler) |
27 | { | 28 | { |
28 | setCaption(caption().arg(mail.envelope().from()[0].name())); | 29 | setCaption(caption().arg(mail.envelope().from()[0].name())); |
29 | 30 | ||
@@ -61,6 +62,31 @@ ViewMail::ViewMail(IMAPResponseFETCH &mail, IMAPHandler *handler, QWidget *paren | |||
61 | connect(_handler, SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPUid(IMAPResponse &))); | 62 | connect(_handler, SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPUid(IMAPResponse &))); |
62 | } | 63 | } |
63 | 64 | ||
65 | ViewMail::~ViewMail() | ||
66 | { | ||
67 | hide(); | ||
68 | } | ||
69 | |||
70 | void ViewMail::hide() | ||
71 | { | ||
72 | QWidget::hide(); | ||
73 | |||
74 | if (_inLoop) { | ||
75 | _inLoop = false; | ||
76 | qApp->exit_loop(); | ||
77 | } | ||
78 | } | ||
79 | |||
80 | void ViewMail::exec() | ||
81 | { | ||
82 | show(); | ||
83 | |||
84 | if (!_inLoop) { | ||
85 | _inLoop = true; | ||
86 | qApp->enter_loop(); | ||
87 | } | ||
88 | } | ||
89 | |||
64 | QString ViewMail::deHtml(const QString &string) | 90 | QString ViewMail::deHtml(const QString &string) |
65 | { | 91 | { |
66 | QString string_ = string; | 92 | QString string_ = string; |
@@ -101,10 +127,10 @@ void ViewMail::slotReply() | |||
101 | sendMail.setInReplyTo(_mail.envelope().messageId()); | 127 | sendMail.setInReplyTo(_mail.envelope().messageId()); |
102 | sendMail.setMessage(rtext); | 128 | sendMail.setMessage(rtext); |
103 | 129 | ||
104 | Composer *composer = new Composer(0, 0, Qt::WType_Modal); | 130 | Composer composer(this, 0, true); |
105 | composer->setSendMail(sendMail); | 131 | composer.setSendMail(sendMail); |
106 | composer->showMaximized(); | 132 | composer.showMaximized(); |
107 | composer->show(); | 133 | composer.exec(); |
108 | } | 134 | } |
109 | 135 | ||
110 | void ViewMail::slotForward() | 136 | void ViewMail::slotForward() |
@@ -145,10 +171,10 @@ void ViewMail::slotForward() | |||
145 | sendMail.setSubject("Fwd: " + _mail.envelope().subject()); | 171 | sendMail.setSubject("Fwd: " + _mail.envelope().subject()); |
146 | sendMail.setMessage(ftext); | 172 | sendMail.setMessage(ftext); |
147 | 173 | ||
148 | Composer *composer = new Composer(0, 0, Qt::WType_Modal); | 174 | Composer composer(this, 0, true); |
149 | composer->setSendMail(sendMail); | 175 | composer.setSendMail(sendMail); |
150 | composer->showMaximized(); | 176 | composer.showMaximized(); |
151 | composer->show(); | 177 | composer.exec(); |
152 | } | 178 | } |
153 | 179 | ||
154 | void ViewMail::slotIMAPUid(IMAPResponse &response) | 180 | void ViewMail::slotIMAPUid(IMAPResponse &response) |