-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 @@ -294,30 +294,46 @@ void OpieMail::replyMail() composer.setCharset( body->getCharset() ); if ( QDialog::Accepted == KApplication::execDialog( &composer ) ) { mail->Wrapper()->answeredMail(mail); } delete settings; } +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() { QListViewItem*item = mailView->currentItem(); if (!item) return; RecMailP mail = ((MailListViewItem*)item)->data(); RecBodyP body = folderView->fetchBody(mail); ViewMail readMail( this,"", Qt::WType_Modal ); readMail.setBody( body ); readMail.setMail( mail ); #ifndef DESKTOP_VERSION readMail.showMaximized(); #else readMail.resize( 640, 480); #endif + connect( &readMail,SIGNAL( showNextMail(ViewMail *) ), this, SLOT( displayNextMail(ViewMail *) ) ); readMail.exec(); if ( readMail.deleted ) { folderView->refreshCurrent(); } else { diff --git a/kmicromail/opiemail.h b/kmicromail/opiemail.h index 44ab1ec..30968a7 100644 --- a/kmicromail/opiemail.h +++ b/kmicromail/opiemail.h @@ -2,16 +2,17 @@ #ifndef OPIEMAIL_H #define OPIEMAIL_H #include "mainwindow.h" #include <libmailwrapper/settings.h> #include <opie2/osmartpointer.h> #include <libmailwrapper/mailtypes.h> +#include <viewmail.h> class OpieMail : public MainWindow { Q_OBJECT public: OpieMail( QWidget *parent = 0, const char *name = 0 ); virtual ~OpieMail(); @@ -20,16 +21,17 @@ public: public slots: virtual void slotwriteMail(const QString&name,const QString&email); virtual void slotwriteMail2(const QString&nameemail); virtual void slotComposeMail(); virtual void slotExtAppHandler(); virtual void appMessage(const QCString &msg, const QByteArray &data); virtual void message(const QCString &msg, const QByteArray &data); protected slots: + virtual void displayNextMail(ViewMail * vm); virtual void slotSendQueued(); virtual void slotSearchMails(); virtual void slotEditSettings(); virtual void slotEditAccounts(); virtual void displayMail(); virtual void replyMail(); virtual void slotDeleteMail(); virtual void slotGetMail(); diff --git a/kmicromail/viewmail.cpp b/kmicromail/viewmail.cpp index 3bd6f41..60c764c 100644 --- a/kmicromail/viewmail.cpp +++ b/kmicromail/viewmail.cpp @@ -321,16 +321,17 @@ ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl) m_gotBody = false; deleted = false; connect( reply, SIGNAL(activated()), SLOT(slotReply())); connect( forward, SIGNAL(activated()), SLOT(slotForward())); connect( deleteMail, SIGNAL( activated() ), SLOT( slotDeleteMail() ) ); connect( showHtml, SIGNAL( toggled(bool) ), SLOT( slotShowHtml(bool) ) ); connect( closeMail, SIGNAL( activated() ), SLOT( close() ) ); + connect( nextMail, SIGNAL( activated() ), SLOT( slotNextMail() ) ); attachments->setEnabled(m_gotBody); connect( attachments, SIGNAL( clicked(QListViewItem*,const QPoint&, int) ), SLOT( slotItemClicked(QListViewItem*,const QPoint&, int) ) ); readConfig(); attachments->setSorting(-1); } diff --git a/kmicromail/viewmail.h b/kmicromail/viewmail.h index 194ac8e..c2c2ce3 100644 --- a/kmicromail/viewmail.h +++ b/kmicromail/viewmail.h @@ -37,23 +37,25 @@ public: ViewMail( QWidget *parent = 0, const char *name = 0, WFlags fl = 0); ~ViewMail(); void hide(); void exec(); void setMail(const RecMailP&mail ); void setBody(const RecBodyP&body); bool deleted; - + signals: + void showNextMail(ViewMail*); protected: QString deHtml(const QString &string); AttachItem* searchParent(const QValueList<int>&path); AttachItem* lastChild(AttachItem*parent); protected slots: + void slotNextMail() { emit showNextMail(this); }; void slotReply(); void slotForward(); void setText(); void slotItemClicked( QListViewItem * item , const QPoint & point, int c ); void slotDeleteMail( ); void slotShowHtml( bool ); private: diff --git a/kmicromail/viewmailbase.cpp b/kmicromail/viewmailbase.cpp index 3d7ed42..c4731a7 100644 --- a/kmicromail/viewmailbase.cpp +++ b/kmicromail/viewmailbase.cpp @@ -44,18 +44,29 @@ ViewMailBase::ViewMailBase(QWidget *parent, const char *name, WFlags fl) showHtml = new QAction( i18n( "Show Html" ), SmallIcon( "html" ), 0, 0, this, 0, true ); showHtml->addTo( toolbar ); showHtml->addTo( mailmenu ); deleteMail = new QAction(i18n("Delete Mail"),SmallIcon("trash"), 0, 0, this); 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); closeMail->addTo(toolbar); closeMail->addTo(mailmenu); QVBox *view = new QVBox(this); setCentralWidget(view); attachments = new QListView(view); diff --git a/kmicromail/viewmailbase.h b/kmicromail/viewmailbase.h index 1c8948a..c97e9e3 100644 --- a/kmicromail/viewmailbase.h +++ b/kmicromail/viewmailbase.h @@ -15,17 +15,17 @@ class QPopupMenu; class ViewMailBase : public QMainWindow { Q_OBJECT public: ViewMailBase(QWidget *parent = 0, const char *name = 0, WFlags fl = 0); protected: - QAction *reply, *forward, *attachbutton, *deleteMail, *showHtml, *closeMail; + QAction *reply, *forward, *attachbutton, *deleteMail, *showHtml, *closeMail, *nextMail; QListView *attachments; QToolBar *toolbar; QTextBrowser *browser; OpenDiag *openDiag; QMenuBar *menubar; QPopupMenu *mailmenu; protected slots: |