diff --git a/proxmox-spice-launcher.sln b/proxmox-spice-launcher.sln index c622efa..abb7794 100644 --- a/proxmox-spice-launcher.sln +++ b/proxmox-spice-launcher.sln @@ -1,9 +1,9 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 -VisualStudioVersion = 17.13.35919.96 d17.13 +VisualStudioVersion = 17.13.35919.96 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "proxmox-spice-launcher", "src\proxmox-spice-launcher\proxmox-spice-launcher\proxmox-spice-launcher.csproj", "{9A4EC4BE-8920-461F-8653-A9650A68B727}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "proxmox-spice-launcher", "src\proxmox-spice-launcher\proxmox-spice-launcher.csproj", "{8F3740FC-DC36-1459-2ECB-B04F0BBA4ED8}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -11,10 +11,10 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {9A4EC4BE-8920-461F-8653-A9650A68B727}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9A4EC4BE-8920-461F-8653-A9650A68B727}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9A4EC4BE-8920-461F-8653-A9650A68B727}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9A4EC4BE-8920-461F-8653-A9650A68B727}.Release|Any CPU.Build.0 = Release|Any CPU + {8F3740FC-DC36-1459-2ECB-B04F0BBA4ED8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8F3740FC-DC36-1459-2ECB-B04F0BBA4ED8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8F3740FC-DC36-1459-2ECB-B04F0BBA4ED8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8F3740FC-DC36-1459-2ECB-B04F0BBA4ED8}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/proxmox-spice-launcher/proxmox-spice-launcher/App.xaml b/src/proxmox-spice-launcher/App.xaml similarity index 100% rename from src/proxmox-spice-launcher/proxmox-spice-launcher/App.xaml rename to src/proxmox-spice-launcher/App.xaml diff --git a/src/proxmox-spice-launcher/proxmox-spice-launcher/App.xaml.cs b/src/proxmox-spice-launcher/App.xaml.cs similarity index 100% rename from src/proxmox-spice-launcher/proxmox-spice-launcher/App.xaml.cs rename to src/proxmox-spice-launcher/App.xaml.cs diff --git a/src/proxmox-spice-launcher/proxmox-spice-launcher/AssemblyInfo.cs b/src/proxmox-spice-launcher/AssemblyInfo.cs similarity index 100% rename from src/proxmox-spice-launcher/proxmox-spice-launcher/AssemblyInfo.cs rename to src/proxmox-spice-launcher/AssemblyInfo.cs diff --git a/src/proxmox-spice-launcher/proxmox-spice-launcher/DPApi.cs b/src/proxmox-spice-launcher/DPApi.cs similarity index 100% rename from src/proxmox-spice-launcher/proxmox-spice-launcher/DPApi.cs rename to src/proxmox-spice-launcher/DPApi.cs diff --git a/src/proxmox-spice-launcher/Extensions/ObservableCollectionExtensions.cs b/src/proxmox-spice-launcher/Extensions/ObservableCollectionExtensions.cs new file mode 100644 index 0000000..3705521 --- /dev/null +++ b/src/proxmox-spice-launcher/Extensions/ObservableCollectionExtensions.cs @@ -0,0 +1,16 @@ +using System.Collections.ObjectModel; + +namespace Proxmox.SpiceLauncher.Extensions; +internal static class ObservableCollectionExtensions +{ + public static ObservableCollection Sort(this ObservableCollection collection, Comparison comparison) + { + var sortableList = new List(collection); + sortableList.Sort(comparison); + for (int i = 0; i < sortableList.Count; i++) + { + collection.Move(collection.IndexOf(sortableList[i]), i); + } + return collection; + } +} diff --git a/src/proxmox-spice-launcher/proxmox-spice-launcher/MainWindow.xaml b/src/proxmox-spice-launcher/MainWindow.xaml similarity index 61% rename from src/proxmox-spice-launcher/proxmox-spice-launcher/MainWindow.xaml rename to src/proxmox-spice-launcher/MainWindow.xaml index 181d274..7bca720 100644 --- a/src/proxmox-spice-launcher/proxmox-spice-launcher/MainWindow.xaml +++ b/src/proxmox-spice-launcher/MainWindow.xaml @@ -7,7 +7,7 @@ xmlns:local="clr-namespace:Proxmox.SpiceLauncher" xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks" mc:Ignorable="d" - Title="Proxmox Spice Launcher" Height="391" Width="350" ResizeMode="NoResize" + Title="Proxmox Spice Launcher" Height="391" Width="539" ResizeMode="NoResize" Initialized="MetroWindow_Initialized" Closing="MetroWindow_Closing" SizeToContent="Height" Icon="pack://application:,,,/Proxmox.SpiceLauncher.png"> @@ -29,18 +29,24 @@ - - - - + + + + + +