mirror of
https://github.com/riegera2412/UVtools.git
synced 2026-08-01 21:32:18 +02:00
v1.1.3
* (Add) Auto-updater: When a new version is detected UVtools still show the same green button at top, on click, it will prompt for auto or manual update. On Linux and Mac the script will kill all UVtools instances and auto-upgrade. On Windows the user must close all instances and continue with the shown MSI installation * (Add) Tool profiles: Create and remove named presets for some tools * (Add) Event handler for handling non-UI thread exceptions * (Fix) Mac: File - Open in a new window was not working * (Fix) Tool - Rotate: Allow negative angles * (Fix) Tool - Rotate: The operation was inverting the angle * (Fix) Tools: Select normal layers can crash the program with small files with low layer count, eg: 3 layers total
This commit is contained in:
+13
-11
@@ -20,7 +20,9 @@ using Avalonia.Media.Imaging;
|
||||
using Avalonia.Platform;
|
||||
using Avalonia.ThemeManager;
|
||||
using Emgu.CV;
|
||||
using UVtools.Core;
|
||||
using UVtools.Core.FileFormats;
|
||||
using UVtools.Core.Operations;
|
||||
using UVtools.WPF.Extensions;
|
||||
using UVtools.WPF.Structures;
|
||||
|
||||
@@ -49,6 +51,8 @@ namespace UVtools.WPF
|
||||
UserSettings.Load();
|
||||
UserSettings.SetVersion();
|
||||
|
||||
OperationProfiles.Load();
|
||||
|
||||
ThemeSelector = Avalonia.ThemeManager.ThemeSelector.Create(Path.Combine(ApplicationPath, "Assets", "Themes"));
|
||||
ThemeSelector.LoadSelectedTheme(Path.Combine(UserSettings.SettingsFolder, "selected.theme"));
|
||||
if (ThemeSelector.SelectedTheme.Name == "UVtoolsDark" || ThemeSelector.SelectedTheme.Name == "Light")
|
||||
@@ -87,25 +91,24 @@ namespace UVtools.WPF
|
||||
}
|
||||
|
||||
#region Utilities
|
||||
|
||||
public static string AppExecutable = Path.Combine(ApplicationPath, About.Software);
|
||||
public static string AppExecutableQuoted = $"\"{AppExecutable}\"";
|
||||
public static void NewInstance(string filePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||
{
|
||||
var info = new ProcessStartInfo("UVtools.exe", $"\"{filePath}\"")
|
||||
{
|
||||
UseShellExecute = true
|
||||
};
|
||||
Process.Start(info).Dispose();
|
||||
StartProcess($"{AppExecutable}.exe", $"\"{filePath}\"");
|
||||
}
|
||||
else if(File.Exists("UVtools"))
|
||||
else if(File.Exists(AppExecutable)) // Direct execute
|
||||
{
|
||||
Process.Start("UVtools", $"\"{filePath}\"").Dispose();
|
||||
StartProcess(AppExecutable, $"\"{filePath}\"");
|
||||
}
|
||||
else
|
||||
{
|
||||
Process.Start("dotnet", $"UVtools.dll \"{filePath}\"").Dispose();
|
||||
StartProcess("dotnet", $"UVtools.dll \"{filePath}\"");
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -142,11 +145,11 @@ namespace UVtools.WPF
|
||||
|
||||
}
|
||||
|
||||
public static void StartProcess(string name)
|
||||
public static void StartProcess(string name, string arguments = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (Process.Start(new ProcessStartInfo(name)
|
||||
using (Process.Start(new ProcessStartInfo(name, arguments)
|
||||
{
|
||||
UseShellExecute = true
|
||||
})) { }
|
||||
@@ -155,7 +158,6 @@ namespace UVtools.WPF
|
||||
{
|
||||
Debug.WriteLine(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static Stream GetAsset(string url)
|
||||
|
||||
Reference in New Issue
Block a user