diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f8b38eb..5d14ef63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - fixed an issue with token manipulation in the SbieDrv driver - fixed "Reset all GUI options" does not reset all GUI sections as expected [#2967](https://github.com/sandboxie-plus/Sandboxie/issues/2967) - fixed sbie:// links below the Box Type presets [#2959](https://github.com/sandboxie-plus/Sandboxie/issues/2959#issuecomment-1565264161) - +- fixed "Reset all GUI options" makes all sandbox names disappear [#2972](https://github.com/sandboxie-plus/Sandboxie/issues/2972) ## [1.9.5 / 5.64.5] - 2023-05-26 diff --git a/SandboxiePlus/MiscHelpers/Common/ListItemModel.cpp b/SandboxiePlus/MiscHelpers/Common/ListItemModel.cpp index 909dc218..01dd9992 100644 --- a/SandboxiePlus/MiscHelpers/Common/ListItemModel.cpp +++ b/SandboxiePlus/MiscHelpers/Common/ListItemModel.cpp @@ -57,7 +57,7 @@ void CSimpleListModel::Sync(QList List) QVariantMap Values = Cur["Values"].toMap(); for(int section = FIRST_COLUMN; section < columnCount(); section++) { - if (!m_Columns.contains(section)) + if (!IsColumnEnabled(section)) continue; // ignore columns which are hidden QVariant Value = Values[QString::number(section)]; diff --git a/SandboxiePlus/MiscHelpers/Common/TreeItemModel.cpp b/SandboxiePlus/MiscHelpers/Common/TreeItemModel.cpp index a59f98c9..7ef50a06 100644 --- a/SandboxiePlus/MiscHelpers/Common/TreeItemModel.cpp +++ b/SandboxiePlus/MiscHelpers/Common/TreeItemModel.cpp @@ -113,7 +113,7 @@ void CSimpleTreeModel::Sync(const QMap& List) QVariantMap Values = Cur["Values"].toMap(); for(int section = FIRST_COLUMN; section < columnCount(); section++) { - if (!m_Columns.contains(section)) + if (!IsColumnEnabled(section)) continue; // ignore columns which are hidden QVariant Value = Cur[m_ColumnKeys.at(section).second]; diff --git a/SandboxiePlus/MiscHelpers/Common/TreeViewEx.h b/SandboxiePlus/MiscHelpers/Common/TreeViewEx.h index f8c1beac..2b62a88b 100644 --- a/SandboxiePlus/MiscHelpers/Common/TreeViewEx.h +++ b/SandboxiePlus/MiscHelpers/Common/TreeViewEx.h @@ -83,20 +83,20 @@ public: bool IsColumnEnabled(int column) { - return m_Columns.contains(column); + return !m_ColumnsOff.contains(column); } void SetColumnEnabled(int column, bool set) { if (!set) - m_Columns.remove(column); + m_ColumnsOff.insert(column); else - m_Columns.insert(column); + m_ColumnsOff.remove(column); } protected: - QSet m_Columns; + QSet m_ColumnsOff; }; class MISCHELPERS_EXPORT QTreeViewEx: public QTreeView diff --git a/SandboxiePlus/SandMan/Models/MonitorModel.cpp b/SandboxiePlus/SandMan/Models/MonitorModel.cpp index c73c848b..c4937de9 100644 --- a/SandboxiePlus/SandMan/Models/MonitorModel.cpp +++ b/SandboxiePlus/SandMan/Models/MonitorModel.cpp @@ -69,7 +69,7 @@ QList CMonitorModel::Sync(const QMap& En for (int section = 0; section < columnCount(); section++) { - if (!m_Columns.contains(section)) + if (!IsColumnEnabled(section)) continue; // ignore columns which are hidden QVariant Value; diff --git a/SandboxiePlus/SandMan/Models/SbieModel.cpp b/SandboxiePlus/SandMan/Models/SbieModel.cpp index 79fce503..d5003bf1 100644 --- a/SandboxiePlus/SandMan/Models/SbieModel.cpp +++ b/SandboxiePlus/SandMan/Models/SbieModel.cpp @@ -289,7 +289,7 @@ QList CSbieModel::Sync(const QMap& BoxList, cons for(int section = 0; section < columnCount(); section++) { - if (!m_Columns.contains(section)) + if (!IsColumnEnabled(section)) continue; // ignore columns which are hidden QVariant Value; @@ -413,7 +413,7 @@ bool CSbieModel::Sync(const CSandBoxPtr& pBox, const QList& Path, cons for (int section = 0; section < columnCount(); section++) { - if (!m_Columns.contains(section)) + if (!IsColumnEnabled(section)) continue; // ignore columns which are hidden QVariant Value; diff --git a/SandboxiePlus/SandMan/Views/SbieView.cpp b/SandboxiePlus/SandMan/Views/SbieView.cpp index 2b048103..9be4c797 100644 --- a/SandboxiePlus/SandMan/Views/SbieView.cpp +++ b/SandboxiePlus/SandMan/Views/SbieView.cpp @@ -112,15 +112,12 @@ CSbieView::CSbieView(QWidget* parent) : CPanelView(parent) CreateTrayMenu(); QByteArray Columns = theConf->GetBlob("MainWindow/BoxTree_Columns"); - if (Columns.isEmpty()) - { - m_pSbieTree->OnResetColumns(); + if (Columns.isEmpty()) { m_pSbieTree->setColumnWidth(0, 300); m_pSbieTree->setColumnWidth(1, 70); m_pSbieTree->setColumnWidth(2, 70); m_pSbieTree->setColumnWidth(3, 70); - } - else + } else m_pSbieTree->restoreState(Columns); if (theConf->GetBool("MainWindow/BoxTree_UseOrder", false) || iViewMode == 2) SetCustomOrder(); diff --git a/SandboxiePlus/SandMan/Views/TraceView.cpp b/SandboxiePlus/SandMan/Views/TraceView.cpp index 13abdc32..81d60a7d 100644 --- a/SandboxiePlus/SandMan/Views/TraceView.cpp +++ b/SandboxiePlus/SandMan/Views/TraceView.cpp @@ -126,8 +126,6 @@ CTraceTree::CTraceTree(QWidget* parent) QByteArray Columns = theConf->GetBlob("MainWindow/TraceLog_Columns"); if (!Columns.isEmpty()) ((QTreeViewEx*)GetView())->restoreState(Columns); - else - ((QTreeViewEx*)GetView())->OnResetColumns(); QByteArray Split = theConf->GetBlob("MainWindow/TraceSplitter"); if(!Split.isEmpty()) @@ -219,8 +217,6 @@ CMonitorList::CMonitorList(QWidget* parent) QByteArray Columns = theConf->GetBlob("MainWindow/Monitor_Columns"); if (!Columns.isEmpty()) ((QTreeViewEx*)GetView())->restoreState(Columns); - else - ((QTreeViewEx*)GetView())->OnResetColumns(); } CMonitorList::~CMonitorList()