Add auto updates gui option

This commit is contained in:
bao-qian
2016-05-13 23:54:37 +01:00
parent 2d1dfece25
commit 71308316b1
4 changed files with 18 additions and 1 deletions

View File

@@ -26,6 +26,7 @@
<system:String x:Key="ignoreHotkeysOnFullscreen">Ignore hotkeys if window is fullscreen</system:String>
<system:String x:Key="pythonDirectory">Python Directory</system:String>
<system:String x:Key="selectPythonDirectory">Select</system:String>
<system:String x:Key="autoUpdates">Auto Updates</system:String>
<!--Setting Plugin-->

View File

@@ -25,6 +25,7 @@
<system:String x:Key="maxShowResults">最大结果显示个数</system:String>
<system:String x:Key="ignoreHotkeysOnFullscreen">全屏模式下忽略热键</system:String>
<system:String x:Key="pythonDirectory">Python 路径</system:String>
<system:String x:Key="autoUpdates">自动更新</system:String>
<!--设置,插件-->
<system:String x:Key="plugin">插件</system:String>

View File

@@ -37,6 +37,9 @@
<CheckBox x:Name="cbIgnoreHotkeysOnFullscreen" Margin="10">
<TextBlock Text="{DynamicResource ignoreHotkeysOnFullscreen}" />
</CheckBox>
<CheckBox x:Name="AutoUpdatesCheckBox" Margin="10">
<TextBlock Text="{DynamicResource autoUpdates}" />
</CheckBox>
<StackPanel Margin="10" Orientation="Horizontal">
<TextBlock Text="{DynamicResource language}" />
<ComboBox Margin="10 0 0 0" Width="120" x:Name="cbLanguages" />

View File

@@ -95,6 +95,17 @@ namespace Wox
_settings.IgnoreHotkeysOnFullscreen = false;
};
AutoUpdatesCheckBox.Checked += (o, e) =>
{
_settings.AutoUpdates = true;
};
AutoUpdatesCheckBox.Unchecked += (o, e) =>
{
_settings.AutoUpdates = false;
};
cbStartWithWindows.IsChecked = CheckApplicationIsStartupWithWindow();
comboMaxResultsToShow.SelectionChanged += (o, e) =>
@@ -107,6 +118,7 @@ namespace Wox
cbDontPromptUpdateMsg.IsChecked = _settings.DontPromptUpdateMsg;
cbRememberLastLocation.IsChecked = _settings.RememberLastLaunchLocation;
cbIgnoreHotkeysOnFullscreen.IsChecked = _settings.IgnoreHotkeysOnFullscreen;
AutoUpdatesCheckBox.IsChecked = _settings.AutoUpdates;
LoadLanguages();
comboMaxResultsToShow.ItemsSource = Enumerable.Range(2, 16);
@@ -639,7 +651,7 @@ namespace Wox
var id = pair.Metadata.ID;
if (checkBox.IsChecked != null)
{
var disabled = (bool) checkBox.IsChecked;
var disabled = (bool)checkBox.IsChecked;
_settings.PluginSettings.Plugins[id].Disabled = disabled;
}
else