Diffstat (limited to 'noncore/net/mailit/mailitwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mailit/mailitwindow.cpp | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/noncore/net/mailit/mailitwindow.cpp b/noncore/net/mailit/mailitwindow.cpp index 2bf1dcb..ef5fc09 100644 --- a/noncore/net/mailit/mailitwindow.cpp +++ b/noncore/net/mailit/mailitwindow.cpp @@ -26,108 +26,140 @@ MailItWindow::MailItWindow(QWidget *parent, const char *name, WFlags fl) setCaption(tr(currentCaption)); views = new QWidgetStack(this); setCentralWidget(views); emailClient = new EmailClient(views, "client"); writeMail = new WriteMail(views, "writing"); readMail = new ReadMail(views, "reading"); views->raiseWidget(emailClient); connect(emailClient, SIGNAL(composeRequested()), this, SLOT(compose()) ); connect(emailClient, SIGNAL(viewEmail(QListView *, Email *)), this, SLOT(viewMail(QListView *, Email *)) ); connect(emailClient, SIGNAL(mailUpdated(Email *)), this, SLOT(updateMailView(Email *)) ); connect(writeMail, SIGNAL(cancelMail()), this, SLOT(showEmailClient()) ); connect(writeMail, SIGNAL(sendMailRequested(const Email &)), this, SLOT(showEmailClient()) ); connect(writeMail, SIGNAL(sendMailRequested(const Email &)), emailClient, SLOT(enqueMail(const Email &)) ); connect(readMail, SIGNAL(cancelView()), this, SLOT(showEmailClient()) ); - connect(readMail, SIGNAL(replyRequested(Email &)), this, - SLOT(composeReply(Email &)) ); + connect(readMail, SIGNAL(replyRequested(Email &, bool&)), this, + SLOT(composeReply(Email &, bool&)) ); + connect(readMail, SIGNAL(forwardRequested(Email &)), this, + SLOT(composeForward(Email &)) ); + connect(readMail, SIGNAL(removeItem(EmailListItem *, bool &)), emailClient, SLOT(deleteMail(EmailListItem *, bool &)) ); connect(readMail, SIGNAL(viewingMail(Email *)), emailClient, SLOT(moveMailFront(Email *)) ); connect(emailClient, SIGNAL(newCaption(const QString &)), this, SLOT(updateCaption(const QString &)) ); viewingMail = FALSE; } MailItWindow::~MailItWindow() { } void MailItWindow::closeEvent(QCloseEvent *e) { if (views->visibleWidget() == emailClient) { e->accept(); } else { showEmailClient(); } } void MailItWindow::compose() { viewingMail = FALSE; emailClient->hide(); readMail->hide(); views->raiseWidget(writeMail); writeMail->setAddressList(emailClient->getAdrListRef()); setCaption( tr( "Write mail" ) ); } -void MailItWindow::composeReply(Email &mail) +void MailItWindow::composeReply(Email &mail, bool& replyAll) +{ + compose(); + writeMail->reply(mail,replyAll) ; +} + +void MailItWindow::composeForward(Email &mail) { compose(); - writeMail->reply(mail); + writeMail->forward(mail) ; } + void MailItWindow::showEmailClient() { viewingMail = FALSE; writeMail->hide(); readMail->hide(); views->raiseWidget(emailClient); setCaption( tr(currentCaption) ); } void MailItWindow::viewMail(QListView *view, Email *mail) { viewingMail = TRUE; emailClient->hide(); readMail->update(view, mail); views->raiseWidget(readMail); setCaption( tr( "Examine mail" ) ); } void MailItWindow::updateMailView(Email *mail) { if (viewingMail) { readMail->mailUpdated(mail); } } void MailItWindow::updateCaption(const QString &newCaption) { currentCaption = newCaption; setCaption(tr(currentCaption)); } void MailItWindow::setDocument(const QString &_address) { // strip leading 'mailto:' QString address = _address; if (address.startsWith("mailto:")) address = address.mid(6); compose(); writeMail->setRecipient(address); } +/*void MailItWindow::reply(Email& mail) +{ + qDebug("####EmailClient: 0 reached"); + composeReply(mail,(bool&)FALSE); +} + +void MailItWindow::replyAll(Email& mail) +{ + qDebug("####EmailClient: 1 reached"); + composeReply(mail,(bool&)TRUE); +} + +void MailItWindow::forward(Email& mail) +{ + qDebug("####EmailClient: 2 reached"); +} + +void MailItWindow::remove(Email&) +{ + qDebug("####EmailClient: 3 reached"); + //emit removeItem(eli,(bool&)TRUE); +} */
\ No newline at end of file |