Skip to content

Commit e789948

Browse files
Text update
1 parent c2b1481 commit e789948

File tree

5 files changed

+29
-20
lines changed

5 files changed

+29
-20
lines changed

Flow.Launcher/CustomShortcutSetting.xaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
44
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
55
xmlns:flowlauncher="clr-namespace:Flow.Launcher"
6-
Title="{DynamicResource customeQueryHotkeyTitle}"
6+
Title="{DynamicResource customeQueryShortcutTitle}"
77
Width="530"
88
Background="{DynamicResource PopuBGColor}"
99
Foreground="{DynamicResource PopupTextColor}"
@@ -67,13 +67,13 @@
6767
FontFamily="Segoe UI"
6868
FontSize="20"
6969
FontWeight="SemiBold"
70-
Text="{DynamicResource customeQueryHotkeyTitle}"
70+
Text="{DynamicResource customQueryShortcut}"
7171
TextAlignment="Left" />
7272
</StackPanel>
7373
<StackPanel>
7474
<TextBlock
7575
FontSize="14"
76-
Text="{DynamicResource customeQueryHotkeyTips}"
76+
Text="{DynamicResource customeQueryShortcutTips}"
7777
TextAlignment="Left"
7878
TextWrapping="WrapWithOverflow" />
7979
</StackPanel>

Flow.Launcher/CustomShortcutSetting.xaml.cs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
using Flow.Launcher.Core.Resource;
2-
using Flow.Launcher.Helper;
3-
using Flow.Launcher.Infrastructure.UserSettings;
4-
using System.Collections.ObjectModel;
5-
using System.Linq;
1+
using System;
62
using System.Windows;
73
using System.Windows.Input;
8-
using System.Windows.Controls;
9-
using System.Collections.Generic;
4+
using Flow.Launcher.Core.Resource;
5+
using Flow.Launcher.Infrastructure.UserSettings;
106

117
namespace Flow.Launcher
128
{
@@ -40,6 +36,16 @@ private void BtnCancel_OnClick(object sender, RoutedEventArgs e)
4036
private void btnAdd_OnClick(object sender, RoutedEventArgs e)
4137
{
4238
DialogResult = true;
39+
if (_settings.CustomShortcuts.Contains(new CustomShortcutModel(Key, Value)))
40+
{
41+
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("dulplicateShortcut"));
42+
DialogResult = false;
43+
}
44+
else if (String.IsNullOrEmpty(Key) || String.IsNullOrEmpty(Value))
45+
{
46+
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("invalidShortcut"));
47+
DialogResult = false;
48+
}
4349
Close();
4450
}
4551

Flow.Launcher/Languages/en.xaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,9 @@
113113
<system:String x:Key="openResultModifiersToolTip">Select a modifier key to open selected result via keyboard.</system:String>
114114
<system:String x:Key="showOpenResultHotkey">Show Hotkey</system:String>
115115
<system:String x:Key="showOpenResultHotkeyToolTip">Show result selection hotkey with results.</system:String>
116-
<system:String x:Key="customQueryHotkey">Custom Query Hotkey</system:String>
117-
<system:String x:Key="customQuery">Query</system:String>
116+
<system:String x:Key="customQueryHotkey">Custom Query Hotkey</system:String>
117+
<system:String x:Key="customQueryShortcut">Custom Query Shortcut</system:String>
118+
<system:String x:Key="customQuery">Query</system:String>
118119
<system:String x:Key="customShortcut">Shortcut</system:String>
119120
<system:String x:Key="customShortcutExpansion">Expanded</system:String>
120121
<system:String x:Key="delete">Delete</system:String>
@@ -211,7 +212,14 @@
211212
<system:String x:Key="invalidPluginHotkey">Invalid plugin hotkey</system:String>
212213
<system:String x:Key="update">Update</system:String>
213214

214-
<!-- Hotkey Control -->
215+
<!-- Custom Query Shortcut Dialog -->
216+
<system:String x:Key="customeQueryShortcutTitle">Custom Query Shortcut</system:String>
217+
<system:String x:Key="customeQueryShortcutTips">Enter a shortcut to automatically expand to the specified query.</system:String>
218+
<system:String x:Key="preview">Preview</system:String>
219+
<system:String x:Key="dulplicateShortcut">Shortcut is dulplicate, please enter a new Shortcut or edit the existing one.</system:String>
220+
<system:String x:Key="invalidShortcut">Invalid Shortcut</system:String>
221+
222+
<!-- Hotkey Control -->
215223
<system:String x:Key="hotkeyUnavailable">Hotkey Unavailable</system:String>
216224

217225
<!-- Crash Reporter -->

Flow.Launcher/SettingWindow.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2188,14 +2188,14 @@
21882188
Style="{StaticResource {x:Static GridView.GridViewStyleKey}}">
21892189
<ListView.View>
21902190
<GridView>
2191-
<GridViewColumn Header="Key">
2191+
<GridViewColumn Header="{DynamicResource customShortcut}">
21922192
<GridViewColumn.CellTemplate>
21932193
<DataTemplate>
21942194
<TextBlock Text="{Binding Key}" />
21952195
</DataTemplate>
21962196
</GridViewColumn.CellTemplate>
21972197
</GridViewColumn>
2198-
<GridViewColumn Header="Mapped Value">
2198+
<GridViewColumn Header="{DynamicResource customShortcutExpansion}">
21992199
<GridViewColumn.CellTemplate>
22002200
<DataTemplate>
22012201
<TextBlock Text="{Binding Value}" />

Flow.Launcher/SettingWindow.xaml.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -415,11 +415,6 @@ private void OnAddCustomeShortCutClick(object sender, RoutedEventArgs e)
415415
var shortcutSettingWindow = new CustomShortcutSetting();
416416
if (shortcutSettingWindow.ShowDialog() == true)
417417
{
418-
if (settings.CustomShortcuts.Contains(shortcutSettingWindow.ShortCut))
419-
{
420-
MessageBox.Show("Dulplicate shortcut");
421-
return;
422-
}
423418
settings.CustomShortcuts.Add(shortcutSettingWindow.ShortCut);
424419
}
425420
}

0 commit comments

Comments
 (0)