Skip to content

Commit

Permalink
Merge branch 'sandboxie-plus:master' into langupdt007
Browse files Browse the repository at this point in the history
  • Loading branch information
offhub authored Sep 2, 2023
2 parents 20f8b2e + dffb578 commit 2c99883
Show file tree
Hide file tree
Showing 4 changed files with 119 additions and 86 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- added an option to terminate the UI by clicking close button [#3253](https://github.com/sandboxie-plus/Sandboxie/issues/3253)
- added an option to restore Sandboxie that is minimized to the System Tray with a single click [#3251](https://github.com/sandboxie-plus/Sandboxie/issues/3251)
- added an option to minimize Sandboxie to the System Tray by clicking minimize button [3252](https://github.com/sandboxie-plus/Sandboxie/issues/3252)
- added an independent desktop integration setting [#3246](https://github.com/sandboxie-plus/Sandboxie/issues/3246)

### Changed
- moved tray option to an own tab
- repalced some graphics with better compressed once (thanks idealths)

### Fixed
- fixed subscription certificate recognition issue

- fixed Side logo cut-off in the About window [#3249](https://github.com/sandboxie-plus/Sandboxie/issues/3249)


## [1.11.1 / 5.66.1] - 2023-08-31
Expand Down
158 changes: 87 additions & 71 deletions SandboxiePlus/SandMan/Forms/SettingsWindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@
<item row="0" column="0">
<widget class="QTabWidget" name="tabsShell">
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="tabWindows">
<attribute name="title">
Expand All @@ -406,66 +406,91 @@
<layout class="QGridLayout" name="gridLayout_30">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_13">
<item row="9" column="2">
<widget class="QComboBox" name="cmbIntegrateMenu"/>
</item>
<item row="4" column="1" colspan="3">
<widget class="QCheckBox" name="chkShellMenu">
<item row="6" column="2" colspan="3">
<widget class="QCheckBox" name="chkShellMenu2">
<property name="text">
<string>Add 'Run Sandboxed' to the explorer context menu</string>
<string>Add 'Run Un-Sandboxed' to the context menu</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="lblStartUp">
<property name="font">
<font>
<bold>true</bold>
<kerning>true</kerning>
</font>
</property>
<item row="1" column="1" colspan="3">
<widget class="QCheckBox" name="chkAutoStart">
<property name="text">
<string>Start Sandbox Manager</string>
<string>Start UI with Windows</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="3">
<widget class="QCheckBox" name="chkSvcStart">
<item row="9" column="0" colspan="2">
<widget class="QLabel" name="label_22">
<property name="text">
<string>Start UI when a sandboxed process is started</string>
<string>Integrate with Host Start Menu</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="6" column="2" colspan="3">
<widget class="QCheckBox" name="chkShellMenu2">
<item row="8" column="1" colspan="3">
<widget class="QCheckBox" name="chkScanMenu">
<property name="text">
<string>Add 'Run Un-Sandboxed' to the context menu</string>
<string>Scan shell folders and offer links in run menu</string>
</property>
</widget>
</item>
<item row="5" column="2" colspan="3">
<widget class="QCheckBox" name="chkAlwaysDefault">
<item row="7" column="0">
<widget class="QLabel" name="lblStartMenu">
<property name="font">
<font>
<bold>true</bold>
<kerning>true</kerning>
</font>
</property>
<property name="text">
<string>Always use DefaultBox</string>
<string>Start Menu Integration</string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="3">
<widget class="QCheckBox" name="chkAutoStart">
<item row="11" column="1">
<spacer name="verticalSpacer_6">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item row="9" column="2">
<widget class="QComboBox" name="cmbIntegrateMenu"/>
</item>
<item row="4" column="1" colspan="3">
<widget class="QCheckBox" name="chkShellMenu">
<property name="text">
<string>Start UI with Windows</string>
<string>Add 'Run Sandboxed' to the explorer context menu</string>
</property>
</widget>
</item>
<item row="8" column="1" colspan="3">
<widget class="QCheckBox" name="chkScanMenu">
<item row="0" column="0">
<widget class="QLabel" name="lblStartUp">
<property name="font">
<font>
<bold>true</bold>
<kerning>true</kerning>
</font>
</property>
<property name="text">
<string>Scan shell folders and offer links in run menu</string>
<string>Start Sandbox Manager</string>
</property>
</widget>
</item>
<item row="3" column="2">
<spacer name="horizontalSpacer_9">
<item row="3" column="3">
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
Expand Down Expand Up @@ -503,21 +528,15 @@
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="lblStartMenu">
<property name="font">
<font>
<bold>true</bold>
<kerning>true</kerning>
</font>
</property>
<item row="5" column="2" colspan="3">
<widget class="QCheckBox" name="chkAlwaysDefault">
<property name="text">
<string>Start Menu Integration</string>
<string>Always use DefaultBox</string>
</property>
</widget>
</item>
<item row="3" column="3">
<spacer name="horizontalSpacer_6">
<item row="3" column="2">
<spacer name="horizontalSpacer_9">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
Expand All @@ -529,33 +548,7 @@
</property>
</spacer>
</item>
<item row="9" column="0" colspan="2">
<widget class="QLabel" name="label_22">
<property name="text">
<string>Integrate with Host Start Menu</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="10" column="1">
<spacer name="verticalSpacer_6">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item row="10" column="3" colspan="2">
<item row="11" column="3" colspan="2">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
Expand All @@ -568,6 +561,29 @@
</property>
</spacer>
</item>
<item row="2" column="1" colspan="3">
<widget class="QCheckBox" name="chkSvcStart">
<property name="text">
<string>Start UI when a sandboxed process is started</string>
</property>
</widget>
</item>
<item row="10" column="2">
<widget class="QComboBox" name="cmbIntegrateDesk"/>
</item>
<item row="10" column="0" colspan="2">
<widget class="QLabel" name="label_29">
<property name="text">
<string>Integrate with Host Desktop</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
Expand Down
24 changes: 17 additions & 7 deletions SandboxiePlus/SandMan/SandMan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1967,9 +1967,9 @@ void CSandMan::OnBoxAdded(const CSandBoxPtr& pBox)

void CSandMan::EnumBoxLinks(QMap<QString, QMap<QString,SBoxLink> > &BoxLinks, const QString& Prefix, const QString& Folder, bool bWithSubDirs)
{
QRegularExpression exp("/\\[[0-9Sa-zA-Z_]+\\] ");
QRegularExpression exp("(^|/)\\[[0-9Sa-zA-Z_]+\\] ");

QStringList Files = ListDir(Folder, QStringList() << "*.lnk" << "*.url" << "*.pif", bWithSubDirs);
QStringList Files = ListDir(Folder, QStringList() << "*.lnk" << "*.url", bWithSubDirs);
foreach(QString File, Files)
{
auto result = exp.match(File);
Expand Down Expand Up @@ -2050,8 +2050,9 @@ void CSandMan::SyncStartMenu()
{
m_StartMenuUpdatePending = false;

int Mode = theConf->GetInt("Options/IntegrateStartMenu", 0);
if (Mode == 0)
int MenuMode = theConf->GetInt("Options/IntegrateStartMenu", 0);
int DeskMode = theConf->GetInt("Options/IntegrateDesktop", 0);
if (MenuMode == 0 && DeskMode == 0)
return;

QMap<QString, QMap<QString, SBoxLink> > BoxLinks;
Expand All @@ -2070,6 +2071,15 @@ void CSandMan::SyncStartMenu()
QString Location;
QString Prefix;
StrPair LocPath = Split2(Link.Folder, "/");

int Mode = 0;
if (LocPath.first == "Programs")
Mode = MenuMode;
else if (LocPath.first == "Desktop")
Mode = DeskMode;
if (!Mode)
continue;

if (Mode == 2) // deep integration
{
if (LocPath.first == "Programs")
Expand Down Expand Up @@ -3995,9 +4005,9 @@ void CSandMan::OnAbout()
painter.setPen(CSettingsWindow::GetCertColor());

QString Type = CSettingsWindow::GetCertType();
//QSize TypeSize = QFontMetrics(painter.font()).size(Qt::TextSingleLine, Type);
QSize TypeSize = QFontMetrics(painter.font()).size(Qt::TextSingleLine, Type);
//painter.drawText((128 - TypeSize.width()) / 2, 128, TypeSize.width(), TypeSize.height(), 0, Type);
painter.drawText(0, 128 - 8, 128, 16, Qt::AlignHCenter, Type);
painter.drawText(0, 128 - 8, 128, TypeSize.height(), Qt::AlignHCenter, Type);

if (g_CertInfo.level != eCertMaxLevel && g_CertInfo.level != eCertStandard) {

Expand All @@ -4006,7 +4016,7 @@ void CSandMan::OnAbout()
painter.setPen(Qt::black);

QString Level = CSettingsWindow::GetCertLevel();
painter.drawText(0, 128 + 8, 120, 16, Qt::AlignRight, Level);
painter.drawText(0, 128 + 8, 120, TypeSize.height(), Qt::AlignRight, Level);
}
}

Expand Down
20 changes: 13 additions & 7 deletions SandboxiePlus/SandMan/Windows/SettingsWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ CSettingsWindow::CSettingsWindow(QWidget* parent)
ui.cmbIntegrateMenu->addItem(tr("As sub group"));
ui.cmbIntegrateMenu->addItem(tr("Fully integrate"));

ui.cmbIntegrateDesk->addItem(tr("Don't integrate links"));
ui.cmbIntegrateDesk->addItem(tr("As sub group"));
ui.cmbIntegrateDesk->addItem(tr("Fully integrate"));

ui.cmbSysTray->addItem(tr("Don't show any icon"));
ui.cmbSysTray->addItem(tr("Show Plus icon"));
ui.cmbSysTray->addItem(tr("Show Classic icon"));
Expand Down Expand Up @@ -314,8 +318,9 @@ CSettingsWindow::CSettingsWindow(QWidget* parent)
connect(ui.chkAlwaysDefault, SIGNAL(stateChanged(int)), this, SLOT(OnOptChanged()));
connect(ui.chkShellMenu2, SIGNAL(stateChanged(int)), this, SLOT(OnOptChanged()));

connect(ui.chkScanMenu, SIGNAL(stateChanged(int)), this, SLOT(OnChangeGUI()));
connect(ui.cmbIntegrateMenu, SIGNAL(currentIndexChanged(int)), this, SLOT(OnChangeGUI()));
connect(ui.chkScanMenu, SIGNAL(stateChanged(int)), this, SLOT(OnOptChanged()));
connect(ui.cmbIntegrateMenu, SIGNAL(currentIndexChanged(int)), this, SLOT(OnOptChanged()));
connect(ui.cmbIntegrateDesk, SIGNAL(currentIndexChanged(int)), this, SLOT(OnOptChanged()));

connect(ui.cmbSysTray, SIGNAL(currentIndexChanged(int)), this, SLOT(OnOptChanged()));
connect(ui.cmbTrayBoxes, SIGNAL(currentIndexChanged(int)), this, SLOT(OnOptChanged()));
Expand Down Expand Up @@ -902,6 +907,7 @@ void CSettingsWindow::LoadSettings()

ui.chkScanMenu->setChecked(theConf->GetBool("Options/ScanStartMenu", true));
ui.cmbIntegrateMenu->setCurrentIndex(theConf->GetInt("Options/IntegrateStartMenu", 0));
ui.cmbIntegrateDesk->setCurrentIndex(theConf->GetInt("Options/IntegrateDesktop", 0));

ui.cmbSysTray->setCurrentIndex(theConf->GetInt("Options/SysTrayIcon", 1));
ui.cmbTrayBoxes->setCurrentIndex(theConf->GetInt("Options/SysTrayFilter", 0));
Expand Down Expand Up @@ -1410,11 +1416,11 @@ void CSettingsWindow::SaveSettings()
theConf->SetValue("Options/ScanStartMenu", ui.chkScanMenu->isChecked());
int OldIntegrateStartMenu = theConf->GetInt("Options/IntegrateStartMenu", 0);
theConf->SetValue("Options/IntegrateStartMenu", ui.cmbIntegrateMenu->currentIndex());
if (ui.cmbIntegrateMenu->currentIndex() != OldIntegrateStartMenu) {
if (ui.cmbIntegrateMenu->currentIndex() == 0)
theGUI->ClearStartMenu();
else
theGUI->SyncStartMenu();
int OldIntegrateDesktop = theConf->GetInt("Options/IntegrateDesktop", 0);
theConf->SetValue("Options/IntegrateDesktop", ui.cmbIntegrateDesk->currentIndex());
if (ui.cmbIntegrateDesk->currentIndex() != OldIntegrateDesktop || ui.cmbIntegrateMenu->currentIndex() != OldIntegrateStartMenu) {
theGUI->ClearStartMenu();
theGUI->SyncStartMenu();
}

theConf->SetValue("Options/SysTrayIcon", ui.cmbSysTray->currentIndex());
Expand Down

0 comments on commit 2c99883

Please sign in to comment.