diff --git a/WeeXnes/App.xaml.cs b/WeeXnes/App.xaml.cs
index c20cec4..383dc18 100644
--- a/WeeXnes/App.xaml.cs
+++ b/WeeXnes/App.xaml.cs
@@ -36,10 +36,6 @@ namespace WeeXnes
Convert.ToBoolean(SettingsView.Data.settingsFile.GetValue(
SaveSettingsHandler.Data.KeyManager.Section,
SaveSettingsHandler.Data.KeyManager.CensorKeys));
- SettingsView.Data.Autostart.Value =
- Convert.ToBoolean(SettingsView.Data.settingsFile.GetValue(
- SaveSettingsHandler.Data.General.Section,
- SaveSettingsHandler.Data.General.Autostart));
}
diff --git a/WeeXnes/Core/SaveSettingsHandler.cs b/WeeXnes/Core/SaveSettingsHandler.cs
index 7aa0a27..fa9e5b8 100644
--- a/WeeXnes/Core/SaveSettingsHandler.cs
+++ b/WeeXnes/Core/SaveSettingsHandler.cs
@@ -12,7 +12,6 @@ namespace WeeXnes.Core
public static class General
{
public const string Section = "GENERAL";
- public const string Autostart = "Autostart";
}
public static class KeyManager
{
@@ -43,14 +42,6 @@ namespace WeeXnes.Core
KeyManagerView.Data.censorKeys.Value.ToString()
);
};
- SettingsView.Data.Autostart.ValueChanged += () =>
- {
- SettingsView.Data.settingsFile.SetValue(
- Data.General.Section,
- Data.General.Autostart,
- SettingsView.Data.Autostart.Value.ToString()
- );
- };
}
}
}
\ No newline at end of file
diff --git a/WeeXnes/Views/Settings/SettingsView.xaml b/WeeXnes/Views/Settings/SettingsView.xaml
index c63844f..5459bcf 100644
--- a/WeeXnes/Views/Settings/SettingsView.xaml
+++ b/WeeXnes/Views/Settings/SettingsView.xaml
@@ -29,6 +29,18 @@
Name="DialogUpdate"
ButtonLeftClick="DialogUpdate_OnButtonLeftClick"
ButtonRightClick="DialogUpdate_OnButtonRightClick"/>
+
+
+
+
+
@@ -39,8 +51,15 @@
-
+
+
+
+
diff --git a/WeeXnes/Views/Settings/SettingsView.xaml.cs b/WeeXnes/Views/Settings/SettingsView.xaml.cs
index e2348bf..9a13b3d 100644
--- a/WeeXnes/Views/Settings/SettingsView.xaml.cs
+++ b/WeeXnes/Views/Settings/SettingsView.xaml.cs
@@ -18,7 +18,6 @@ namespace WeeXnes.Views.Settings
{
public static INIFile settingsFile = new INIFile(Global.AppDataPath + "\\" + Global.SettingsFile, true);
public static GithubApiResponse updateResponse = null;
- public static UpdateVar Autostart = new UpdateVar();
}
public SettingsView()
{
@@ -29,9 +28,6 @@ namespace WeeXnes.Views.Settings
private void LoadSettingsToGui()
{
CheckboxCensorKeys.IsChecked = KeyManagerView.Data.censorKeys.Value;
- CheckboxAutostartRpc.IsChecked = Data.Autostart.Value;
-
- SetCheckboxAutostartRpc();
}
private void CheckboxCensorKeys_OnChecked(object sender, RoutedEventArgs e)
{
@@ -104,70 +100,44 @@ namespace WeeXnes.Views.Settings
}
}
- void SetCheckboxAutostartRpc()
- {
- CheckboxAutostartRpc.Checked += CheckboxAutostartRpc_OnChecked;
- CheckboxAutostartRpc.Unchecked += CheckboxAutostartRpc_OnUnchecked;
- }
- void UnsetCheckboxAutostartRpc()
- {
- CheckboxAutostartRpc.Checked -= CheckboxAutostartRpc_OnChecked;
- CheckboxAutostartRpc.Unchecked -= CheckboxAutostartRpc_OnUnchecked;
- }
- void SwitchAutostartRpc(bool enable)
+ private void ButtonEnableRPC_OnClick(object sender, RoutedEventArgs e)
{
- UnsetCheckboxAutostartRpc();
-
-
- if (enable)
+ try
{
- bool proc_suc;
- try
- {
- Process uacpromp = Process.Start("WeeXnes_UAC.exe", "-EnableAutostart");
- uacpromp.WaitForExit();
- proc_suc = true;
- }
- catch (Exception ex)
- {
- Console.WriteLine(ex);
- proc_suc = false;
- }
-
- Data.Autostart.Value = proc_suc;
- CheckboxAutostartRpc.IsChecked = proc_suc;
+ Process uac_prompt = Process.Start("WeeXnes_UAC.exe", "-EnableAutostart");
+ uac_prompt.WaitForExit();
}
- else
+ catch (Exception ex)
{
- bool proc_suc;
- try
- {
- Process uacpromp = Process.Start("WeeXnes_UAC.exe", "-DisableAutostart");
- uacpromp.WaitForExit();
- proc_suc = true;
- }
- catch (Exception ex)
- {
- Console.WriteLine(ex);
- proc_suc = false;
- }
-
- Data.Autostart.Value = !proc_suc;
- CheckboxAutostartRpc.IsChecked = !proc_suc;
+ MessageBox.Show(ex.Message);
}
-
-
- SetCheckboxAutostartRpc();
- }
- private void CheckboxAutostartRpc_OnChecked(object sender, RoutedEventArgs e)
- {
- SwitchAutostartRpc(true);
}
- private void CheckboxAutostartRpc_OnUnchecked(object sender, RoutedEventArgs e)
+ private void ButtonDisableRPC_OnClick(object sender, RoutedEventArgs e)
{
- SwitchAutostartRpc(false);
+ try
+ {
+ Process uac_prompt = Process.Start("WeeXnes_UAC.exe", "-DisableAutostart");
+ uac_prompt.WaitForExit();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message);
+ }
+ }
+
+ private void ButtonCreateStartMenuShortcut_OnClick(object sender, RoutedEventArgs e)
+ {
+ try
+ {
+ Process p = Process.Start("WeeXnes_UAC.exe", "-CreateStartMenuShortcut");
+ p.WaitForExit();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message);
+ }
}
}
}
\ No newline at end of file