mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 20:57:22 +02:00
[OOBE]Add What's New page - SCOOBE (#16478)
* [Oobe]Add a What's New page * Show What's New when version changes * Add link to GitHub * Use generic icon for now * Get only the latest 5 releases * fix spellchecker * rename last_version_run.json * Remove UserControl_Loaded * Remove installer hash from the release notes * constexpr some strings * Add check your internet connection message
This commit is contained in:
@@ -18,6 +18,8 @@ namespace PowerToys.Settings
|
||||
|
||||
public bool ShowOobe { get; set; }
|
||||
|
||||
public bool ShowScoobe { get; set; }
|
||||
|
||||
public Type StartupPage { get; set; } = typeof(Microsoft.PowerToys.Settings.UI.Views.GeneralPage);
|
||||
|
||||
public void OpenSettingsWindow(Type type)
|
||||
@@ -45,7 +47,7 @@ namespace PowerToys.Settings
|
||||
|
||||
private void Application_Startup(object sender, StartupEventArgs e)
|
||||
{
|
||||
if (!ShowOobe)
|
||||
if (!ShowOobe && !ShowScoobe)
|
||||
{
|
||||
settingsWindow = new MainWindow();
|
||||
settingsWindow.Show();
|
||||
@@ -53,15 +55,22 @@ namespace PowerToys.Settings
|
||||
}
|
||||
else
|
||||
{
|
||||
PowerToysTelemetry.Log.WriteEvent(new OobeStartedEvent());
|
||||
|
||||
// Create the Settings window so that it's fully initialized and
|
||||
// it will be ready to receive the notification if the user opens
|
||||
// the Settings from the tray icon.
|
||||
InitHiddenSettingsWindow();
|
||||
|
||||
OobeWindow oobeWindow = new OobeWindow();
|
||||
oobeWindow.Show();
|
||||
if (ShowOobe)
|
||||
{
|
||||
PowerToysTelemetry.Log.WriteEvent(new OobeStartedEvent());
|
||||
OobeWindow oobeWindow = new OobeWindow((int)Microsoft.PowerToys.Settings.UI.OOBE.Enums.PowerToysModulesEnum.Overview);
|
||||
oobeWindow.Show();
|
||||
}
|
||||
else if (ShowScoobe)
|
||||
{
|
||||
PowerToysTelemetry.Log.WriteEvent(new ScoobeStartedEvent());
|
||||
OobeWindow scoobeWindow = new OobeWindow((int)Microsoft.PowerToys.Settings.UI.OOBE.Enums.PowerToysModulesEnum.WhatsNew);
|
||||
scoobeWindow.Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ namespace PowerToys.Settings
|
||||
// open oobe
|
||||
ShellPage.SetOpenOobeCallback(() =>
|
||||
{
|
||||
var oobe = new OobeWindow();
|
||||
var oobe = new OobeWindow((int)Microsoft.PowerToys.Settings.UI.OOBE.Enums.PowerToysModulesEnum.Overview);
|
||||
oobe.Show();
|
||||
});
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ namespace PowerToys.Settings
|
||||
{
|
||||
private static Window inst;
|
||||
private OobeShellPage shellPage;
|
||||
private int initialModule;
|
||||
|
||||
public static bool IsOpened
|
||||
{
|
||||
@@ -29,10 +30,11 @@ namespace PowerToys.Settings
|
||||
}
|
||||
}
|
||||
|
||||
public OobeWindow()
|
||||
public OobeWindow(int initialModule)
|
||||
{
|
||||
InitializeComponent();
|
||||
Utils.FitToScreen(this);
|
||||
this.initialModule = initialModule;
|
||||
|
||||
ResourceLoader loader = ResourceLoader.GetForViewIndependentUse();
|
||||
Title = loader.GetString("OobeWindow_Title");
|
||||
@@ -69,6 +71,11 @@ namespace PowerToys.Settings
|
||||
WindowsXamlHost windowsXamlHost = sender as WindowsXamlHost;
|
||||
shellPage = windowsXamlHost.GetUwpInternalObject() as OobeShellPage;
|
||||
|
||||
if (shellPage != null)
|
||||
{
|
||||
shellPage.NavigateToModule(initialModule);
|
||||
}
|
||||
|
||||
OobeShellPage.SetRunSharedEventCallback(() =>
|
||||
{
|
||||
return Constants.PowerLauncherSharedEvent();
|
||||
|
||||
@@ -21,12 +21,13 @@ namespace PowerToys.Settings
|
||||
ElevatedStatus,
|
||||
IsUserAdmin,
|
||||
ShowOobeWindow,
|
||||
ShowScoobeWindow,
|
||||
SettingsWindow,
|
||||
}
|
||||
|
||||
// Quantity of arguments
|
||||
private const int RequiredArgumentsQty = 7;
|
||||
private const int RequiredAndOptionalArgumentsQty = 8;
|
||||
private const int RequiredArgumentsQty = 8;
|
||||
private const int RequiredAndOptionalArgumentsQty = 9;
|
||||
|
||||
// Create an instance of the IPC wrapper.
|
||||
private static TwoWayPipeMessageIPCManaged ipcmanager;
|
||||
@@ -55,6 +56,7 @@ namespace PowerToys.Settings
|
||||
IsElevated = args[(int)Arguments.ElevatedStatus] == "true";
|
||||
IsUserAnAdmin = args[(int)Arguments.IsUserAdmin] == "true";
|
||||
app.ShowOobe = args[(int)Arguments.ShowOobeWindow] == "true";
|
||||
app.ShowScoobe = args[(int)Arguments.ShowScoobeWindow] == "true";
|
||||
|
||||
if (args.Length == RequiredAndOptionalArgumentsQty)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user