-rw-r--r-- | kmicromail/opiemail.cpp | 16 | ||||
-rw-r--r-- | kmicromail/opiemail.h | 2 | ||||
-rw-r--r-- | kmicromail/viewmail.cpp | 1 | ||||
-rw-r--r-- | kmicromail/viewmail.h | 4 | ||||
-rw-r--r-- | kmicromail/viewmailbase.cpp | 13 | ||||
-rw-r--r-- | kmicromail/viewmailbase.h | 2 |
6 files changed, 35 insertions, 3 deletions
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp index c20c7ce..ec192ea 100644 --- a/kmicromail/opiemail.cpp +++ b/kmicromail/opiemail.cpp @@ -300,4 +300,19 @@ void OpieMail::replyMail() } +void OpieMail::displayNextMail(ViewMail * vm) +{ + QListViewItem*item = mailView->currentItem(); + if (!item) return; + item = item->itemBelow(); + if (!item) { + vm->setCaption(i18n("End of List" )); + return; + } + mailView->setCurrentItem(item); + RecMailP mail = ((MailListViewItem*)item)->data(); + RecBodyP body = folderView->fetchBody(mail); + vm->setBody( body ); + vm->setMail( mail ); +} void OpieMail::displayMail() { @@ -314,4 +329,5 @@ void OpieMail::displayMail() readMail.resize( 640, 480); #endif + connect( &readMail,SIGNAL( showNextMail(ViewMail *) ), this, SLOT( displayNextMail(ViewMail *) ) ); readMail.exec(); diff --git a/kmicromail/opiemail.h b/kmicromail/opiemail.h index 44ab1ec..30968a7 100644 --- a/kmicromail/opiemail.h +++ b/kmicromail/opiemail.h @@ -8,4 +8,5 @@ #include <opie2/osmartpointer.h> #include <libmailwrapper/mailtypes.h> +#include <viewmail.h> class OpieMail : public MainWindow @@ -26,4 +27,5 @@ public slots: virtual void message(const QCString &msg, const QByteArray &data); protected slots: + virtual void displayNextMail(ViewMail * vm); virtual void slotSendQueued(); virtual void slotSearchMails(); diff --git a/kmicromail/viewmail.cpp b/kmicromail/viewmail.cpp index 3bd6f41..60c764c 100644 --- a/kmicromail/viewmail.cpp +++ b/kmicromail/viewmail.cpp @@ -327,4 +327,5 @@ ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl) connect( showHtml, SIGNAL( toggled(bool) ), SLOT( slotShowHtml(bool) ) ); connect( closeMail, SIGNAL( activated() ), SLOT( close() ) ); + connect( nextMail, SIGNAL( activated() ), SLOT( slotNextMail() ) ); attachments->setEnabled(m_gotBody); diff --git a/kmicromail/viewmail.h b/kmicromail/viewmail.h index 194ac8e..c2c2ce3 100644 --- a/kmicromail/viewmail.h +++ b/kmicromail/viewmail.h @@ -43,5 +43,6 @@ public: void setBody(const RecBodyP&body); bool deleted; - + signals: + void showNextMail(ViewMail*); protected: QString deHtml(const QString &string); @@ -50,4 +51,5 @@ protected: protected slots: + void slotNextMail() { emit showNextMail(this); }; void slotReply(); void slotForward(); diff --git a/kmicromail/viewmailbase.cpp b/kmicromail/viewmailbase.cpp index 3d7ed42..c4731a7 100644 --- a/kmicromail/viewmailbase.cpp +++ b/kmicromail/viewmailbase.cpp @@ -50,6 +50,17 @@ ViewMailBase::ViewMailBase(QWidget *parent, const char *name, WFlags fl) deleteMail->addTo(toolbar); deleteMail->addTo(mailmenu); - closeMail = new QAction(i18n("Close"),SmallIcon("exit"), 0, 0, this); + + + + nextMail = new QAction(i18n("Show next mail"),SmallIcon("add"), 0, 0, this); QLabel *spacer = new QLabel(toolbar); + nextMail->addTo(toolbar); + nextMail->addTo(mailmenu); + + + + + closeMail = new QAction(i18n("Close"),SmallIcon("exit"), 0, 0, this); + //QLabel *spacer = new QLabel(toolbar); spacer->setBackgroundMode(QWidget::PaletteButton); toolbar->setStretchableWidget(spacer); diff --git a/kmicromail/viewmailbase.h b/kmicromail/viewmailbase.h index 1c8948a..c97e9e3 100644 --- a/kmicromail/viewmailbase.h +++ b/kmicromail/viewmailbase.h @@ -21,5 +21,5 @@ public: protected: - QAction *reply, *forward, *attachbutton, *deleteMail, *showHtml, *closeMail; + QAction *reply, *forward, *attachbutton, *deleteMail, *showHtml, *closeMail, *nextMail; QListView *attachments; QToolBar *toolbar; |