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-05-16 20:30:40 +01:00
|
|
|
#include <QFileIconProvider>
|
2021-10-15 16:39:43 +01:00
|
|
|
|
|
|
|
class CSbieView : public CPanelView
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
CSbieView(QWidget* parent = 0);
|
|
|
|
virtual ~CSbieView();
|
|
|
|
|
|
|
|
virtual QTreeViewEx* GetTree() { return m_pSbieTree; }
|
|
|
|
|
|
|
|
virtual QList<CSandBoxPtr> GetSelectedBoxes();
|
|
|
|
virtual QList<CBoxedProcessPtr> GetSelectedProcesses();
|
|
|
|
virtual QStringList GetSelectedGroups(bool bAndBoxes = false);
|
|
|
|
|
|
|
|
//virtual void UpdateRunMenu();
|
|
|
|
|
|
|
|
virtual QString AddNewBox();
|
|
|
|
virtual QString AddNewGroup();
|
2022-04-16 14:01:01 +01:00
|
|
|
virtual bool TestNameAndWarn(const QString& Name);
|
2021-10-15 16:39:43 +01:00
|
|
|
virtual void SelectBox(const QString& Name);
|
|
|
|
|
|
|
|
virtual void PopUpMenu(const QString& Name);
|
|
|
|
virtual void ShowOptions(const QString& Name);
|
|
|
|
|
|
|
|
QMap<QString, QStringList> GetGroups() { return m_Groups; }
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void Clear();
|
|
|
|
void Refresh();
|
|
|
|
void ReloadUserConfig();
|
|
|
|
void SaveUserConfig();
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void OnToolTipCallback(const QVariant& ID, QString& ToolTip);
|
|
|
|
|
|
|
|
void OnCustomSortByColumn(int column);
|
|
|
|
|
|
|
|
void OnDoubleClicked(const QModelIndex& index);
|
|
|
|
void ProcessSelection(const QItemSelection& selected, const QItemSelection& deselected);
|
|
|
|
|
|
|
|
void OnGroupAction();
|
2022-04-16 14:01:01 +01:00
|
|
|
void OnGroupAction(QAction* pAction);
|
2021-10-15 16:39:43 +01:00
|
|
|
void OnSandBoxAction();
|
|
|
|
void OnSandBoxAction(QAction* pAction);
|
|
|
|
void OnProcessAction();
|
2022-04-16 14:01:01 +01:00
|
|
|
void OnProcessAction(QAction* pAction);
|
2021-10-15 16:39:43 +01:00
|
|
|
|
|
|
|
void OnExpanded(const QModelIndex& index) { ChangeExpand(index, true); }
|
|
|
|
void OnCollapsed(const QModelIndex& index) { ChangeExpand(index, false); }
|
|
|
|
|
2022-06-04 20:07:04 +01:00
|
|
|
void OnMoveItem(const QString& Name, const QString& To, int row);
|
2022-04-16 14:01:01 +01:00
|
|
|
|
|
|
|
void OnRemoveItem();
|
|
|
|
|
2021-10-15 16:39:43 +01:00
|
|
|
protected:
|
|
|
|
virtual void OnMenu(const QPoint& Point);
|
|
|
|
virtual QTreeView* GetView() { return m_pSbieTree; }
|
|
|
|
virtual QAbstractItemModel* GetModel() { return m_pSortProxy; }
|
|
|
|
|
|
|
|
virtual void UpdateRunMenu(const CSandBoxPtr& pBox);
|
|
|
|
|
|
|
|
QMap<QString, QStringList> m_Groups;
|
|
|
|
QSet<QString> m_Collapsed;
|
2021-12-23 15:28:14 +00:00
|
|
|
//bool m_UserConfigChanged;
|
2021-10-15 16:39:43 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
2022-02-05 14:09:53 +00:00
|
|
|
bool UpdateMenu();
|
2021-10-15 16:39:43 +01:00
|
|
|
void UpdateGroupMenu();
|
|
|
|
void RenameGroup(const QString OldName, const QString NewName);
|
2022-04-16 14:01:01 +01:00
|
|
|
bool RenameItem(const QString OldName, const QString NewName);
|
|
|
|
|
2022-06-04 20:20:27 +01:00
|
|
|
void SetCustomOrder();
|
|
|
|
void MoveItem(const QString& Name, const QString& To, int pos = -1);
|
2021-10-15 16:39:43 +01:00
|
|
|
|
|
|
|
QString FindParent(const QString& Name);
|
|
|
|
bool IsParentOf(const QString& Name, const QString& Group);
|
|
|
|
|
|
|
|
void ChangeExpand(const QModelIndex& index, bool bExpand);
|
|
|
|
|
|
|
|
QVBoxLayout* m_pMainLayout;
|
|
|
|
|
|
|
|
QTreeViewEx* m_pSbieTree;
|
|
|
|
CSbieModel* m_pSbieModel;
|
|
|
|
QSortFilterProxyModel* m_pSortProxy;
|
|
|
|
|
|
|
|
QMenu* m_pMenu2;
|
|
|
|
|
|
|
|
QAction* m_pNewBox;
|
|
|
|
QAction* m_pAddGroupe;
|
|
|
|
QAction* m_pRenGroupe;
|
|
|
|
QAction* m_pDelGroupe;
|
2022-02-05 14:09:53 +00:00
|
|
|
QAction* m_pStopAsync;
|
2021-10-15 16:39:43 +01:00
|
|
|
int m_iMenuTop;
|
|
|
|
QMenu* m_pMenuRun;
|
|
|
|
QAction* m_pMenuRunAny;
|
|
|
|
QAction* m_pMenuRunMenu;
|
|
|
|
QAction* m_pMenuRunBrowser;
|
|
|
|
QAction* m_pMenuRunMailer;
|
|
|
|
QMenu* m_pMenuRunTools;
|
|
|
|
QAction* m_pMenuRunExplorer;
|
|
|
|
QAction* m_pMenuRunRegEdit;
|
|
|
|
QAction* m_pMenuRunAppWiz;
|
|
|
|
QAction* m_pMenuAutoRun;
|
|
|
|
QAction* m_pMenuRunCmd;
|
|
|
|
QAction* m_pMenuRunCmdAdmin;
|
|
|
|
QAction* m_pMenuRunCmd32;
|
|
|
|
QAction* m_pMenuMkLink;
|
|
|
|
QMenu* m_pMenuPresets;
|
|
|
|
QActionGroup* m_pMenuPresetsAdmin;
|
|
|
|
QAction* m_pMenuPresetsShowUAC;
|
|
|
|
QAction* m_pMenuPresetsNoAdmin;
|
|
|
|
QAction* m_pMenuPresetsFakeAdmin;
|
|
|
|
QAction* m_pMenuPresetsINet;
|
|
|
|
QAction* m_pMenuPresetsShares;
|
2022-06-13 19:12:53 +01:00
|
|
|
QAction* m_pMenuPresetsRecovery;
|
2021-10-15 16:39:43 +01:00
|
|
|
QAction* m_pMenuOptions;
|
|
|
|
QAction* m_pMenuSnapshots;
|
|
|
|
QAction* m_pMenuEmptyBox;
|
|
|
|
QMenu* m_pMenuContent;
|
|
|
|
QAction* m_pMenuExplore;
|
|
|
|
QAction* m_pMenuBrowse;
|
2022-06-13 19:12:53 +01:00
|
|
|
QAction* m_pMenuRefresh;
|
2021-10-15 16:39:43 +01:00
|
|
|
QAction* m_pMenuRegEdit;
|
|
|
|
QAction* m_pMenuRecover;
|
|
|
|
QAction* m_pMenuCleanUp;
|
|
|
|
QAction* m_pMenuRemove;
|
2021-11-13 08:28:32 +00:00
|
|
|
QAction* m_pMenuDuplicate;
|
2021-10-15 16:39:43 +01:00
|
|
|
QAction* m_pMenuMoveUp;
|
|
|
|
//QAction* m_pMenuMoveBy;
|
|
|
|
QAction* m_pMenuMoveDown;
|
|
|
|
QMenu* m_pMenuMoveTo;
|
|
|
|
int m_iMoveTo;
|
|
|
|
QAction* m_pMenuRename;
|
|
|
|
int m_iMenuBox;
|
|
|
|
|
|
|
|
QAction* m_pMenuTerminate;
|
|
|
|
QAction* m_pMenuLinkTo;
|
|
|
|
QMenu* m_pMenuPreset;
|
|
|
|
QAction* m_pMenuBlackList;
|
|
|
|
QAction* m_pMenuAllowInternet;
|
|
|
|
QAction* m_pMenuMarkForced;
|
|
|
|
QAction* m_pMenuMarkLinger;
|
|
|
|
QAction* m_pMenuMarkLeader;
|
|
|
|
QAction* m_pMenuPinToRun;
|
|
|
|
//QAction* m_pMenuSuspend;
|
|
|
|
//QAction* m_pMenuResume;
|
|
|
|
int m_iMenuProc;
|
|
|
|
|
2022-04-16 14:01:01 +01:00
|
|
|
QAction* m_pRemove;
|
|
|
|
|
2021-10-15 16:39:43 +01:00
|
|
|
int m_iMenuRun;
|
2022-05-16 20:30:40 +01:00
|
|
|
|
|
|
|
QFileIconProvider m_IconProvider;
|
2020-06-01 17:11:56 +01:00
|
|
|
};
|