mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-14 00:49:41 -05:00
Enabled back counting People
Enabled "Sort by Posts" for Channels/Forums/Posted Fixed Width/Height of Message Composer Moved Chat Settings Page order.
This commit is contained in:
parent
12c919491c
commit
7afcc2a91e
@ -517,6 +517,10 @@ void IdDialog::insertIdList(uint32_t token)
|
||||
else
|
||||
allItem->addChild(item);
|
||||
}
|
||||
|
||||
/* count items */
|
||||
int itemCount = contactsItem->childCount() + allItem->childCount();
|
||||
ui->label_count->setText( "(" + QString::number( itemCount ) + ")" );
|
||||
|
||||
filterIds();
|
||||
updateSelection();
|
||||
|
@ -46,10 +46,11 @@
|
||||
#define ROLE_DESCRIPTION Qt::UserRole + 2
|
||||
#define ROLE_POPULARITY Qt::UserRole + 3
|
||||
#define ROLE_LASTPOST Qt::UserRole + 4
|
||||
#define ROLE_SEARCH_SCORE Qt::UserRole + 5
|
||||
#define ROLE_SUBSCRIBE_FLAGS Qt::UserRole + 6
|
||||
#define ROLE_COLOR Qt::UserRole + 7
|
||||
#define ROLE_SAVED_ICON Qt::UserRole + 8
|
||||
#define ROLE_POSTS Qt::UserRole + 5
|
||||
#define ROLE_SEARCH_SCORE Qt::UserRole + 6
|
||||
#define ROLE_SUBSCRIBE_FLAGS Qt::UserRole + 7
|
||||
#define ROLE_COLOR Qt::UserRole + 8
|
||||
#define ROLE_SAVED_ICON Qt::UserRole + 9
|
||||
|
||||
#define FILTER_NAME_INDEX 0
|
||||
#define FILTER_DESC_INDEX 1
|
||||
@ -65,6 +66,7 @@ GroupTreeWidget::GroupTreeWidget(QWidget *parent) :
|
||||
actionSortByName = NULL;
|
||||
actionSortByPopularity = NULL;
|
||||
actionSortByLastPost = NULL;
|
||||
actionSortByPosts = NULL;
|
||||
|
||||
compareRole = new RSTreeWidgetItemCompareRole;
|
||||
compareRole->setRole(COLUMN_DATA, ROLE_NAME);
|
||||
@ -153,6 +155,7 @@ void GroupTreeWidget::processSettings(RshareSettings *settings, bool load)
|
||||
const int SORTBY_NAME = 1;
|
||||
const int SORTBY_POPULRITY = 2;
|
||||
const int SORTBY_LASTPOST = 3;
|
||||
const int SORTBY_POSTS = 4;
|
||||
|
||||
if (load) {
|
||||
// load settings
|
||||
@ -175,6 +178,11 @@ void GroupTreeWidget::processSettings(RshareSettings *settings, bool load)
|
||||
actionSortByLastPost->setChecked(true);
|
||||
}
|
||||
break;
|
||||
case SORTBY_POSTS:
|
||||
if (actionSortByPosts) {
|
||||
actionSortByPosts->setChecked(true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
// save settings
|
||||
@ -221,6 +229,10 @@ void GroupTreeWidget::initDisplayMenu(QToolButton *toolButton)
|
||||
actionSortByLastPost = displayMenu->addAction(QIcon(), tr("Sort by Last Post"), this, SLOT(sort()));
|
||||
actionSortByLastPost->setCheckable(true);
|
||||
actionSortByLastPost->setActionGroup(actionGroup);
|
||||
|
||||
actionSortByPosts = displayMenu->addAction(QIcon(), tr("Sort by Posts"), this, SLOT(sort()));
|
||||
actionSortByPosts->setCheckable(true);
|
||||
actionSortByPosts->setActionGroup(actionGroup);
|
||||
|
||||
toolButton->setMenu(displayMenu);
|
||||
}
|
||||
@ -359,6 +371,9 @@ void GroupTreeWidget::fillGroupItems(QTreeWidgetItem *categoryItem, const QList<
|
||||
/* Set last post */
|
||||
qlonglong lastPost = itemInfo.lastpost.toTime_t();
|
||||
item->setData(COLUMN_DATA, ROLE_LASTPOST, -lastPost); // negative for correct sorting
|
||||
|
||||
/* Set visible posts */
|
||||
item->setData(COLUMN_DATA, ROLE_POSTS, -itemInfo.max_visible_posts);// negative for correct sorting
|
||||
|
||||
/* Set icon */
|
||||
if (ui->treeWidget->itemWidget(item, COLUMN_NAME)) {
|
||||
@ -623,6 +638,8 @@ void GroupTreeWidget::resort(QTreeWidgetItem *categoryItem)
|
||||
compareRole->setRole(COLUMN_DATA, ROLE_POPULARITY);
|
||||
} else if (actionSortByLastPost && actionSortByLastPost->isChecked()) {
|
||||
compareRole->setRole(COLUMN_DATA, ROLE_LASTPOST);
|
||||
} else if (actionSortByPosts && actionSortByPosts->isChecked()) {
|
||||
compareRole->setRole(COLUMN_DATA, ROLE_POSTS);
|
||||
}
|
||||
|
||||
if (categoryItem) {
|
||||
|
@ -137,6 +137,7 @@ private:
|
||||
QAction *actionSortByName;
|
||||
QAction *actionSortByPopularity;
|
||||
QAction *actionSortByLastPost;
|
||||
QAction *actionSortByPosts;
|
||||
|
||||
RSTreeWidgetItemCompareRole *compareRole;
|
||||
|
||||
|
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1679</width>
|
||||
<height>951</height>
|
||||
<width>935</width>
|
||||
<height>706</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -191,7 +191,16 @@
|
||||
<enum>QFrame::Sunken</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<property name="margin">
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
@ -772,7 +781,16 @@
|
||||
<enum>QFrame::Box</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<property name="margin">
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
@ -1009,7 +1027,16 @@ border-image: url(:/images/closepressed.png)
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget_1">
|
||||
<layout class="QGridLayout" name="layoutrecommended">
|
||||
<property name="margin">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
@ -1084,8 +1111,8 @@ border-image: url(:/images/closepressed.png)
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1679</width>
|
||||
<height>37</height>
|
||||
<width>935</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
|
@ -142,11 +142,11 @@ RSettingsWin::initStackedWidget()
|
||||
addPage(new PluginsPage() );
|
||||
addPage(new NotifyPage());
|
||||
addPage(new CryptoPage());
|
||||
addPage(new ChatPage());
|
||||
addPage(new MessagePage());
|
||||
addPage(new ChannelPage());
|
||||
addPage(new ForumPage());
|
||||
addPage(new PostedPage());
|
||||
addPage(new ChatPage());
|
||||
addPage(new PostedPage());
|
||||
addPage(new AppearancePage());
|
||||
addPage(new SoundPage() );
|
||||
addPage(new ServicePermissionsPage() );
|
||||
|
Loading…
Reference in New Issue
Block a user