mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Fix add button action to not duplicate + implement new model
This commit is contained in:
parent
b2a47e6216
commit
006ec1abb8
1 changed files with 13 additions and 6 deletions
|
|
@ -1,6 +1,8 @@
|
|||
using System.Windows;
|
||||
using System.Windows.Forms;
|
||||
using Wox.Plugin.Program.Programs;
|
||||
using Wox.Plugin.Program.Views.Models;
|
||||
using Wox.Plugin.Program.Views;
|
||||
using System.Linq;
|
||||
|
||||
namespace Wox.Plugin.Program
|
||||
{
|
||||
|
|
@ -50,12 +52,17 @@ namespace Wox.Plugin.Program
|
|||
}
|
||||
if (_editing == null)
|
||||
{
|
||||
var source = new Settings.ProgramSource
|
||||
if (!ProgramSetting.ProgramSettingDisplayList.Any(x => x.UniqueIdentifier == Directory.Text))
|
||||
{
|
||||
Location = Directory.Text,
|
||||
UniqueIdentifier = Directory.Text
|
||||
};
|
||||
_settings.ProgramSources.Insert(0, source);
|
||||
var source = new ProgramSource
|
||||
{
|
||||
Location = Directory.Text,
|
||||
UniqueIdentifier = Directory.Text
|
||||
};
|
||||
|
||||
_settings.ProgramSources.Insert(0, source);
|
||||
ProgramSetting.ProgramSettingDisplayList.Add(source);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue