added next unread button to forums (patch from devnewton #3401840)

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4614 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2011-09-25 12:15:25 +00:00
parent fdd8825399
commit ad4b0153b2
3 changed files with 45 additions and 2 deletions

View File

@ -152,6 +152,8 @@ ForumsDialog::ForumsDialog(QWidget *parent)
connect(ui.expandButton, SIGNAL(clicked()), this, SLOT(togglethreadview())); connect(ui.expandButton, SIGNAL(clicked()), this, SLOT(togglethreadview()));
connect(ui.previousButton, SIGNAL(clicked()), this, SLOT(previousMessage())); connect(ui.previousButton, SIGNAL(clicked()), this, SLOT(previousMessage()));
connect(ui.nextButton, SIGNAL(clicked()), this, SLOT(nextMessage())); 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.downloadButton, SIGNAL(clicked()), this, SLOT(downloadAllFiles()));
connect(ui.clearButton, SIGNAL(clicked()), this, SLOT(clearFilter())); connect(ui.clearButton, SIGNAL(clicked()), this, SLOT(clearFilter()));
@ -1159,6 +1161,27 @@ void ForumsDialog::downloadAllFiles()
RetroShareLink::process(urls, RetroShareLink::TYPE_FILE/*, true*/); 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 // TODO
#if 0 #if 0
void ForumsDialog::removemessage() void ForumsDialog::removemessage()

View File

@ -86,6 +86,7 @@ private slots:
void previousMessage (); void previousMessage ();
void nextMessage (); void nextMessage ();
void nextUnreadMessage();
void downloadAllFiles(); void downloadAllFiles();
void changedViewBox(); void changedViewBox();

View File

@ -950,7 +950,7 @@ background: white;}</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="6"> <item row="0" column="7">
<widget class="QPushButton" name="expandButton"> <widget class="QPushButton" name="expandButton">
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
@ -976,7 +976,7 @@ background: white;}</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="5"> <item row="0" column="6">
<widget class="QPushButton" name="downloadButton"> <widget class="QPushButton" name="downloadButton">
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
@ -996,6 +996,25 @@ background: white;}</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="5">
<widget class="QPushButton" name="nextUnreadButton">
<property name="minimumSize">
<size>
<width>80</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>80</width>
<height>24</height>
</size>
</property>
<property name="text">
<string>Next unread</string>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
<item row="0" column="0"> <item row="0" column="0">