Skip to content

Commit c385b95

Browse files
committed
- Add Height Program Plugin Setting Panel
- Disable Done Button when Null in TextBoxes - Adjust Dopus Arguments
1 parent 434b409 commit c385b95

File tree

3 files changed

+156
-47
lines changed

3 files changed

+156
-47
lines changed

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ public CustomExplorerViewModel CustomExplorer
6666
{
6767
Name = "Directory Opus",
6868
Path = @"C:\Program Files\GPSoftware\Directory Opus\dopusrt.exe",
69-
DirectoryArgument = "/cmd Go \"%d\"",
70-
FileArgument = "/cmd Go \"%f\""
71-
69+
DirectoryArgument = "/cmd Go \"%d\" NEW",
70+
FileArgument = "/cmd Go \"%f\" NEW"
71+
7272
},
7373
new()
7474
{

Flow.Launcher/SelectFileManagerWindow.xaml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@
106106
FontSize="14"
107107
Text="{DynamicResource fileManager_profile_name}" />
108108
<TextBox
109+
x:Name="ProfileTextBox"
109110
Grid.Row="0"
110111
Grid.Column="1"
111112
Width="Auto"
@@ -123,6 +124,7 @@
123124
FontSize="14"
124125
Text="{DynamicResource fileManager_path}" />
125126
<TextBox
127+
x:Name="PathTextBox"
126128
Grid.Row="1"
127129
Grid.Column="1"
128130
Width="Auto"
@@ -140,6 +142,7 @@
140142
FontSize="14"
141143
Text="{DynamicResource fileManager_directory_arg}" />
142144
<TextBox
145+
x:Name="directoryArgTextBox"
143146
Grid.Row="2"
144147
Grid.Column="1"
145148
Width="Auto"
@@ -157,6 +160,7 @@
157160
FontSize="14"
158161
Text="{DynamicResource fileManager_file_arg}" />
159162
<TextBox
163+
x:Name="fileArgTextBox"
160164
Grid.Row="3"
161165
Grid.Column="1"
162166
Width="Auto"
@@ -187,7 +191,27 @@
187191
Height="30"
188192
Margin="5,0,0,0"
189193
Click="btnDone_Click"
190-
Content="{DynamicResource done}" />
194+
Content="{DynamicResource done}"
195+
ForceCursor="True">
196+
<Button.Style>
197+
<Style BasedOn="{StaticResource DefaultButtonStyle}" TargetType="{x:Type Button}">
198+
<Style.Triggers>
199+
<DataTrigger Binding="{Binding Text.Length, ElementName=ProfileTextBox, UpdateSourceTrigger=PropertyChanged}" Value="0">
200+
<Setter Property="IsEnabled" Value="False" />
201+
</DataTrigger>
202+
<DataTrigger Binding="{Binding Text.Length, ElementName=PathTextBox, UpdateSourceTrigger=PropertyChanged}" Value="0">
203+
<Setter Property="IsEnabled" Value="False" />
204+
</DataTrigger>
205+
<DataTrigger Binding="{Binding Text.Length, ElementName=directoryArgTextBox, UpdateSourceTrigger=PropertyChanged}" Value="0">
206+
<Setter Property="IsEnabled" Value="False" />
207+
</DataTrigger>
208+
<DataTrigger Binding="{Binding Text.Length, ElementName=fileArgTextBox, UpdateSourceTrigger=PropertyChanged}" Value="0">
209+
<Setter Property="IsEnabled" Value="False" />
210+
</DataTrigger>
211+
</Style.Triggers>
212+
</Style>
213+
</Button.Style>
214+
</Button>
191215
</StackPanel>
192216
</Grid>
193217
</Window>

Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml

Lines changed: 128 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,164 @@
1-
<UserControl x:Class="Flow.Launcher.Plugin.Program.Views.ProgramSetting"
2-
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3-
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4-
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5-
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6-
xmlns:program="clr-namespace:Flow.Launcher.Plugin.Program"
7-
DataContext="{Binding RelativeSource={RelativeSource Self}}"
8-
mc:Ignorable="d"
9-
d:DesignHeight="404.508" d:DesignWidth="600">
10-
<Grid Margin="10">
1+
<UserControl
2+
x:Class="Flow.Launcher.Plugin.Program.Views.ProgramSetting"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
7+
xmlns:program="clr-namespace:Flow.Launcher.Plugin.Program"
8+
Height="450"
9+
d:DesignHeight="404.508"
10+
d:DesignWidth="600"
11+
DataContext="{Binding RelativeSource={RelativeSource Self}}"
12+
mc:Ignorable="d">
13+
<Grid Margin="20">
1114
<Grid.RowDefinitions>
12-
<RowDefinition Height="120"/>
13-
<RowDefinition Height="*"/>
14-
<RowDefinition Height="50"/>
15+
<RowDefinition Height="120" />
16+
<RowDefinition Height="*" />
17+
<RowDefinition Height="50" />
1518
</Grid.RowDefinitions>
16-
<StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Stretch">
17-
<StackPanel Orientation="Vertical" Width="Auto">
18-
<CheckBox Name="StartMenuEnabled" IsChecked="{Binding EnableStartMenuSource}" Margin="5" Content="{DynamicResource flowlauncher_plugin_program_index_start}" ToolTip="{DynamicResource flowlauncher_plugin_program_index_start_tooltip}" />
19-
<CheckBox Name="RegistryEnabled" IsChecked="{Binding EnableRegistrySource}" Margin="5" Content="{DynamicResource flowlauncher_plugin_program_index_registry}" ToolTip="{DynamicResource flowlauncher_plugin_program_index_registry_tooltip}" />
20-
<CheckBox Name="DescriptionEnabled" IsChecked="{Binding EnableDescription}" Margin="5" Content="{DynamicResource flowlauncher_plugin_program_enable_description}" ToolTip="{DynamicResource flowlauncher_plugin_program_enable_description_tooltip}" />
19+
<StackPanel
20+
Grid.Row="0"
21+
HorizontalAlignment="Stretch"
22+
Orientation="Horizontal">
23+
<StackPanel Width="Auto" Orientation="Vertical">
24+
<CheckBox
25+
Name="StartMenuEnabled"
26+
Margin="5"
27+
Content="{DynamicResource flowlauncher_plugin_program_index_start}"
28+
IsChecked="{Binding EnableStartMenuSource}"
29+
ToolTip="{DynamicResource flowlauncher_plugin_program_index_start_tooltip}" />
30+
<CheckBox
31+
Name="RegistryEnabled"
32+
Margin="5"
33+
Content="{DynamicResource flowlauncher_plugin_program_index_registry}"
34+
IsChecked="{Binding EnableRegistrySource}"
35+
ToolTip="{DynamicResource flowlauncher_plugin_program_index_registry_tooltip}" />
36+
<CheckBox
37+
Name="DescriptionEnabled"
38+
Margin="5"
39+
Content="{DynamicResource flowlauncher_plugin_program_enable_description}"
40+
IsChecked="{Binding EnableDescription}"
41+
ToolTip="{DynamicResource flowlauncher_plugin_program_enable_description_tooltip}" />
2142
</StackPanel>
22-
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal" Width="Auto">
23-
<Button Height="31" HorizontalAlignment="Right" Margin="10" Width="100" x:Name="btnLoadAllProgramSource" Click="btnLoadAllProgramSource_OnClick" Content="{DynamicResource flowlauncher_plugin_program_all_programs}" />
24-
<Button Height="31" HorizontalAlignment="Right" Margin="10" Width="100" x:Name="btnProgramSuffixes" Click="BtnProgramSuffixes_OnClick" Content="{DynamicResource flowlauncher_plugin_program_suffixes}" />
25-
<Button Height="31" HorizontalAlignment="Right" Margin="10" Width="100" x:Name="btnReindex" Click="btnReindex_Click" Content="{DynamicResource flowlauncher_plugin_program_reindex}" />
43+
<StackPanel
44+
Width="Auto"
45+
HorizontalAlignment="Right"
46+
Orientation="Horizontal">
47+
<Button
48+
x:Name="btnLoadAllProgramSource"
49+
Width="100"
50+
Height="31"
51+
Margin="10"
52+
HorizontalAlignment="Right"
53+
Click="btnLoadAllProgramSource_OnClick"
54+
Content="{DynamicResource flowlauncher_plugin_program_all_programs}" />
55+
<Button
56+
x:Name="btnProgramSuffixes"
57+
Width="100"
58+
Height="31"
59+
Margin="10"
60+
HorizontalAlignment="Right"
61+
Click="BtnProgramSuffixes_OnClick"
62+
Content="{DynamicResource flowlauncher_plugin_program_suffixes}" />
63+
<Button
64+
x:Name="btnReindex"
65+
Width="100"
66+
Height="31"
67+
Margin="10"
68+
HorizontalAlignment="Right"
69+
Click="btnReindex_Click"
70+
Content="{DynamicResource flowlauncher_plugin_program_reindex}" />
2671
</StackPanel>
2772
</StackPanel>
28-
<ListView x:Name="programSourceView" Grid.Row="1" AllowDrop="True" SelectionMode="Extended" Style="{StaticResource {x:Static GridView.GridViewStyleKey}}"
29-
Margin="0,13,0,10"
30-
BorderBrush="DarkGray"
31-
BorderThickness="1"
32-
GridViewColumnHeader.Click="GridViewColumnHeaderClickedHandler"
33-
PreviewMouseRightButtonUp="ProgramSourceView_PreviewMouseRightButtonUp"
34-
DragEnter="programSourceView_DragEnter"
35-
Drop="programSourceView_Drop">
73+
<ListView
74+
x:Name="programSourceView"
75+
Grid.Row="1"
76+
Margin="0,13,0,10"
77+
AllowDrop="True"
78+
BorderBrush="DarkGray"
79+
BorderThickness="1"
80+
DragEnter="programSourceView_DragEnter"
81+
Drop="programSourceView_Drop"
82+
GridViewColumnHeader.Click="GridViewColumnHeaderClickedHandler"
83+
PreviewMouseRightButtonUp="ProgramSourceView_PreviewMouseRightButtonUp"
84+
SelectionMode="Extended"
85+
Style="{StaticResource {x:Static GridView.GridViewStyleKey}}">
3686
<ListView.ItemContainerStyle>
3787
<Style TargetType="ListViewItem">
38-
<EventSetter Event="PreviewMouseUp" Handler="Row_OnClick"/>
88+
<EventSetter Event="PreviewMouseUp" Handler="Row_OnClick" />
3989
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
4090
</Style>
4191
</ListView.ItemContainerStyle>
4292
<ListView.View>
4393
<GridView>
44-
<GridViewColumn Header="Name" Width="150">
94+
<GridViewColumn Width="150" Header="Name">
4595
<GridViewColumn.CellTemplate>
4696
<DataTemplate>
47-
<TextBlock Text="{Binding Name}"/>
97+
<TextBlock Text="{Binding Name}" />
4898
</DataTemplate>
4999
</GridViewColumn.CellTemplate>
50100
</GridViewColumn>
51101
<GridViewColumn Header="Enabled">
52102
<GridViewColumn.CellTemplate>
53103
<DataTemplate>
54-
<TextBlock Text="{Binding Enabled}" MaxWidth="60" TextAlignment="Center"/>
104+
<TextBlock
105+
MaxWidth="60"
106+
Text="{Binding Enabled}"
107+
TextAlignment="Center" />
55108
</DataTemplate>
56109
</GridViewColumn.CellTemplate>
57110
</GridViewColumn>
58-
<GridViewColumn Header="{DynamicResource flowlauncher_plugin_program_location}" Width="550">
111+
<GridViewColumn Width="550" Header="{DynamicResource flowlauncher_plugin_program_location}">
59112
<GridViewColumn.CellTemplate>
60113
<DataTemplate>
61-
<TextBlock Text="{Binding Location, ConverterParameter=(null), Converter={program:LocationConverter}}"/>
114+
<TextBlock Text="{Binding Location, ConverterParameter=(null), Converter={program:LocationConverter}}" />
62115
</DataTemplate>
63116
</GridViewColumn.CellTemplate>
64117
</GridViewColumn>
65118
</GridView>
66119
</ListView.View>
67120
</ListView>
68-
<DockPanel Grid.Row="2" Margin="0,0,0,0" Grid.RowSpan="1">
69-
<StackPanel x:Name="indexingPanel" Visibility="Hidden" HorizontalAlignment="Left" Orientation="Horizontal">
70-
<ProgressBar x:Name="progressBarIndexing" Height="20" Width="80" Minimum="0" Maximum="100" IsIndeterminate="True" />
71-
<TextBlock Margin="10 0 0 0" Height="20" HorizontalAlignment="Center" Text="{DynamicResource flowlauncher_plugin_program_indexing}" />
121+
<DockPanel
122+
Grid.Row="2"
123+
Grid.RowSpan="1"
124+
Margin="0,0,0,0">
125+
<StackPanel
126+
x:Name="indexingPanel"
127+
HorizontalAlignment="Left"
128+
Orientation="Horizontal"
129+
Visibility="Hidden">
130+
<ProgressBar
131+
x:Name="progressBarIndexing"
132+
Width="80"
133+
Height="20"
134+
IsIndeterminate="True"
135+
Maximum="100"
136+
Minimum="0" />
137+
<TextBlock
138+
Height="20"
139+
Margin="10,0,0,0"
140+
HorizontalAlignment="Center"
141+
Text="{DynamicResource flowlauncher_plugin_program_indexing}" />
72142
</StackPanel>
73143
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
74-
<Button x:Name="btnProgramSourceStatus" Click="btnProgramSourceStatus_OnClick" Width="100" Margin="10" Content="{DynamicResource flowlauncher_plugin_program_disable}" />
75-
<Button x:Name="btnEditProgramSource" Click="btnEditProgramSource_OnClick" Width="100" Margin="10" Content="{DynamicResource flowlauncher_plugin_program_edit}"/>
76-
<Button x:Name="btnAddProgramSource" Click="btnAddProgramSource_OnClick" Width="100" Margin="10 10 0 10" Content="{DynamicResource flowlauncher_plugin_program_add}"/>
144+
<Button
145+
x:Name="btnProgramSourceStatus"
146+
Width="100"
147+
Margin="10"
148+
Click="btnProgramSourceStatus_OnClick"
149+
Content="{DynamicResource flowlauncher_plugin_program_disable}" />
150+
<Button
151+
x:Name="btnEditProgramSource"
152+
Width="100"
153+
Margin="10"
154+
Click="btnEditProgramSource_OnClick"
155+
Content="{DynamicResource flowlauncher_plugin_program_edit}" />
156+
<Button
157+
x:Name="btnAddProgramSource"
158+
Width="100"
159+
Margin="10,10,0,10"
160+
Click="btnAddProgramSource_OnClick"
161+
Content="{DynamicResource flowlauncher_plugin_program_add}" />
77162
</StackPanel>
78163
</DockPanel>
79164
</Grid>

0 commit comments

Comments
 (0)