mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-14 00:49:41 -05:00
proper on/off switch for status show
This commit is contained in:
parent
038a0ae4c7
commit
70680fae47
@ -56,6 +56,12 @@ RsFriendListModel::RsFriendListModel(QObject *parent)
|
||||
mFilterStrings.clear();
|
||||
}
|
||||
|
||||
void RsFriendListModel::setDisplayStatusString(bool b)
|
||||
{
|
||||
mDisplayStatusString = b;
|
||||
postMods();
|
||||
}
|
||||
|
||||
void RsFriendListModel::setDisplayGroups(bool b)
|
||||
{
|
||||
mDisplayGroups = b;
|
||||
@ -676,7 +682,7 @@ QVariant RsFriendListModel::displayRole(const EntryIndex& e, int col) const
|
||||
{
|
||||
std::string css = rsMsgs->getCustomStateString(node->node_info.id);
|
||||
|
||||
if(!css.empty())
|
||||
if(!css.empty() && mDisplayStatusString)
|
||||
return QVariant(QString::fromUtf8(node->node_info.location.c_str())+"\n"+QString::fromUtf8(css.c_str()));
|
||||
else
|
||||
return QVariant(QString::fromUtf8(node->node_info.location.c_str()));
|
||||
|
@ -119,6 +119,9 @@ public:
|
||||
void setDisplayGroups(bool b);
|
||||
bool getDisplayGroups() const { return mDisplayGroups; }
|
||||
|
||||
void setDisplayStatusString(bool b);
|
||||
bool getDisplayStatusString() const { return mDisplayStatusString; }
|
||||
|
||||
EntryType getType(const QModelIndex&) const;
|
||||
|
||||
bool getGroupData (const QModelIndex&,RsGroupInfo &) const;
|
||||
@ -198,6 +201,7 @@ private:
|
||||
FilterType mFilterType;
|
||||
|
||||
bool mDisplayGroups ;
|
||||
bool mDisplayStatusString ;
|
||||
|
||||
// The 3 vectors below store thehierarchical information for groups, profiles and locations,
|
||||
// meaning which is the child/parent of which. The actual group/profile/node data are also stored in the
|
||||
|
@ -158,7 +158,6 @@ NewFriendList::NewFriendList(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::NewFriendList()),
|
||||
// mCompareRole(new RSTreeWidgetItemCompareRole),
|
||||
mShowState(false),
|
||||
groupsHasChanged(false)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
@ -294,7 +293,7 @@ void NewFriendList::headerContextMenuRequested(QPoint p)
|
||||
displayMenu.addAction(ui->actionShowGroups);
|
||||
|
||||
ui->actionShowOfflineFriends->setChecked(mProxyModel->showOfflineNodes());
|
||||
ui->actionShowState->setChecked(mShowState);
|
||||
ui->actionShowState->setChecked(mModel->getDisplayStatusString());
|
||||
ui->actionShowGroups->setChecked(mModel->getDisplayGroups());
|
||||
|
||||
QHeaderView *header = ui->peerTreeWidget->header();
|
||||
@ -347,7 +346,7 @@ void NewFriendList::processSettings(bool load)
|
||||
|
||||
// states
|
||||
setShowUnconnected(!Settings->value("hideUnconnected", mProxyModel->showOfflineNodes()).toBool());
|
||||
setShowState(Settings->value("showState", mShowState).toBool());
|
||||
setShowState(Settings->value("showState", mModel->getDisplayStatusString()).toBool());
|
||||
setShowGroups(Settings->value("showGroups", mModel->getDisplayGroups()).toBool());
|
||||
|
||||
setColumnVisible(RsFriendListModel::COLUMN_THREAD_IP,Settings->value("showIP", isColumnVisible(RsFriendListModel::COLUMN_THREAD_IP)).toBool());
|
||||
@ -379,7 +378,7 @@ void NewFriendList::processSettings(bool load)
|
||||
|
||||
// states
|
||||
Settings->setValue("hideUnconnected", !mProxyModel->showOfflineNodes());
|
||||
Settings->setValue("showState", mShowState);
|
||||
Settings->setValue("showState", mModel->getDisplayStatusString());
|
||||
Settings->setValue("showGroups", mModel->getDisplayGroups());
|
||||
|
||||
Settings->setValue("showIP",isColumnVisible(RsFriendListModel::COLUMN_THREAD_IP));
|
||||
@ -1467,7 +1466,7 @@ void NewFriendList::sortByColumn(int column, Qt::SortOrder sortOrder)
|
||||
|
||||
void NewFriendList::setShowState(bool show)
|
||||
{
|
||||
mShowState = show;
|
||||
mModel->setDisplayStatusString(show);
|
||||
}
|
||||
|
||||
void NewFriendList::setShowGroups(bool show)
|
||||
|
Loading…
Reference in New Issue
Block a user