This commit is contained in:
DavidXanatos 2021-01-30 19:10:49 +01:00
parent 9d4c89e86d
commit 388a307ce4
30 changed files with 506 additions and 198 deletions

View File

@ -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));

View File

@ -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);
}

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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)

View File

@ -43,29 +43,47 @@ 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"
}
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");
}
}

View File

@ -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<QString, CSandBoxPtr> 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);
}
else if(bFullUpdate)
UpdateBoxPaths(pBox);
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;
}

View File

@ -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);

View File

@ -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

View File

@ -45,7 +45,7 @@
<enum>QTabWidget::West</enum>
</property>
<property name="currentIndex">
<number>0</number>
<number>8</number>
</property>
<widget class="QWidget" name="tabGeneral">
<attribute name="title">
@ -1323,26 +1323,18 @@ For files access you can use 'Direct All' instead to make it apply to all progra
</property>
</widget>
</item>
<item row="6" column="1" colspan="2">
<widget class="QCheckBox" name="chkRestrictServices">
<property name="text">
<string>Do not start sandboxed services using a system token (recommended)</string>
<item row="15" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="13" column="1" colspan="2">
<widget class="QCheckBox" name="chkOpenSmartCard">
<property name="text">
<string>Allow access to Smart Cards</string>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</widget>
</item>
<item row="9" column="1" colspan="2">
<widget class="QCheckBox" name="chkProtectSystem">
<property name="text">
<string>Protect sandboxed SYSTEM processes from unprivileged unsandboxed processes</string>
</property>
</widget>
</spacer>
</item>
<item row="7" column="0" colspan="3">
<widget class="QLabel" name="label_12">
@ -1360,6 +1352,22 @@ For files access you can use 'Direct All' instead to make it apply to all progra
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_22">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="toolTip">
<string>Protect the sandbox integrity itself</string>
</property>
<property name="text">
<string>Sandbox isolation</string>
</property>
</widget>
</item>
<item row="3" column="1" colspan="2">
<widget class="QCheckBox" name="chkNoWindowRename">
<property name="text">
@ -1367,10 +1375,10 @@ For files access you can use 'Direct All' instead to make it apply to all progra
</property>
</widget>
</item>
<item row="12" column="2">
<widget class="QCheckBox" name="chkOpenCredentials">
<item row="6" column="1" colspan="2">
<widget class="QCheckBox" name="chkRestrictServices">
<property name="text">
<string>Open Windows Credentials Store</string>
<string>Do not start sandboxed services using a system token (recommended)</string>
</property>
</widget>
</item>
@ -1381,7 +1389,7 @@ For files access you can use 'Direct All' instead to make it apply to all progra
</property>
</widget>
</item>
<item row="14" column="2">
<item row="15" column="2">
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -1394,6 +1402,34 @@ For files access you can use 'Direct All' instead to make it apply to all progra
</property>
</spacer>
</item>
<item row="13" column="1" colspan="2">
<widget class="QCheckBox" name="chkOpenSmartCard">
<property name="text">
<string>Allow access to Smart Cards</string>
</property>
</widget>
</item>
<item row="5" column="1" colspan="2">
<widget class="QCheckBox" name="chkAddToJob">
<property name="text">
<string>Add sandboxed processes to job objects (recommended)</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
<widget class="QCheckBox" name="chkPreferExternalManifest">
<property name="text">
<string>Force usage of custom dummy Manifest files (legacy behaviour)</string>
</property>
</widget>
</item>
<item row="9" column="1" colspan="2">
<widget class="QCheckBox" name="chkProtectSystem">
<property name="text">
<string>Protect sandboxed SYSTEM processes from unprivileged unsandboxed processes</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_5">
<property name="font">
@ -1407,46 +1443,17 @@ For files access you can use 'Direct All' instead to make it apply to all progra
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
<widget class="QCheckBox" name="chkPreferExternalManifest">
<item row="12" column="2">
<widget class="QCheckBox" name="chkOpenCredentials">
<property name="text">
<string>Force usage of custom dummy Manifest files (legacy behaviour)</string>
<string>Open Windows Credentials Store</string>
</property>
</widget>
</item>
<item row="14" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="5" column="1" colspan="2">
<widget class="QCheckBox" name="chkAddToJob">
<item row="14" column="1" colspan="2">
<widget class="QCheckBox" name="chkOpenBluetooth">
<property name="text">
<string>Add sandboxed processes to job objects (recommended)</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_22">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="toolTip">
<string>Protect the sandbox integrity itself</string>
</property>
<property name="text">
<string>Sandbox isolation</string>
<string>Allow access to Bluetooth</string>
</property>
</widget>
</item>
@ -1770,8 +1777,8 @@ instead of &quot;*&quot;.</string>
<rect>
<x>0</x>
<y>0</y>
<width>530</width>
<height>312</height>
<width>98</width>
<height>28</height>
</rect>
</property>
<layout class="QGridLayout" name="dbgLayout">

