Skip to content

Commit 465146d

Browse files
committed
Add Exploere Customize to Program Plugin
1 parent c254c93 commit 465146d

File tree

5 files changed

+24
-8
lines changed

5 files changed

+24
-8
lines changed

Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,9 @@ public List<Result> ContextMenus(IPublicAPI api)
324324

325325
Action = _ =>
326326
{
327-
Main.StartProcess(Process.Start, new ProcessStartInfo(Package.Location));
327+
Main.StartProcess(Process.Start, new ProcessStartInfo(
328+
!string.IsNullOrEmpty(Main._settings.CustomizedExploere)?Main._settings.CustomizedExploere:"exploere"
329+
, Package.Location));
328330

329331
return true;
330332
},

Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,9 @@ public List<Result> ContextMenus(IPublicAPI api)
140140
Title = api.GetTranslation("flowlauncher_plugin_program_open_containing_folder"),
141141
Action = _ =>
142142
{
143-
144-
145-
Main.StartProcess(Process.Start, new ProcessStartInfo("explorer", ParentDirectory));
146-
143+
Main.StartProcess(Process.Start, new ProcessStartInfo(
144+
!string.IsNullOrEmpty(Main._settings.CustomizedExploere)?Main._settings.CustomizedExploere:"exploere"
145+
, ParentDirectory));
147146
return true;
148147
},
149148
IcoPath = "Images/folder.png"

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public class Settings
1414
public bool EnableStartMenuSource { get; set; } = true;
1515

1616
public bool EnableRegistrySource { get; set; } = true;
17+
public string CustomizedExploere { get; set; } = "exploere";
1718

1819
internal const char SuffixSeperator = ';';
1920

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
66
xmlns:program="clr-namespace:Flow.Launcher.Plugin.Program"
77
mc:Ignorable="d"
8-
d:DesignHeight="300" d:DesignWidth="600">
8+
d:DesignHeight="404.508" d:DesignWidth="600">
99
<Grid Margin="10">
1010
<Grid.RowDefinitions>
1111
<RowDefinition Height="75"/>
1212
<RowDefinition Height="*"/>
1313
<RowDefinition Height="50"/>
14+
<RowDefinition Height="50"/>
1415
</Grid.RowDefinitions>
1516
<StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Stretch">
1617
<StackPanel Orientation="Vertical" Width="205">
@@ -24,7 +25,7 @@
2425
</StackPanel>
2526
</StackPanel>
2627
<ListView x:Name="programSourceView" Grid.Row="1" AllowDrop="True" SelectionMode="Extended" Style="{StaticResource {x:Static GridView.GridViewStyleKey}}"
27-
Margin="0 13 0 0"
28+
Margin="0,13,0,10"
2829
BorderBrush="DarkGray"
2930
BorderThickness="1"
3031
GridViewColumnHeader.Click="GridViewColumnHeaderClickedHandler"
@@ -63,7 +64,7 @@
6364
</GridView>
6465
</ListView.View>
6566
</ListView>
66-
<DockPanel Grid.Row="2">
67+
<DockPanel Grid.Row="2" Margin="0,0,0,0" Grid.RowSpan="1">
6768
<StackPanel x:Name="indexingPanel" Visibility="Hidden" HorizontalAlignment="Left" Orientation="Horizontal">
6869
<ProgressBar x:Name="progressBarIndexing" Height="20" Width="80" Minimum="0" Maximum="100" IsIndeterminate="True" />
6970
<TextBlock Margin="10 0 0 0" Height="20" HorizontalAlignment="Center" Text="{DynamicResource flowlauncher_plugin_program_indexing}" />
@@ -74,6 +75,12 @@
7475
<Button x:Name="btnAddProgramSource" Click="btnAddProgramSource_OnClick" Width="100" Margin="10" Content="{DynamicResource flowlauncher_plugin_program_add}"/>
7576
</StackPanel>
7677
</DockPanel>
78+
<TextBlock Text="Customized Explorer" HorizontalAlignment="Left" Margin="20,0,0,0" Grid.Row="3" VerticalAlignment="Center" FontSize="15"
79+
ToolTip="You can customized the exploere for opening the container folder
80+
by inputing the Environmental Variable of the exploere you want to use.
81+
It will be useful to use CMD to test whether the Environmental Variable is avaliable."/>
82+
<TextBox HorizontalAlignment="Right" Margin="0,0,30,0" Grid.Row="3" Text="" TextWrapping="NoWrap" VerticalAlignment="Center" Width="250" Height="30" FontSize="15"
83+
TextChanged="CustomizeExplorer" x:Name="CustomizeExplorerBox"/>
7784
</Grid>
7885
</UserControl>
7986

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ private void Setting_Loaded(object sender, RoutedEventArgs e)
4343
StartMenuEnabled.IsChecked = _settings.EnableStartMenuSource;
4444
RegistryEnabled.IsChecked = _settings.EnableRegistrySource;
4545

46+
CustomizeExplorerBox.Text = _settings.CustomizedExploere;
47+
4648
ViewRefresh();
4749
}
4850

@@ -326,5 +328,10 @@ private void Row_OnClick(object sender, RoutedEventArgs e)
326328
btnProgramSourceStatus.Content = "Enable";
327329
}
328330
}
331+
332+
private void CustomizeExplorer(object sender, TextChangedEventArgs e)
333+
{
334+
_settings.CustomizedExploere = CustomizeExplorerBox.Text;
335+
}
329336
}
330337
}

0 commit comments

Comments
 (0)