Skip to content

Commit 74167a9

Browse files
committed
Strings translations and warning box
1 parent 61aca74 commit 74167a9

File tree

3 files changed

+27
-12
lines changed

3 files changed

+27
-12
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
<!-- Dialogues -->
77
<system:String x:Key="plugin_explorer_make_selection_warning">Please make a selection first</system:String>
8+
<system:String x:Key="plugin_explorer_quick_access_link_no_folder_selected">Please select path folder</system:String>
89
<system:String x:Key="plugin_explorer_select_folder_link_warning">Please select a folder link</system:String>
910
<system:String x:Key="plugin_explorer_delete_folder_link">Are you sure you want to delete {0}?</system:String>
1011
<system:String x:Key="plugin_explorer_deletefileconfirm">Are you sure you want to permanently delete this file?</system:String>
@@ -27,6 +28,9 @@
2728
<system:String x:Key="plugin_explorer_add">Add</system:String>
2829
<system:String x:Key="plugin_explorer_generalsetting_header">General Setting</system:String>
2930
<system:String x:Key="plugin_explorer_manageactionkeywords_header">Customise Action Keywords</system:String>
31+
<system:String x:Key="plugin_explorer_manage_quick_access_links_header">Customise Quick Access</system:String>
32+
<system:String x:Key="plugin_explorer_manage_quick_access_addr">Add</system:String>
33+
3034
<system:String x:Key="plugin_explorer_quickaccesslinks_header">Quick Access Links</system:String>
3135
<system:String x:Key="plugin_explorer_everything_setting_header">Everything Setting</system:String>
3236
<system:String x:Key="plugin_explorer_previewpanel_setting_header">Preview Panel</system:String>

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

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
Margin="0 0 0 0"
6262
FontSize="20"
6363
FontWeight="SemiBold"
64-
Text="{DynamicResource plugin_explorer_manageactionkeywords_header}"
64+
Text="{DynamicResource plugin_explorer_manage_quick_access_links_header}"
6565
TextAlignment="Left" />
6666
</StackPanel>
6767
<StackPanel Margin="0 10 0 0" Orientation="Horizontal">
@@ -71,11 +71,12 @@
7171
HorizontalAlignment="Left"
7272
VerticalAlignment="Center"
7373
FontSize="14"
74-
Text="{DynamicResource plugin_explorer_actionkeyword_current}" />
74+
Text="{DynamicResource plugin_explorer_name}" />
7575
<TextBox
76-
Width="135"
77-
HorizontalAlignment="Left"
76+
Margin="10 0 0 0"
7877
VerticalAlignment="Center"
78+
FontSize="12"
79+
Width="250"
7980
Text="{Binding SelectedName, Mode=TwoWay}" />
8081
</StackPanel>
8182

@@ -86,23 +87,23 @@
8687
HorizontalAlignment="Left"
8788
VerticalAlignment="Center"
8889
FontSize="14"
89-
Text="Path:" />
90+
Text="{DynamicResource plugin_explorer_path}" />
9091

91-
<TextBlock
92+
93+
<TextBox
9294
Margin="10 0 0 0"
9395
VerticalAlignment="Center"
9496
FontSize="12"
9597
Width="250"
96-
TextTrimming="CharacterEllipsis"
97-
Text="{Binding SelectedPath, Mode=OneWay}" />
98-
98+
Text="{Binding SelectedPath, Mode=TwoWay}"
99+
IsReadOnly="True" />
99100
<Button
100101
Width="80"
101-
Height="25"
102+
Height="Auto"
102103
Margin="10 0 0 0"
103104
HorizontalAlignment="Left"
104105
VerticalAlignment="Center"
105-
Content="Adicionar"
106+
Content="{DynamicResource select}"
106107
Click="SelectPath_OnClick" />
107108
</StackPanel>
108109

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ public string SelectedPath
3333
private string _selectedName;
3434
public string SelectedName
3535
{
36-
get => _selectedName;
36+
get
37+
{
38+
if (string.IsNullOrEmpty(_selectedName)) return GetPathName();
39+
return _selectedName;
40+
}
3741
set
3842
{
3943
if (_selectedName != value)
@@ -60,6 +64,12 @@ private void BtnCancel_OnClick(object sender, RoutedEventArgs e)
6064

6165
private void OnDoneButtonClick(object sender, RoutedEventArgs e)
6266
{
67+
if (string.IsNullOrEmpty(SelectedName) && string.IsNullOrEmpty(SelectedPath))
68+
{
69+
var warning = Main.Context.API.GetTranslation("plugin_explorer_quick_access_link_no_folder_selected");
70+
Main.Context.API.ShowMsgBox(warning);
71+
return;
72+
}
6373
var container = Settings.QuickAccessLinks;
6474

6575

0 commit comments

Comments
 (0)