Diffstat (limited to 'noncore/unsupported/mail2/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/mail2/mainwindow.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/noncore/unsupported/mail2/mainwindow.cpp b/noncore/unsupported/mail2/mainwindow.cpp index 0d09ec8..ce80391 100644 --- a/noncore/unsupported/mail2/mainwindow.cpp +++ b/noncore/unsupported/mail2/mainwindow.cpp | |||
@@ -1,118 +1,118 @@ | |||
1 | #include <qmessagebox.h> | 1 | #include <qmessagebox.h> |
2 | #include <qaction.h> | 2 | #include <qaction.h> |
3 | #include <qapplication.h> | 3 | #include <qapplication.h> |
4 | 4 | ||
5 | #include <qpe/qcopenvelope_qws.h> | 5 | #include <qpe/qcopenvelope_qws.h> |
6 | 6 | ||
7 | #include "mailstatusbar.h" | 7 | #include "mailstatusbar.h" |
8 | #include "folderwidget.h" | 8 | #include "folderwidget.h" |
9 | #include "mainwindow.h" | 9 | #include "mainwindow.h" |
10 | #include "configdiag.h" | 10 | #include "configdiag.h" |
11 | #include "configfile.h" | 11 | #include "configfile.h" |
12 | #include "searchdiag.h" | 12 | #include "searchdiag.h" |
13 | #include "mailtable.h" | 13 | #include "mailtable.h" |
14 | #include "composer.h" | 14 | #include "composer.h" |
15 | #include "viewmail.h" | 15 | #include "viewmail.h" |
16 | #include "mailfactory.h" | 16 | #include "mailfactory.h" |
17 | 17 | ||
18 | MainWindow::MainWindow(QWidget *parent, const char *name, WFlags fl) | 18 | MainWindow::MainWindow(QWidget *parent, const char *name, WFlags fl) |
19 | : MainWindowBase(parent, name, fl) | 19 | : MainWindowBase(parent, name, fl) |
20 | { | 20 | { |
21 | status->setStopEnabled(false); | 21 | status->setStopEnabled(false); |
22 | 22 | ||
23 | connect(folderView, SIGNAL(status(const QString &)), status, SLOT(setStatusText(const QString &))); | 23 | connect(folderView, SIGNAL(status(const QString&)), status, SLOT(setStatusText(const QString&))); |
24 | connect(folderView, SIGNAL(folderSelected(Folder)), mailView, SLOT(setFolder(Folder))); | 24 | connect(folderView, SIGNAL(folderSelected(Folder)), mailView, SLOT(setFolder(Folder))); |
25 | 25 | ||
26 | connect(mailView, SIGNAL(mailClicked(IMAPResponseFETCH, IMAPHandler *)), SLOT(mailClicked(IMAPResponseFETCH, IMAPHandler *))); | 26 | connect(mailView, SIGNAL(mailClicked(IMAPResponseFETCH,IMAPHandler*)), SLOT(mailClicked(IMAPResponseFETCH,IMAPHandler*))); |
27 | connect(mailView, SIGNAL(status(const QString &)), status, SLOT(setStatusText(const QString &))); | 27 | connect(mailView, SIGNAL(status(const QString&)), status, SLOT(setStatusText(const QString&))); |
28 | connect(mailView, SIGNAL(totalSteps(int)), status, SLOT(setProgressTotalSteps(int))); | 28 | connect(mailView, SIGNAL(totalSteps(int)), status, SLOT(setProgressTotalSteps(int))); |
29 | connect(mailView, SIGNAL(progress(int)), status, SLOT(setProgress(int))); | 29 | connect(mailView, SIGNAL(progress(int)), status, SLOT(setProgress(int))); |
30 | connect(mailView, SIGNAL(resetProgress()), status, SLOT(resetProgress())); | 30 | connect(mailView, SIGNAL(resetProgress()), status, SLOT(resetProgress())); |
31 | connect(mailView, SIGNAL(stopEnabled(bool)), status, SLOT(setStopEnabled(bool))); | 31 | connect(mailView, SIGNAL(stopEnabled(bool)), status, SLOT(setStopEnabled(bool))); |
32 | 32 | ||
33 | connect(status, SIGNAL(stop()), mailView, SLOT(stop())); | 33 | connect(status, SIGNAL(stop()), mailView, SLOT(stop())); |
34 | 34 | ||
35 | connect(compose, SIGNAL(activated()), SLOT(slotComposeNoParams())); | 35 | connect(compose, SIGNAL(activated()), SLOT(slotComposeNoParams())); |
36 | connect(sendQueue, SIGNAL(activated()), SLOT(slotSendQueued())); | 36 | connect(sendQueue, SIGNAL(activated()), SLOT(slotSendQueued())); |
37 | connect(findmails, SIGNAL(activated()), SLOT(slotSearch())); | 37 | connect(findmails, SIGNAL(activated()), SLOT(slotSearch())); |
38 | connect(configure, SIGNAL(activated()), SLOT(slotConfigure())); | 38 | connect(configure, SIGNAL(activated()), SLOT(slotConfigure())); |
39 | 39 | ||
40 | // Added by Stefan Eilers to allow starting by addressbook.. | 40 | // Added by Stefan Eilers to allow starting by addressbook.. |
41 | #if !defined(QT_NO_COP) | 41 | #if !defined(QT_NO_COP) |
42 | // QCopChannel *addressChannel = new QCopChannel("QPE/Application/mail" , this ); | 42 | // QCopChannel *addressChannel = new QCopChannel("QPE/Application/mail" , this ); |
43 | // connect (addressChannel, SIGNAL( received(const QCString &, const QByteArray &)), | 43 | // connect (addressChannel, SIGNAL( received(const QCString&,const QByteArray&)), |
44 | // this, SLOT ( appMessage(const QCString &, const QByteArray &) ) ); | 44 | // this, SLOT ( appMessage(const QCString&,const QByteArray&) ) ); |
45 | connect( qApp, SIGNAL( appMessage( const QCString&, const QByteArray& ) ), | 45 | connect( qApp, SIGNAL( appMessage(const QCString&,const QByteArray&) ), |
46 | this, SLOT( appMessage( const QCString&, const QByteArray& ) ) ); | 46 | this, SLOT( appMessage(const QCString&,const QByteArray&) ) ); |
47 | #endif | 47 | #endif |
48 | } | 48 | } |
49 | 49 | ||
50 | // Added by Stefan Eilers to allow starting by addressbook.. | 50 | // Added by Stefan Eilers to allow starting by addressbook.. |
51 | void MainWindow::appMessage(const QCString &msg, const QByteArray &data) | 51 | void MainWindow::appMessage(const QCString &msg, const QByteArray &data) |
52 | { | 52 | { |
53 | if (msg == "writeMail(QString,QString)") { | 53 | if (msg == "writeMail(QString,QString)") { |
54 | QDataStream stream(data,IO_ReadOnly); | 54 | QDataStream stream(data,IO_ReadOnly); |
55 | QString name, email; | 55 | QString name, email; |
56 | stream >> name >> email; | 56 | stream >> name >> email; |
57 | 57 | ||
58 | qWarning("opie-mail:: Should send mail to %s with address %s", name.latin1(), email.latin1() ); | 58 | qWarning("opie-mail:: Should send mail to %s with address %s", name.latin1(), email.latin1() ); |
59 | 59 | ||
60 | slotCompose( name, email ); | 60 | slotCompose( name, email ); |
61 | 61 | ||
62 | }else{ | 62 | }else{ |
63 | QString str_message = msg; | 63 | QString str_message = msg; |
64 | qWarning("opie-mail:: Received unknown QCop-Message: %s", str_message.latin1() ); | 64 | qWarning("opie-mail:: Received unknown QCop-Message: %s", str_message.latin1() ); |
65 | } | 65 | } |
66 | } | 66 | } |
67 | 67 | ||
68 | void MainWindow::slotCompose( const QString& name, const QString& email ) | 68 | void MainWindow::slotCompose( const QString& name, const QString& email ) |
69 | { | 69 | { |
70 | Composer composer(this, 0, true); | 70 | Composer composer(this, 0, true); |
71 | 71 | ||
72 | // If there is a mailaddress given, create message.. | 72 | // If there is a mailaddress given, create message.. |
73 | if ( ! name.isEmpty() ){ | 73 | if ( ! name.isEmpty() ){ |
74 | qWarning("opie-mail:: Compose mail for %s with address %s", name.latin1(), email.latin1() ); | 74 | qWarning("opie-mail:: Compose mail for %s with address %s", name.latin1(), email.latin1() ); |
75 | SendMail compMail; | 75 | SendMail compMail; |
76 | compMail.setTo( "\"" + name + "\"" + " " + "<"+ email + ">"); | 76 | compMail.setTo( "\"" + name + "\"" + " " + "<"+ email + ">"); |
77 | composer.setSendMail( compMail ); | 77 | composer.setSendMail( compMail ); |
78 | } | 78 | } |
79 | composer.showMaximized(); | 79 | composer.showMaximized(); |
80 | composer.exec(); | 80 | composer.exec(); |
81 | } | 81 | } |
82 | 82 | ||
83 | void MainWindow::slotComposeNoParams() | 83 | void MainWindow::slotComposeNoParams() |
84 | { | 84 | { |
85 | slotCompose( 0l, 0l); | 85 | slotCompose( 0l, 0l); |
86 | } | 86 | } |
87 | 87 | ||
88 | void MainWindow::slotSendQueued() | 88 | void MainWindow::slotSendQueued() |
89 | { | 89 | { |
90 | Composer composer(this, 0, true, true); | 90 | Composer composer(this, 0, true, true); |
91 | // composer.sendQueue(); | 91 | // composer.sendQueue(); |
92 | composer.showMaximized(); | 92 | composer.showMaximized(); |
93 | composer.exec(); | 93 | composer.exec(); |
94 | //composer.close(); | 94 | //composer.close(); |
95 | } | 95 | } |
96 | 96 | ||
97 | void MainWindow::slotSearch() | 97 | void MainWindow::slotSearch() |
98 | { | 98 | { |
99 | SearchDiag searchDiag(this, 0, true); | 99 | SearchDiag searchDiag(this, 0, true); |
100 | searchDiag.showMaximized(); | 100 | searchDiag.showMaximized(); |
101 | searchDiag.exec(); | 101 | searchDiag.exec(); |
102 | } | 102 | } |
103 | 103 | ||
104 | void MainWindow::slotConfigure() | 104 | void MainWindow::slotConfigure() |
105 | { | 105 | { |
106 | ConfigDiag configDiag(this, 0, true); | 106 | ConfigDiag configDiag(this, 0, true); |
107 | configDiag.showMaximized(); | 107 | configDiag.showMaximized(); |
108 | configDiag.exec(); | 108 | configDiag.exec(); |
109 | 109 | ||
110 | connect(&configDiag, SIGNAL(changed()), folderView, SLOT(update())); | 110 | connect(&configDiag, SIGNAL(changed()), folderView, SLOT(update())); |
111 | } | 111 | } |
112 | 112 | ||
113 | void MainWindow::mailClicked(IMAPResponseFETCH mail, IMAPHandler *handler) | 113 | void MainWindow::mailClicked(IMAPResponseFETCH mail, IMAPHandler *handler) |
114 | { | 114 | { |
115 | ViewMail viewMail(mail, handler, this, 0, true); | 115 | ViewMail viewMail(mail, handler, this, 0, true); |
116 | viewMail.showMaximized(); | 116 | viewMail.showMaximized(); |
117 | viewMail.exec(); | 117 | viewMail.exec(); |
118 | } | 118 | } |