Sandboxie/SandboxiePlus/SandMan/Views/TraceView.h

139 lines
2.6 KiB
C
Raw Normal View History

2021-10-15 16:39:43 +01:00
#pragma once
#include "../../MiscHelpers/Common/PanelView.h"
#include "../../MiscHelpers/Common/TreeviewEx.h"
#include "../Models/SbieModel.h"
2022-03-26 09:09:24 +00:00
#include "../Models/TraceModel.h"
#include "../Models/MonitorModel.h"
2023-01-12 22:10:50 +00:00
#include "../../MiscHelpers/Common/SortFilterProxyModel.h"
2021-10-15 16:39:43 +01:00
2022-03-26 09:09:24 +00:00
class CTraceTree : public CPanelWidget<QTreeViewEx>
{
Q_OBJECT
public:
CTraceTree(QWidget* parent = 0);
~CTraceTree();
CTraceModel* m_pTraceModel;
public slots:
2023-01-12 22:10:50 +00:00
void SetFilter(const QString& Exp, int iOptions = 0, int Column = -1);
2022-03-26 09:09:24 +00:00
signals:
2023-01-12 22:10:50 +00:00
void FilterChanged();
protected:
friend class CTraceView;
QString GetFilterExp() const { return m_FilterExp; }
//QRegularExpression m_FilterExp;
QString m_FilterExp;
bool m_bHighLight;
//int m_FilterCol;
2022-03-26 09:09:24 +00:00
};
class CMonitorList : public CPanelWidget<QTreeViewEx>
{
public:
CMonitorList(QWidget* parent = 0);
~CMonitorList();
CSortFilterProxyModel* m_pSortProxy;
CMonitorModel* m_pMonitorModel;
};
class CTraceView : public QWidget
2021-10-15 16:39:43 +01:00
{
Q_OBJECT
public:
2022-07-09 10:46:07 +01:00
CTraceView(bool bStandAlone, QWidget* parent = 0);
2021-10-15 16:39:43 +01:00
~CTraceView();
2022-04-07 19:49:13 +01:00
void AddAction(QAction* pAction);
2021-10-15 16:39:43 +01:00
public slots:
2022-07-09 10:46:07 +01:00
void Refresh();
void Clear();
2021-10-15 16:39:43 +01:00
void OnSetTree();
2023-01-07 15:57:55 +00:00
void OnObjTree();
2022-03-26 09:09:24 +00:00
void OnSetMode();
2021-10-15 16:39:43 +01:00
void OnSetPidFilter();
void OnSetTidFilter();
void OnSetFilter();
private slots:
void UpdateFilters();
2023-01-12 22:10:50 +00:00
void OnFilterChanged();
2021-10-15 16:39:43 +01:00
2021-10-16 17:24:16 +01:00
void SaveToFile();
2022-03-26 09:09:24 +00:00
protected:
2022-07-09 10:46:07 +01:00
void timerEvent(QTimerEvent* pEvent);
int m_uTimerID;
2022-03-26 09:09:24 +00:00
struct SProgInfo
{
QString Name;
QSet<quint32> Threads;
};
QMap<quint32, SProgInfo>m_PidMap;
quint64 m_LastID;
int m_LastCount;
bool m_bUpdatePending;
2023-01-07 15:57:55 +00:00
QVector<CTraceEntryPtr> m_TraceList;
2022-03-26 09:09:24 +00:00
QMap<QString, CMonitorEntryPtr> m_MonitorMap;
2021-10-15 16:39:43 +01:00
protected:
bool m_FullRefresh;
quint32 m_FilterPid;
quint32 m_FilterTid;
2021-10-30 08:46:49 +01:00
QList<quint32> m_FilterTypes;
2021-10-15 16:39:43 +01:00
quint32 m_FilterStatus;
void* m_pCurrentBox;
2022-03-26 09:09:24 +00:00
QVBoxLayout* m_pMainLayout;
CTraceTree* m_pTrace;
CMonitorList* m_pMonitor;
2021-10-15 16:39:43 +01:00
QToolBar* m_pTraceToolBar;
2022-03-26 09:09:24 +00:00
QAction* m_pMonitorMode;
2021-10-15 16:39:43 +01:00
QAction* m_pTraceTree;
2023-01-07 15:57:55 +00:00
QAction* m_pObjectTree;
2021-10-15 16:39:43 +01:00
QComboBox* m_pTracePid;
QComboBox* m_pTraceTid;
2021-10-30 08:46:49 +01:00
class QCheckList* m_pTraceType;
2021-10-15 16:39:43 +01:00
QComboBox* m_pTraceStatus;
2021-10-16 17:24:16 +01:00
QAction* m_pAllBoxes;
QAction* m_pSaveToFile;
2021-10-15 16:39:43 +01:00
2022-03-26 09:09:24 +00:00
QWidget* m_pView;
QStackedLayout* m_pLayout;
2022-07-09 10:46:07 +01:00
};
2022-07-11 20:12:42 +01:00
////////////////////////////////////////////////////////////////////////////////////////
// CTraceWindow
2022-07-09 10:46:07 +01:00
class CTraceWindow : public QDialog
{
Q_OBJECT
public:
CTraceWindow(QWidget *parent = Q_NULLPTR);
~CTraceWindow();
signals:
void Closed();
protected:
void closeEvent(QCloseEvent *e);
};