Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#4171 #4174

Merged
Merged

#4171 #4174

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- added "HideDiskSerialNumber"(bool) return random value when applications tries to get disk serial number
- added option to get free 10 days evaluation certificates from the support settings page.
- The evaluation certificates are node lcoked to the HwID and for each HwID up to 3 certs can be requested.
- added "TerminateWhenExit"(bool,in Sandboxie-Plus.ini) to terminate all processes when Sandman exits for [#4171](https://github.com/sandboxie-plus/Sandboxie/issues/4171)
- added a question box to ask for Sandbox Import Location for [#4169](https://github.com/sandboxie-plus/Sandboxie/issues/4169)


Expand Down
220 changes: 115 additions & 105 deletions SandboxiePlus/SandMan/Forms/SettingsWindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<enum>QTabWidget::North</enum>
</property>
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="tabGeneral">
<attribute name="title">
Expand All @@ -65,65 +65,49 @@
<string>General Options</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_8">
<item row="3" column="1" colspan="2">
<widget class="QCheckBox" name="chkMonitorSize">
<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>Count and display the disk space occupied by each sandbox</string>
<string>SandMan Options</string>
</property>
</widget>
</item>
<item row="7" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QCheckBox" name="chkSuspend">
<property name="text">
<string>Hotkey for suspending all processes:</string>
</property>
</widget>
</item>
<item>
<widget class="QKeySequenceEdit" name="keySuspend"/>
</item>
</layout>
</item>
<item row="13" column="1">
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
<item row="1" column="0">
<widget class="QLabel" name="label_19">
<property name="text">
<string>UI Language:</string>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>84</height>
</size>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</spacer>
</widget>
</item>
<item row="13" column="2">
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<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="sizeHint" stdset="0">
<size>
<width>195</width>
<height>20</height>
</size>
<property name="tristate">
<bool>true</bool>
</property>
</spacer>
</widget>
</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>
<item row="3" column="1" colspan="2">
<widget class="QCheckBox" name="chkMonitorSize">
<property name="text">
<string>Count and display the disk space occupied by each sandbox</string>
</property>
</spacer>
</widget>
</item>
<item row="4" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_3">
Expand All @@ -139,23 +123,6 @@
</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>
Expand All @@ -170,40 +137,6 @@
</item>
</layout>
</item>
<item row="9" column="0">
<widget class="QLabel" name="lblRecovery">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
<kerning>true</kerning>
</font>
</property>
<property name="text">
<string>Recovery Options</string>
</property>
</widget>
</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="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>
Expand All @@ -218,6 +151,48 @@
</item>
</layout>
</item>
<item row="7" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QCheckBox" name="chkSuspend">
<property name="text">
<string>Hotkey for suspending all processes:</string>
</property>
</widget>
</item>
<item>
<widget class="QKeySequenceEdit" name="keySuspend"/>
</item>
</layout>
</item>
<item row="8" column="1" colspan="2">
<widget class="QCheckBox" name="chkAsyncBoxOps">
<property name="text">
<string>Run box operations asynchronously whenever possible (like content deletion)</string>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QCheckBox" name="chkAutoTerminate">
<property name="text">
<string>Terminate all boxed processes when Sandman exits</string>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="lblRecovery">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
<kerning>true</kerning>
</font>
</property>
<property name="text">
<string>Recovery Options</string>
</property>
</widget>
</item>
<item row="11" column="1">
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="bottomMargin">
Expand Down Expand Up @@ -246,12 +221,44 @@
</item>
</layout>
</item>
<item row="8" column="1" colspan="2">
<widget class="QCheckBox" name="chkAsyncBoxOps">
<property name="text">
<string>Run box operations asynchronously whenever possible (like content deletion)</string>
<item row="12" column="1">
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
<property name="sizeHint" stdset="0">
<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 row="12" column="3">
<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>
</layout>
</widget>
Expand Down Expand Up @@ -1601,6 +1608,7 @@
<widget class="QLabel" name="lblCertExp">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
<kerning>true</kerning>
</font>
Expand Down Expand Up @@ -1711,6 +1719,7 @@
<widget class="QLabel" name="lblCertGuide">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
<kerning>true</kerning>
</font>
Expand Down Expand Up @@ -2263,6 +2272,7 @@ Unlike the preview channel, it does not include untested, potentially breaking,
<widget class="QLabel" name="lblProtection">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
<kerning>true</kerning>
</font>
Expand Down
8 changes: 7 additions & 1 deletion SandboxiePlus/SandMan/SandMan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1315,12 +1315,18 @@ void CSandMan::OnRestartAsAdmin()
se.nShow = SW_HIDE;
se.fMask = 0;
ShellExecuteEx(&se);
OnExit();
m_bExit = true;
close();
}

void CSandMan::OnExit()
{
m_bExit = true;
if (theConf->GetBool("Options/TerminateWhenExit", false)) {
if (theAPI->IsConnected()) {
theAPI->TerminateAll(!theConf->GetBool("Options/ExceptWhenAutoTerminate", false));
}
}
close();
}

Expand Down
3 changes: 3 additions & 0 deletions SandboxiePlus/SandMan/Windows/SettingsWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ CSettingsWindow::CSettingsWindow(QWidget* parent)
connect(ui.uiLang, SIGNAL(currentIndexChanged(int)), this, SLOT(OnChangeGUI()));

connect(ui.chkSandboxUrls, SIGNAL(stateChanged(int)), this, SLOT(OnOptChanged()));
connect(ui.chkAutoTerminate, SIGNAL(stateChanged(int)), this, SLOT(OnOptChanged()));
connect(ui.chkMonitorSize, SIGNAL(stateChanged(int)), this, SLOT(OnOptChanged()));
connect(ui.chkPanic, SIGNAL(stateChanged(int)), this, SLOT(OnOptChanged()));
connect(ui.keyPanic, SIGNAL(keySequenceChanged(const QKeySequence &)), this, SLOT(OnOptChanged()));
Expand Down Expand Up @@ -937,6 +938,7 @@ void CSettingsWindow::LoadSettings()
ui.chkNoMessages->setChecked(!theConf->GetBool("Options/ShowNotifications", true));

ui.chkSandboxUrls->setCheckState(CSettingsWindow__Int2Chk(theConf->GetInt("Options/OpenUrlsSandboxed", 2)));
ui.chkAutoTerminate->setChecked(theConf->GetBool("Options/TerminateWhenExit"));

ui.chkShowRecovery->setChecked(theConf->GetBool("Options/ShowRecovery", false));
ui.chkCheckDelete->setChecked(theConf->GetBool("Options/CleanUpOnStart", false));
Expand Down Expand Up @@ -1711,6 +1713,7 @@ void CSettingsWindow::SaveSettings()
theConf->SetValue("Options/ShowNotifications", !ui.chkNoMessages->isChecked());

theConf->SetValue("Options/OpenUrlsSandboxed", CSettingsWindow__Chk2Int(ui.chkSandboxUrls->checkState()));
theConf->SetValue("Options/TerminateWhenExit", ui.chkAutoTerminate->isChecked());

theConf->SetValue("Options/ShowRecovery", ui.chkShowRecovery->isChecked());
theConf->SetValue("Options/InstantRecovery", !ui.chkNotifyRecovery->isChecked());
Expand Down