Diffstat (limited to 'noncore/unsupported/mailit/mailitwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/mailit/mailitwindow.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/noncore/unsupported/mailit/mailitwindow.cpp b/noncore/unsupported/mailit/mailitwindow.cpp index 6e298c7..fec4d78 100644 --- a/noncore/unsupported/mailit/mailitwindow.cpp +++ b/noncore/unsupported/mailit/mailitwindow.cpp | |||
@@ -1,113 +1,113 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2001 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2001 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qt Palmtop Environment. | 4 | ** This file is part of Qt Palmtop Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include <qwhatsthis.h> | 20 | #include <qwhatsthis.h> |
21 | #include <qmessagebox.h> | 21 | #include <qmessagebox.h> |
22 | #include "mailitwindow.h" | 22 | #include "mailitwindow.h" |
23 | 23 | ||
24 | MailItWindow::MailItWindow(QWidget *parent, const char *name, WFlags /*fl*/) | 24 | MailItWindow::MailItWindow(QWidget *parent, const char *name, WFlags /*fl*/) |
25 | : QMainWindow(parent, name, WStyle_ContextHelp) | 25 | : QMainWindow(parent, name, WStyle_ContextHelp) |
26 | { | 26 | { |
27 | currentCaption = tr("Mailit"); | 27 | currentCaption = tr("Mailit"); |
28 | setCaption(tr(currentCaption)); | 28 | setCaption(tr(currentCaption)); |
29 | views = new QWidgetStack(this); | 29 | views = new QWidgetStack(this); |
30 | setCentralWidget(views); | 30 | setCentralWidget(views); |
31 | QWhatsThis::add(views,tr("Central view area")); | 31 | QWhatsThis::add(views,tr("Central view area")); |
32 | emailClient = new EmailClient(views, "client"); | 32 | emailClient = new EmailClient(views, "client"); |
33 | writeMail = new WriteMail(views, "writing"); | 33 | writeMail = new WriteMail(views, "writing"); |
34 | readMail = new ReadMail(views, "reading"); | 34 | readMail = new ReadMail(views, "reading"); |
35 | 35 | ||
36 | views->raiseWidget(emailClient); | 36 | views->raiseWidget(emailClient); |
37 | 37 | ||
38 | connect(emailClient, SIGNAL(composeRequested()), | 38 | connect(emailClient, SIGNAL(composeRequested()), |
39 | this, SLOT(compose()) ); | 39 | this, SLOT(compose()) ); |
40 | connect(emailClient, SIGNAL(viewEmail(QListView *, Email *)), this, | 40 | connect(emailClient, SIGNAL(viewEmail(QListView*,Email*)), this, |
41 | SLOT(viewMail(QListView *, Email *)) ); | 41 | SLOT(viewMail(QListView*,Email*)) ); |
42 | connect(emailClient, SIGNAL(mailUpdated(Email *)), this, | 42 | connect(emailClient, SIGNAL(mailUpdated(Email*)), this, |
43 | SLOT(updateMailView(Email *)) ); | 43 | SLOT(updateMailView(Email*)) ); |
44 | 44 | ||
45 | connect(writeMail, SIGNAL(cancelMail()), this, SLOT(showEmailClient()) ); | 45 | connect(writeMail, SIGNAL(cancelMail()), this, SLOT(showEmailClient()) ); |
46 | connect(writeMail, SIGNAL(sendMailRequested(const Email &)), this, | 46 | connect(writeMail, SIGNAL(sendMailRequested(const Email&)), this, |
47 | SLOT(showEmailClient()) ); | 47 | SLOT(showEmailClient()) ); |
48 | connect(writeMail, SIGNAL(sendMailRequested(const Email &)), emailClient, | 48 | connect(writeMail, SIGNAL(sendMailRequested(const Email&)), emailClient, |
49 | SLOT(enqueMail(const Email &)) ); | 49 | SLOT(enqueMail(const Email&)) ); |
50 | 50 | ||
51 | connect(readMail, SIGNAL(cancelView()), this, SLOT(showEmailClient()) ); | 51 | connect(readMail, SIGNAL(cancelView()), this, SLOT(showEmailClient()) ); |
52 | connect(readMail, SIGNAL(replyRequested(Email &, bool&)), this, | 52 | connect(readMail, SIGNAL(replyRequested(Email&,bool&)), this, |
53 | SLOT(composeReply(Email &, bool&)) ); | 53 | SLOT(composeReply(Email&,bool&)) ); |
54 | connect(readMail, SIGNAL(forwardRequested(Email &)), this, | 54 | connect(readMail, SIGNAL(forwardRequested(Email&)), this, |
55 | SLOT(composeForward(Email &)) ); | 55 | SLOT(composeForward(Email&)) ); |
56 | 56 | ||
57 | connect(readMail, SIGNAL(removeItem(EmailListItem *, bool &)), emailClient, | 57 | connect(readMail, SIGNAL(removeItem(EmailListItem*,bool&)), emailClient, |
58 | SLOT(deleteMail(EmailListItem *, bool &)) ); | 58 | SLOT(deleteMail(EmailListItem*,bool&)) ); |
59 | connect(readMail, SIGNAL(viewingMail(Email *)), emailClient, | 59 | connect(readMail, SIGNAL(viewingMail(Email*)), emailClient, |
60 | SLOT(moveMailFront(Email *)) ); | 60 | SLOT(moveMailFront(Email*)) ); |
61 | 61 | ||
62 | connect(emailClient, SIGNAL(newCaption(const QString &)), | 62 | connect(emailClient, SIGNAL(newCaption(const QString&)), |
63 | this, SLOT(updateCaption(const QString &)) ); | 63 | this, SLOT(updateCaption(const QString&)) ); |
64 | 64 | ||
65 | connect(readMail, SIGNAL(download(Email *)), emailClient, SLOT(download(Email*)) ); | 65 | connect(readMail, SIGNAL(download(Email*)), emailClient, SLOT(download(Email*)) ); |
66 | 66 | ||
67 | viewingMail = FALSE; | 67 | viewingMail = FALSE; |
68 | } | 68 | } |
69 | 69 | ||
70 | MailItWindow::~MailItWindow() | 70 | MailItWindow::~MailItWindow() |
71 | { | 71 | { |
72 | } | 72 | } |
73 | 73 | ||
74 | void MailItWindow::closeEvent(QCloseEvent *e) | 74 | void MailItWindow::closeEvent(QCloseEvent *e) |
75 | { | 75 | { |
76 | if (views->visibleWidget() == emailClient) { | 76 | if (views->visibleWidget() == emailClient) { |
77 | e->accept(); | 77 | e->accept(); |
78 | } else { | 78 | } else { |
79 | showEmailClient(); | 79 | showEmailClient(); |
80 | } | 80 | } |
81 | } | 81 | } |
82 | 82 | ||
83 | void MailItWindow::compose() | 83 | void MailItWindow::compose() |
84 | { | 84 | { |
85 | viewingMail = FALSE; | 85 | viewingMail = FALSE; |
86 | emailClient->hide(); | 86 | emailClient->hide(); |
87 | readMail->hide(); | 87 | readMail->hide(); |
88 | views->raiseWidget(writeMail); | 88 | views->raiseWidget(writeMail); |
89 | writeMail->setAddressList(emailClient->getAdrListRef()); | 89 | writeMail->setAddressList(emailClient->getAdrListRef()); |
90 | writeMail->newMail(); | 90 | writeMail->newMail(); |
91 | setCaption( tr( "Write mail" ) ); | 91 | setCaption( tr( "Write mail" ) ); |
92 | } | 92 | } |
93 | 93 | ||
94 | void MailItWindow::composeReply(Email &mail, bool& replyAll) | 94 | void MailItWindow::composeReply(Email &mail, bool& replyAll) |
95 | { | 95 | { |
96 | compose(); | 96 | compose(); |
97 | writeMail->reply(mail,replyAll) ; | 97 | writeMail->reply(mail,replyAll) ; |
98 | } | 98 | } |
99 | 99 | ||
100 | void MailItWindow::composeForward(Email &mail) | 100 | void MailItWindow::composeForward(Email &mail) |
101 | { | 101 | { |
102 | compose(); | 102 | compose(); |
103 | writeMail->forward(mail) ; | 103 | writeMail->forward(mail) ; |
104 | } | 104 | } |
105 | 105 | ||
106 | 106 | ||
107 | void MailItWindow::showEmailClient() | 107 | void MailItWindow::showEmailClient() |
108 | { | 108 | { |
109 | viewingMail = FALSE; | 109 | viewingMail = FALSE; |
110 | writeMail->hide(); | 110 | writeMail->hide(); |
111 | readMail->hide(); | 111 | readMail->hide(); |
112 | views->raiseWidget(emailClient); | 112 | views->raiseWidget(emailClient); |
113 | setCaption( tr(currentCaption) ); | 113 | setCaption( tr(currentCaption) ); |