mirror of
https://github.com/9ParsonsB/Pulsar.git
synced 2025-04-21 01:53:49 -04:00
feat: add plugin folder button
This commit is contained in:
parent
5edb32e8c7
commit
a2261a5c6c
@ -14,6 +14,7 @@ using System.Collections.Generic;
|
|||||||
using Avalonia.Media;
|
using Avalonia.Media;
|
||||||
using Avalonia.Controls.ApplicationLifetimes;
|
using Avalonia.Controls.ApplicationLifetimes;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
namespace Observatory.UI.Views
|
namespace Observatory.UI.Views
|
||||||
{
|
{
|
||||||
@ -140,7 +141,7 @@ namespace Observatory.UI.Views
|
|||||||
#region Native Settings
|
#region Native Settings
|
||||||
|
|
||||||
#region Plugin List
|
#region Plugin List
|
||||||
DataGrid pluginList = new() { Margin = new Thickness(0, 20) };
|
DataGrid pluginList = new() { Margin = new Thickness(0, 20, 0, 0) };
|
||||||
|
|
||||||
pluginList.Columns.Add(new DataGridTextColumn()
|
pluginList.Columns.Add(new DataGridTextColumn()
|
||||||
{
|
{
|
||||||
@ -192,6 +193,31 @@ namespace Observatory.UI.Views
|
|||||||
pluginList.Items = uniquePlugins.Values;
|
pluginList.Items = uniquePlugins.Values;
|
||||||
gridManager.AddSetting(pluginList);
|
gridManager.AddSetting(pluginList);
|
||||||
|
|
||||||
|
Button pluginFolderButton = new()
|
||||||
|
{
|
||||||
|
Content = "Open Plugin Folder",
|
||||||
|
Height = 30,
|
||||||
|
Width = 150,
|
||||||
|
HorizontalAlignment = Avalonia.Layout.HorizontalAlignment.Right,
|
||||||
|
HorizontalContentAlignment = Avalonia.Layout.HorizontalAlignment.Center,
|
||||||
|
Margin = new Thickness(0, 0, 0, 20)
|
||||||
|
};
|
||||||
|
|
||||||
|
pluginFolderButton.Click += (object sender, RoutedEventArgs e) =>
|
||||||
|
{
|
||||||
|
string pluginDir = AppDomain.CurrentDomain.BaseDirectory + "plugins";
|
||||||
|
|
||||||
|
if (!Directory.Exists(pluginDir))
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(pluginDir);
|
||||||
|
}
|
||||||
|
|
||||||
|
var fileExplorerInfo = new System.Diagnostics.ProcessStartInfo() { FileName = pluginDir, UseShellExecute = true };
|
||||||
|
System.Diagnostics.Process.Start(fileExplorerInfo);
|
||||||
|
};
|
||||||
|
|
||||||
|
gridManager.AddSetting(pluginFolderButton);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Popup Notification settings
|
#region Popup Notification settings
|
||||||
@ -679,7 +705,6 @@ namespace Observatory.UI.Views
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user