mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-10 13:35:31 +02:00
[settings] Support launching settings app directly (#27881)
* Support launching settings app directly * Update src/settings-ui/Settings.UI/SettingsXAML/App.xaml.cs Co-authored-by: Davide Giacometti <davide.giacometti@outlook.it> * Update src/settings-ui/Settings.UI/SettingsXAML/App.xaml.cs Co-authored-by: Jaime Bernardo <jaime@janeasystems.com> --------- Co-authored-by: Davide Giacometti <davide.giacometti@outlook.it> Co-authored-by: Jaime Bernardo <jaime@janeasystems.com>
This commit is contained in:
@@ -7,6 +7,7 @@ using System.Diagnostics;
|
|||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Common.UI;
|
||||||
using interop;
|
using interop;
|
||||||
using ManagedCommon;
|
using ManagedCommon;
|
||||||
using Microsoft.PowerToys.Settings.UI.Helpers;
|
using Microsoft.PowerToys.Settings.UI.Helpers;
|
||||||
@@ -208,17 +209,18 @@ namespace Microsoft.PowerToys.Settings.UI
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#if DEBUG
|
||||||
// For debugging purposes
|
// For debugging purposes
|
||||||
// Window is also needed to show MessageDialog
|
// Window is also needed to show MessageDialog
|
||||||
settingsWindow = new MainWindow(isDark);
|
settingsWindow = new MainWindow(isDark);
|
||||||
settingsWindow.ExtendsContentIntoTitleBar = true;
|
settingsWindow.ExtendsContentIntoTitleBar = true;
|
||||||
settingsWindow.Activate();
|
settingsWindow.Activate();
|
||||||
settingsWindow.NavigateToSection(StartupPage);
|
settingsWindow.NavigateToSection(StartupPage);
|
||||||
|
ShowMessageDialog("The application is running in Debug mode.", "DEBUG");
|
||||||
#if !DEBUG
|
|
||||||
ShowMessageDialogAndExit("The application cannot be run as a standalone process. Please start the application through the runner.", "Forbidden");
|
|
||||||
#else
|
#else
|
||||||
ShowMessageDialog("The application cannot be run as a standalone process. Please start the application through the runner.", "Forbidden");
|
/* If we try to run Settings as a standalone app, it will start PowerToys.exe if not running and open Settings again through it in the General page. */
|
||||||
|
SettingsDeepLink.OpenSettings(SettingsDeepLink.SettingsWindow.Overview, true);
|
||||||
|
Exit();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user