mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Add settings check box ui and viewmodel
This commit is contained in:
parent
56b8b5f3d6
commit
f6ae266a88
2 changed files with 25 additions and 8 deletions
|
|
@ -33,6 +33,9 @@
|
|||
<TabControl Height="auto" SelectedIndex="0">
|
||||
<TabItem Header="{DynamicResource general}">
|
||||
<StackPanel Orientation="Vertical">
|
||||
<CheckBox Margin="10" IsChecked="{Binding PortableMode}">
|
||||
<TextBlock Text="Portable Mode" />
|
||||
</CheckBox>
|
||||
<CheckBox Margin="10" IsChecked="{Binding Settings.StartWoxOnSystemStartup}"
|
||||
Checked="OnAutoStartupChecked" Unchecked="OnAutoStartupUncheck">
|
||||
<TextBlock Text="{DynamicResource startWoxOnSystemStartup}" />
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
|
@ -13,7 +13,6 @@ using Wox.Core.Plugin;
|
|||
using Wox.Core.Resource;
|
||||
using Wox.Helper;
|
||||
using Wox.Infrastructure;
|
||||
using Wox.Infrastructure.Http;
|
||||
using Wox.Infrastructure.Storage;
|
||||
using Wox.Infrastructure.UserSettings;
|
||||
using Wox.Plugin;
|
||||
|
|
@ -39,8 +38,7 @@ namespace Wox.ViewModel
|
|||
OnPropertyChanged(nameof(ActivatedTimes));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
_portableMode = Settings.PortableMode;
|
||||
}
|
||||
|
||||
public Settings Settings { get; set; }
|
||||
|
|
@ -50,14 +48,30 @@ namespace Wox.ViewModel
|
|||
await _updater.UpdateApp(false);
|
||||
}
|
||||
|
||||
public void EnablePortableMode()
|
||||
private bool _portableMode;
|
||||
public bool PortableMode
|
||||
{
|
||||
_portable.EnablePortableMode();
|
||||
get { return _portableMode; }
|
||||
set
|
||||
{
|
||||
_portableMode = value;
|
||||
|
||||
Settings.PortableMode = value;
|
||||
Save();
|
||||
PortabilityUpdate(value);
|
||||
}
|
||||
}
|
||||
|
||||
public void DisablePortableMode()
|
||||
private void PortabilityUpdate(bool enabled)
|
||||
{
|
||||
_portable.DisablePortableMode();
|
||||
if (enabled)
|
||||
{
|
||||
_portable.EnablePortableMode();
|
||||
}
|
||||
else
|
||||
{
|
||||
_portable.DisablePortableMode();
|
||||
}
|
||||
}
|
||||
|
||||
public void Save()
|
||||
|
|
|
|||
Loading…
Reference in a new issue