prep-work for adding auto updates option
This commit is contained in:
parent
56174d8003
commit
48ef43f31e
4 changed files with 26 additions and 0 deletions
|
@ -18,6 +18,7 @@ namespace WeeXnes.Core
|
||||||
public static string AppDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "WeeXnes");
|
public static string AppDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "WeeXnes");
|
||||||
public static UpdateVar<string> AppDataPathRPC = new UpdateVar<string>();
|
public static UpdateVar<string> AppDataPathRPC = new UpdateVar<string>();
|
||||||
public static UpdateVar<string> AppDataPathKEY = new UpdateVar<string>();
|
public static UpdateVar<string> AppDataPathKEY = new UpdateVar<string>();
|
||||||
|
public static UpdateVar<bool> checkUpdateOnStartup = new UpdateVar<bool>();
|
||||||
public static string SettingsFile = "settings.ini";
|
public static string SettingsFile = "settings.ini";
|
||||||
public class Defaults
|
public class Defaults
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,6 +18,7 @@ namespace WeeXnes.Core
|
||||||
public const string Section = "GENERAL";
|
public const string Section = "GENERAL";
|
||||||
public const string RpcFilesPath = "RpcFilesPath";
|
public const string RpcFilesPath = "RpcFilesPath";
|
||||||
public const string KeyFilesPath = "KeyFilesPath";
|
public const string KeyFilesPath = "KeyFilesPath";
|
||||||
|
public const string StartupUpdateCheck = "StartupUpdateCheck";
|
||||||
}
|
}
|
||||||
public static class KeyManager
|
public static class KeyManager
|
||||||
{
|
{
|
||||||
|
@ -87,6 +88,14 @@ namespace WeeXnes.Core
|
||||||
Global.AppDataPathKEY.Value
|
Global.AppDataPathKEY.Value
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Global.checkUpdateOnStartup.ValueChanged += () =>
|
||||||
|
{
|
||||||
|
SettingsView.Data.settingsFile.SetValue(
|
||||||
|
Data.General.Section,
|
||||||
|
Data.General.StartupUpdateCheck,
|
||||||
|
Global.checkUpdateOnStartup.Value.ToString()
|
||||||
|
);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -114,6 +114,11 @@
|
||||||
|
|
||||||
<StackPanel Orientation="Vertical" Visibility="Collapsed" Name="DebugOptions">
|
<StackPanel Orientation="Vertical" Visibility="Collapsed" Name="DebugOptions">
|
||||||
<Label Content="Debug" HorizontalAlignment="Center"/>
|
<Label Content="Debug" HorizontalAlignment="Center"/>
|
||||||
|
|
||||||
|
<CheckBox Content="Check for updates on Startup"
|
||||||
|
Name="CheckboxAutoUpdate"
|
||||||
|
Checked="CheckboxAutoUpdate_OnChecked"
|
||||||
|
Unchecked="CheckboxAutoUpdate_OnUnchecked"/>
|
||||||
<ui:CardAction Icon="ErrorCircle24"
|
<ui:CardAction Icon="ErrorCircle24"
|
||||||
Click="dbg_throwException">
|
Click="dbg_throwException">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
|
|
|
@ -51,6 +51,17 @@ namespace WeeXnes.Views.Settings
|
||||||
KeyManagerView.Data.censorKeys.Value = false;
|
KeyManagerView.Data.censorKeys.Value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void CheckboxAutoUpdate_OnChecked(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
Global.checkUpdateOnStartup.Value = true;
|
||||||
|
}
|
||||||
|
private void CheckboxAutoUpdate_OnUnchecked(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
Global.checkUpdateOnStartup.Value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void ButtonCheckForUpdates_OnClick(object sender, RoutedEventArgs e)
|
private void ButtonCheckForUpdates_OnClick(object sender, RoutedEventArgs e)
|
||||||
|
|
Loading…
Add table
Reference in a new issue