mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 03:07:04 +02:00
Fix add button action to not duplicate + implement new model
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user