Skip to content

Commit

Permalink
AF Configuration: Main screen skin selector.
Browse files Browse the repository at this point in the history
  • Loading branch information
TBXin committed Jan 3, 2017
1 parent 0b297af commit eecb4d5
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 17 deletions.
7 changes: 7 additions & 0 deletions src/NToolbox/Models/ArcticFoxConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ internal class UIConfiguration
public ScreenProtectionTime ScreensaveDuration;
public byte PuffScreenDelay; // 0..50 = 0,0..5,0 sec
public PuffsTimeFormat PuffsTimeFormat;
public Skin MainScreenSkin;
}

internal class CountersData
Expand Down Expand Up @@ -212,6 +213,12 @@ internal enum PuffsTimeFormat : byte
HourMinuteSeconds = 1
}

internal enum Skin : byte
{
Classic = 0,
Circle = 1
}

internal enum ScreenProtectionTime : byte
{
Off = 0,
Expand Down
6 changes: 6 additions & 0 deletions src/NToolbox/Models/PredefinedData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ internal class Profile
new NamedItemContainer<ArcticFoxConfiguration.LineContent>("Last Temperature", ArcticFoxConfiguration.LineContent.LastTemperature),
};

public static readonly object[] MainScreenSkins =
{
new NamedItemContainer<ArcticFoxConfiguration.Skin>("Classic", ArcticFoxConfiguration.Skin.Classic),
new NamedItemContainer<ArcticFoxConfiguration.Skin>("Circle", ArcticFoxConfiguration.Skin.Circle)
};

public static readonly object[] ChargeScreenTypes =
{
new NamedItemContainer<ArcticFoxConfiguration.ChargeScreenType>("Classic", ArcticFoxConfiguration.ChargeScreenType.Classic),
Expand Down
63 changes: 48 additions & 15 deletions src/NToolbox/Windows/ArcticFoxConfigurationWindow.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions src/NToolbox/Windows/ArcticFoxConfigurationWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ private void InitializeComboBoxes()
comboBox.Fill(PredefinedData.ArcticFox.SmallScreenLineContentItems);
}

MainScreenSkinComboBox.Fill(PredefinedData.ArcticFox.MainScreenSkins);
ChargeScreenComboBox.Fill(PredefinedData.ArcticFox.ChargeScreenTypes);
ClockTypeComboBox.Fill(PredefinedData.ArcticFox.ClockTypes);
ScreensaverTimeComboBox.Fill(PredefinedData.ArcticFox.ScreenSaverTimes);
Expand Down Expand Up @@ -304,12 +305,13 @@ private void InitializeWorkspace()
PuffScreenDelayUpDown.SetValue(ui.PuffScreenDelay / 10m);
StealthModeCheckBox.Checked = ui.IsStealthMode;
FlippedModeCheckBox.Checked = ui.IsFlipped;
ChargeScreenComboBox.SelectItem(ui.ChargeScreenType);
MainScreenSkinComboBox.SelectItem(ui.MainScreenSkin);
UseClassicMenuCheckBox.Checked = ui.IsClassicMenu;
ShowLogoCheckBox.Checked = ui.IsLogoEnabled;
ShowClockCheckBox.Checked = ui.IsClockOnMainScreen;
ClockTypeComboBox.SelectItem(ui.ClockType);
ScreensaverTimeComboBox.SelectItem(ui.ScreensaveDuration);
ChargeScreenComboBox.SelectItem(ui.ChargeScreenType);

// Classic Screen
InitializeLineContentEditor(ui.ClassicSkinVWLines.Line1, ClassicVWLine1ComboBox, ClassicVWLine1FireCheckBox);
Expand Down Expand Up @@ -408,12 +410,13 @@ private void SaveWorkspace()
ui.PuffScreenDelay = (byte)(PuffScreenDelayUpDown.Value * 10);
ui.IsStealthMode = StealthModeCheckBox.Checked;
ui.IsFlipped = FlippedModeCheckBox.Checked;
ui.ChargeScreenType = ChargeScreenComboBox.GetSelectedItem<ArcticFoxConfiguration.ChargeScreenType>();
ui.MainScreenSkin = MainScreenSkinComboBox.GetSelectedItem<ArcticFoxConfiguration.Skin>();
ui.IsClassicMenu = UseClassicMenuCheckBox.Checked;
ui.IsLogoEnabled = ShowLogoCheckBox.Checked;
ui.IsClockOnMainScreen = ShowClockCheckBox.Checked;
ui.ClockType = ClockTypeComboBox.GetSelectedItem<ArcticFoxConfiguration.ClockType>();
ui.ScreensaveDuration = ScreensaverTimeComboBox.GetSelectedItem<ArcticFoxConfiguration.ScreenProtectionTime>();
ui.ChargeScreenType = ChargeScreenComboBox.GetSelectedItem<ArcticFoxConfiguration.ChargeScreenType>();

// General -> Layout Tab -> Classic Screen
ui.ClassicSkinVWLines.Line1 = SaveLineContent(ClassicVWLine1ComboBox, ClassicVWLine1FireCheckBox);
Expand Down

0 comments on commit eecb4d5

Please sign in to comment.