[Settings UI] Updated General Settings (#2676)

* updated general settings view

* moved text to string resource

* Update App.xaml.cs

* set run-elevated as a start-up argument
This commit is contained in:
Lavius Motileng
2020-05-05 10:02:31 -07:00
committed by GitHub
parent 67b2f28064
commit a722ce460c
11 changed files with 411 additions and 47 deletions

View File

@@ -31,6 +31,16 @@ namespace Microsoft.PowerToys.Settings.UI.Runner
{
Program.GetTwoWayIPCManager().Send(msg);
});
// send IPC Message
shellPage.SetRestartAdminSndMessageCallback(msg =>
{
Program.GetTwoWayIPCManager().Send(msg);
System.Windows.Application.Current.Shutdown(); // close application
});
shellPage.SetElevationStatus(Program.IsElevated);
shellPage.Refresh();
}
}
}

View File

@@ -5,6 +5,7 @@
using System;
using System.Windows;
using interop;
using Windows.UI.Popups;
namespace Microsoft.PowerToys.Settings.UI.Runner
{
@@ -13,6 +14,8 @@ namespace Microsoft.PowerToys.Settings.UI.Runner
// Create an instance of the IPC wrapper.
private static TwoWayPipeMessageIPCManaged ipcmanager;
public static bool IsElevated { get; set; }
[STAThread]
public static void Main(string[] args)
{
@@ -21,8 +24,17 @@ namespace Microsoft.PowerToys.Settings.UI.Runner
App app = new App();
app.InitializeComponent();
if (args.Length > 1)
if (args.Length > 3)
{
if (args[4] == "true")
{
IsElevated = true;
}
else
{
IsElevated = false;
}
ipcmanager = new TwoWayPipeMessageIPCManaged(args[1], args[0], null);
ipcmanager.Start();
app.Run();