Merge pull request #3656 from love-code-yeyixiao/master

add "restart as admin" feature
This commit is contained in:
DavidXanatos 2024-03-02 11:14:23 +01:00 committed by GitHub
commit 45ed7b91dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 481 additions and 409 deletions

View File

@ -1608,6 +1608,28 @@ _FX LRESULT Gui_WindowProcW(
return lResult; return lResult;
} }
_FX VOID ProtectScreen(HWND hWnd) {
WCHAR buffer[BOXNAME_COUNT] = { L"\0" };
SbieApi_QueryProcess(GetCurrentProcess(), buffer, 0, 0, 0);
if (SbieApi_QueryConfBool(buffer, L"IsProtectScreen", FALSE)) {
OSVERSIONINFOEX os;
os.dwOSVersionInfoSize = sizeof(os);
if (GetVersionEx(&os))
{
if (os.dwMajorVersion == 6) {
HMODULE hDll = GetModuleHandleW(L"user32.dll");
if (hDll != NULL && hDll != INVALID_HANDLE_VALUE) {
typedef BOOL(*LPSETWINDOWDISPLAYAFFINITY)(HWND, DWORD);
LPSETWINDOWDISPLAYAFFINITY swda =(LPSETWINDOWDISPLAYAFFINITY) GetProcAddress(hDll, "SetWindowDisplayAffinity");
if (swda) {
swda(hWnd, 0x00000001);
}
}
}
}
}
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// Gui_WindowProcA // Gui_WindowProcA
@ -1629,6 +1651,8 @@ _FX LRESULT Gui_WindowProcA(
if (uMsg == WM_SETTEXT && Gui_ShouldCreateTitle(hWnd)) if (uMsg == WM_SETTEXT && Gui_ShouldCreateTitle(hWnd))
new_lParam = (LPARAM)Gui_CreateTitleA((UCHAR *)lParam); new_lParam = (LPARAM)Gui_CreateTitleA((UCHAR *)lParam);
if (uMsg == WM_CREATE)
ProtectScreen(hWnd);
else else
new_lParam = lParam; new_lParam = lParam;
@ -2702,3 +2726,4 @@ _FX BOOLEAN ComDlg32_Init(HMODULE module)
return TRUE; return TRUE;
} }

View File

