mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 19:57:07 +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;
|
||||||
using System.Windows.Forms;
|
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
|
namespace Wox.Plugin.Program
|
||||||
{
|
{
|
||||||
@@ -50,12 +52,17 @@ namespace Wox.Plugin.Program
|
|||||||
}
|
}
|
||||||
if (_editing == null)
|
if (_editing == null)
|
||||||
{
|
{
|
||||||
var source = new Settings.ProgramSource
|
if (!ProgramSetting.ProgramSettingDisplayList.Any(x => x.UniqueIdentifier == Directory.Text))
|
||||||
{
|
{
|
||||||
Location = Directory.Text,
|
var source = new ProgramSource
|
||||||
UniqueIdentifier = Directory.Text
|
{
|
||||||
};
|
Location = Directory.Text,
|
||||||
_settings.ProgramSources.Insert(0, source);
|
UniqueIdentifier = Directory.Text
|
||||||
|
};
|
||||||
|
|
||||||
|
_settings.ProgramSources.Insert(0, source);
|
||||||
|
ProgramSetting.ProgramSettingDisplayList.Add(source);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user