Skip to content

Commit bad007c

Browse files
committed
show Explorer action keywords on UI
1 parent 7ad0071 commit bad007c

File tree

3 files changed

+40
-3
lines changed

3 files changed

+40
-3
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
1+
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
22
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
33
xmlns:system="clr-namespace:System;assembly=mscorlib">
44

@@ -13,11 +13,11 @@
1313
<system:String x:Key="plugin_explorer_delete">Delete</system:String>
1414
<system:String x:Key="plugin_explorer_edit">Edit</system:String>
1515
<system:String x:Key="plugin_explorer_add">Add</system:String>
16+
<system:String x:Key="plugin_explorer_manageactionkeywords_header">Customise Action Keywords</system:String>
1617
<system:String x:Key="plugin_explorer_quickfolderaccess_header">Quick Folder Access Paths</system:String>
1718
<system:String x:Key="plugin_explorer_indexsearchexcludedpaths_header">Index Search Excluded Paths</system:String>
1819
<system:String x:Key="plugin_explorer_manageindexoptions">Indexing Options</system:String>
1920

20-
2121
<!--Plugin Infos-->
2222
<system:String x:Key="plugin_explorer_plugin_name">Explorer</system:String>
2323
<system:String x:Key="plugin_explorer_plugin_description">Search and manage files and folders. Explorer utilises Windows Index Search</system:String>

Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@
1717
Text="{Binding Nickname, Mode=OneTime}"
1818
Margin="0,5,0,5" />
1919
</DataTemplate>
20+
<DataTemplate x:Key="ListViewActionKeywords">
21+
<Grid>
22+
<TextBlock
23+
Text="{Binding Description, Mode=OneTime}"
24+
Margin="0,5,0,0" />
25+
<TextBlock
26+
Text="{Binding Keyword, Mode=OneTime}"
27+
Margin="150,5,0,0" />
28+
</Grid>
29+
</DataTemplate>
2030
</UserControl.Resources>
2131
<Grid Margin="10">
2232
<Grid.RowDefinitions>
@@ -25,8 +35,14 @@
2535
</Grid.RowDefinitions>
2636
<ScrollViewer Margin="20 35 0 0" HorizontalScrollBarVisibility="Hidden" Grid.Row="0" VerticalScrollBarVisibility="Auto">
2737
<StackPanel>
38+
<Expander Name="expActionKeywords" Header="{DynamicResource plugin_explorer_manageactionkeywords_header}"
39+
Expanded="expActionKeywords_Click" Collapsed="expActionKeywords_Click">
40+
<ListView x:Name="lbxActionKeywords"
41+
ItemTemplate="{StaticResource ListViewActionKeywords}"/>
42+
</Expander>
2843
<Expander Name="expFolderLinks" Header="{DynamicResource plugin_explorer_quickfolderaccess_header}"
29-
Expanded="expFolderLinks_Click" Collapsed="expFolderLinks_Click">
44+
Expanded="expFolderLinks_Click" Collapsed="expFolderLinks_Click"
45+
Margin="0 10 0 0">
3046
<ListView
3147
x:Name="lbxFolderLinks" AllowDrop="True"
3248
Drop="lbxFolders_Drop"

Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ public ExplorerSettings(SettingsViewModel viewModel)
3030

3131
lbxExcludedPaths.ItemsSource = this.viewModel.Settings.IndexSearchExcludedSubdirectoryPaths;
3232

33+
var actionKeywordsListView = new List<ActionKeywordView>();
34+
35+
actionKeywordsListView.Add(new ActionKeywordView() { Description = "Search Activation:", Keyword = this.viewModel.Settings.SearchActionKeyword });
36+
actionKeywordsListView.Add(new ActionKeywordView() { Description = "File Content Search:", Keyword = this.viewModel.Settings.FileContentSearchActionKeyword });
37+
38+
lbxActionKeywords.ItemsSource = actionKeywordsListView;
39+
3340
RefreshView();
3441
}
3542

@@ -77,6 +84,13 @@ public void RefreshView()
7784
lbxFolderLinks.Items.Refresh();
7885

7986
lbxExcludedPaths.Items.Refresh();
87+
88+
lbxActionKeywords.Items.Refresh();
89+
}
90+
91+
private void expActionKeywords_Click(object sender, RoutedEventArgs e)
92+
{
93+
8094
}
8195

8296
private void expFolderLinks_Click(object sender, RoutedEventArgs e)
@@ -242,4 +256,11 @@ private void btnOpenIndexingOptions_Click(object sender, RoutedEventArgs e)
242256
viewModel.OpenWindowsIndexingOptions();
243257
}
244258
}
259+
260+
public class ActionKeywordView
261+
{
262+
public string Description { get; set; }
263+
264+
public string Keyword { get; set; }
265+
}
245266
}

0 commit comments

Comments
 (0)