@ -45,7 +45,7 @@
<enum>QTabWidget::North</enum> <enum>QTabWidget::North</enum>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>10</number> <number>1</number>
</property> </property>
<widget class="QWidget" name="tabGeneral"> <widget class="QWidget" name="tabGeneral">
<attribute name="title"> <attribute name="title">
@ -1004,7 +1004,7 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QTabWidget" name="tabsSecurity"> <widget class="QTabWidget" name="tabsSecurity">
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>2</number>
</property> </property>
<widget class="QWidget" name="tabHarden"> <widget class="QWidget" name="tabHarden">
<attribute name="title"> <attribute name="title">
@ -1346,21 +1346,23 @@
<attribute name="title"> <attribute name="title">
<string>Box Protection</string> <string>Box Protection</string>
</attribute> </attribute>
<layout class="QGridLayout" name="gridLayout_83"> <layout class="QGridLayout" name="gridLayout_15">
<item row="0" column="0"> <item row="0" column="0" colspan="4">
<layout class="QGridLayout" name="gridLayout_82"> <widget class="QLabel" name="label_52">
<item row="1" column="2"> <property name="text">
<spacer name="horizontalSpacer_19"> <string>Sandboxie-Plus is able to create confidential sandboxes that provide robust protection against unauthorized surveillance or tampering by host processes. By utilizing an encrypted sandbox image, this feature delivers the highest level of operational confidentiality, ensuring the safety and integrity of sandboxed processes.</string>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="wordWrap">
<size> <bool>true</bool>
<width>40</width>
<height>20</height>
</size>
</property> </property>
</spacer> </widget>
</item>
<item row="2" column="1" colspan="2">
<widget class="QCheckBox" name="chkConfidential">
<property name="text">
<string>Protect processes within this box from host processes</string>
</property>
</widget>
</item> </item>
<item row="7" column="3"> <item row="7" column="3">
<widget class="QPushButton" name="btnHostProcessDeny"> <widget class="QPushButton" name="btnHostProcessDeny">
@ -1369,55 +1371,33 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="8" column="3"> <item row="11" column="0" colspan="3">
<spacer name="verticalSpacer_31">
<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="10" column="3">
<widget class="QPushButton" name="btnDelHostProcess">
<property name="text">
<string>Remove</string>
</property>
</widget>
</item>
<item row="11" column="0" colspan="4">
<widget class="QCheckBox" name="chkNotifyProtect"> <widget class="QCheckBox" name="chkNotifyProtect">
<property name="text"> <property name="text">
<string>Issue message 1318/1317 when a host process tries to access a sandboxed process/the box root</string> <string>Issue message 1318/1317 when a host process tries to access a sandboxed process/the box root</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="0" rowspan="5" colspan="3"> <item row="3" column="2">
<widget class="QTreeWidget" name="treeHostProc"> <widget class="QCheckBox" name="chkLessConfidential">
<property name="sortingEnabled">
<bool>true</bool>
</property>
<column>
<property name="text"> <property name="text">
<string>Process</string> <string>Allow useful Windows processes access to protected processes</string>
</property> </property>
</column>
<column>
<property name="text">
<string>Action</string>
</property>
</column>
<column>
<property name="text">
<string/>
</property>
</column>
</widget> </widget>
</item> </item>
<item row="1" column="2">
<spacer name="horizontalSpacer_19">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>471</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="3"> <item row="4" column="3">
<spacer name="verticalSpacer_40"> <spacer name="verticalSpacer_40">
<property name="orientation"> <property name="orientation">
@ -1431,37 +1411,23 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="9" column="3"> <item row="8" column="3">
<widget class="QCheckBox" name="chkShowHostProcTmpl"> <spacer name="verticalSpacer_31">
<property name="text"> <property name="orientation">
<string>Show Templates</string> <enum>Qt::Vertical</enum>
</property> </property>
</widget> <property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>76</height>
</size>
</property>
</spacer>
</item> </item>
<item row="1" column="0"> <item row="10" column="3">
<widget class="QLabel" name="lblBoxProtection"> <widget class="QPushButton" name="btnDelHostProcess">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
<kerning>true</kerning>
</font>
</property>
<property name="toolTip">
<string>Protect the sandbox integrity itself</string>
</property>
<property name="text"> <property name="text">
<string>Box Protection</string> <string>Remove</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="4">
<widget class="QLabel" name="label_52">
<property name="text">
<string>Sandboxie-Plus is able to create confidential sandboxes that provide robust protection against unauthorized surveillance or tampering by host processes. By utilizing an encrypted sandbox image, this feature delivers the highest level of operational confidentiality, ensuring the safety and integrity of sandboxed processes.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
@ -1501,21 +1467,58 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="2" colspan="2"> <item row="9" column="3">
<widget class="QCheckBox" name="chkLessConfidential"> <widget class="QCheckBox" name="chkShowHostProcTmpl">
<property name="text"> <property name="text">
<string>Allow useful Windows processes access to protected processes</string> <string>Show Templates</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1" colspan="3"> <item row="6" column="0" rowspan="5" colspan="3">
<widget class="QCheckBox" name="chkConfidential"> <widget class="QTreeWidget" name="treeHostProc">
<property name="sortingEnabled">
<bool>true</bool>
</property>
<column>
<property name="text"> <property name="text">
<string>Protect processes within this box from host processes</string> <string>Process</string>
</property>
</column>
<column>
<property name="text">
<string>Action</string>
</property>
</column>
<column>
<property name="text">
<string/>
</property>
</column>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="lblBoxProtection">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
<kerning>true</kerning>
</font>
</property>
<property name="toolTip">
<string>Protect the sandbox integrity itself</string>
</property>
<property name="text">
<string>Box Protection</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout> <item row="4" column="1" colspan="2">
<widget class="QCheckBox" name="chkProtectWindow">
<property name="text">
<string>Prevents getting an image of the window in the sandbox.</string>
</property>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>
@ -4505,7 +4508,7 @@ instead of &quot;*&quot;.</string>
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>92</width> <width>75</width>
<height>16</height> <height>16</height>
</rect> </rect>
</property> </property>

View File