View File

@ -137,6 +137,9 @@ QList<QVariant> CSbieModel::Sync(const QMap<QString, CSandBoxPtr>& BoxList, cons
foreach (const CSandBoxPtr& pBox, BoxList)
{
if (!ShowHidden && !pBox->IsEnabled())
continue;
QVariant ID = pBox->GetName();
QModelIndex Index;
@ -161,9 +164,6 @@ QList<QVariant> CSbieModel::Sync(const QMap<QString, CSandBoxPtr>& BoxList, cons
CSandBoxPlus* pBoxEx = qobject_cast<CSandBoxPlus*>(pBox.data());
if (!ShowHidden && !pBoxEx->IsEnabled())
continue;
int Col = 0;
bool State = false;
int Changed = 0;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 401 KiB

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 566 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 566 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

View File

@ -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");
}

View File

@ -14,7 +14,7 @@
#define VERSION_MJR 0
#define VERSION_MIN 6
#define VERSION_REV 0
#define VERSION_REV 5
#define VERSION_UPD 0

View File

@ -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

View File

@ -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

View File

@ -1,6 +1,6 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#include "./resources/resource.h"
/////////////////////////////////////////////////////////////////////////////
// German (Austria) resources

View File

@ -243,9 +243,6 @@
<ItemGroup>
<QtRcc Include="Resources\SandMan.qrc" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Resources\SandMan.rc" />
</ItemGroup>
<ItemGroup>
<Image Include="Resources\finder-empty.bmp" />
<Image Include="Resources\finder-full.bmp" />
@ -265,8 +262,12 @@
<None Include="sandman_pt.ts" />
<None Include="sandman_ru.ts" />
<None Include="sandman_tr.ts" />
<None Include="sandman_zh-TW.ts" />
<None Include="sandman_zh.ts" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="SandMan.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
<Import Project="$(QtMsBuild)\qt.targets" />

View File

@ -169,11 +169,6 @@
<Filter>Resource Files</Filter>
</QtRcc>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Resources\SandMan.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<Image Include="Resources\SandMan.ico">
<Filter>Resource Files</Filter>
@ -224,5 +219,13 @@
<None Include="sandman_tr.ts">
<Filter>Translation Files</Filter>
</None>
<None Include="sandman_zh-TW.ts">
<Filter>Translation Files</Filter>
</None>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="SandMan.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>

View File

@ -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;

View File

@ -150,7 +150,7 @@ COptionsWindow::COptionsWindow(const QSharedPointer<CSbieIni>& 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<CSbieIni>& 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<CSbieIni>& 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<CSbieIni>& 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<CSbieIni>& 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<CSbieIni>& 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<CSbieIni>& 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()

View File

@ -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;

View File

@ -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<QString, QString> 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<QPair<QString, QString>> FileList;
for(QMap<QString, QString>::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)
{

View File

@ -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());

View File

@ -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()));

View File

@ -1,6 +1,6 @@
#include "stdafx.h"
#include "SandMan.h"
#include <QApplication>
#include <QtWidgets/QApplication>
#include "../QSbieAPI/SbieAPI.h"
#include "../QtSingleApp/src/qtsingleapplication.h"
#include "../QSbieAPI/SbieUtils.h"