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)
|
if (selectedItems.Count == 0)
|
||||||
{
|
{
|
||||||
var msg = context.API.GetTranslation("flowlauncher_plugin_program_pls_select_program_source");
|
context.API.ShowMsgBox(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);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -376,7 +368,7 @@ namespace Flow.Launcher.Plugin.Program.Views
|
||||||
var dataView = CollectionViewSource.GetDefaultView(programSourceView.ItemsSource);
|
var dataView = CollectionViewSource.GetDefaultView(programSourceView.ItemsSource);
|
||||||
|
|
||||||
dataView.SortDescriptions.Clear();
|
dataView.SortDescriptions.Clear();
|
||||||
SortDescription sd = new SortDescription(sortBy, direction);
|
var sd = new SortDescription(sortBy, direction);
|
||||||
dataView.SortDescriptions.Add(sd);
|
dataView.SortDescriptions.Add(sd);
|
||||||
dataView.Refresh();
|
dataView.Refresh();
|
||||||
}
|
}
|
||||||
|
|
@ -421,20 +413,18 @@ namespace Flow.Launcher.Plugin.Program.Views
|
||||||
|
|
||||||
if (selectedItems.Count == 0)
|
if (selectedItems.Count == 0)
|
||||||
{
|
{
|
||||||
var msg = context.API.GetTranslation("flowlauncher_plugin_program_pls_select_program_source");
|
context.API.ShowMsgBox(context.API.GetTranslation("flowlauncher_plugin_program_pls_select_program_source"));
|
||||||
context.API.ShowMsgBox(msg);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IsAllItemsUserAdded(selectedItems))
|
if (!IsAllItemsUserAdded(selectedItems))
|
||||||
{
|
{
|
||||||
var msg1 = context.API.GetTranslation("flowlauncher_plugin_program_delete_program_source_select_user_added");
|
context.API.ShowMsgBox(context.API.GetTranslation("flowlauncher_plugin_program_delete_program_source_select_user_added"));
|
||||||
context.API.ShowMsgBox(msg1);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var msg2 = context.API.GetTranslation("flowlauncher_plugin_program_delete_program_source");
|
if (context.API.ShowMsgBox(context.API.GetTranslation("flowlauncher_plugin_program_delete_program_source"),
|
||||||
if (context.API.ShowMsgBox(msg2, string.Empty, MessageBoxButton.YesNo) == MessageBoxResult.No)
|
string.Empty, MessageBoxButton.YesNo) == MessageBoxResult.No)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue