mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Fix logic & Improve code quality
This commit is contained in:
parent
204d1d285a
commit
da77085508
1 changed files with 6 additions and 16 deletions
|
|
@ -298,15 +298,7 @@ namespace Flow.Launcher.Plugin.Program.Views
|
|||
|
||||
if (selectedItems.Count == 0)
|
||||
{
|
||||
var msg = context.API.GetTranslation("flowlauncher_plugin_program_pls_select_program_source");
|
||||
context.API.ShowMsgBox(msg);
|
||||
return;
|
||||
}
|
||||
|
||||
if (IsAllItemsUserAdded(selectedItems))
|
||||
{
|
||||
var msg1 = context.API.GetTranslation("flowlauncher_plugin_program_delete_program_source_select_not_user_added");
|
||||
context.API.ShowMsgBox(msg1);
|
||||
context.API.ShowMsgBox(context.API.GetTranslation("flowlauncher_plugin_program_pls_select_program_source"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -376,7 +368,7 @@ namespace Flow.Launcher.Plugin.Program.Views
|
|||
var dataView = CollectionViewSource.GetDefaultView(programSourceView.ItemsSource);
|
||||
|
||||
dataView.SortDescriptions.Clear();
|
||||
SortDescription sd = new SortDescription(sortBy, direction);
|
||||
var sd = new SortDescription(sortBy, direction);
|
||||
dataView.SortDescriptions.Add(sd);
|
||||
dataView.Refresh();
|
||||
}
|
||||
|
|
@ -421,20 +413,18 @@ namespace Flow.Launcher.Plugin.Program.Views
|
|||
|
||||
if (selectedItems.Count == 0)
|
||||
{
|
||||
var msg = context.API.GetTranslation("flowlauncher_plugin_program_pls_select_program_source");
|
||||
context.API.ShowMsgBox(msg);
|
||||
context.API.ShowMsgBox(context.API.GetTranslation("flowlauncher_plugin_program_pls_select_program_source"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!IsAllItemsUserAdded(selectedItems))
|
||||
{
|
||||
var msg1 = context.API.GetTranslation("flowlauncher_plugin_program_delete_program_source_select_user_added");
|
||||
context.API.ShowMsgBox(msg1);
|
||||
context.API.ShowMsgBox(context.API.GetTranslation("flowlauncher_plugin_program_delete_program_source_select_user_added"));
|
||||
return;
|
||||
}
|
||||
|
||||
var msg2 = context.API.GetTranslation("flowlauncher_plugin_program_delete_program_source");
|
||||
if (context.API.ShowMsgBox(msg2, string.Empty, MessageBoxButton.YesNo) == MessageBoxResult.No)
|
||||
if (context.API.ShowMsgBox(context.API.GetTranslation("flowlauncher_plugin_program_delete_program_source"),
|
||||
string.Empty, MessageBoxButton.YesNo) == MessageBoxResult.No)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue