From f589ac427f9dd4705c89c14671ba30d1675950de Mon Sep 17 00:00:00 2001 From: DavidXanatos Date: Fri, 1 Jul 2022 08:19:30 +0200 Subject: [PATCH] 1.2.1 --- SandboxiePlus/SandMan/Windows/SettingsWindow.cpp | 15 ++++++++++++--- SandboxiePlus/SandMan/Windows/SettingsWindow.h | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp b/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp index 23d5f4a4..f7e5b1e0 100644 --- a/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp +++ b/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp @@ -122,8 +122,17 @@ CSettingsWindow::CSettingsWindow(QWidget *parent) ui.uiLang->setCurrentIndex(ui.uiLang->findData(theConf->GetString("Options/UiLanguage"))); + QSettings settings("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", QSettings::NativeFormat); + if (settings.value("CurrentBuild").toInt() >= 22000) { // Windows 11 + QCheckBox* SecretCheckBox = new CSecretCheckBox(ui.chkShellMenu->text()); + ((QGridLayout*)((QWidget*)ui.chkShellMenu->parent())->layout())->replaceWidget(ui.chkShellMenu, SecretCheckBox); + ui.chkShellMenu->deleteLater(); + ui.chkShellMenu = SecretCheckBox; + } + LoadSettings(); - + + connect(ui.cmbSysTray, SIGNAL(currentIndexChanged(int)), this, SLOT(OnChange())); connect(ui.cmbTrayBoxes, SIGNAL(currentIndexChanged(int)), this, SLOT(OnChange())); connect(ui.cmbOnClose, SIGNAL(currentIndexChanged(int)), this, SLOT(OnChange())); @@ -231,10 +240,10 @@ Qt::CheckState CSettingsWindow__IsContextMenu() return Qt::Unchecked; // not set up } -void CSettingsWindow__AddContextMenu() +void CSettingsWindow__AddContextMenu(bool bAlwaysClassic) { QSettings settings("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", QSettings::NativeFormat); - if (settings.value("CurrentBuild").toInt() >= 22000) // Windows 11 + if (settings.value("CurrentBuild").toInt() >= 22000 && !bAlwaysClassic) // Windows 11 { QProcess Proc; Proc.execute("rundll32.exe", QStringList() << QCoreApplication::applicationDirPath().replace("/", "\\") + "\\SbieShellExt.dll,RegisterPackage"); diff --git a/SandboxiePlus/SandMan/Windows/SettingsWindow.h b/SandboxiePlus/SandMan/Windows/SettingsWindow.h index d16c1c76..308a3605 100644 --- a/SandboxiePlus/SandMan/Windows/SettingsWindow.h +++ b/SandboxiePlus/SandMan/Windows/SettingsWindow.h @@ -90,7 +90,7 @@ private: Ui::SettingsWindow ui; }; -void CSettingsWindow__AddContextMenu(); +void CSettingsWindow__AddContextMenu(bool bAlwaysClassic = false); void CSettingsWindow__RemoveContextMenu(); void CSettingsWindow__AddBrowserIcon();