1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2026-03-24 10:18:47 +00:00

Fixed effects not realising they are active in the UI

This commit is contained in:
SpoinkyNL 2016-08-26 10:20:12 +02:00
parent 821726d376
commit 3256666f79
3 changed files with 20 additions and 7 deletions

View File

@ -97,9 +97,13 @@ namespace Artemis.Settings
else else
mgr.RemoveShortcutsForExecutable("Artemis.exe", ShortcutLocation.Startup); mgr.RemoveShortcutsForExecutable("Artemis.exe", ShortcutLocation.Startup);
} }
catch (FileNotFoundException)
{
// Ignored, only happens when running from VS
}
catch (DirectoryNotFoundException) catch (DirectoryNotFoundException)
{ {
// ignored, this'll only occur if Artemis isn't installed (ran from VS) // Ignored, only happens when running from VS
} }
} }

View File

@ -24,19 +24,22 @@ namespace Artemis.Utilities
/// </summary> /// </summary>
public static async void UpdateApp() public static async void UpdateApp()
{ {
// Only update if the user allows it var settings = SettingsProvider.Load<GeneralSettings>();
if (SettingsProvider.Load<GeneralSettings>().AutoUpdate) Logger.Info("Update check enabled: {0}", settings.AutoUpdate);
return;
Logger.Info("Checking for updates..."); // Only update if the user allows it
if (!SettingsProvider.Load<GeneralSettings>().AutoUpdate)
return;
// Pre-release // Pre-release
using (var mgr = UpdateManager.GitHubUpdateManager("https://github.com/SpoinkyNL/Artemis", null, null, null, true)) // using (var mgr = UpdateManager.GitHubUpdateManager("https://github.com/SpoinkyNL/Artemis", null, null, null, true))
// Release // Release
// using (var mgr = UpdateManager.GitHubUpdateManager("https://github.com/SpoinkyNL/Artemis")) using (var mgr = UpdateManager.GitHubUpdateManager("https://github.com/SpoinkyNL/Artemis"))
{ {
try try
{ {
await mgr.Result.UpdateApp(); await mgr.Result.UpdateApp();
Logger.Info("Update check complete");
mgr.Result.Dispose(); mgr.Result.Dispose();
} }
catch (Exception e) catch (Exception e)

View File

@ -24,6 +24,7 @@ namespace Artemis.ViewModels.Abstract
EffectSettings = effectModel.Settings; EffectSettings = effectModel.Settings;
MainManager.OnEnabledChangedEvent += MainManagerOnOnEnabledChangedEvent; MainManager.OnEnabledChangedEvent += MainManagerOnOnEnabledChangedEvent;
MainManager.EffectManager.OnEffectChangedEvent += EffectManagerOnOnEffectChangedEvent;
} }
private void MainManagerOnOnEnabledChangedEvent(object sender, EnabledChangedEventArgs e) private void MainManagerOnOnEnabledChangedEvent(object sender, EnabledChangedEventArgs e)
@ -31,6 +32,11 @@ namespace Artemis.ViewModels.Abstract
NotifyOfPropertyChange(() => EffectEnabled); NotifyOfPropertyChange(() => EffectEnabled);
} }
private void EffectManagerOnOnEffectChangedEvent(object sender, EffectChangedEventArgs e)
{
NotifyOfPropertyChange(() => EffectEnabled);
}
[Inject] [Inject]
public MetroDialogService DialogService { get; set; } public MetroDialogService DialogService { get; set; }