Skip to content

Commit 12fc597

Browse files
committed
Add Checkbox for Skip Confirm
1 parent 886cd75 commit 12fc597

4 files changed

Lines changed: 24 additions & 3 deletions

File tree

Plugins/Flow.Launcher.Plugin.Sys/Languages/en.xaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:system="clr-namespace:System;assembly=mscorlib">
55

6+
<!-- Setting -->
7+
<system:String x:Key="flowlauncher_plugin_sys_skip_confirm">Skip confirmation when Shutting down, Restarting, or Logging off</system:String>
8+
69
<!-- Command List -->
710
<system:String x:Key="flowlauncher_plugin_sys_name">Name</system:String>
811
<system:String x:Key="flowlauncher_plugin_sys_desc">Description</system:String>

Plugins/Flow.Launcher.Plugin.Sys/Settings.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,4 +124,13 @@ public Settings()
124124

125125
[JsonIgnore]
126126
public Command SelectedCommand { get; set; }
127+
private bool _skipPowerActionConfirmation;
128+
public bool SkipPowerActionConfirmation
129+
{
130+
get => _skipPowerActionConfirmation;
131+
set
132+
{
133+
_skipPowerActionConfirmation = value;
134+
}
135+
}
127136
}

Plugins/Flow.Launcher.Plugin.Sys/SettingsViewModel.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ public class SettingsViewModel(Settings settings)
44
{
55
public Settings Settings { get; } = settings;
66
}
7+
8+
79
}

Plugins/Flow.Launcher.Plugin.Sys/SysSettings.xaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,20 @@
1212

1313
<Grid Margin="{StaticResource SettingPanelMargin}">
1414
<Grid.RowDefinitions>
15+
<RowDefinition Height="Auto" />
1516
<RowDefinition />
1617
<RowDefinition Height="Auto" />
1718
</Grid.RowDefinitions>
18-
19+
<StackPanel
20+
Grid.Row="0"
21+
Margin="0 0 0 6"
22+
HorizontalAlignment="Left"
23+
Orientation="Horizontal">
24+
<CheckBox Content="{DynamicResource flowlauncher_plugin_sys_skip_confirm}" IsChecked="{Binding Settings.SkipPowerActionConfirmation}" />
25+
</StackPanel>
1926
<ListView
2027
x:Name="lbxCommands"
21-
Grid.Row="0"
28+
Grid.Row="1"
2229
Margin="{StaticResource SettingPanelItemTopBottomMargin}"
2330
BorderBrush="DarkGray"
2431
BorderThickness="1"
@@ -57,7 +64,7 @@
5764
</ListView>
5865

5966
<StackPanel
60-
Grid.Row="1"
67+
Grid.Row="2"
6168
Margin="{StaticResource SettingPanelItemTopBottomMargin}"
6269
HorizontalAlignment="Right"
6370
Orientation="Horizontal">

0 commit comments

Comments
 (0)