This commit is contained in:
DavidXanatos 2023-05-25 20:07:13 +02:00
parent 796b86406d
commit 82ca352338
4 changed files with 30 additions and 1 deletions

View File

@ -9,6 +9,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed ### Fixed
- fixed sbie:// links are not working [#2959](https://github.com/sandboxie-plus/Sandboxie/issues/2959) - 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)

View File

@ -45,6 +45,19 @@ public:
m_ColumnReset = iMode; 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 sizeHint() const {return m_AutoFitMax ? MySize() : QTreeWidget::sizeHint(); };
QSize minimumSizeHint() 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(); QTreeWidgetItem* pHeader = headerItem();
for(int i=0; i < columnCount(); i++) 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); pAction->setCheckable(true);
connect(pAction, SIGNAL(triggered()), this, SLOT(OnMenu())); connect(pAction, SIGNAL(triggered()), this, SLOT(OnMenu()));
m_pMenu->addAction(pAction); m_pMenu->addAction(pAction);
@ -149,5 +165,6 @@ protected:
QMenu* m_pMenu; QMenu* m_pMenu;
QMap<QAction*, int> m_Columns; QMap<QAction*, int> m_Columns;
int m_AutoFitMax; int m_AutoFitMax;
QSet<int> m_FixedColumns;
int m_ColumnReset; int m_ColumnReset;
}; };

View File

@ -984,6 +984,7 @@ void CSandMan::CreateView(int iViewMode)
//m_pMessageLog->GetView()->setItemDelegate(theGUI->GetItemDelegate()); //m_pMessageLog->GetView()->setItemDelegate(theGUI->GetItemDelegate());
((QTreeWidgetEx*)m_pMessageLog->GetView())->setHeaderLabels(tr("Time|Message").split("|")); ((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()->insertAction(m_pMessageLog->GetMenu()->actions()[0], m_pCleanUpMsgLog);
m_pMessageLog->GetMenu()->insertSeparator(m_pMessageLog->GetMenu()->actions()[0]); m_pMessageLog->GetMenu()->insertSeparator(m_pMessageLog->GetMenu()->actions()[0]);
@ -1009,6 +1010,8 @@ void CSandMan::CreateView(int iViewMode)
//m_pRecoveryLog->GetView()->setItemDelegate(theGUI->GetItemDelegate()); //m_pRecoveryLog->GetView()->setItemDelegate(theGUI->GetItemDelegate());
((QTreeWidgetEx*)m_pRecoveryLog->GetView())->setHeaderLabels(tr("Time|Box Name|File Path").split("|")); ((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()->insertAction(m_pRecoveryLog->GetMenu()->actions()[0], m_pCleanUpRecovery);
m_pRecoveryLog->GetMenu()->insertSeparator(m_pRecoveryLog->GetMenu()->actions()[0]); m_pRecoveryLog->GetMenu()->insertSeparator(m_pRecoveryLog->GetMenu()->actions()[0]);

View File

@ -81,6 +81,10 @@ CTraceTree::CTraceTree(QWidget* parent)
m_pTreeList->setContextMenuPolicy(Qt::CustomContextMenu); m_pTreeList->setContextMenuPolicy(Qt::CustomContextMenu);
connect(m_pTreeList, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(OnMenu(const QPoint&))); 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); m_pTreeList->setColumnReset(1);
//connect(m_pTreeList, SIGNAL(ResetColumns()), m_pTreeList, SLOT(OnResetColumns())); //connect(m_pTreeList, SIGNAL(ResetColumns()), m_pTreeList, SLOT(OnResetColumns()));
//connect(m_pBoxTree, SIGNAL(ColumnChanged(int, bool)), this, SLOT(OnColumnsChanged())); //connect(m_pBoxTree, SIGNAL(ColumnChanged(int, bool)), this, SLOT(OnColumnsChanged()));
@ -151,6 +155,10 @@ CMonitorList::CMonitorList(QWidget* parent)
m_pTreeList->setContextMenuPolicy(Qt::CustomContextMenu); m_pTreeList->setContextMenuPolicy(Qt::CustomContextMenu);
connect(m_pTreeList, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(OnMenu(const QPoint&))); 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); m_pTreeList->setColumnReset(1);
//connect(m_pTreeList, SIGNAL(ResetColumns()), m_pTreeList, SLOT(OnResetColumns())); //connect(m_pTreeList, SIGNAL(ResetColumns()), m_pTreeList, SLOT(OnResetColumns()));
//connect(m_pBoxTree, SIGNAL(ColumnChanged(int, bool)), this, SLOT(OnColumnsChanged())); //connect(m_pBoxTree, SIGNAL(ColumnChanged(int, bool)), this, SLOT(OnColumnsChanged()));