author | groucho <groucho> | 2003-04-29 08:04:34 (UTC) |
---|---|---|
committer | groucho <groucho> | 2003-04-29 08:04:34 (UTC) |
commit | f09f685be0540e98cc33bc4f664a812aed756926 (patch) (side-by-side diff) | |
tree | 10a2193eafd1dc0ae25cd458f3bfa9f0f23522e1 /noncore/net/mailit/emailclient.cpp | |
parent | e096c9d1f2be1ec74ede583fc4221871a56ef508 (diff) | |
download | opie-f09f685be0540e98cc33bc4f664a812aed756926.zip opie-f09f685be0540e98cc33bc4f664a812aed756926.tar.gz opie-f09f685be0540e98cc33bc4f664a812aed756926.tar.bz2 |
- added ReplyAll for CC: addressing
- added a download button in mail view
- smaller layout fixes
- now it's getting to be real useful
Diffstat (limited to 'noncore/net/mailit/emailclient.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mailit/emailclient.cpp | 130 |
1 files changed, 97 insertions, 33 deletions
diff --git a/noncore/net/mailit/emailclient.cpp b/noncore/net/mailit/emailclient.cpp index dff1888..2cedc51 100644 --- a/noncore/net/mailit/emailclient.cpp +++ b/noncore/net/mailit/emailclient.cpp @@ -20,4 +20,5 @@ #include <qapplication.h> #include <qmessagebox.h> +#include <qvbox.h> #include <qfile.h> #include <qcheckbox.h> @@ -27,4 +28,5 @@ #include <qpe/resource.h> #include "emailclient.h" +#include "writemail.h" QCollection::Item AccountList::newItem(QCollection::Item d) @@ -54,4 +56,6 @@ EmailClient::EmailClient( QWidget* parent, const char* name, WFlags fl ) init(); + + connect(emailHandler, SIGNAL(mailSent()), this, SLOT(mailSent()) ); @@ -67,5 +71,4 @@ EmailClient::EmailClient( QWidget* parent, const char* name, WFlags fl ) connect(inboxView, SIGNAL(clicked(QListViewItem *)), this, SLOT(inboxItemReleased()) ); - connect(emailHandler, SIGNAL(mailArrived(const Email &, bool)), this, SLOT(mailArrived(const Email &, bool)) ); @@ -85,4 +88,9 @@ EmailClient::EmailClient( QWidget* parent, const char* name, WFlags fl ) mailboxView->setCurrentTab(0); //ensure that inbox has focus + + /*channel = new QCopChannel( "QPE/Application/mailit", this ); + connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), + this, SLOT(receive(const QCString&, const QByteArray&)) );*/ + } @@ -105,26 +113,5 @@ EmailClient::~EmailClient() void EmailClient::init() { - statusBar = new QStatusBar(this); - statusBar->setSizeGripEnabled(FALSE); - - status1Label = new QLabel( tr("Idle"), statusBar); - status2Label = new QLabel("", statusBar); - connect(emailHandler, SIGNAL(updatePopStatus(const QString &)), - status2Label, SLOT(setText(const QString &)) ); - connect(emailHandler, SIGNAL(updateSmtpStatus(const QString &)), - status2Label, SLOT(setText(const QString &)) ); - - progressBar = new QProgressBar(statusBar); - - connect(emailHandler, SIGNAL(mailboxSize(int)), - this, SLOT(setTotalSize(int)) ); - connect(emailHandler, SIGNAL(currentMailSize(int)), - this, SLOT(setMailSize(int)) ); - connect(emailHandler, SIGNAL(downloadedSize(int)), - this, SLOT(setDownloadedSize(int)) ); - - statusBar->addWidget(status1Label); - statusBar->addWidget(progressBar); - statusBar->addWidget(status2Label); + initStatusBar(this); setToolBarsMovable(FALSE); @@ -195,6 +182,9 @@ void EmailClient::init() inboxView->setMinimumSize( QSize( 0, 0 ) ); inboxView->setAllColumnsShowFocus(TRUE); - QWhatsThis::add(inboxView,QWidget::tr("This is the inbox view.\n It keeps the fetched mail which can be viewed by double clicking the entry.\n" - " A blue attachment icon shows whether this mail has attachments.")); + QWhatsThis::add(inboxView,QWidget::tr("This is the inbox view.\n" + "It keeps the fetched mail which can be \n" + "viewed by double clicking the entry.\n" + "blue attachment icon shows whether this \n" + "mailhas attachments.\n")); grid_2->addWidget( inboxView, 2, 0 ); @@ -211,5 +201,7 @@ void EmailClient::init() outboxView->setAllColumnsShowFocus(TRUE); - QWhatsThis::add(outboxView,QWidget::tr("This is the oubox view.\n It keeps the queued mails to send which can be reviewed by double clicking the entry.")); + QWhatsThis::add(outboxView,QWidget::tr("This is the outbox view.\n" + "It keeps the queued mails to send which can be \n" + "reviewed by double clicking the entry.")); grid_3->addWidget( outboxView, 0, 0 ); mailboxView->addTab( widget_2,"mailit/outbox", tr( "Outbox" ) ); @@ -219,4 +211,31 @@ void EmailClient::init() } +void EmailClient::initStatusBar(QWidget* parent) +{ + statusBar = new QStatusBar(parent); + statusBar->setSizeGripEnabled(FALSE); + + status1Label = new QLabel( tr("Idle"), statusBar); + status2Label = new QLabel("", statusBar); + connect(emailHandler, SIGNAL(updatePopStatus(const QString &)), + status2Label, SLOT(setText(const QString &)) ); + connect(emailHandler, SIGNAL(updateSmtpStatus(const QString &)), + status2Label, SLOT(setText(const QString &)) ); + + progressBar = new QProgressBar(statusBar); + + connect(emailHandler, SIGNAL(mailboxSize(int)), + this, SLOT(setTotalSize(int)) ); + connect(emailHandler, SIGNAL(currentMailSize(int)), + this, SLOT(setMailSize(int)) ); + connect(emailHandler, SIGNAL(downloadedSize(int)), + this, SLOT(setDownloadedSize(int)) ); + + statusBar->addWidget(status1Label); + statusBar->addWidget(progressBar); + statusBar->addWidget(status2Label); + +} + void EmailClient::compose() { @@ -320,5 +339,5 @@ void EmailClient::getNewMail() { //get any previous mails not downloaded and add to queue - mailDownloadList.clear(); + /*mailDownloadList.clear(); Email *mailPtr; item = (EmailListItem *) inboxView->firstChild(); @@ -329,5 +348,5 @@ void EmailClient::getNewMail() { } item = (EmailListItem *) item->nextSibling(); - } + }*/ emailHandler->getMailHeaders(); @@ -352,4 +371,5 @@ void EmailClient::mailArrived(const Email &mail, bool fromDisk) if (fromDisk) { + newMail.downloaded = mailconf->readBoolEntry("downloaded"); newMail.size = mailconf->readNumEntry("size"); @@ -359,4 +379,5 @@ void EmailClient::mailArrived(const Email &mail, bool fromDisk) else { //mail arrived from server + newMail.serverId = mail.serverId; newMail.size = mail.size; @@ -919,5 +940,5 @@ void EmailClient::inboxItemReleased() } -void EmailClient::timerEvent(QTimerEvent *e) +/*void EmailClient::timerEvent(QTimerEvent *e) { /*killTimer(timerID); @@ -936,6 +957,6 @@ void EmailClient::timerEvent(QTimerEvent *e) if (action) delete action; - */ -} + +}*/ Email* EmailClient::getCurrentMail() @@ -954,6 +975,4 @@ void EmailClient::download(Email* mail) tempMailDownloadList.clear(); tempMailDownloadList.sizeInsert(mail->serverId, mail->size); - if (accountList.count()>0) - qDebug("Accounts present"); acc=accountList.at(mail->fromAccountId-1); @@ -967,2 +986,47 @@ void EmailClient::download(Email* mail) tr("No account associated"), tr("There is no active account \nassociated to this mail\n it can not be downloaded"), "Abort\n"); } + +void EmailClient::receive(const QCString& msg, const QByteArray& data) +{ + /*if (msg=="getMail()") + { + /*QDialog qd(qApp->activeWindow(),"Getting mail",true); + QVBoxLayout *vbProg = new QVBoxLayout( &qd ); + + initStatusBar(&qd); + + if (statusBar==0) + { + qDebug("No Bar ..."); + //statusBar=new ProgressBar(&qd); + } + statusBar->show(); + vbProg->addWidget(statusBar); + qd.showMaximized(); + qd.show(); + emit getAllNewMail(); + //qd.exec(); + } + else if (msg=="compose()") + { + QDialog qd(qApp->activeWindow(),"Getting mail",true); + + WriteMail wm(&qd,"write new mail"); + QVBoxLayout vbProg( &qd ); + + wm.showMaximized(); + vbProg.addWidget(&wm); + + qd.showMaximized(); + + emit composeRequested(); + qd.exec(); + + QMessageBox::warning(qApp->activeWindow(),tr("Info"), tr("Info"), "OK\n"); + } + + else if (msg=="dialog()") + { + QMessageBox::warning(qApp->activeWindow(),tr("Info"), tr("Info"), "OK\n"); + }*/ +} |