@ -65,43 +65,6 @@
<string>General Options</string> <string>General Options</string>
</attribute> </attribute>
<layout class="QGridLayout" name="gridLayout_8"> <layout class="QGridLayout" name="gridLayout_8">
<item row="0" column="0">
<widget class="QLabel" name="lblGeneral">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
<kerning>true</kerning>
</font>
</property>
<property name="text">
<string>SandMan Options</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_19">
<property name="text">
<string>UI Language:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="uiLang"/>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="chkSandboxUrls">
<property name="text">
<string>Open urls from this ui sandboxed</string>
</property>
<property name="tristate">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="1" colspan="2"> <item row="3" column="1" colspan="2">
<widget class="QCheckBox" name="chkMonitorSize"> <widget class="QCheckBox" name="chkMonitorSize">
<property name="text"> <property name="text">
@ -109,48 +72,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QCheckBox" name="chkPanic">
<property name="text">
<string>Hotkey for terminating all boxed processes:</string>
</property>
</widget>
</item>
<item>
<widget class="QKeySequenceEdit" name="keyPanic"/>
</item>
</layout>
</item>
<item row="5" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QCheckBox" name="chkTop">
<property name="text">
<string>Hotkey for bringing sandman to the top:</string>
</property>
</widget>
</item>
<item>
<widget class="QKeySequenceEdit" name="keyTop"/>
</item>
</layout>
</item>
<item row="6" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QCheckBox" name="chkPauseForce">
<property name="text">
<string>Hotkey for suspending process/folder forcing:</string>
</property>
</widget>
</item>
<item>
<widget class="QKeySequenceEdit" name="keyPauseForce"/>
</item>
</layout>
</item>
<item row="7" column="1" colspan="2"> <item row="7" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<item> <item>
@ -165,13 +86,90 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="8" column="1" colspan="2"> <item row="13" column="1">
<widget class="QCheckBox" name="chkAsyncBoxOps"> <spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>84</height>
</size>
</property>
</spacer>
</item>
<item row="13" column="2">
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>195</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="12" column="3" rowspan="2">
<spacer name="horizontalSpacer_14">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QCheckBox" name="chkPanic">
<property name="text"> <property name="text">
<string>Run box operations asynchronously whenever possible (like content deletion)</string> <string>Hotkey for terminating all boxed processes:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QKeySequenceEdit" name="keyPanic"/>
</item>
</layout>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="uiLang"/>
</item>
<item row="0" column="0">
<widget class="QLabel" name="lblGeneral">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
<kerning>true</kerning>
</font>
</property>
<property name="text">
<string>SandMan Options</string>
</property>
</widget>
</item>
<item row="5" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QCheckBox" name="chkTop">
<property name="text">
<string>Hotkey for bringing sandman to the top:</string>
</property>
</widget>
</item>
<item>
<widget class="QKeySequenceEdit" name="keyTop"/>
</item>
</layout>
</item>
<item row="9" column="0"> <item row="9" column="0">
<widget class="QLabel" name="lblRecovery"> <widget class="QLabel" name="lblRecovery">
<property name="font"> <property name="font">
@ -186,58 +184,74 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="10" column="1" colspan="2"> <item row="2" column="1">
<widget class="QCheckBox" name="chkSandboxUrls">
<property name="text">
<string>Open urls from this ui sandboxed</string>
</property>
<property name="tristate">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_19">
<property name="text">
<string>UI Language:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="6" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QCheckBox" name="chkPauseForce">
<property name="text">
<string>Hotkey for suspending process/folder forcing:</string>
</property>
</widget>
</item>
<item>
<widget class="QKeySequenceEdit" name="keyPauseForce"/>
</item>
</layout>
</item>
<item row="11" column="1">
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QCheckBox" name="chkShowRecovery"> <widget class="QCheckBox" name="chkShowRecovery">
<property name="text"> <property name="text">
<string>Show file recovery window when emptying sandboxes</string> <string>Show file recovery window when emptying sandboxes</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="11" column="1"> <item>
<widget class="QCheckBox" name="chkCheckDelete">
<property name="text">
<string>Check sandboxes' auto-delete status when Sandman starts</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chkRecoveryTop"> <widget class="QCheckBox" name="chkRecoveryTop">
<property name="text"> <property name="text">
<string>Show the Recovery Window as Always on Top</string> <string>Show the Recovery Window as Always on Top</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="11" column="3" rowspan="2"> </layout>
<spacer name="horizontalSpacer_14">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item> </item>
<item row="12" column="1"> <item row="8" column="1" colspan="2">
<spacer name="verticalSpacer_4"> <widget class="QCheckBox" name="chkAsyncBoxOps">
<property name="orientation"> <property name="text">
<enum>Qt::Vertical</enum> <string>Run box operations asynchronously whenever possible (like content deletion)</string>
</property> </property>
<property name="sizeHint" stdset="0"> </widget>
<size>
<width>20</width>
<height>84</height>
</size>
</property>
</spacer>
</item>
<item row="12" column="2">
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>195</width>
<height>20</height>
</size>
</property>
</spacer>
</item> </item>
</layout> </layout>
</widget> </widget>

