From 82ca352338468c99a8ecbf5f6cddca105972ed6b Mon Sep 17 00:00:00 2001 From: DavidXanatos <3890945+DavidXanatos@users.noreply.github.com> Date: Thu, 25 May 2023 20:07:13 +0200 Subject: [PATCH] 1.9.5 --- CHANGELOG.md | 1 + .../MiscHelpers/Common/TreeWidgetEx.h | 19 ++++++++++++++++++- SandboxiePlus/SandMan/SandMan.cpp | 3 +++ SandboxiePlus/SandMan/Views/TraceView.cpp | 8 ++++++++ 4 files changed, 30 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index efe14cfa..ae4a7b3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Fixed - fixed sbie:// links are not working [#2959](https://github.com/sandboxie-plus/Sandboxie/issues/2959) +- fixed Sbie Messages, Trace Log, Recovery Log tabs should never hide some columns [#2940](https://github.com/sandboxie-plus/Sandboxie/issues/2940) diff --git a/SandboxiePlus/MiscHelpers/Common/TreeWidgetEx.h b/SandboxiePlus/MiscHelpers/Common/TreeWidgetEx.h index b0292b8b..f08c8173 100644 --- a/SandboxiePlus/MiscHelpers/Common/TreeWidgetEx.h +++ b/SandboxiePlus/MiscHelpers/Common/TreeWidgetEx.h @@ -45,6 +45,19 @@ public: m_ColumnReset = iMode; } + void setColumnFixed(int column, bool fixed) + { + if (fixed) + m_FixedColumns.insert(column); + else + m_FixedColumns.remove(column); + } + + bool isColumnFixed(int column) const + { + return m_FixedColumns.contains(column); + } + QSize sizeHint() const {return m_AutoFitMax ? MySize() : QTreeWidget::sizeHint(); }; QSize minimumSizeHint() const { return m_AutoFitMax ? MySize() : QTreeWidget::sizeHint(); }; @@ -68,7 +81,10 @@ private slots: QTreeWidgetItem* pHeader = headerItem(); for(int i=0; i < columnCount(); i++) { - QAction* pAction = new QAction(pHeader->text(i), m_pMenu); + QString Label = pHeader->text(i); + if(Label.isEmpty() || m_FixedColumns.contains(i)) + continue; + QAction* pAction = new QAction(Label, m_pMenu); pAction->setCheckable(true); connect(pAction, SIGNAL(triggered()), this, SLOT(OnMenu())); m_pMenu->addAction(pAction); @@ -149,5 +165,6 @@ protected: QMenu* m_pMenu; QMap m_Columns; int m_AutoFitMax; + QSet m_FixedColumns; int m_ColumnReset; }; diff --git a/SandboxiePlus/SandMan/SandMan.cpp b/SandboxiePlus/SandMan/SandMan.cpp index f11dcf19..8fe2e4a6 100644 --- a/SandboxiePlus/SandMan/SandMan.cpp +++ b/SandboxiePlus/SandMan/SandMan.cpp @@ -984,6 +984,7 @@ void CSandMan::CreateView(int iViewMode) //m_pMessageLog->GetView()->setItemDelegate(theGUI->GetItemDelegate()); ((QTreeWidgetEx*)m_pMessageLog->GetView())->setHeaderLabels(tr("Time|Message").split("|")); + ((QTreeWidgetEx*)m_pMessageLog->GetView())->setColumnFixed(1, true); m_pMessageLog->GetMenu()->insertAction(m_pMessageLog->GetMenu()->actions()[0], m_pCleanUpMsgLog); m_pMessageLog->GetMenu()->insertSeparator(m_pMessageLog->GetMenu()->actions()[0]); @@ -1009,6 +1010,8 @@ void CSandMan::CreateView(int iViewMode) //m_pRecoveryLog->GetView()->setItemDelegate(theGUI->GetItemDelegate()); ((QTreeWidgetEx*)m_pRecoveryLog->GetView())->setHeaderLabels(tr("Time|Box Name|File Path").split("|")); + ((QTreeWidgetEx*)m_pRecoveryLog->GetView())->setColumnFixed(1, true); + ((QTreeWidgetEx*)m_pRecoveryLog->GetView())->setColumnFixed(2, true); m_pRecoveryLog->GetMenu()->insertAction(m_pRecoveryLog->GetMenu()->actions()[0], m_pCleanUpRecovery); m_pRecoveryLog->GetMenu()->insertSeparator(m_pRecoveryLog->GetMenu()->actions()[0]); diff --git a/SandboxiePlus/SandMan/Views/TraceView.cpp b/SandboxiePlus/SandMan/Views/TraceView.cpp index b4f36c98..66d05c8e 100644 --- a/SandboxiePlus/SandMan/Views/TraceView.cpp +++ b/SandboxiePlus/SandMan/Views/TraceView.cpp @@ -81,6 +81,10 @@ CTraceTree::CTraceTree(QWidget* parent) m_pTreeList->setContextMenuPolicy(Qt::CustomContextMenu); connect(m_pTreeList, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(OnMenu(const QPoint&))); + m_pTreeList->setColumnFixed(0, true); + m_pTreeList->setColumnFixed(1, true); + m_pTreeList->setColumnFixed(2, true); + m_pTreeList->setColumnFixed(3, true); m_pTreeList->setColumnReset(1); //connect(m_pTreeList, SIGNAL(ResetColumns()), m_pTreeList, SLOT(OnResetColumns())); //connect(m_pBoxTree, SIGNAL(ColumnChanged(int, bool)), this, SLOT(OnColumnsChanged())); @@ -151,6 +155,10 @@ CMonitorList::CMonitorList(QWidget* parent) m_pTreeList->setContextMenuPolicy(Qt::CustomContextMenu); connect(m_pTreeList, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(OnMenu(const QPoint&))); + m_pTreeList->setColumnFixed(0, true); + m_pTreeList->setColumnFixed(1, true); + m_pTreeList->setColumnFixed(2, true); + m_pTreeList->setColumnFixed(3, true); m_pTreeList->setColumnReset(1); //connect(m_pTreeList, SIGNAL(ResetColumns()), m_pTreeList, SLOT(OnResetColumns())); //connect(m_pBoxTree, SIGNAL(ColumnChanged(int, bool)), this, SLOT(OnColumnsChanged()));