Skip to content

Commit

Permalink
Fixed some fatal problems.
Browse files Browse the repository at this point in the history
  • Loading branch information
t-miyake committed Oct 1, 2017
1 parent b2eb5b4 commit a3484e2
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion PocketFanController/AboutWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Title="About | Pocket Fan Controller" Height="300" Width="300" ScrollViewer.VerticalScrollBarVisibility="Disabled" ShowInTaskbar="False" ResizeMode="NoResize" WindowStartupLocation="CenterScreen">
<StackPanel>
<TextBlock Padding="8,0,0,0" Margin="0,5,0,0">Pocket Fan Controller</TextBlock>
<TextBlock Padding="15,0,0,0">Version 0.5.0</TextBlock>
<TextBlock Padding="15,0,0,0">Version 0.5.1</TextBlock>
<TextBlock Padding="15,0,0,0">© 2017 Takafumi Miyake</TextBlock>

<TextBlock Padding="8,0,0,0" Margin="0,10,0,0">Third-Party Software Usage and Licenses</TextBlock>
Expand Down
12 changes: 11 additions & 1 deletion PocketFanController/ConfigWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,15 @@ public ConfigWindowViewModel()

OkButton = new RelayCommand(() =>
{
Model.SaveManualConfig(Margin,BorderOfSlow,BorderOfFast,BorderOfFastest);
Model.SaveManualConfig(Margin, BorderOfSlow, BorderOfFast, BorderOfFastest);
SetManual();
Application.Current.MainWindow.Close();
});

ApplyButton = new RelayCommand(() =>
{
Model.SaveManualConfig(Margin, BorderOfSlow, BorderOfFast, BorderOfFastest);
SetManual();
MessageBox.Show("Apply completed.");
});

Expand All @@ -81,6 +83,14 @@ public ConfigWindowViewModel()
UpdateStatus();
}

private void SetManual()
{
if (Model.CurrentState == 5)
{
Model.SetManual();
}
}

private void UpdateStatus()
{
OnPropertyChanged("Margin");
Expand Down
7 changes: 5 additions & 2 deletions PocketFanController/Model.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,11 @@ public void GetCurrentStatus()
}
}

if (current.SequenceEqual(states[CurrentState])) return;
CurrentState = 5;
if (CurrentState != 5)
{
if (current.SequenceEqual(states[CurrentState])) return;
CurrentState = 5;
}
}

public void SetDefault()
Expand Down
4 changes: 2 additions & 2 deletions PocketFanController/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
// すべての値を指定するか、次を使用してビルド番号とリビジョン番号を既定に設定できます
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.5.0.0")]
[assembly: AssemblyFileVersion("0.5.0.0")]
[assembly: AssemblyVersion("0.5.1.0")]
[assembly: AssemblyFileVersion("0.5.1.0")]
[assembly: NeutralResourcesLanguage("en")]

0 comments on commit a3484e2

Please sign in to comment.