mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 04:37:30 +02:00
User/lamotile/add powerrename settings (#1813)
* added powerrename settings * removed pop-up message * removed unused files * revrted changes to old settings * updated solution file * added ToJsonString() method * added JSON property for the powertoy name
This commit is contained in:
@@ -32,7 +32,7 @@ namespace Microsoft.PowerToys.Settings.UI.Views
|
||||
{
|
||||
this.InitializeComponent();
|
||||
}
|
||||
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
@@ -52,7 +52,7 @@ namespace Microsoft.PowerToys.Settings.UI.Views
|
||||
{
|
||||
// create settings file if one is not found.
|
||||
settings = new GeneralSettings();
|
||||
SettingsUtils.SaveSettings<GeneralSettings>(settings, string.Empty);
|
||||
SettingsUtils.SaveSettings(settings.ToJsonString(), string.Empty);
|
||||
// load and apply theme settings
|
||||
this.ReLoadTheme(settings.theme);
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace Microsoft.PowerToys.Settings.UI.Views
|
||||
break;
|
||||
}
|
||||
|
||||
SettingsUtils.SaveSettings<GeneralSettings>(settings, string.Empty);
|
||||
SettingsUtils.SaveSettings(settings.ToJsonString(), string.Empty);
|
||||
OutGoingGeneralSettings outsettings = new OutGoingGeneralSettings(settings);
|
||||
|
||||
if (ShellPage.Default_SndMSG_Callback != null)
|
||||
@@ -129,16 +129,16 @@ namespace Microsoft.PowerToys.Settings.UI.Views
|
||||
{
|
||||
RadioButton rb = sender as RadioButton;
|
||||
|
||||
//if (rb != null)
|
||||
//{
|
||||
// string themeName = rb.Tag.ToString();
|
||||
// this.ReLoadTheme(themeName);
|
||||
if (rb != null)
|
||||
{
|
||||
string themeName = rb.Tag.ToString();
|
||||
this.ReLoadTheme(themeName);
|
||||
|
||||
// // update and save settings to file.
|
||||
// GeneralSettings settings = SettingsUtils.GetSettings<GeneralSettings>(string.Empty);
|
||||
// settings.theme = themeName;
|
||||
// SettingsUtils.SaveSettings<GeneralSettings>(settings, string.Empty);
|
||||
//}
|
||||
// update and save settings to file.
|
||||
GeneralSettings settings = SettingsUtils.GetSettings<GeneralSettings>(string.Empty);
|
||||
settings.theme = themeName;
|
||||
SettingsUtils.SaveSettings(settings.ToJsonString(), string.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
private async void CheckForUpdates_Click(object sender, RoutedEventArgs e)
|
||||
@@ -146,4 +146,4 @@ namespace Microsoft.PowerToys.Settings.UI.Views
|
||||
await Launcher.LaunchUriAsync(new Uri("https://github.com/microsoft/PowerToys/releases"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user