From 4eea4ef687f0df6bce90e561baa848d96695c8da Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 12 Jan 2019 14:44:46 +0100 Subject: [PATCH] removed Subscribed column in chat room list since it duplicates information. WARNING: RS UI will get confused about previously saved config. Needs 2 restarts to get right --- retroshare-gui/src/gui/ChatLobbyWidget.cpp | 24 +--------------------- retroshare-gui/src/gui/ChatLobbyWidget.h | 2 -- 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/retroshare-gui/src/gui/ChatLobbyWidget.cpp b/retroshare-gui/src/gui/ChatLobbyWidget.cpp index e1c486130..f93d9a501 100644 --- a/retroshare-gui/src/gui/ChatLobbyWidget.cpp +++ b/retroshare-gui/src/gui/ChatLobbyWidget.cpp @@ -54,8 +54,7 @@ #define COLUMN_NAME 0 #define COLUMN_USER_COUNT 1 #define COLUMN_TOPIC 2 -#define COLUMN_SUBSCRIBED 3 -#define COLUMN_COUNT 4 +#define COLUMN_COUNT 3 #define COLUMN_DATA 0 #define ROLE_SORT Qt::UserRole @@ -115,17 +114,14 @@ ChatLobbyWidget::ChatLobbyWidget(QWidget *parent, Qt::WindowFlags flags) headerItem->setText(COLUMN_NAME, tr("Name")); headerItem->setText(COLUMN_USER_COUNT, tr("Count")); headerItem->setText(COLUMN_TOPIC, tr("Topic")); - headerItem->setText(COLUMN_SUBSCRIBED, tr("Subscribed")); headerItem->setTextAlignment(COLUMN_NAME, Qt::AlignHCenter | Qt::AlignVCenter); headerItem->setTextAlignment(COLUMN_TOPIC, Qt::AlignHCenter | Qt::AlignVCenter); headerItem->setTextAlignment(COLUMN_USER_COUNT, Qt::AlignHCenter | Qt::AlignVCenter); - headerItem->setTextAlignment(COLUMN_SUBSCRIBED, Qt::AlignHCenter | Qt::AlignVCenter); QHeaderView *header = ui.lobbyTreeWidget->header(); QHeaderView_setSectionResizeModeColumn(header, COLUMN_NAME, QHeaderView::Interactive); QHeaderView_setSectionResizeModeColumn(header, COLUMN_USER_COUNT, QHeaderView::Interactive); QHeaderView_setSectionResizeModeColumn(header, COLUMN_TOPIC, QHeaderView::Interactive); - QHeaderView_setSectionResizeModeColumn(header, COLUMN_SUBSCRIBED, QHeaderView::Interactive); privateSubLobbyItem = new RSTreeWidgetItem(compareRole, TYPE_FOLDER); privateSubLobbyItem->setText(COLUMN_NAME, tr("Private Subscribed chat rooms")); @@ -159,7 +155,6 @@ ChatLobbyWidget::ChatLobbyWidget(QWidget *parent, Qt::WindowFlags flags) ui.lobbyTreeWidget->setColumnHidden(COLUMN_NAME,false) ; ui.lobbyTreeWidget->setColumnHidden(COLUMN_USER_COUNT,true) ; ui.lobbyTreeWidget->setColumnHidden(COLUMN_TOPIC,true) ; - ui.lobbyTreeWidget->setColumnHidden(COLUMN_SUBSCRIBED,true) ; ui.lobbyTreeWidget->setSortingEnabled(true) ; float fact = QFontMetricsF(font()).height()/14.0f; @@ -176,9 +171,6 @@ ChatLobbyWidget::ChatLobbyWidget(QWidget *parent, Qt::WindowFlags flags) showTopicAct= new QAction(headerItem->text(COLUMN_TOPIC),this); showTopicAct->setCheckable(true); showTopicAct->setToolTip(tr("Show")+" "+showTopicAct->text()+" "+tr("column")); connect(showTopicAct,SIGNAL(triggered(bool)),this,SLOT(setShowTopicColumn(bool))) ; - showSubscribeAct= new QAction(headerItem->text(COLUMN_SUBSCRIBED),this); - showSubscribeAct->setCheckable(true); showSubscribeAct->setToolTip(tr("Show")+" "+showSubscribeAct->text()+" "+tr("column")); - connect(showSubscribeAct,SIGNAL(triggered(bool)),this,SLOT(setShowSubscribeColumn(bool))) ; // Set initial size of the splitter ui.splitter->setStretchFactor(0, 0); @@ -351,12 +343,10 @@ void ChatLobbyWidget::lobbyTreeWidgetCustomPopupMenu(QPoint) showUserCountAct->setChecked(!ui.lobbyTreeWidget->isColumnHidden(COLUMN_USER_COUNT)); showTopicAct->setChecked(!ui.lobbyTreeWidget->isColumnHidden(COLUMN_TOPIC)); - showSubscribeAct->setChecked(!ui.lobbyTreeWidget->isColumnHidden(COLUMN_SUBSCRIBED)); QMenu *menu = contextMnu.addMenu(tr("Columns")); menu->addAction(showUserCountAct); menu->addAction(showTopicAct); - menu->addAction(showSubscribeAct); contextMnu.exec(QCursor::pos()); } @@ -385,8 +375,6 @@ static void updateItem(QTreeWidget *treeWidget, QTreeWidgetItem *item, ChatLobby //item->setText(COLUMN_USER_COUNT, QString::number(count)); item->setData(COLUMN_USER_COUNT, Qt::EditRole, count); - item->setText(COLUMN_SUBSCRIBED, subscribed?qApp->translate("ChatLobbyWidget", "Yes"):qApp->translate("ChatLobbyWidget", "No")); - item->setData(COLUMN_DATA, ROLE_ID, (qulonglong)id); item->setData(COLUMN_DATA, ROLE_SUBSCRIBED, subscribed); item->setData(COLUMN_DATA, ROLE_FLAGS, lobby_flags.toUInt32()); @@ -1283,7 +1271,6 @@ void ChatLobbyWidget::processSettings(bool bLoad) setShowUserCountColumn(Settings->value("showUserCountColumn", !ui.lobbyTreeWidget->isColumnHidden(COLUMN_USER_COUNT)).toBool()); setShowTopicColumn(Settings->value("showTopicColumn", !ui.lobbyTreeWidget->isColumnHidden(COLUMN_TOPIC)).toBool()); - setShowSubscribeColumn(Settings->value("showSubscribeColumn", !ui.lobbyTreeWidget->isColumnHidden(COLUMN_SUBSCRIBED)).toBool()); } else { // save settings Settings->setValue("splitter", ui.splitter->saveState()); @@ -1292,7 +1279,6 @@ void ChatLobbyWidget::processSettings(bool bLoad) Settings->setValue("showUserCountColumn", !ui.lobbyTreeWidget->isColumnHidden(COLUMN_USER_COUNT)); Settings->setValue("showTopicColumn", !ui.lobbyTreeWidget->isColumnHidden(COLUMN_TOPIC)); - Settings->setValue("showSubscribeColumn", !ui.lobbyTreeWidget->isColumnHidden(COLUMN_SUBSCRIBED)); } Settings->endGroup(); @@ -1315,14 +1301,6 @@ void ChatLobbyWidget::setShowTopicColumn(bool show) ui.lobbyTreeWidget->header()->setVisible(getNumColVisible()>1); } -void ChatLobbyWidget::setShowSubscribeColumn(bool show) -{ - if (ui.lobbyTreeWidget->isColumnHidden(COLUMN_SUBSCRIBED) == show) { - ui.lobbyTreeWidget->setColumnHidden(COLUMN_SUBSCRIBED, !show); - } - ui.lobbyTreeWidget->header()->setVisible(getNumColVisible()>1); -} - int ChatLobbyWidget::getNumColVisible() { int iNumColVis=0; diff --git a/retroshare-gui/src/gui/ChatLobbyWidget.h b/retroshare-gui/src/gui/ChatLobbyWidget.h index 9464a514e..39422ec6a 100644 --- a/retroshare-gui/src/gui/ChatLobbyWidget.h +++ b/retroshare-gui/src/gui/ChatLobbyWidget.h @@ -105,7 +105,6 @@ private slots: void setShowUserCountColumn(bool show); void setShowTopicColumn(bool show); - void setShowSubscribeColumn(bool show); void updateNotify(ChatLobbyId id, unsigned int count) ; void idChooserCurrentIndexChanged(int index); @@ -136,7 +135,6 @@ private: /** Defines the actions for the header context menu */ QAction* showUserCountAct; QAction* showTopicAct; - QAction* showSubscribeAct; int getNumColVisible(); ChatLobbyUserNotify* myChatLobbyUserNotify;