Skip to content

Commit c2b1481

Browse files
Warn if trying to add existing shortcut
1. Warn if trying to add existing shortcut
1 parent a0c70a3 commit c2b1481

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ public string QuerySearchPrecisionString
175175

176176

177177
public ObservableCollection<CustomPluginHotkey> CustomPluginHotkeys { get; set; } = new ObservableCollection<CustomPluginHotkey>();
178+
public ObservableCollection<CustomShortcutModel> CustomShortcuts { get; set; } = new ObservableCollection<CustomShortcutModel>();
178179

179180
public bool DontPromptUpdateMsg { get; set; }
180181
public bool EnableUpdateLog { get; set; }
@@ -204,7 +205,6 @@ public bool HideNotifyIcon
204205

205206
// This needs to be loaded last by staying at the bottom
206207
public PluginsSettings PluginSettings { get; set; } = new PluginsSettings();
207-
internal ObservableCollection<CustomShortcutModel> CustomShortcuts { get; set; } = new();
208208
}
209209

210210
public enum LastQueryMode

Flow.Launcher/SettingWindow.xaml.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,11 @@ 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+
}
418423
settings.CustomShortcuts.Add(shortcutSettingWindow.ShortCut);
419424
}
420425
}

0 commit comments

Comments
 (0)