mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-10 07:32:42 -04:00
Added display menu in channels and forums to sort the group tree by name, popularity or last post.
Removed unnecessary loop over the forum messages in ForumDetails. Removed date and time when lastPost==0 in ForumDetails and ChannelDetails. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3950 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
28b4534fdf
commit
ff57befb1f
14 changed files with 403 additions and 133 deletions
|
@ -27,6 +27,10 @@
|
|||
#include <QTreeWidgetItem>
|
||||
#include <QDateTime>
|
||||
|
||||
class QPushButton;
|
||||
class RshareSettings;
|
||||
class RSTreeWidgetItemCompareRole;
|
||||
|
||||
namespace Ui {
|
||||
class GroupTreeWidget;
|
||||
}
|
||||
|
@ -58,6 +62,11 @@ public:
|
|||
GroupTreeWidget(QWidget *parent = 0);
|
||||
~GroupTreeWidget();
|
||||
|
||||
// Load and save settings (group must be startet from the caller)
|
||||
void processSettings(RshareSettings *settings, bool load);
|
||||
// Initialize the display menu for sorting
|
||||
void initDisplayMenu(QPushButton *pushButton);
|
||||
|
||||
// Add a new category item
|
||||
QTreeWidgetItem *addCategoryItem(const QString &name, const QIcon &icon, bool expand);
|
||||
// Get id of item
|
||||
|
@ -68,22 +77,34 @@ public:
|
|||
void setUnreadCount(QTreeWidgetItem *item, int unreadCount);
|
||||
|
||||
signals:
|
||||
void treeCustomContextMenuRequested(const QPoint &pos);
|
||||
void treeCurrentItemChanged(const QString &id);
|
||||
void treeCustomContextMenuRequested(const QPoint &pos);
|
||||
void treeCurrentItemChanged(const QString &id);
|
||||
|
||||
protected:
|
||||
void changeEvent(QEvent *e);
|
||||
|
||||
private slots:
|
||||
void customContextMenuRequested(const QPoint &pos);
|
||||
void currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
|
||||
void currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
|
||||
void filterChanged();
|
||||
void clearFilter();
|
||||
|
||||
private:
|
||||
void calculateScore(QTreeWidgetItem *item);
|
||||
void sort();
|
||||
|
||||
private:
|
||||
void calculateScore(QTreeWidgetItem *item);
|
||||
void resort(QTreeWidgetItem *categoryItem);
|
||||
|
||||
private:
|
||||
QMenu *displayMenu;
|
||||
QAction *actionSortAscending;
|
||||
// QAction *actionSortDescending;
|
||||
QAction *actionSortByName;
|
||||
QAction *actionSortByPopularity;
|
||||
QAction *actionSortByLastPost;
|
||||
|
||||
RSTreeWidgetItemCompareRole *compareRole;
|
||||
|
||||
Ui::GroupTreeWidget *ui;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue