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