Skip to content

Commit e9b4e62

Browse files
committed
Merge Settings.cs Default Explorer argument
2 parents 68cc6c4 + 07b42ff commit e9b4e62

File tree

6 files changed

+1369
-904
lines changed

6 files changed

+1369
-904
lines changed

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ 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\""
69+
DirectoryArgument = "/cmd Go \"%d\" NEW",
70+
FileArgument = "/cmd Go \"%f\" NEW"
7171

7272
},
7373
new()

Flow.Launcher/Languages/en.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
<system:String x:Key="maxShowResults">Maximum results shown</system:String>
3535
<system:String x:Key="ignoreHotkeysOnFullscreen">Ignore hotkeys in fullscreen mode</system:String>
3636
<system:String x:Key="ignoreHotkeysOnFullscreenToolTip">Disable Flow Launcher activation when a full screen application is active (Recommended for games).</system:String>
37+
<system:String x:Key="defaultFileManager">Default File Manager</system:String>
38+
<system:String x:Key="defaultFileManagerToolTip">Select the file manager to use when opening the folder.</system:String>
3739
<system:String x:Key="pythonDirectory">Python Directory</system:String>
3840
<system:String x:Key="autoUpdates">Auto Update</system:String>
3941
<system:String x:Key="selectPythonDirectory">Select</system:String>

Flow.Launcher/SelectFileManagerWindow.xaml

Lines changed: 54 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
Orientation="Horizontal">
8989
<Grid Width="545">
9090
<Grid.ColumnDefinitions>
91-
<ColumnDefinition Width="220" />
91+
<ColumnDefinition Width="200" />
9292
<ColumnDefinition />
9393
</Grid.ColumnDefinitions>
9494
<Grid.RowDefinitions>
@@ -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"
@@ -122,15 +123,35 @@
122123
VerticalAlignment="Center"
123124
FontSize="14"
124125
Text="{DynamicResource fileManager_path}" />
125-
<TextBox
126-
Grid.Row="1"
127-
Grid.Column="1"
128-
Width="Auto"
129-
Margin="10,10,15,0"
130-
HorizontalAlignment="Stretch"
131-
VerticalAlignment="Center"
132-
IsEnabled="{Binding Editable}"
133-
Text="{Binding Path}" />
126+
<DockPanel Grid.Row="1" Grid.Column="1">
127+
<TextBox
128+
x:Name="PathTextBox"
129+
Width="230"
130+
Margin="10,10,10,0"
131+
HorizontalAlignment="Stretch"
132+
VerticalAlignment="Center"
133+
IsEnabled="{Binding Editable}"
134+
Text="{Binding Path}" />
135+
<Button
136+
Name="btnBrowseFile"
137+
Width="80"
138+
Margin="0,10,15,0"
139+
HorizontalAlignment="Right"
140+
VerticalAlignment="Center"
141+
Click="btnBrowseFile_Click"
142+
Content="{DynamicResource selectPythonDirectory}"
143+
DockPanel.Dock="Right">
144+
<Button.Style>
145+
<Style BasedOn="{StaticResource DefaultButtonStyle}" TargetType="{x:Type Button}">
146+
<Style.Triggers>
147+
<DataTrigger Binding="{Binding ElementName=ProfileTextBox, UpdateSourceTrigger=PropertyChanged, Path=IsEnabled}" Value="False">
148+
<Setter Property="IsEnabled" Value="False" />
149+
</DataTrigger>
150+
</Style.Triggers>
151+
</Style>
152+
</Button.Style>
153+
</Button>
154+
</DockPanel>
134155
<TextBlock
135156
Grid.Row="2"
136157
Grid.Column="0"
@@ -140,6 +161,7 @@
140161
FontSize="14"
141162
Text="{DynamicResource fileManager_directory_arg}" />
142163
<TextBox
164+
x:Name="directoryArgTextBox"
143165
Grid.Row="2"
144166
Grid.Column="1"
145167
Width="Auto"
@@ -157,6 +179,7 @@
157179
FontSize="14"
158180
Text="{DynamicResource fileManager_file_arg}" />
159181
<TextBox
182+
x:Name="fileArgTextBox"
160183
Grid.Row="3"
161184
Grid.Column="1"
162185
Width="Auto"
@@ -187,7 +210,27 @@
187210
Height="30"
188211
Margin="5,0,0,0"
189212
Click="btnDone_Click"
190-
Content="{DynamicResource done}" />
213+
Content="{DynamicResource done}"
214+
ForceCursor="True">
215+
<Button.Style>
216+
<Style BasedOn="{StaticResource DefaultButtonStyle}" TargetType="{x:Type Button}">
217+
<Style.Triggers>
218+
<DataTrigger Binding="{Binding Text.Length, ElementName=ProfileTextBox, UpdateSourceTrigger=PropertyChanged}" Value="0">
219+
<Setter Property="IsEnabled" Value="False" />
220+
</DataTrigger>
221+
<DataTrigger Binding="{Binding Text.Length, ElementName=PathTextBox, UpdateSourceTrigger=PropertyChanged}" Value="0">
222+
<Setter Property="IsEnabled" Value="False" />
223+
</DataTrigger>
224+
<DataTrigger Binding="{Binding Text.Length, ElementName=directoryArgTextBox, UpdateSourceTrigger=PropertyChanged}" Value="0">
225+
<Setter Property="IsEnabled" Value="False" />
226+
</DataTrigger>
227+
<DataTrigger Binding="{Binding Text.Length, ElementName=fileArgTextBox, UpdateSourceTrigger=PropertyChanged}" Value="0">
228+
<Setter Property="IsEnabled" Value="False" />
229+
</DataTrigger>
230+
</Style.Triggers>
231+
</Style>
232+
</Button.Style>
233+
</Button>
191234
</StackPanel>
192235
</Grid>
193236
</Window>

Flow.Launcher/SelectFileManagerWindow.xaml.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,19 @@ private void btnDelete_Click(object sender, RoutedEventArgs e)
7373
{
7474
CustomExplorers.RemoveAt(SelectedCustomExplorerIndex--);
7575
}
76+
77+
private void btnBrowseFile_Click(object sender, RoutedEventArgs e)
78+
{
79+
Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
80+
Nullable<bool> result = dlg.ShowDialog();
81+
82+
if (result == true)
83+
{
84+
TextBox path = (TextBox)(((FrameworkElement)sender).Parent as FrameworkElement).FindName("PathTextBox");
85+
path.Text = dlg.FileName;
86+
path.Focus();
87+
((Button)sender).Focus();
88+
}
89+
}
7690
}
7791
}

0 commit comments

Comments
 (0)