View File

@ -507,6 +507,7 @@ void CSandMan::CreateMenus(bool bAdvanced)
m_pNewBox = m_pMenuFile->addAction(CSandMan::GetIcon("NewBox"), tr("Create New Box"), this, SLOT(OnSandBoxAction())); m_pNewBox = m_pMenuFile->addAction(CSandMan::GetIcon("NewBox"), tr("Create New Box"), this, SLOT(OnSandBoxAction()));
m_pNewGroup = m_pMenuFile->addAction(CSandMan::GetIcon("Group"), tr("Create Box Group"), this, SLOT(OnSandBoxAction())); m_pNewGroup = m_pMenuFile->addAction(CSandMan::GetIcon("Group"), tr("Create Box Group"), this, SLOT(OnSandBoxAction()));
m_pImportBox = m_pMenuFile->addAction(CSandMan::GetIcon("UnPackBox"), tr("Import Box"), this, SLOT(OnSandBoxAction())); m_pImportBox = m_pMenuFile->addAction(CSandMan::GetIcon("UnPackBox"), tr("Import Box"), this, SLOT(OnSandBoxAction()));
m_pImportBox->setEnabled(CArchive::IsInit()); m_pImportBox->setEnabled(CArchive::IsInit());
m_pMenuFile->addSeparator(); m_pMenuFile->addSeparator();
m_pRunBoxed = m_pMenuFile->addAction(CSandMan::GetIcon("Run"), tr("Run Sandboxed"), this, SLOT(OnSandBoxAction())); m_pRunBoxed = m_pMenuFile->addAction(CSandMan::GetIcon("Run"), tr("Run Sandboxed"), this, SLOT(OnSandBoxAction()));
@ -537,6 +538,7 @@ void CSandMan::CreateMenus(bool bAdvanced)
} }
m_pMenuFile->addSeparator(); m_pMenuFile->addSeparator();
m_pRestart = m_pMenuFile->addAction(CSandMan::GetIcon("Exit"), tr("Restart As Admin"), this, SLOT(OnRestartAsAdmin()));
m_pExit = m_pMenuFile->addAction(CSandMan::GetIcon("Exit"), tr("Exit"), this, SLOT(OnExit())); m_pExit = m_pMenuFile->addAction(CSandMan::GetIcon("Exit"), tr("Exit"), this, SLOT(OnExit()));
@ -691,7 +693,7 @@ void CSandMan::CreateOldMenus()
m_pSetupWizard = NULL; m_pSetupWizard = NULL;
//m_pUpdateCore = NULL; //m_pUpdateCore = NULL;
} }
m_pRestart = m_pMenuFile->addAction(CSandMan::GetIcon("Exit"), tr("Restart As Admin"), this, SLOT(OnRestartAsAdmin()));
m_pExit = m_pMenuFile->addAction(CSandMan::GetIcon("Exit"), tr("Exit"), this, SLOT(OnExit())); m_pExit = m_pMenuFile->addAction(CSandMan::GetIcon("Exit"), tr("Exit"), this, SLOT(OnExit()));
m_pMenuView = m_pMenuBar->addMenu(tr("&View")); m_pMenuView = m_pMenuBar->addMenu(tr("&View"));
@ -862,6 +864,7 @@ QList<ToolBarAction> CSandMan::GetAvailableToolBarActions()
ToolBarAction{ "CheckForUpdates", m_pUpdate }, ToolBarAction{ "CheckForUpdates", m_pUpdate },
ToolBarAction{ "About", m_pAbout }, ToolBarAction{ "About", m_pAbout },
ToolBarAction{ "", nullptr }, // separator ToolBarAction{ "", nullptr }, // separator
ToolBarAction{ "RestartAsAdmin", m_pRestart },
ToolBarAction{ "Exit", m_pExit }, ToolBarAction{ "Exit", m_pExit },
ToolBarAction{ "", nullptr }, // separator ToolBarAction{ "", nullptr }, // separator
ToolBarAction{ "Contribute", m_pContribution } ToolBarAction{ "Contribute", m_pContribution }
@ -1296,7 +1299,20 @@ void CSandMan::CheckForUpdates(bool bManual)
} }
#include "SandManTray.cpp" #include "SandManTray.cpp"
void CSandMan::OnRestartAsAdmin() {
theAPI->Disconnect();
WCHAR buf[255] = { 0 };
GetModuleFileNameW(NULL, buf, 255);
SHELLEXECUTEINFO se;
memset(&se, 0, sizeof(SHELLEXECUTEINFO));
se.cbSize = sizeof(SHELLEXECUTEINFO);
se.lpVerb = L"runas";
se.lpFile = buf;
se.nShow = SW_HIDE;
se.fMask = 0;
ShellExecuteEx(&se);
OnExit();
}
void CSandMan::OnExit() void CSandMan::OnExit()
{ {
m_bExit = true; m_bExit = true;
@ -2661,8 +2677,11 @@ void CSandMan::OnHotKey(size_t id)
case HK_SUSPEND: case HK_SUSPEND:
{ {
for (auto each : theAPI->GetAllBoxes())
each->SetSuspendedAll(TRUE); for (auto each : theAPI->GetAllBoxes().toStdMap()) {
each.second->SetSuspendedAll(TRUE);
}
break; break;
} }

View File

@ -279,6 +279,8 @@ private slots:
void CheckForUpdates(bool bManual = true); void CheckForUpdates(bool bManual = true);
void OnRestartAsAdmin();
void OnExit(); void OnExit();
void OnHelp(); void OnHelp();
void OnAbout(); void OnAbout();
@ -366,6 +368,7 @@ private:
QHBoxLayout* m_pMenuLayout; QHBoxLayout* m_pMenuLayout;
QMenu* m_pMenuFile; QMenu* m_pMenuFile;
QAction* m_pRestart;
QAction* m_pRunBoxed; QAction* m_pRunBoxed;
QAction* m_pNewBox; QAction* m_pNewBox;
QAction* m_pNewGroup; QAction* m_pNewGroup;

View File

@ -104,6 +104,7 @@ void COptionsWindow::CreateAdvanced()
connect(ui.chkShowHostProcTmpl, SIGNAL(clicked(bool)), this, SLOT(OnShowHostProcTmpl())); connect(ui.chkShowHostProcTmpl, SIGNAL(clicked(bool)), this, SLOT(OnShowHostProcTmpl()));
connect(ui.chkConfidential, SIGNAL(clicked(bool)), this, SLOT(OnConfidentialChanged())); connect(ui.chkConfidential, SIGNAL(clicked(bool)), this, SLOT(OnConfidentialChanged()));
connect(ui.chkLessConfidential, SIGNAL(clicked(bool)), this, SLOT(OnLessConfidentialChanged())); connect(ui.chkLessConfidential, SIGNAL(clicked(bool)), this, SLOT(OnLessConfidentialChanged()));
connect(ui.chkProtectWindow, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged()));
connect(ui.chkNotifyProtect, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged())); connect(ui.chkNotifyProtect, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged()));
connect(ui.treeInjectDll, SIGNAL(itemChanged(QTreeWidgetItem *, int)), this, SLOT(OnToggleInjectDll(QTreeWidgetItem *, int))); connect(ui.treeInjectDll, SIGNAL(itemChanged(QTreeWidgetItem *, int)), this, SLOT(OnToggleInjectDll(QTreeWidgetItem *, int)));
@ -262,6 +263,7 @@ void COptionsWindow::LoadAdvanced()
ui.chkLessConfidential->setChecked(m_BoxTemplates.contains("LessConfidentialBox")); ui.chkLessConfidential->setChecked(m_BoxTemplates.contains("LessConfidentialBox"));
ui.chkNotifyProtect->setChecked(m_pBox->GetBool("NotifyBoxProtected", false)); ui.chkNotifyProtect->setChecked(m_pBox->GetBool("NotifyBoxProtected", false));
ui.chkProtectWindow->setChecked(m_pBox->GetBool("IsProtectScreen"));
QStringList Users = m_pBox->GetText("Enabled").split(","); QStringList Users = m_pBox->GetText("Enabled").split(",");
ui.lstUsers->clear(); ui.lstUsers->clear();
@ -465,6 +467,8 @@ void COptionsWindow::SaveAdvanced()
WriteAdvancedCheck(ui.chkConfidential, "ConfidentialBox", "y", ""); WriteAdvancedCheck(ui.chkConfidential, "ConfidentialBox", "y", "");
WriteAdvancedCheck(ui.chkNotifyProtect, "NotifyBoxProtected", "y", ""); WriteAdvancedCheck(ui.chkNotifyProtect, "NotifyBoxProtected", "y", "");
WriteAdvancedCheck(ui.chkProtectWindow, "IsProtectScreen", "y", "n");
QStringList Users; QStringList Users;
for (int i = 0; i < ui.lstUsers->count(); i++) for (int i = 0; i < ui.lstUsers->count(); i++)
Users.append(ui.lstUsers->item(i)->text()); Users.append(ui.lstUsers->item(i)->text());

