Skip to content

Commit

Permalink
version 4.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Grabacr07 committed Nov 10, 2015
1 parent 6dc84e7 commit c69d2a9
Show file tree
Hide file tree
Showing 6 changed files with 173 additions and 157 deletions.
96 changes: 48 additions & 48 deletions source/Grabacr07.KanColleViewer/Models/Settings/GeneralSettings.cs
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using MetroTrilithon.Serialization;

namespace Grabacr07.KanColleViewer.Models.Settings
{
public static class GeneralSettings
{
/// <summary>
/// カルチャ設定を取得します。
/// </summary>
public static SerializableProperty<string> Culture { get; }
= new SerializableProperty<string>(GetKey(), Providers.Roaming) { AutoSave = true };

/// <summary>
/// アプリケーションがプロキシ モード (ブラウザーを表示せず、プロキシとしてのみ使用するモード) で動作するかどうかを示す設定値を取得します。
/// </summary>
public static SerializableProperty<bool> IsProxyMode { get; }
= new SerializableProperty<bool>(GetKey(), Providers.Roaming, false);

/// <summary>
/// アプリケーション終了時の確認動作を示す設定値を取得します。
/// </summary>
public static SerializableProperty<ExitConfirmationType> ExitConfirmationType { get; }
= new SerializableProperty<ExitConfirmationType>(GetKey(), Providers.Roaming, Models.ExitConfirmationType.None) { AutoSave = true };

/// <summary>
/// ブラウザーの拡大鏡を示す設定値を取得します。
/// </summary>
public static SerializableProperty<double> BrowserZoomFactor { get; }
= new SerializableProperty<double>(GetKey(), Providers.Local, 1.0);

/// <summary>
/// ユーザー スタイル シート設定を取得します。
/// </summary>
public static SerializableProperty<string> UserStyleSheet { get; }
= new SerializableProperty<string>(GetKey(), Providers.Roaming, Properties.Settings.Default.OverrideStyleSheet) { AutoSave = true };


private static string GetKey([CallerMemberName] string propertyName = "")
{
return nameof(GeneralSettings) + "." + propertyName;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using MetroTrilithon.Serialization;

namespace Grabacr07.KanColleViewer.Models.Settings
{
public static class GeneralSettings
{
/// <summary>
/// カルチャ設定を取得します。
/// </summary>
public static SerializableProperty<string> Culture { get; }
= new SerializableProperty<string>(GetKey(), Providers.Roaming) { AutoSave = true };

/// <summary>
/// アプリケーションがプロキシ モード (ブラウザーを表示せず、プロキシとしてのみ使用するモード) で動作するかどうかを示す設定値を取得します。
/// </summary>
public static SerializableProperty<bool> IsProxyMode { get; }
= new SerializableProperty<bool>(GetKey(), Providers.Roaming, false);

/// <summary>
/// アプリケーション終了時の確認動作を示す設定値を取得します。
/// </summary>
public static SerializableProperty<ExitConfirmationType> ExitConfirmationType { get; }
= new SerializableProperty<ExitConfirmationType>(GetKey(), Providers.Roaming, Models.ExitConfirmationType.None) { AutoSave = true };

/// <summary>
/// ブラウザーの拡大鏡を示す設定値を取得します。
/// </summary>
public static SerializableProperty<double> BrowserZoomFactor { get; }
= new SerializableProperty<double>(GetKey(), Providers.Local, 1.0);

/// <summary>
/// ユーザー スタイル シート設定を取得します。
/// </summary>
public static SerializableProperty<string> UserStyleSheet { get; }
= new SerializableProperty<string>(GetKey(), Providers.Roaming, Properties.Settings.Default.OverrideStyleSheet) { AutoSave = true };


private static string GetKey([CallerMemberName] string propertyName = "")
{
return nameof(GeneralSettings) + "." + propertyName;
}
}
}
2 changes: 1 addition & 1 deletion source/Grabacr07.KanColleViewer/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@
// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.1.5.0")]
[assembly: AssemblyVersion("4.1.6.0")]
Original file line number Diff line number Diff line change
@@ -1,68 +1,83 @@
using Grabacr07.KanColleViewer.Models.Settings;
using Grabacr07.KanColleWrapper;
using Livet;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MetroTrilithon.Mvvm;

namespace Grabacr07.KanColleViewer.ViewModels.Settings
{
public class UserStyleSheetSettingsViewModel : ViewModel
{
private bool isBackToDefaultValue;

#region UserStyleSheet 変更通知プロパティ

private string _UserStyleSheet;

public string UserStyleSheet
{
get { return this._UserStyleSheet; }
set
{
this.isBackToDefaultValue = false;
if (this._UserStyleSheet != value)
{
this._UserStyleSheet = value;
this.RaisePropertyChanged();
}
}
}

#endregion


public void Initialize()
{
GeneralSettings.UserStyleSheet.Subscribe(x => this.UserStyleSheet = x).AddTo(this);

if (!GeneralSettings.UserStyleSheet.Provider.IsLoaded)
GeneralSettings.UserStyleSheet.Provider.Load();
this.isBackToDefaultValue = !GeneralSettings.UserStyleSheet.Provider.TryGetValue(GeneralSettings.UserStyleSheet.Key, out this._UserStyleSheet);
this._UserStyleSheet = GeneralSettings.UserStyleSheet;
this.RaisePropertyChanged(nameof(this.UserStyleSheet));
}

public void Apply()
{
if (this.isBackToDefaultValue)
GeneralSettings.UserStyleSheet.Reset();
else
GeneralSettings.UserStyleSheet.Value = this.UserStyleSheet;
}

public void Cancel()
{
this.UserStyleSheet = GeneralSettings.UserStyleSheet;
}

public void BackToDefaultValue()
{
this.UserStyleSheet = GeneralSettings.UserStyleSheet.Default;
this.isBackToDefaultValue = true;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Grabacr07.KanColleViewer.Models.Settings;
using Livet;
using MetroTrilithon.Mvvm;

namespace Grabacr07.KanColleViewer.ViewModels.Settings
{
public class UserStyleSheetSettingsViewModel : ViewModel
{
#region UserStyleSheet 変更通知プロパティ

private string _UserStyleSheet;

public string UserStyleSheet
{
get { return this._UserStyleSheet; }
set
{
if (this._UserStyleSheet != value)
{
this._UserStyleSheet = value;
this.IsEditing = true;
this.RaisePropertyChanged();
}
}
}

#endregion

#region IsEditing 変更通知プロパティ

private bool _IsEditing;

public bool IsEditing
{
get { return this._IsEditing; }
set
{
if (this._IsEditing != value)
{
this._IsEditing = value;
this.RaisePropertyChanged();
}
}
}

#endregion


public void Initialize()
{
GeneralSettings.UserStyleSheet
.Subscribe(x =>
{
this.UserStyleSheet = x;
this.IsEditing = false;
})
.AddTo(this);

this._UserStyleSheet = GeneralSettings.UserStyleSheet;
this.RaisePropertyChanged(nameof(this.UserStyleSheet));
}

public void Apply()
{
GeneralSettings.UserStyleSheet.Value = this.UserStyleSheet;
}

public void Cancel()
{
this.UserStyleSheet = GeneralSettings.UserStyleSheet;
this.IsEditing = false;
}

public void BackToDefaultValue()
{
this.UserStyleSheet = GeneralSettings.UserStyleSheet.Default;
}
}
}
76 changes: 38 additions & 38 deletions source/Grabacr07.KanColleViewer/Views/Settings/Others.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,45 +130,45 @@
Style="{DynamicResource SettingsHeaderTextStyleKey}"
Margin="0,10" />

<metro:PromptTextBox Text="{Binding UserStyleSheetSettings.UserStyleSheet, Mode=TwoWay}"
Margin="20,0,0,10"
Height="100"
AcceptsReturn="True"
TextWrapping="NoWrap"
VerticalContentAlignment="Top"
VerticalScrollBarVisibility="Auto"
Prompt="CSS"/>
<StackPanel Margin="20,0,0,0">
<metro:PromptTextBox Text="{Binding UserStyleSheetSettings.UserStyleSheet, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Height="100"
AcceptsReturn="True"
TextWrapping="NoWrap"
VerticalContentAlignment="Top"
VerticalScrollBarVisibility="Auto"
Prompt="CSS" />

<Grid Margin="20,0,0,10"
DataContext="{Binding UserStyleSheetSettings}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<metro2:CallMethodButton MethodTarget="{Binding}"
MethodName="BackToDefaultValue"
Content="既定値に戻す"
MinWidth="110"
Padding="16,6"
Margin="0,2"
Grid.Column="0"/>
<metro2:CallMethodButton MethodTarget="{Binding}"
MethodName="Apply"
Content="適用"
MinWidth="110"
Padding="16,6"
Margin="4,2"
Grid.Column="2"/>
<metro2:CallMethodButton MethodTarget="{Binding}"
MethodName="Cancel"
Content="キャンセル"
MinWidth="110"
Padding="16,6"
Margin="4,2,0,4"
Grid.Column="3"/>
</Grid>
<DockPanel Margin="-4,4"
DataContext="{Binding UserStyleSheetSettings}"
LastChildFill="False">
<Panel.Resources>
<Style TargetType="{x:Type metro2:CallMethodButton}"
BasedOn="{StaticResource {x:Type metro2:CallMethodButton}}">
<Setter Property="MinWidth"
Value="100" />
<Setter Property="Margin"
Value="4" />
<Setter Property="Padding"
Value="16,4" />
</Style>
</Panel.Resources>
<metro2:CallMethodButton DockPanel.Dock="Left"
MethodTarget="{Binding}"
MethodName="BackToDefaultValue"
Content="既定値に戻す" />
<metro2:CallMethodButton DockPanel.Dock="Right"
MethodTarget="{Binding}"
MethodName="Cancel"
Content="キャンセル"
IsEnabled="{Binding IsEditing}" />
<metro2:CallMethodButton DockPanel.Dock="Right"
MethodTarget="{Binding}"
MethodName="Apply"
Content="適用"
IsEnabled="{Binding IsEditing}" />
</DockPanel>
</StackPanel>

<Rectangle Height="1"
Style="{DynamicResource SeparatorRectangleStyleKey}" />
Expand Down
3 changes: 2 additions & 1 deletion source/Grabacr07.KanColleViewer/readme.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
提督業も忙しい! (KanColleViewer)
version 4.1.5 2015/10/30
version 4.1.6 2015/11/10
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━


Expand Down Expand Up @@ -167,6 +167,7 @@ Desktop Toast

■更新履歴

2015/11/10 - version 4.1.6 リリース
2015/10/30 - version 4.1.5 リリース
2015/08/28 - version 4.1.3 リリース
2015/08/20 - version 4.1.2 リリース
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.6.0")]
[assembly: AssemblyVersion("1.2.7.0")]

0 comments on commit c69d2a9

Please sign in to comment.