diff --git a/retroshare-gui/src/gui/ForumsDialog.cpp b/retroshare-gui/src/gui/ForumsDialog.cpp index 8a1507e2b..0a80f15c3 100644 --- a/retroshare-gui/src/gui/ForumsDialog.cpp +++ b/retroshare-gui/src/gui/ForumsDialog.cpp @@ -152,6 +152,8 @@ ForumsDialog::ForumsDialog(QWidget *parent) connect(ui.expandButton, SIGNAL(clicked()), this, SLOT(togglethreadview())); connect(ui.previousButton, SIGNAL(clicked()), this, SLOT(previousMessage())); connect(ui.nextButton, SIGNAL(clicked()), this, SLOT(nextMessage())); + connect(ui.nextUnreadButton, SIGNAL(clicked()), this, SLOT(nextUnreadMessage())); + connect(ui.downloadButton, SIGNAL(clicked()), this, SLOT(downloadAllFiles())); connect(ui.clearButton, SIGNAL(clicked()), this, SLOT(clearFilter())); @@ -1159,6 +1161,27 @@ void ForumsDialog::downloadAllFiles() RetroShareLink::process(urls, RetroShareLink::TYPE_FILE/*, true*/); } +void ForumsDialog::nextUnreadMessage() +{ + QTreeWidgetItem* currentItem = ui.threadTreeWidget->currentItem(); + if( !currentItem ) + { + currentItem = ui.threadTreeWidget->topLevelItem(0); + if( !currentItem ) + return; + } + + do + { + uint32_t status = currentItem->data(COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt(); + if( IS_UNREAD(status) ) + { + ui.threadTreeWidget->setCurrentItem(currentItem); + return; + } + } while( currentItem = ui.threadTreeWidget->itemBelow(currentItem) ); +} + // TODO #if 0 void ForumsDialog::removemessage() diff --git a/retroshare-gui/src/gui/ForumsDialog.h b/retroshare-gui/src/gui/ForumsDialog.h index 4f1c06c8f..989e42262 100644 --- a/retroshare-gui/src/gui/ForumsDialog.h +++ b/retroshare-gui/src/gui/ForumsDialog.h @@ -86,6 +86,7 @@ private slots: void previousMessage (); void nextMessage (); + void nextUnreadMessage(); void downloadAllFiles(); void changedViewBox(); diff --git a/retroshare-gui/src/gui/ForumsDialog.ui b/retroshare-gui/src/gui/ForumsDialog.ui index fb0c4f82a..ba2cfed19 100644 --- a/retroshare-gui/src/gui/ForumsDialog.ui +++ b/retroshare-gui/src/gui/ForumsDialog.ui @@ -950,7 +950,7 @@ background: white;} - + @@ -976,7 +976,7 @@ background: white;} - + @@ -996,6 +996,25 @@ background: white;} + + + + + 80 + 24 + + + + + 80 + 24 + + + + Next unread + + +