View File

@ -313,6 +313,7 @@ CSettingsWindow::CSettingsWindow(QWidget* parent)
connect(ui.chkNotifyRecovery, SIGNAL(stateChanged(int)), this, SLOT(OnOptChanged())); connect(ui.chkNotifyRecovery, SIGNAL(stateChanged(int)), this, SLOT(OnOptChanged()));
connect(ui.chkShowRecovery, SIGNAL(stateChanged(int)), this, SLOT(OnOptChanged())); connect(ui.chkShowRecovery, SIGNAL(stateChanged(int)), this, SLOT(OnOptChanged()));
connect(ui.chkCheckDelete, SIGNAL(stateChanged(int)), this, SLOT(OnOptChanged()));
connect(ui.chkRecoveryTop, SIGNAL(stateChanged(int)), this, SLOT(OnOptChanged())); connect(ui.chkRecoveryTop, SIGNAL(stateChanged(int)), this, SLOT(OnOptChanged()));
// //
@ -908,6 +909,7 @@ void CSettingsWindow::LoadSettings()
ui.chkSandboxUrls->setCheckState(CSettingsWindow__Int2Chk(theConf->GetInt("Options/OpenUrlsSandboxed", 2))); ui.chkSandboxUrls->setCheckState(CSettingsWindow__Int2Chk(theConf->GetInt("Options/OpenUrlsSandboxed", 2)));
ui.chkShowRecovery->setChecked(theConf->GetBool("Options/ShowRecovery", false)); ui.chkShowRecovery->setChecked(theConf->GetBool("Options/ShowRecovery", false));
ui.chkCheckDelete->setChecked(!theConf->GetBool("Options/CleanUpOnStart", false));
ui.chkNotifyRecovery->setChecked(!theConf->GetBool("Options/InstantRecovery", true)); ui.chkNotifyRecovery->setChecked(!theConf->GetBool("Options/InstantRecovery", true));
ui.chkRecoveryTop->setChecked(theConf->GetBool("Options/RecoveryOnTop", true)); ui.chkRecoveryTop->setChecked(theConf->GetBool("Options/RecoveryOnTop", true));
ui.chkAsyncBoxOps->setChecked(theConf->GetBool("Options/UseAsyncBoxOps", false)); ui.chkAsyncBoxOps->setChecked(theConf->GetBool("Options/UseAsyncBoxOps", false));
@ -1558,6 +1560,8 @@ void CSettingsWindow::SaveSettings()
theConf->SetValue("Options/EnableSuspendKey", ui.chkSuspend->isChecked()); theConf->SetValue("Options/EnableSuspendKey", ui.chkSuspend->isChecked());
theConf->SetValue("Options/SuspendKeySequence", ui.keySuspend->keySequence().toString()); theConf->SetValue("Options/SuspendKeySequence", ui.keySuspend->keySequence().toString());
theConf->SetValue("Options/CleanUpOnStart", !ui.chkCheckDelete->isChecked());
theConf->SetValue("Options/WatchBoxSize", ui.chkMonitorSize->isChecked()); theConf->SetValue("Options/WatchBoxSize", ui.chkMonitorSize->isChecked());
theConf->SetValue("Options/WatchIni", ui.chkWatchConfig->isChecked()); theConf->SetValue("Options/WatchIni", ui.chkWatchConfig->isChecked());