diff --git a/CHANGELOG.md b/CHANGELOG.md index bf0f7bf92b..cc5732a599 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ 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 @@ -19,7 +20,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### 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 diff --git a/SandboxiePlus/SandMan/Forms/SettingsWindow.ui b/SandboxiePlus/SandMan/Forms/SettingsWindow.ui index 8622586a87..c94de06ba2 100644 --- a/SandboxiePlus/SandMan/Forms/SettingsWindow.ui +++ b/SandboxiePlus/SandMan/Forms/SettingsWindow.ui @@ -397,7 +397,7 @@ - 1 + 0 @@ -406,66 +406,91 @@ - - - - - + + - Add 'Run Sandboxed' to the explorer context menu + Add 'Run Un-Sandboxed' to the context menu - - - - - true - true - - + + - Start Sandbox Manager + Start UI with Windows - - + + - Start UI when a sandboxed process is started + Integrate with Host Start Menu + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true - - + + - Add 'Run Un-Sandboxed' to the context menu + Scan shell folders and offer links in run menu - - + + + + + true + true + + - Always use DefaultBox + Start Menu Integration - - + + + + Qt::Vertical + + + + 20 + 0 + + + + + + + + + - Start UI with Windows + Add 'Run Sandboxed' to the explorer context menu - - + + + + + true + true + + - Scan shell folders and offer links in run menu + Start Sandbox Manager - - + + Qt::Horizontal @@ -503,21 +528,15 @@ - - - - - true - true - - + + - Start Menu Integration + Always use DefaultBox - - + + Qt::Horizontal @@ -529,33 +548,7 @@ - - - - Integrate with Host Start Menu - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - - - - - Qt::Vertical - - - - 20 - 0 - - - - - + Qt::Horizontal @@ -568,6 +561,29 @@ + + + + Start UI when a sandboxed process is started + + + + + + + + + + Integrate with Host Desktop + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + diff --git a/SandboxiePlus/SandMan/SandMan.cpp b/SandboxiePlus/SandMan/SandMan.cpp index 2df7e9e05f..cf10473485 100644 --- a/SandboxiePlus/SandMan/SandMan.cpp +++ b/SandboxiePlus/SandMan/SandMan.cpp @@ -1967,9 +1967,9 @@ void CSandMan::OnBoxAdded(const CSandBoxPtr& pBox) void CSandMan::EnumBoxLinks(QMap > &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); @@ -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 > BoxLinks; @@ -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") @@ -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) { @@ -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); } } diff --git a/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp b/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp index 5ccc40d565..27952de463 100644 --- a/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp +++ b/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp @@ -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")); @@ -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())); @@ -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)); @@ -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());