Skip to content

Commit

Permalink
Reworked Application Profiles
Browse files Browse the repository at this point in the history
Now instead of preset profiles that are saved into the default profile when selected, the profiles will exist individually and when selected will be edited and saved directly to the same file.
  • Loading branch information
simon-wh committed May 16, 2017
1 parent da7644b commit 8752679
Show file tree
Hide file tree
Showing 170 changed files with 2,474 additions and 2,390 deletions.
4 changes: 2 additions & 2 deletions Project-Aurora/Plugin-Example/PluginMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ public class PluginMain : IPlugin
public IPluginHost PluginHost { get { return pluginHost; }
set {
pluginHost = value;
if (value is ProfilesManager)
if (value is LightingStateManager)
{
((ProfilesManager)value).RegisterLayerHandler(new LayerHandlerEntry("ExampleLayer", "Example Layer", typeof(ExampleLayerHandler)));
((LightingStateManager)value).RegisterLayerHandler(new LayerHandlerEntry("ExampleLayer", "Example Layer", typeof(ExampleLayerHandler)));
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Project-Aurora/Project-Aurora/ConfigUI.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@

<Grid x:Name="gridManagers" Margin="5,5,0,5" HorizontalAlignment="Left" Width="200">
<StackPanel x:Name="stackPanelManagers">
<Settings:Control_ProfileManager x:Name="ctrlProfileManager" FocusedProfile="{Binding FocusedProfile}" Height="25" Margin="0,0,0,3" Background="#00000000" PreviewMouseDown="ctrlProfileManager_PreviewMouseDown" />
<Settings:Control_LayerManager x:Name="ctrlLayerManager" FocusedProfile="{Binding FocusedProfile}" Background="#00000000" PreviewMouseDown="ctrlLayerManager_PreviewMouseDown" />
<Settings:Control_ProfileManager x:Name="ctrlProfileManager" FocusedApplication="{Binding FocusedApplication}" Height="25" Margin="0,0,0,3" Background="#00000000" PreviewMouseDown="ctrlProfileManager_PreviewMouseDown" />
<Settings:Control_LayerManager x:Name="ctrlLayerManager" FocusedApplication="{Binding FocusedApplication}" Background="#00000000" PreviewMouseDown="ctrlLayerManager_PreviewMouseDown" />
</StackPanel>
</Grid>

Expand Down
324 changes: 163 additions & 161 deletions Project-Aurora/Project-Aurora/ConfigUI.xaml.cs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Project-Aurora/Project-Aurora/Controls/ColorZones.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ private void effect_settings_button_Click(object sender, RoutedEventArgs e)
if (cz_list.SelectedItem != null)
{
EffectSettingsWindow effect_settings = new EffectSettingsWindow(((ColorZone)cz_list.SelectedItem).effect_config);
effect_settings.preview_key = Global.ProfilesManager.PreviewProfileKey;
effect_settings.preview_key = Global.LightingStateManager.PreviewProfileKey;
effect_settings.EffectConfigUpdated += Effect_settings_EffectConfigUpdated;

effect_settings.ShowDialog();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ private void accept_button_Click(object sender, RoutedEventArgs e)

private void Window_Activated(object sender, EventArgs e)
{
Global.ProfilesManager.PreviewProfileKey = preview_key;
Global.LightingStateManager.PreviewProfileKey = preview_key;
}

private void Window_Deactivated(object sender, EventArgs e)
{
Global.ProfilesManager.PreviewProfileKey = null;
Global.LightingStateManager.PreviewProfileKey = null;
}

private void effect_angle_ValueChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
Expand Down
6 changes: 3 additions & 3 deletions Project-Aurora/Project-Aurora/Controls/LogicCheckEdit.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public Layer Layer
set
{
SetValue(LayerProperty, value);
this.cmbParameter.ItemsSource = value.AssociatedProfile.ParameterLookup
this.cmbParameter.ItemsSource = value.AssociatedApplication.ParameterLookup
.Where(s => (s.Value.Item1.IsPrimitive || s.Value.Item1 == typeof(string)) && s.Value.Item2 == null).ToDictionary(s => s) //Remove methods and non-primitives for right now
.Keys;
}
Expand Down Expand Up @@ -67,8 +67,8 @@ private void cmbParameter_SelectionChanged(object sender, SelectionChangedEventA

string str = e.AddedItems[0] as string;
string old_str = e.RemovedItems[0] as string;
Tuple<Type, Type> typ = Layer.AssociatedProfile.ParameterLookup[str];
Tuple<Type, Type> old_typ = old_str != null ? Layer.AssociatedProfile.ParameterLookup[str] : null;
Tuple<Type, Type> typ = Layer.AssociatedApplication.ParameterLookup[str];
Tuple<Type, Type> old_typ = old_str != null ? Layer.AssociatedApplication.ParameterLookup[str] : null;
if (old_typ == null || old_typ.Item1 != typ.Item1)
{
List<LogicOperator> operators = new List<LogicOperator>();
Expand Down
4 changes: 2 additions & 2 deletions Project-Aurora/Project-Aurora/Devices/DeviceManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public void Initialize()

NewDevicesInitialized?.Invoke(this, new EventArgs());

if (Global.ProfilesManager.DesktopProfile.Settings.IsEnabled)
if (Global.LightingStateManager.DesktopProfile.Settings.IsEnabled)
{
if (!retryActivated)
{
Expand All @@ -133,7 +133,7 @@ private void RetryInitialize()
{
for (int try_count = 0; try_count < retryAttemps; try_count++)
{
if (!Global.ProfilesManager.DesktopProfile.Settings.IsEnabled)
if (!Global.LightingStateManager.DesktopProfile.Settings.IsEnabled)
break;

Global.logger.LogLine("Retrying Device Initialization", Logging_Level.Info);
Expand Down
Loading

0 comments on commit 8752679

Please sign in to comment.