Core - Added utility for opening URLs in the default browser

This commit is contained in:
Robert committed 2020-10-14 20:50:16 +02:00
1 parent 016d39d034
commit 8be1945145
7 files changed
+28 -22

No files matched your search

+2 -9
View File
@@ -1,6 +1,4 @@
using System;
using System.Diagnostics;
using Stylet;
using Stylet;
namespace Artemis.UI.Screens.Home
{
@@ -13,12 +11,7 @@ namespace Artemis.UI.Screens.Home
public void OpenUrl(string url)
{
// Don't open anything but valid URIs
if (Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute))
{
url = url.Replace("&", "^&");
Process.Start(new ProcessStartInfo("cmd", $"/c start {url}") {CreateNoWindow = true});
}
Core.Utilities.OpenUrl(url);
}
}
}
@@ -131,7 +131,7 @@ namespace Artemis.UI.Screens.Settings.Tabs.Plugins
// Give the logger a chance to write, might not always be enough but oh well
await Task.Delay(500);
ApplicationUtilities.Shutdown(2, true);
Core.Utilities.Shutdown(2, true);
}
private PackIconKind GetIconKind()
@@ -227,7 +227,7 @@ namespace Artemis.UI.Screens.Settings.Tabs.Plugins
// Give the logger a chance to write, might not always be enough but oh well
await Task.Delay(500);
ApplicationUtilities.Shutdown(2, true);
Core.Utilities.Shutdown(2, true);
}
NotifyOfPropertyChange(nameof(IsEnabled));
+1 -1
View File
@@ -68,7 +68,7 @@ namespace Artemis.UI.Screens
public void TrayExit()
{
ApplicationUtilities.Shutdown(2, false);
Core.Utilities.Shutdown(2, false);
}
public void TrayOpenDebugger()