diff --git a/SandboxiePlus/MiscHelpers/Common/ItemChooser.cpp b/SandboxiePlus/MiscHelpers/Common/ItemChooser.cpp index 4f0072e9..cecf3bdc 100644 --- a/SandboxiePlus/MiscHelpers/Common/ItemChooser.cpp +++ b/SandboxiePlus/MiscHelpers/Common/ItemChooser.cpp @@ -27,11 +27,11 @@ CItemChooser::CItemChooser(const QString& Prompt, QWidget *parent) m_pMidleLayout->addItem(new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding)); m_pBtnAdd = new QPushButton(tr("Add >"), this); - connect(m_pBtnAdd, SIGNAL(pressed()), this, SLOT(OnAdd())); + connect(m_pBtnAdd, SIGNAL(clicked(bool)), this, SLOT(OnAdd())); m_pMidleLayout->addWidget(m_pBtnAdd); m_pBtnRemove = new QPushButton(tr("< Remove"), this); - connect(m_pBtnRemove, SIGNAL(pressed()), this, SLOT(OnRemove())); + connect(m_pBtnRemove, SIGNAL(clicked(bool)), this, SLOT(OnRemove())); m_pMidleLayout->addWidget(m_pBtnRemove); m_pMidleLayout->addItem(new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding)); @@ -45,11 +45,11 @@ CItemChooser::CItemChooser(const QString& Prompt, QWidget *parent) m_pCenterLayout->addLayout(m_pRightLayout); m_pBtnUp = new QPushButton(tr("Move Up"), this); - connect(m_pBtnUp, SIGNAL(pressed()), this, SLOT(OnUp())); + connect(m_pBtnUp, SIGNAL(clicked(bool)), this, SLOT(OnUp())); m_pRightLayout->addWidget(m_pBtnUp); m_pBtnDown = new QPushButton(tr("Move Down"), this); - connect(m_pBtnDown, SIGNAL(pressed()), this, SLOT(OnDown())); + connect(m_pBtnDown, SIGNAL(clicked(bool)), this, SLOT(OnDown())); m_pRightLayout->addWidget(m_pBtnDown); m_pRightLayout->addItem(new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding)); diff --git a/SandboxiePlus/MiscHelpers/Common/SettingsWidgets.cpp b/SandboxiePlus/MiscHelpers/Common/SettingsWidgets.cpp index 79a5a43d..d1e21e79 100644 --- a/SandboxiePlus/MiscHelpers/Common/SettingsWidgets.cpp +++ b/SandboxiePlus/MiscHelpers/Common/SettingsWidgets.cpp @@ -17,7 +17,7 @@ CPathEdit::CPathEdit(bool bDirs, QWidget *parent) pLayout->addWidget(m_pEdit); QPushButton* pButton = new QPushButton("..."); pButton->setMaximumWidth(25); - connect(pButton, SIGNAL(pressed()), this, SLOT(Browse())); + connect(pButton, SIGNAL(clicked(bool)), this, SLOT(Browse())); pLayout->addWidget(pButton); } diff --git a/SandboxiePlus/MiscHelpers/MiscHelpers.pri b/SandboxiePlus/MiscHelpers/MiscHelpers.pri new file mode 100644 index 00000000..dd0205da --- /dev/null +++ b/SandboxiePlus/MiscHelpers/MiscHelpers.pri @@ -0,0 +1,58 @@ +# ---------------------------------------------------- +# This file is generated by the Qt Visual Studio Tools. +# ------------------------------------------------------ + +HEADERS += ./MiscHelpers.h \ + ./mischelpers_global.h \ + ./stdafx.h \ + ./Common/Common.h \ + ./Common/DebugHelpers.h \ + ./Common/ExitDialog.h \ + ./Common/FlexError.h \ + ./Common/FlowLayout.h \ + ./Common/HistoryGraph.h \ + ./Common/IconExtreactor.h \ + ./Common/qRC4.h \ + ./Common/Xml.h \ + ./Common/CheckableMessageBox.h \ + ./Common/ComboInputDialog.h \ + ./Common/Finder.h \ + ./Common/ItemChooser.h \ + ./Common/KeyValueInputDialog.h \ + ./Common/ListItemModel.h \ + ./Common/MultiLineInputDialog.h \ + ./Common/PanelView.h \ + ./Common/ProgressDialog.h \ + ./Common/Settings.h \ + ./Common/SettingsWidgets.h \ + ./Common/SmartGridWidget.h \ + ./Common/SortFilterProxyModel.h \ + ./Common/SplitTreeView.h \ + ./Common/TabPanel.h \ + ./Common/TreeItemModel.h \ + ./Common/TreeViewEx.h \ + ./Common/TreeWidgetEx.h \ + ./Common/NetworkAccessManager.h +SOURCES += ./MiscHelpers.cpp \ + ./stdafx.cpp \ + ./Common/CheckableMessageBox.cpp \ + ./Common/ComboInputDialog.cpp \ + ./Common/Common.cpp \ + ./Common/DebugHelpers.cpp \ + ./Common/Finder.cpp \ + ./Common/FlowLayout.cpp \ + ./Common/IconExtreactor.cpp \ + ./Common/ItemChooser.cpp \ + ./Common/KeyValueInputDialog.cpp \ + ./Common/ListItemModel.cpp \ + ./Common/MultiLineInputDialog.cpp \ + ./Common/PanelView.cpp \ + ./Common/qRC4.cpp \ + ./Common/NetworkAccessManager.cpp \ + ./Common/Settings.cpp \ + ./Common/SettingsWidgets.cpp \ + ./Common/SmartGridWidget.cpp \ + ./Common/SplitTreeView.cpp \ + ./Common/TabPanel.cpp \ + ./Common/TreeItemModel.cpp \ + ./Common/Xml.cpp diff --git a/SandboxiePlus/MiscHelpers/MiscHelpers.qc.pro b/SandboxiePlus/MiscHelpers/MiscHelpers.qc.pro new file mode 100644 index 00000000..5df9b0b9 --- /dev/null +++ b/SandboxiePlus/MiscHelpers/MiscHelpers.qc.pro @@ -0,0 +1,36 @@ + +TEMPLATE = lib +TARGET = MiscHelpers +QT += core network widgets winextras +#CONFIG += debug +# DEFINES += QT_LARGEFILE_SUPPORT QTSERVICE_LIB QT_WIDGETS_LIB QT_QTSINGLEAPPLICATION_EXPORT +DEFINES += MISCHELPERS_LIB +#LIBS += -L"." +PRECOMPILED_HEADER = stdafx.h +#DEPENDPATH += . +#MOC_DIR += ./GeneratedFiles/$(ConfigurationName) +#OBJECTS_DIR += debug +#UI_DIR += ./GeneratedFiles +#RCC_DIR += ./GeneratedFiles +!win32:LIBS += -lUser32 -lShell32 + +!mac:unix:QMAKE_LFLAGS += -Wl,-rpath,'\$\$ORIGIN' +mac:QMAKE_CXXFLAGS += -std=c++11 + +!win32:QMAKE_LFLAGS +=-rdynamic + +CONFIG(release, debug|release):{ +QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO +QMAKE_LFLAGS_RELEASE = $$QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO +} +CONFIG(debug, debug|release):DESTDIR = ../Debug +CONFIG(release, debug|release):DESTDIR = ../Release +INCLUDEPATH += . +DEPENDPATH += . +#MOC_DIR += ./GeneratedFiles +#OBJECTS_DIR += ./ObjectFiles +#UI_DIR += ./GeneratedFiles +#RCC_DIR += ./GeneratedFiles + + +include(MiscHelpers.pri) diff --git a/SandboxiePlus/QSbieAPI/QSbieAPI.pri b/SandboxiePlus/QSbieAPI/QSbieAPI.pri new file mode 100644 index 00000000..69058e52 --- /dev/null +++ b/SandboxiePlus/QSbieAPI/QSbieAPI.pri @@ -0,0 +1,31 @@ +# ---------------------------------------------------- +# This file is generated by the Qt Visual Studio Tools. +# ------------------------------------------------------ + +# This is a reminder that you are using a generated .pro file. +# Remove it when you are finished editing this file. +message("You are running qmake on a generated .pro file. This may not work!") + + +HEADERS += ./qsbieapi_global.h \ + ./stdafx.h \ + ../../Sandboxie/common/win32_ntddk.h \ + ./SbieDefs.h \ + ./SbieUtils.h \ + ./SbieAPI.h \ + ./SbieStatus.h \ + ./Sandboxie/BoxedProcess.h \ + ./Sandboxie/SandBox.h \ + ./Sandboxie/SbieIni.h \ + ./Sandboxie/BoxBorder.h \ + ./Sandboxie/SbieTemplates.h \ + ./Helpers/NtIO.h +SOURCES += ./stdafx.cpp \ + ./SbieAPI.cpp \ + ./SbieUtils.cpp \ + ./Sandboxie/BoxBorder.cpp \ + ./Sandboxie/BoxedProcess.cpp \ + ./Sandboxie/SandBox.cpp \ + ./Sandboxie/SbieIni.cpp \ + ./Sandboxie/SbieTemplates.cpp \ + ./Helpers/NtIO.cpp diff --git a/SandboxiePlus/QSbieAPI/QSbieAPI.qc.pro b/SandboxiePlus/QSbieAPI/QSbieAPI.qc.pro new file mode 100644 index 00000000..6ec8b84d --- /dev/null +++ b/SandboxiePlus/QSbieAPI/QSbieAPI.qc.pro @@ -0,0 +1,31 @@ + +TEMPLATE = lib +TARGET = QSbieAPI +QT += core concurrent +#CONFIG += debug +# DEFINES += QT_LARGEFILE_SUPPORT QTSERVICE_LIB QT_WIDGETS_LIB QT_QTSINGLEAPPLICATION_EXPORT +DEFINES += QSBIEAPI_LIB +#LIBS += -L"." +PRECOMPILED_HEADER = stdafx.h +#DEPENDPATH += . +#MOC_DIR += ./GeneratedFiles/$(ConfigurationName) +#OBJECTS_DIR += debug +#UI_DIR += ./GeneratedFiles +#RCC_DIR += ./GeneratedFiles +LIBS += -lNtdll -lAdvapi32 -lOle32 -lUser32 -lShell32 -lGdi32 + +CONFIG(release, debug|release):{ +QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO +QMAKE_LFLAGS_RELEASE = $$QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO +} +CONFIG(debug, debug|release):DESTDIR = ../Debug +CONFIG(release, debug|release):DESTDIR = ../Release +INCLUDEPATH += . +DEPENDPATH += . +#MOC_DIR += ./GeneratedFiles +#OBJECTS_DIR += ./ObjectFiles +#UI_DIR += ./GeneratedFiles +#RCC_DIR += ./GeneratedFiles + + +include(QSbieAPI.pri) diff --git a/SandboxiePlus/QSbieAPI/Sandboxie/SandBox.cpp b/SandboxiePlus/QSbieAPI/Sandboxie/SandBox.cpp index 597ce4ae..681891a7 100644 --- a/SandboxiePlus/QSbieAPI/Sandboxie/SandBox.cpp +++ b/SandboxiePlus/QSbieAPI/Sandboxie/SandBox.cpp @@ -43,30 +43,48 @@ CSandBox::CSandBox(const QString& BoxName, class CSbieAPI* pAPI) : CSbieIni(BoxN // when loading a sandbox that is not initialized, initialize it int cfglvl = GetNum("ConfigLevel"); - if (cfglvl >= 7) + if (cfglvl >= 8) return; - SetNum("ConfigLevel", 7); + SetNum("ConfigLevel", 8); - SetBool("AutoRecover", false); - SetBool("BlockNetworkFiles", true); + if (cfglvl == 0) + { + SetBool("AutoRecover", false); + SetBool("BlockNetworkFiles", true); - // templates L6 - InsertText("Template", "AutoRecoverIgnore"); - InsertText("Template", "Firefox_Phishing_DirectAccess"); - InsertText("Template", "Chrome_Phishing_DirectAccess"); - InsertText("Template", "LingerPrograms"); - // templates L7 - InsertText("Template", "BlockPorts"); - InsertText("Template", "qWave"); + // recovery + InsertText("RecoverFolder", "%Desktop%"); + //InsertText("RecoverFolder", "%Favorites%"); // obsolete + InsertText("RecoverFolder", "%Personal%"); + InsertText("RecoverFolder", "%{374DE290-123F-4565-9164-39C4925E467B}%"); // %USERPROFILE%\Downloads - // recovery - InsertText("RecoverFolder", "%Desktop%"); - //InsertText("RecoverFolder", "%Favorites%"); // obsolete - InsertText("RecoverFolder", "%Personal%"); - InsertText("RecoverFolder", "%{374DE290-123F-4565-9164-39C4925E467B}%"); // %USERPROFILE%\Downloads + SetText("BorderColor", "#00FFFF,ttl"); // "#00FFFF,off" + } + + if (cfglvl < 6) + { + // templates L6 + InsertText("Template", "AutoRecoverIgnore"); + InsertText("Template", "Firefox_Phishing_DirectAccess"); + InsertText("Template", "Chrome_Phishing_DirectAccess"); + InsertText("Template", "LingerPrograms"); + } + + if (cfglvl < 7) + { + // templates L7 + InsertText("Template", "BlockPorts"); + //InsertText("Template", "WindowsFontCache"); // since 5.46.3 open by driver + InsertText("Template", "qWave"); + } + + if (cfglvl < 8) + { + // templates L8 + InsertText("Template", "FileCppy"); + InsertText("Template", "SkipHook"); + } - SetText("BorderColor", "#00FFFF,ttl"); // "#00FFFF,off" - } CSandBox::~CSandBox() diff --git a/SandboxiePlus/QSbieAPI/SbieAPI.cpp b/SandboxiePlus/QSbieAPI/SbieAPI.cpp index b2f994fe..30424e4d 100644 --- a/SandboxiePlus/QSbieAPI/SbieAPI.cpp +++ b/SandboxiePlus/QSbieAPI/SbieAPI.cpp @@ -177,7 +177,7 @@ CBoxedProcess* CSbieAPI::NewBoxedProcess(quint32 ProcessId, class CSandBox* pBox return new CBoxedProcess(ProcessId, pBox); } -QString CSbieAPI__GetRegValue(HANDLE hKey, WCHAR* pName) +QString CSbieAPI__GetRegValue(HANDLE hKey, const WCHAR* pName) { char buf[sizeof(KEY_VALUE_PARTIAL_INFORMATION) + MAX_PATH]; KEY_VALUE_PARTIAL_INFORMATION *value = (KEY_VALUE_PARTIAL_INFORMATION *)buf; @@ -918,7 +918,7 @@ QString CSbieAPI::GetStartPath() const return m_SbiePath + "//" + QString::fromWCharArray(SBIESTART_EXE); } -SB_STATUS CSbieAPI::ReloadBoxes() +SB_STATUS CSbieAPI::ReloadBoxes(bool bFullUpdate) { QMap OldSandBoxes = m_SandBoxes; @@ -927,6 +927,7 @@ SB_STATUS CSbieAPI::ReloadBoxes() QString BoxName = SbieIniGet(QString(), QString(), (i | CONF_GET_NO_EXPAND)); if (BoxName.isNull()) break; + bool bIsEnabled; if (!IsBox(BoxName, bIsEnabled)) continue; @@ -936,9 +937,11 @@ SB_STATUS CSbieAPI::ReloadBoxes() { pBox = CSandBoxPtr(NewSandBox(BoxName, this)); m_SandBoxes.insert(BoxName.toLower(), pBox); + UpdateBoxPaths(pBox); } - - UpdateBoxPaths(pBox); + else if(bFullUpdate) + UpdateBoxPaths(pBox); + pBox->m_IsEnabled = bIsEnabled; pBox->UpdateDetails(); @@ -1599,7 +1602,7 @@ SB_STATUS CSbieAPI::ReloadConfig(quint32 SessionId) //emit LogMessage("Sandboxie config has been reloaded.", false); emit LogSbieMessage(0, QStringList() << "Sandboxie config has been reloaded" << "" << "", 4); - ReloadBoxes(); + ReloadBoxes(true); return SB_OK; } diff --git a/SandboxiePlus/QSbieAPI/SbieAPI.h b/SandboxiePlus/QSbieAPI/SbieAPI.h index acbf70b9..faba557e 100644 --- a/SandboxiePlus/QSbieAPI/SbieAPI.h +++ b/SandboxiePlus/QSbieAPI/SbieAPI.h @@ -101,7 +101,7 @@ public: virtual void UpdateDriveLetters(); virtual QString Nt2DosPath(QString NtPath) const; - virtual SB_STATUS ReloadBoxes(); + virtual SB_STATUS ReloadBoxes(bool bFullUpdate = false); static SB_STATUS ValidateName(const QString& BoxName); virtual SB_STATUS CreateBox(const QString& BoxName); diff --git a/SandboxiePlus/QtSingleApp/qtsingleapp/qtsingleapp/qtsingleapp.qc.pro b/SandboxiePlus/QtSingleApp/qtsingleapp/qtsingleapp/qtsingleapp.qc.pro index d69432e0..276c5ef9 100644 --- a/SandboxiePlus/QtSingleApp/qtsingleapp/qtsingleapp/qtsingleapp.qc.pro +++ b/SandboxiePlus/QtSingleApp/qtsingleapp/qtsingleapp/qtsingleapp.qc.pro @@ -2,9 +2,9 @@ # This file is generated by the Qt Visual Studio Add-in. # ------------------------------------------------------ -QT += core widgets network TEMPLATE = lib TARGET = qtsingleapp +QT += core network widgets DEFINES += QT_LARGEFILE_SUPPORT QTSERVICE_LIB QT_WIDGETS_LIB QT_QTSINGLEAPPLICATION_EXPORT !mac:unix:QMAKE_LFLAGS += -Wl,-rpath,'\$\$ORIGIN' mac:QMAKE_CXXFLAGS += -std=c++11 diff --git a/SandboxiePlus/SandMan/Forms/OptionsWindow.ui b/SandboxiePlus/SandMan/Forms/OptionsWindow.ui index 508e3572..a701c6de 100644 --- a/SandboxiePlus/SandMan/Forms/OptionsWindow.ui +++ b/SandboxiePlus/SandMan/Forms/OptionsWindow.ui @@ -45,7 +45,7 @@ QTabWidget::West - 0 + 8 @@ -1323,26 +1323,18 @@ For files access you can use 'Direct All' instead to make it apply to all progra - - - - Do not start sandboxed services using a system token (recommended) + + + + Qt::Vertical - - - - - - Allow access to Smart Cards + + + 20 + 40 + - - - - - - Protect sandboxed SYSTEM processes from unprivileged unsandboxed processes - - + @@ -1360,6 +1352,22 @@ For files access you can use 'Direct All' instead to make it apply to all progra + + + + + 75 + true + + + + Protect the sandbox integrity itself + + + Sandbox isolation + + + @@ -1367,10 +1375,10 @@ For files access you can use 'Direct All' instead to make it apply to all progra - - + + - Open Windows Credentials Store + Do not start sandboxed services using a system token (recommended) @@ -1381,7 +1389,7 @@ For files access you can use 'Direct All' instead to make it apply to all progra - + Qt::Horizontal @@ -1394,6 +1402,34 @@ For files access you can use 'Direct All' instead to make it apply to all progra + + + + Allow access to Smart Cards + + + + + + + Add sandboxed processes to job objects (recommended) + + + + + + + Force usage of custom dummy Manifest files (legacy behaviour) + + + + + + + Protect sandboxed SYSTEM processes from unprivileged unsandboxed processes + + + @@ -1407,46 +1443,17 @@ For files access you can use 'Direct All' instead to make it apply to all progra - - + + - Force usage of custom dummy Manifest files (legacy behaviour) + Open Windows Credentials Store - - - - Qt::Vertical - - - - 20 - 40 - - - - - - + + - Add sandboxed processes to job objects (recommended) - - - - - - - - 75 - true - - - - Protect the sandbox integrity itself - - - Sandbox isolation + Allow access to Bluetooth @@ -1770,8 +1777,8 @@ instead of "*". 0 0 - 530 - 312 + 98 + 28 diff --git a/SandboxiePlus/SandMan/Models/SbieModel.cpp b/SandboxiePlus/SandMan/Models/SbieModel.cpp index 32f1a70d..53b7d2a5 100644 --- a/SandboxiePlus/SandMan/Models/SbieModel.cpp +++ b/SandboxiePlus/SandMan/Models/SbieModel.cpp @@ -137,6 +137,9 @@ QList CSbieModel::Sync(const QMap& BoxList, cons foreach (const CSandBoxPtr& pBox, BoxList) { + if (!ShowHidden && !pBox->IsEnabled()) + continue; + QVariant ID = pBox->GetName(); QModelIndex Index; @@ -161,9 +164,6 @@ QList CSbieModel::Sync(const QMap& BoxList, cons CSandBoxPlus* pBoxEx = qobject_cast(pBox.data()); - if (!ShowHidden && !pBoxEx->IsEnabled()) - continue; - int Col = 0; bool State = false; int Changed = 0; diff --git a/SandboxiePlus/SandMan/Resources/SandMan.ico b/SandboxiePlus/SandMan/Resources/SandMan.ico index c05a26c5..36bddfa0 100644 Binary files a/SandboxiePlus/SandMan/Resources/SandMan.ico and b/SandboxiePlus/SandMan/Resources/SandMan.ico differ diff --git a/SandboxiePlus/SandMan/Resources/finder-empty.bmp b/SandboxiePlus/SandMan/Resources/finder-empty.bmp new file mode 100644 index 00000000..d288e2d7 Binary files /dev/null and b/SandboxiePlus/SandMan/Resources/finder-empty.bmp differ diff --git a/SandboxiePlus/SandMan/Resources/finder-full.bmp b/SandboxiePlus/SandMan/Resources/finder-full.bmp new file mode 100644 index 00000000..e3e1b706 Binary files /dev/null and b/SandboxiePlus/SandMan/Resources/finder-full.bmp differ diff --git a/SandboxiePlus/SandMan/Resources/finder.cur b/SandboxiePlus/SandMan/Resources/finder.cur new file mode 100644 index 00000000..ae6c1cdb Binary files /dev/null and b/SandboxiePlus/SandMan/Resources/finder.cur differ diff --git a/SandboxiePlus/SandMan/SandMan.cpp b/SandboxiePlus/SandMan/SandMan.cpp index d51a250e..9a57332a 100644 --- a/SandboxiePlus/SandMan/SandMan.cpp +++ b/SandboxiePlus/SandMan/SandMan.cpp @@ -452,7 +452,7 @@ void CSandMan::CreateToolBar() m_pCleanUpButton->setPopupMode(QToolButton::MenuButtonPopup); m_pCleanUpButton->setMenu(m_pCleanUpMenu); //QObject::connect(m_pCleanUpButton, SIGNAL(triggered(QAction*)), , SLOT()); - QObject::connect(m_pCleanUpButton, SIGNAL(pressed()), this, SLOT(OnCleanUp())); + QObject::connect(m_pCleanUpButton, SIGNAL(clicked(bool)), this, SLOT(OnCleanUp())); m_pToolBar->addWidget(m_pCleanUpButton); @@ -616,8 +616,8 @@ void CSandMan::timerEvent(QTimerEvent* pEvent) { SB_STATUS Status = theAPI->ReloadBoxes(); - if (!Status.IsError() && theAPI->GetAllBoxes().count() == 0) { - OnLogMessage(tr("No sandboxes found; creating: %1").arg("DefaultBox")); + if (!Status.IsError() && !theAPI->GetAllBoxes().contains("defaultbox")) { + OnLogMessage(tr("Default sandbox not found; creating: %1").arg("DefaultBox")); theAPI->CreateBox("DefaultBox"); } diff --git a/SandboxiePlus/SandMan/SandMan.h b/SandboxiePlus/SandMan/SandMan.h index c8a3b1ba..77a266d2 100644 --- a/SandboxiePlus/SandMan/SandMan.h +++ b/SandboxiePlus/SandMan/SandMan.h @@ -14,7 +14,7 @@ #define VERSION_MJR 0 #define VERSION_MIN 6 -#define VERSION_REV 0 +#define VERSION_REV 5 #define VERSION_UPD 0 diff --git a/SandboxiePlus/SandMan/SandMan.pri b/SandboxiePlus/SandMan/SandMan.pri new file mode 100644 index 00000000..99bac872 --- /dev/null +++ b/SandboxiePlus/SandMan/SandMan.pri @@ -0,0 +1,58 @@ +# ---------------------------------------------------- +# This file is generated by the Qt Visual Studio Tools. +# ------------------------------------------------------ + + +HEADERS += ./stdafx.h \ + ./SandMan.h \ + ./ApiLog.h \ + ./SbiePlusAPI.h \ + ./Models/SbieModel.h \ + ./Models/ResMonModel.h \ + ./Models/ApiMonModel.h \ + ./Views/SbieView.h \ + ./Dialogs/MultiErrorDialog.h \ + ./Helpers/FindTool.h \ + ./Helpers/WinAdmin.h \ + ./Windows/NewBoxWindow.h \ + ./Windows/RecoveryWindow.h \ + ./Windows/PopUpWindow.h \ + ./Windows/SnapshotsWindow.h \ + ./Windows/SettingsWindow.h \ + ./Windows/OptionsWindow.h + +SOURCES += ./main.cpp \ + ./stdafx.cpp \ + ./ApiLog.cpp \ + ./SandMan.cpp \ + ./SbiePlusAPI.cpp \ + ./Models/ApiMonModel.cpp \ + ./Models/ResMonModel.cpp \ + ./Models/SbieModel.cpp \ + ./Views/SbieView.cpp \ + ./Dialogs/MultiErrorDialog.cpp \ + ./Helpers/FindTool.cpp \ + ./Helpers/WinAdmin.cpp \ + ./Helpers/WindowFromPointEx.cpp \ + ./Windows/NewBoxWindow.cpp \ + ./Windows/OptionsWindow.cpp \ + ./Windows/PopUpWindow.cpp \ + ./Windows/RecoveryWindow.cpp \ + ./Windows/SettingsWindow.cpp \ + ./Windows/SnapshotsWindow.cpp + +FORMS += ./Forms/NewBoxWindow.ui \ + ./Forms/OptionsWindow.ui \ + ./Forms/PopUpWindow.ui \ + ./Forms/RecoveryWindow.ui \ + ./Forms/SettingsWindow.ui \ + ./Forms/SnapshotsWindow.ui + +TRANSLATIONS += ./sandman_de.ts \ + ./sandman_pt.ts \ + ./sandman_ru.ts \ + ./sandman_tr.ts \ + ./sandman_zh.ts \ + ./sandman_zh-TW.ts + +RESOURCES += Resources/SandMan.qrc diff --git a/SandboxiePlus/SandMan/SandMan.qc.pro b/SandboxiePlus/SandMan/SandMan.qc.pro new file mode 100644 index 00000000..4698a573 --- /dev/null +++ b/SandboxiePlus/SandMan/SandMan.qc.pro @@ -0,0 +1,39 @@ + +TEMPLATE = app +TARGET = SandMan +PRECOMPILED_HEADER = stdafx.h + +QT += core gui network widgets winextras concurrent + +win32:{ +CONFIG(debug, debug|release):LIBS += -L../Debug/ +CONFIG(release, debug|release):LIBS += -L../Release/ +} + +LIBS += -lNtdll -lAdvapi32 -lOle32 -lUser32 -lShell32 -lGdi32 -lQSbieAPI -lMiscHelpers -lqtsingleapp + + +CONFIG(release, debug|release):{ +QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO +QMAKE_LFLAGS_RELEASE = $$QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO +} +CONFIG(debug, debug|release):DESTDIR = ../Debug +CONFIG(release, debug|release):DESTDIR = ../Release +INCLUDEPATH += . +DEPENDPATH += . +MOC_DIR += . +OBJECTS_DIR += debug +UI_DIR += . +RCC_DIR += . + + + +include(SandMan.pri) +win32:RC_FILE = SandMan.rc + +TRANSLATIONS += sandman_de.ts \ + sandman_pt.ts \ + sandman_ru.ts \ + sandman_tr.ts \ + sandman_zh.ts \ + sandman_zh-TW.ts diff --git a/SandboxiePlus/SandMan/Resources/SandMan.rc b/SandboxiePlus/SandMan/SandMan.rc similarity index 94% rename from SandboxiePlus/SandMan/Resources/SandMan.rc rename to SandboxiePlus/SandMan/SandMan.rc index e7569a5a..65562253 100644 --- a/SandboxiePlus/SandMan/Resources/SandMan.rc +++ b/SandboxiePlus/SandMan/SandMan.rc @@ -1,6 +1,6 @@ // Microsoft Visual C++ generated resource script. // -#include "resource.h" +#include "./resources/resource.h" ///////////////////////////////////////////////////////////////////////////// // German (Austria) resources diff --git a/SandboxiePlus/SandMan/SandMan.vcxproj b/SandboxiePlus/SandMan/SandMan.vcxproj index 9efb4f03..8961d3b7 100644 --- a/SandboxiePlus/SandMan/SandMan.vcxproj +++ b/SandboxiePlus/SandMan/SandMan.vcxproj @@ -243,9 +243,6 @@ - - - @@ -265,8 +262,12 @@ + + + + diff --git a/SandboxiePlus/SandMan/SandMan.vcxproj.filters b/SandboxiePlus/SandMan/SandMan.vcxproj.filters index ca9b34aa..1a68646c 100644 --- a/SandboxiePlus/SandMan/SandMan.vcxproj.filters +++ b/SandboxiePlus/SandMan/SandMan.vcxproj.filters @@ -169,11 +169,6 @@ Resource Files - - - Resource Files - - Resource Files @@ -224,5 +219,13 @@ Translation Files + + Translation Files + + + + + Resource Files + \ No newline at end of file diff --git a/SandboxiePlus/SandMan/Views/SbieView.cpp b/SandboxiePlus/SandMan/Views/SbieView.cpp index 42092961..41cf2757 100644 --- a/SandboxiePlus/SandMan/Views/SbieView.cpp +++ b/SandboxiePlus/SandMan/Views/SbieView.cpp @@ -209,6 +209,7 @@ void CSbieView::OnMenu(const QPoint& Point) foreach(const QModelIndex& Index, Rows) { QModelIndex ModelIndex = m_pSortProxy->mapToSource(Index); + pProcess = m_pSbieModel->GetProcess(ModelIndex); if (pProcess) { @@ -219,10 +220,13 @@ void CSbieView::OnMenu(const QPoint& Point) else { pBox = m_pSbieModel->GetSandBox(ModelIndex); - if (!pBox->IsEnabled()) - iSandBoxeCount = -1; - if (pBox && iSandBoxeCount != -1) - iSandBoxeCount++; + if (pBox) + { + if (!pBox->IsEnabled()) + iSandBoxeCount = -1; + else if (iSandBoxeCount != -1) + iSandBoxeCount++; + } } } @@ -501,6 +505,11 @@ void CSbieView::OnSandBoxAction() } else if (Action == m_pMenuExplore) { + if (SandBoxes.first()->IsEmpty()) { + QMessageBox("Sandboxie-Plus", tr("This Sandbox is empty."), QMessageBox::Information, QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton, this).exec(); + return; + } + if (theConf->GetBool("Options/AdvancedView", true) == false && theConf->GetBool("Options/ExplorerInfo", true)) { bool State = false; diff --git a/SandboxiePlus/SandMan/Windows/OptionsWindow.cpp b/SandboxiePlus/SandMan/Windows/OptionsWindow.cpp index 38c64606..83088851 100644 --- a/SandboxiePlus/SandMan/Windows/OptionsWindow.cpp +++ b/SandboxiePlus/SandMan/Windows/OptionsWindow.cpp @@ -150,7 +150,7 @@ COptionsWindow::COptionsWindow(const QSharedPointer& pBox, const QStri connect(ui.cmbBoxIndicator, SIGNAL(currentIndexChanged(int)), this, SLOT(OnGeneralChanged())); connect(ui.cmbBoxBorder, SIGNAL(currentIndexChanged(int)), this, SLOT(OnGeneralChanged())); - connect(ui.btnBorderColor, SIGNAL(pressed()), this, SLOT(OnPickColor())); + connect(ui.btnBorderColor, SIGNAL(clicked(bool)), this, SLOT(OnPickColor())); connect(ui.spinBorderWidth, SIGNAL(valueChanged(int)), this, SLOT(OnGeneralChanged())); connect(ui.chkBlockNetShare, SIGNAL(clicked(bool)), this, SLOT(OnGeneralChanged())); @@ -185,22 +185,22 @@ COptionsWindow::COptionsWindow(const QSharedPointer& pBox, const QStri // // Groupes - connect(ui.btnAddGroup, SIGNAL(pressed()), this, SLOT(OnAddGroup())); - connect(ui.btnAddProg, SIGNAL(pressed()), this, SLOT(OnAddProg())); - connect(ui.btnDelProg, SIGNAL(pressed()), this, SLOT(OnDelProg())); + connect(ui.btnAddGroup, SIGNAL(clicked(bool)), this, SLOT(OnAddGroup())); + connect(ui.btnAddProg, SIGNAL(clicked(bool)), this, SLOT(OnAddProg())); + connect(ui.btnDelProg, SIGNAL(clicked(bool)), this, SLOT(OnDelProg())); // // Force - connect(ui.btnForceProg, SIGNAL(pressed()), this, SLOT(OnForceProg())); - connect(ui.btnForceDir, SIGNAL(pressed()), this, SLOT(OnForceDir())); - connect(ui.btnDelForce, SIGNAL(pressed()), this, SLOT(OnDelForce())); + connect(ui.btnForceProg, SIGNAL(clicked(bool)), this, SLOT(OnForceProg())); + connect(ui.btnForceDir, SIGNAL(clicked(bool)), this, SLOT(OnForceDir())); + connect(ui.btnDelForce, SIGNAL(clicked(bool)), this, SLOT(OnDelForce())); connect(ui.chkShowForceTmpl, SIGNAL(clicked(bool)), this, SLOT(OnShowForceTmpl())); // // Stop - connect(ui.btnAddLingering, SIGNAL(pressed()), this, SLOT(OnAddLingering())); - connect(ui.btnAddLeader, SIGNAL(pressed()), this, SLOT(OnAddLeader())); - connect(ui.btnDelStopProg, SIGNAL(pressed()), this, SLOT(OnDelStopProg())); + connect(ui.btnAddLingering, SIGNAL(clicked(bool)), this, SLOT(OnAddLingering())); + connect(ui.btnAddLeader, SIGNAL(clicked(bool)), this, SLOT(OnAddLeader())); + connect(ui.btnDelStopProg, SIGNAL(clicked(bool)), this, SLOT(OnDelStopProg())); connect(ui.chkShowStopTmpl, SIGNAL(clicked(bool)), this, SLOT(OnShowStopTmpl())); // @@ -208,35 +208,35 @@ COptionsWindow::COptionsWindow(const QSharedPointer& pBox, const QStri connect(ui.radStartAll, SIGNAL(clicked(bool)), this, SLOT(OnRestrictStart())); connect(ui.radStartExcept, SIGNAL(clicked(bool)), this, SLOT(OnRestrictStart())); connect(ui.radStartSelected, SIGNAL(clicked(bool)), this, SLOT(OnRestrictStart())); - connect(ui.btnAddStartProg, SIGNAL(pressed()), this, SLOT(OnAddStartProg())); - connect(ui.btnDelStartProg, SIGNAL(pressed()), this, SLOT(OnDelStartProg())); + connect(ui.btnAddStartProg, SIGNAL(clicked(bool)), this, SLOT(OnAddStartProg())); + connect(ui.btnDelStartProg, SIGNAL(clicked(bool)), this, SLOT(OnDelStartProg())); connect(ui.chkStartBlockMsg, SIGNAL(clicked(bool)), this, SLOT(OnStartChanged())); // // INet connect(ui.chkBlockINet, SIGNAL(clicked(bool)), this, SLOT(OnBlockINet())); - connect(ui.btnAddINetProg, SIGNAL(pressed()), this, SLOT(OnAddINetProg())); - connect(ui.btnDelINetProg, SIGNAL(pressed()), this, SLOT(OnDelINetProg())); + connect(ui.btnAddINetProg, SIGNAL(clicked(bool)), this, SLOT(OnAddINetProg())); + connect(ui.btnDelINetProg, SIGNAL(clicked(bool)), this, SLOT(OnDelINetProg())); connect(ui.chkINetBlockPrompt, SIGNAL(clicked(bool)), this, SLOT(OnINetBlockChanged())); connect(ui.chkINetBlockMsg, SIGNAL(clicked(bool)), this, SLOT(OnINetBlockChanged())); // // Access - connect(ui.btnAddFile, SIGNAL(pressed()), this, SLOT(OnAddFile())); + connect(ui.btnAddFile, SIGNAL(clicked(bool)), this, SLOT(OnAddFile())); QMenu* pFileBtnMenu = new QMenu(ui.btnAddFile); pFileBtnMenu->addAction(tr("Browse for File"), this, SLOT(OnBrowseFile())); pFileBtnMenu->addAction(tr("Browse for Folder"), this, SLOT(OnBrowseFolder())); ui.btnAddFile->setPopupMode(QToolButton::MenuButtonPopup); ui.btnAddFile->setMenu(pFileBtnMenu); - connect(ui.btnAddKey, SIGNAL(pressed()), this, SLOT(OnAddKey())); - connect(ui.btnAddIPC, SIGNAL(pressed()), this, SLOT(OnAddIPC())); - connect(ui.btnAddWnd, SIGNAL(pressed()), this, SLOT(OnAddWnd())); - connect(ui.btnAddCOM, SIGNAL(pressed()), this, SLOT(OnAddCOM())); + connect(ui.btnAddKey, SIGNAL(clicked(bool)), this, SLOT(OnAddKey())); + connect(ui.btnAddIPC, SIGNAL(clicked(bool)), this, SLOT(OnAddIPC())); + connect(ui.btnAddWnd, SIGNAL(clicked(bool)), this, SLOT(OnAddWnd())); + connect(ui.btnAddCOM, SIGNAL(clicked(bool)), this, SLOT(OnAddCOM())); // todo: add priority by order ui.btnMoveUp->setVisible(false); ui.btnMoveDown->setVisible(false); connect(ui.chkShowAccessTmpl, SIGNAL(clicked(bool)), this, SLOT(OnShowAccessTmpl())); - connect(ui.btnDelAccess, SIGNAL(pressed()), this, SLOT(OnDelAccess())); + connect(ui.btnDelAccess, SIGNAL(clicked(bool)), this, SLOT(OnDelAccess())); connect(ui.treeAccess, SIGNAL(itemClicked(QTreeWidgetItem*, int)), this, SLOT(OnAccessItemClicked(QTreeWidgetItem*, int))); connect(ui.treeAccess, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)), this, SLOT(OnAccessItemDoubleClicked(QTreeWidgetItem*, int))); @@ -245,10 +245,10 @@ COptionsWindow::COptionsWindow(const QSharedPointer& pBox, const QStri // Recovery connect(ui.chkAutoRecovery, SIGNAL(clicked(bool)), this, SLOT(OnRecoveryChanged())); - connect(ui.btnAddRecovery, SIGNAL(pressed()), this, SLOT(OnAddRecFolder())); - connect(ui.btnDelRecovery, SIGNAL(pressed()), this, SLOT(OnDelRecEntry())); - connect(ui.btnAddRecIgnore, SIGNAL(pressed()), this, SLOT(OnAddRecIgnore())); - connect(ui.btnAddRecIgnoreExt, SIGNAL(pressed()), this, SLOT(OnAddRecIgnoreExt())); + connect(ui.btnAddRecovery, SIGNAL(clicked(bool)), this, SLOT(OnAddRecFolder())); + connect(ui.btnDelRecovery, SIGNAL(clicked(bool)), this, SLOT(OnDelRecEntry())); + connect(ui.btnAddRecIgnore, SIGNAL(clicked(bool)), this, SLOT(OnAddRecIgnore())); + connect(ui.btnAddRecIgnoreExt, SIGNAL(clicked(bool)), this, SLOT(OnAddRecIgnoreExt())); connect(ui.chkShowRecoveryTmpl, SIGNAL(clicked(bool)), this, SLOT(OnShowRecoveryTmpl())); // @@ -264,6 +264,7 @@ COptionsWindow::COptionsWindow(const QSharedPointer& pBox, const QStri connect(ui.chkOpenCredentials, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged())); connect(ui.chkOpenProtectedStorage, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged())); connect(ui.chkOpenSmartCard, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged())); + connect(ui.chkOpenBluetooth, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged())); //connect(ui.chkOpenLsaEndpoint, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged())); connect(ui.chkAddToJob, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged())); @@ -276,15 +277,15 @@ COptionsWindow::COptionsWindow(const QSharedPointer& pBox, const QStri connect(ui.chkComTrace, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged())); connect(ui.chkDbgTrace, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged())); - connect(ui.btnAddAutoExec, SIGNAL(pressed()), this, SLOT(OnAddAutoExec())); - connect(ui.btnDelAutoExec, SIGNAL(pressed()), this, SLOT(OnDelAutoExec())); + connect(ui.btnAddAutoExec, SIGNAL(clicked(bool)), this, SLOT(OnAddAutoExec())); + connect(ui.btnDelAutoExec, SIGNAL(clicked(bool)), this, SLOT(OnDelAutoExec())); connect(ui.chkHideOtherBoxes, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged())); - connect(ui.btnAddProcess, SIGNAL(pressed()), this, SLOT(OnAddProcess())); - connect(ui.btnDelProcess, SIGNAL(pressed()), this, SLOT(OnDelProcess())); + connect(ui.btnAddProcess, SIGNAL(clicked(bool)), this, SLOT(OnAddProcess())); + connect(ui.btnDelProcess, SIGNAL(clicked(bool)), this, SLOT(OnDelProcess())); - connect(ui.btnAddUser, SIGNAL(pressed()), this, SLOT(OnAddUser())); - connect(ui.btnDelUser, SIGNAL(pressed()), this, SLOT(OnDelUser())); + connect(ui.btnAddUser, SIGNAL(clicked(bool)), this, SLOT(OnAddUser())); + connect(ui.btnDelUser, SIGNAL(clicked(bool)), this, SLOT(OnDelUser())); connect(ui.chkMonitorAdminOnly, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged())); // @@ -299,13 +300,13 @@ COptionsWindow::COptionsWindow(const QSharedPointer& pBox, const QStri connect(ui.tabs, SIGNAL(currentChanged(int)), this, SLOT(OnTab())); // edit - connect(ui.btnEditIni, SIGNAL(pressed()), this, SLOT(OnEditIni())); - connect(ui.btnSaveIni, SIGNAL(pressed()), this, SLOT(OnSaveIni())); - connect(ui.btnCancelEdit, SIGNAL(pressed()), this, SLOT(OnCancelEdit())); + connect(ui.btnEditIni, SIGNAL(clicked(bool)), this, SLOT(OnEditIni())); + connect(ui.btnSaveIni, SIGNAL(clicked(bool)), this, SLOT(OnSaveIni())); + connect(ui.btnCancelEdit, SIGNAL(clicked(bool)), this, SLOT(OnCancelEdit())); // - connect(ui.buttonBox->button(QDialogButtonBox::Ok), SIGNAL(pressed()), this, SLOT(ok())); - connect(ui.buttonBox->button(QDialogButtonBox::Apply), SIGNAL(pressed()), this, SLOT(apply())); + connect(ui.buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked(bool)), this, SLOT(ok())); + connect(ui.buttonBox->button(QDialogButtonBox::Apply), SIGNAL(clicked(bool)), this, SLOT(apply())); connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(close())); if (ReadOnly) { @@ -368,12 +369,17 @@ void COptionsWindow::closeEvent(QCloseEvent *e) bool COptionsWindow::eventFilter(QObject *source, QEvent *event) { if (event->type() == QEvent::KeyPress && ((QKeyEvent*)event)->key() == Qt::Key_Escape && ((QKeyEvent*)event)->modifiers() == Qt::NoModifier) + { CloseAccessEdit(false); - else if (source == ui.treeAccess->viewport() && event->type() == QEvent::MouseButtonPress) + return true; // cancel event + } + + if (source == ui.treeAccess->viewport() && event->type() == QEvent::MouseButtonPress) + { CloseAccessEdit(); - else - return QDialog::eventFilter(source, event); - return true; + } + + return QDialog::eventFilter(source, event); } //void COptionsWindow::OnWithTemplates() @@ -479,6 +485,7 @@ void COptionsWindow::LoadConfig() ui.chkOpenCredentials->setEnabled(!ui.chkOpenProtectedStorage->isChecked()); ui.chkOpenCredentials->setChecked(!ui.chkOpenCredentials->isEnabled() || m_pBox->GetBool("OpenCredentials", false)); ui.chkOpenSmartCard->setChecked(m_pBox->GetBool("OpenSmartCard", true)); + ui.chkOpenBluetooth->setChecked(m_pBox->GetBool("OpenBluetooth", false)); //ui.chkOpenLsaEndpoint->setChecked(m_pBox->GetBool("OpenLsaEndpoint", false)); @@ -645,6 +652,7 @@ void COptionsWindow::SaveConfig() if(ui.chkOpenCredentials->isEnabled()) WriteAdvancedCheck(ui.chkOpenCredentials, "OpenCredentials", "y", ""); WriteAdvancedCheck(ui.chkOpenSmartCard, "OpenSmartCard", "", "n"); + WriteAdvancedCheck(ui.chkOpenBluetooth, "OpenBluetooth", "y", ""); //WriteAdvancedCheck(ui.chkOpenLsaEndpoint, "OpenLsaEndpoint", "y", ""); WriteAdvancedCheck(ui.chkAddToJob, "NoAddProcessToJob", "", "y"); @@ -700,6 +708,8 @@ void COptionsWindow::apply() return; } + CloseAccessEdit(); + if (!ui.btnEditIni->isEnabled()) SaveIniSection(); else @@ -1471,27 +1481,27 @@ QString COptionsWindow::GetAccessModeStr(EAccessMode Mode) { switch (Mode) { - case eDirect: return "Direct"; - case eDirectAll: return "Direct All"; - case eClosed: return "Closed"; - case eClosedRT: return "Closed RT"; - case eReadOnly: return "Read Only"; - case eWriteOnly: return "Write Only"; + case eDirect: return tr("Direct"); + case eDirectAll: return tr("Direct All"); + case eClosed: return tr("Closed"); + case eClosedRT: return tr("Closed RT"); + case eReadOnly: return tr("Read Only"); + case eWriteOnly: return tr("Hidden"); } - return "Unknown"; + return tr("Unknown"); } QString COptionsWindow::GetAccessTypeStr(EAccessType Type) { switch (Type) { - case eFile: return "File/Folder"; - case eKey: return "Registry"; - case eIPC: return "IPC Path"; - case eWnd: return "Wnd Class"; - case eCOM: return "COM Object"; + case eFile: return tr("File/Folder"); + case eKey: return tr("Registry"); + case eIPC: return tr("IPC Path"); + case eWnd: return tr("Wnd Class"); + case eCOM: return tr("COM Object"); } - return "Unknown"; + return tr("Unknown"); } void COptionsWindow::OnBrowseFile() diff --git a/SandboxiePlus/SandMan/Windows/PopUpWindow.h b/SandboxiePlus/SandMan/Windows/PopUpWindow.h index 0d570537..b795c769 100644 --- a/SandboxiePlus/SandMan/Windows/PopUpWindow.h +++ b/SandboxiePlus/SandMan/Windows/PopUpWindow.h @@ -46,7 +46,7 @@ public: pHelp->setText(tr("?")); pHelp->setToolTip(tr("Visit %1 for a detailed explanation.").arg(QString("https://sandboxie-plus.com/go.php?to=sbie-sbie%1/").arg(GetMsgId()))); pHelp->setMaximumWidth(16); - QObject::connect(pHelp, SIGNAL(pressed()), this, SLOT(OnHelp())); + QObject::connect(pHelp, SIGNAL(clicked(bool)), this, SLOT(OnHelp())); m_pMainLayout->addWidget(pHelp, 0, 1); @@ -58,7 +58,7 @@ public: pMenu->addAction(tr("Hide all such messages"), this, SIGNAL(Hide())); pDismiss->setMenu(pMenu); //QObject::connect(pDismiss, SIGNAL(triggered(QAction*)), , SLOT()); - QObject::connect(pDismiss, SIGNAL(pressed()), this, SIGNAL(Dismiss())); + QObject::connect(pDismiss, SIGNAL(clicked(bool)), this, SIGNAL(Dismiss())); m_pMainLayout->addWidget(pDismiss, 0, 2); } } @@ -107,17 +107,17 @@ public: m_pYes = new QToolButton(); m_pYes->setText(tr("Yes")); - connect(m_pYes, SIGNAL(pressed()), this, SLOT(OnAccepted())); + connect(m_pYes, SIGNAL(clicked(bool)), this, SLOT(OnAccepted())); m_pMainLayout->addWidget(m_pYes, 1, 2); m_pNo = new QToolButton(); m_pNo->setText(tr("No")); - connect(m_pNo, SIGNAL(pressed()), this, SLOT(OnRejected())); + connect(m_pNo, SIGNAL(clicked(bool)), this, SLOT(OnRejected())); m_pMainLayout->addWidget(m_pNo, 1, 3); m_pTerminate = new QToolButton(); m_pTerminate->setText(tr("Terminate")); - connect(m_pTerminate, SIGNAL(pressed()), this, SLOT(OnTerminate())); + connect(m_pTerminate, SIGNAL(clicked(bool)), this, SLOT(OnTerminate())); m_pMainLayout->addWidget(m_pTerminate, 1, 4); @@ -256,7 +256,7 @@ public: pRecMenu->addAction(tr("Open file recovery for this box"), this, SIGNAL(OpenRecovery())); pRecover->setMenu(pRecMenu); //QObject::connect(pRecover, SIGNAL(triggered(QAction*)), , SLOT()); - QObject::connect(pRecover, SIGNAL(pressed()), this, SLOT(OnRecover())); + QObject::connect(pRecover, SIGNAL(clicked(bool)), this, SLOT(OnRecover())); m_pMainLayout->addWidget(pRecover, 2, 2); @@ -269,7 +269,7 @@ public: pMenu->addAction(tr("Disable quick recovery until the box restarts"), this, SLOT(OnDisable())); pDismiss->setMenu(pMenu); //QObject::connect(pDismiss, SIGNAL(triggered(QAction*)), , SLOT()); - QObject::connect(pDismiss, SIGNAL(pressed()), this, SIGNAL(Dismiss())); + QObject::connect(pDismiss, SIGNAL(clicked(bool)), this, SIGNAL(Dismiss())); m_pMainLayout->addWidget(pDismiss, 2, 3); } @@ -359,7 +359,7 @@ public: //pMenu->addAction(tr("Hide this progress for this process"), this, SIGNAL(Hide())); //pDismiss->setMenu(pMenu); //QObject::connect(pDismiss, SIGNAL(triggered(QAction*)), , SLOT()); - QObject::connect(pDismiss, SIGNAL(pressed()), this, SIGNAL(Dismiss())); + QObject::connect(pDismiss, SIGNAL(clicked(bool)), this, SIGNAL(Dismiss())); m_pMainLayout->addWidget(pDismiss, 1, 2); m_iTimeOutSec = 5; diff --git a/SandboxiePlus/SandMan/Windows/RecoveryWindow.cpp b/SandboxiePlus/SandMan/Windows/RecoveryWindow.cpp index 3227ccfd..8a69f69c 100644 --- a/SandboxiePlus/SandMan/Windows/RecoveryWindow.cpp +++ b/SandboxiePlus/SandMan/Windows/RecoveryWindow.cpp @@ -58,13 +58,13 @@ CRecoveryWindow::CRecoveryWindow(const CSandBoxPtr& pBox, QWidget *parent) //connect(ui.treeFiles->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)), this, SLOT(UpdateSnapshot(const QModelIndex&))); //connect(ui.treeFiles, SIGNAL(doubleClicked(const QModelIndex&)), this, SLOT(OnSelectSnapshot())); - connect(ui.btnAddFolder, SIGNAL(pressed()), this, SLOT(OnAddFolder())); + connect(ui.btnAddFolder, SIGNAL(clicked(bool)), this, SLOT(OnAddFolder())); connect(ui.chkShowAll, SIGNAL(clicked(bool)), this, SLOT(FindFiles())); - connect(ui.btnRefresh, SIGNAL(pressed()), this, SLOT(FindFiles())); - connect(ui.btnRecover, SIGNAL(pressed()), this, SLOT(OnRecover())); - connect(ui.btnRecoverTo, SIGNAL(pressed()), this, SLOT(OnRecoverTo())); - connect(ui.btnDeleteAll, SIGNAL(pressed()), this, SLOT(OnDeleteAll())); - connect(ui.btnClose, SIGNAL(pressed()), this, SLOT(close())); + connect(ui.btnRefresh, SIGNAL(clicked(bool)), this, SLOT(FindFiles())); + connect(ui.btnRecover, SIGNAL(clicked(bool)), this, SLOT(OnRecover())); + connect(ui.btnRecoverTo, SIGNAL(clicked(bool)), this, SLOT(OnRecoverTo())); + connect(ui.btnDeleteAll, SIGNAL(clicked(bool)), this, SLOT(OnDeleteAll())); + connect(ui.btnClose, SIGNAL(clicked(bool)), this, SLOT(close())); restoreGeometry(theConf->GetBlob("RecoveryWindow/Window_Geometry")); @@ -226,7 +226,6 @@ int CRecoveryWindow::FindFiles(const QString& RecParent, const QString& BoxedFol void CRecoveryWindow::RecoverFiles(bool bBrowse) { bool HasShare = false; - QMap FileMap; foreach(const QModelIndex& Index, ui.treeFiles->selectionModel()->selectedIndexes()) { @@ -262,17 +261,21 @@ void CRecoveryWindow::RecoverFiles(bool bBrowse) } } - QString RecoveryFolder; - if (HasShare && !bBrowse) - { - if (!bBrowse) - QMessageBox::warning(this, "Sandboxie-Plus", tr("One or more selected files are located on a network share, and must be recovered to a local drive, please select a folder to recover all selected files to.")); + if (HasShare && !bBrowse) { + QMessageBox::warning(this, "Sandboxie-Plus", tr("One or more selected files are located on a network share, and must be recovered to a local drive, please select a folder to recover all selected files to.")); + bBrowse = true; + } + + + QString RecoveryFolder; + if (bBrowse) { RecoveryFolder = QFileDialog::getExistingDirectory(this, tr("Select Directory")).replace("/", "\\"); if (RecoveryFolder.isEmpty()) return; } + QList> FileList; for(QMap::const_iterator I = FileMap.begin(); I != FileMap.end(); ++I) { @@ -287,6 +290,7 @@ void CRecoveryWindow::RecoverFiles(bool bBrowse) FileList.append(qMakePair(BoxedFilePath, RecoveryPath)); } + SB_PROGRESS Status = theGUI->RecoverFiles(FileList); if (Status.GetStatus() == OP_ASYNC) { diff --git a/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp b/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp index 65aa435f..d1ead340 100644 --- a/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp +++ b/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp @@ -89,7 +89,7 @@ CSettingsWindow::CSettingsWindow(QWidget *parent) ui.chkAdminOnly->setChecked(theAPI->GetGlobalSettings()->GetBool("EditAdminOnly", false)); ui.chkPassRequired->setChecked(!theAPI->GetGlobalSettings()->GetText("EditPassword", "").isEmpty()); connect(ui.chkPassRequired, SIGNAL(stateChanged(int)), this, SLOT(OnChange())); - connect(ui.btnSetPassword, SIGNAL(pressed()), this, SLOT(OnSetPassword())); + connect(ui.btnSetPassword, SIGNAL(clicked(bool)), this, SLOT(OnSetPassword())); ui.chkAdminOnlyFP->setChecked(theAPI->GetGlobalSettings()->GetBool("ForceDisableAdminOnly", false)); ui.chkClearPass->setChecked(theAPI->GetGlobalSettings()->GetBool("ForgetPassword", false)); @@ -97,9 +97,9 @@ CSettingsWindow::CSettingsWindow(QWidget *parent) connect(ui.chkStartBlock, SIGNAL(stateChanged(int)), this, SLOT(OnWarnChanged())); ui.chkStartBlockMsg->setChecked(theAPI->GetGlobalSettings()->GetBool("NotifyStartRunAccessDenied", true)); connect(ui.chkStartBlockMsg, SIGNAL(stateChanged(int)), this, SLOT(OnWarnChanged())); - connect(ui.btnAddWarnProg, SIGNAL(pressed()), this, SLOT(OnAddWarnProg())); - connect(ui.btnAddWarnFolder, SIGNAL(pressed()), this, SLOT(OnAddWarnFolder())); - connect(ui.btnDelWarnProg, SIGNAL(pressed()), this, SLOT(OnDelWarnProg())); + connect(ui.btnAddWarnProg, SIGNAL(clicked(bool)), this, SLOT(OnAddWarnProg())); + connect(ui.btnAddWarnFolder, SIGNAL(clicked(bool)), this, SLOT(OnAddWarnFolder())); + connect(ui.btnDelWarnProg, SIGNAL(clicked(bool)), this, SLOT(OnDelWarnProg())); foreach(const QString& Value, theAPI->GetGlobalSettings()->GetTextList("AlertProcess", false)) AddWarnEntry(Value, 1); @@ -127,7 +127,7 @@ CSettingsWindow::CSettingsWindow(QWidget *parent) } m_WarnProgsChanged = false; - connect(ui.btnBrowse, SIGNAL(pressed()), this, SLOT(OnBrowse())); + connect(ui.btnBrowse, SIGNAL(clicked(bool)), this, SLOT(OnBrowse())); int PortableRootDir = theConf->GetInt("Options/PortableRootDir", -1); if (PortableRootDir != -1 && theConf->IsPortable()) @@ -136,8 +136,8 @@ CSettingsWindow::CSettingsWindow(QWidget *parent) ui.chkAutoRoot->setVisible(false); connect(ui.chkAutoRoot, SIGNAL(stateChanged(int)), this, SLOT(OnChange())); - connect(ui.btnAddCompat, SIGNAL(pressed()), this, SLOT(OnAddCompat())); - connect(ui.btnDelCompat, SIGNAL(pressed()), this, SLOT(OnDelCompat())); + connect(ui.btnAddCompat, SIGNAL(clicked(bool)), this, SLOT(OnAddCompat())); + connect(ui.btnDelCompat, SIGNAL(clicked(bool)), this, SLOT(OnDelCompat())); m_CompatLoaded = 0; m_CompatChanged = false; @@ -148,8 +148,8 @@ CSettingsWindow::CSettingsWindow(QWidget *parent) connect(ui.tabs, SIGNAL(currentChanged(int)), this, SLOT(OnTab())); - connect(ui.buttonBox->button(QDialogButtonBox::Ok), SIGNAL(pressed()), this, SLOT(ok())); - connect(ui.buttonBox->button(QDialogButtonBox::Apply), SIGNAL(pressed()), this, SLOT(apply())); + connect(ui.buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked(bool)), this, SLOT(ok())); + connect(ui.buttonBox->button(QDialogButtonBox::Apply), SIGNAL(clicked(bool)), this, SLOT(apply())); connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(reject())); restoreGeometry(theConf->GetBlob("SettingsWindow/Window_Geometry")); @@ -294,7 +294,7 @@ void CSettingsWindow::apply() } if (ui.chkAutoRoot->isVisible()) - theConf->SetValue("Options/PortableRootDir", ui.chkAutoRoot->checkState() != Qt::Checked ? 1 : 0); + theConf->SetValue("Options/PortableRootDir", ui.chkAutoRoot->checkState() == Qt::Checked ? 1 : 0); theConf->SetValue("Options/AutoRunSoftCompat", !ui.chkNoCompat->isChecked()); diff --git a/SandboxiePlus/SandMan/Windows/SnapshotsWindow.cpp b/SandboxiePlus/SandMan/Windows/SnapshotsWindow.cpp index 09746b69..644fc104 100644 --- a/SandboxiePlus/SandMan/Windows/SnapshotsWindow.cpp +++ b/SandboxiePlus/SandMan/Windows/SnapshotsWindow.cpp @@ -49,9 +49,9 @@ CSnapshotsWindow::CSnapshotsWindow(const CSandBoxPtr& pBox, QWidget *parent) connect(ui.treeSnapshots->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)), this, SLOT(UpdateSnapshot(const QModelIndex&))); connect(ui.treeSnapshots, SIGNAL(doubleClicked(const QModelIndex&)), this, SLOT(OnSelectSnapshot())); - connect(ui.btnTake, SIGNAL(pressed()), this, SLOT(OnTakeSnapshot())); - connect(ui.btnSelect, SIGNAL(pressed()), this, SLOT(OnSelectSnapshot())); - connect(ui.btnRemove, SIGNAL(pressed()), this, SLOT(OnRemoveSnapshot())); + connect(ui.btnTake, SIGNAL(clicked(bool)), this, SLOT(OnTakeSnapshot())); + connect(ui.btnSelect, SIGNAL(clicked(bool)), this, SLOT(OnSelectSnapshot())); + connect(ui.btnRemove, SIGNAL(clicked(bool)), this, SLOT(OnRemoveSnapshot())); connect(ui.txtName, SIGNAL(textEdited(const QString&)), this, SLOT(SaveInfo())); connect(ui.txtInfo, SIGNAL(textChanged()), this, SLOT(SaveInfo())); diff --git a/SandboxiePlus/SandMan/main.cpp b/SandboxiePlus/SandMan/main.cpp index fafc139b..6e37b5ae 100644 --- a/SandboxiePlus/SandMan/main.cpp +++ b/SandboxiePlus/SandMan/main.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "SandMan.h" -#include +#include #include "../QSbieAPI/SbieAPI.h" #include "../QtSingleApp/src/qtsingleapplication.h" #include "../QSbieAPI/SbieUtils.h" @@ -31,7 +31,7 @@ int main(int argc, char *argv[]) return 0; } - if (app.sendMessage("ShowWnd")) + if (app.sendMessage("ShowWnd")) return 0; theConf = new CSettings("Sandboxie-Plus");