mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Use api functions instead
This commit is contained in:
parent
5626ab71c7
commit
6e36b08cad
1 changed files with 7 additions and 13 deletions
|
|
@ -7,6 +7,7 @@ using System.Linq;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Documents;
|
using System.Windows.Documents;
|
||||||
|
using System.Windows.Navigation;
|
||||||
using CommunityToolkit.Mvvm.ComponentModel;
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
using Flow.Launcher.Infrastructure.UserSettings;
|
using Flow.Launcher.Infrastructure.UserSettings;
|
||||||
using Flow.Launcher.ViewModel;
|
using Flow.Launcher.ViewModel;
|
||||||
|
|
@ -33,6 +34,7 @@ namespace Flow.Launcher
|
||||||
public ObservableCollection<CustomExplorerViewModel> CustomExplorers { get; set; }
|
public ObservableCollection<CustomExplorerViewModel> CustomExplorers { get; set; }
|
||||||
|
|
||||||
public CustomExplorerViewModel CustomExplorer => CustomExplorers[SelectedCustomExplorerIndex];
|
public CustomExplorerViewModel CustomExplorer => CustomExplorers[SelectedCustomExplorerIndex];
|
||||||
|
|
||||||
public SelectFileManagerWindow(Settings settings)
|
public SelectFileManagerWindow(Settings settings)
|
||||||
{
|
{
|
||||||
_settings = settings;
|
_settings = settings;
|
||||||
|
|
@ -46,13 +48,9 @@ namespace Flow.Launcher
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Hyperlink_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e)
|
private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
|
||||||
{
|
{
|
||||||
Process.Start(new ProcessStartInfo
|
App.API.OpenUrl(e.Uri.AbsoluteUri);
|
||||||
{
|
|
||||||
FileName = e.Uri.AbsoluteUri,
|
|
||||||
UseShellExecute = true
|
|
||||||
});
|
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -62,9 +60,9 @@ namespace Flow.Launcher
|
||||||
if (!IsFileManagerValid(CustomExplorer.Path))
|
if (!IsFileManagerValid(CustomExplorer.Path))
|
||||||
{
|
{
|
||||||
var result = App.API.ShowMsgBox(
|
var result = App.API.ShowMsgBox(
|
||||||
string.Format((string)Application.Current.FindResource("fileManagerPathNotFound"),
|
string.Format(App.API.GetTranslation("fileManagerPathNotFound"),
|
||||||
CustomExplorer.Name, CustomExplorer.Path),
|
CustomExplorer.Name, CustomExplorer.Path),
|
||||||
(string)Application.Current.FindResource("fileManagerPathError"),
|
App.API.GetTranslation("fileManagerPathError"),
|
||||||
MessageBoxButton.YesNo,
|
MessageBoxButton.YesNo,
|
||||||
MessageBoxImage.Warning);
|
MessageBoxImage.Warning);
|
||||||
|
|
||||||
|
|
@ -136,11 +134,7 @@ namespace Flow.Launcher
|
||||||
hyperlink.Inlines.Add(url);
|
hyperlink.Inlines.Add(url);
|
||||||
hyperlink.RequestNavigate += (s, args) =>
|
hyperlink.RequestNavigate += (s, args) =>
|
||||||
{
|
{
|
||||||
Process.Start(new ProcessStartInfo
|
App.API.OpenUrl(args.Uri.AbsoluteUri);
|
||||||
{
|
|
||||||
FileName = args.Uri.AbsoluteUri,
|
|
||||||
UseShellExecute = true
|
|
||||||
});
|
|
||||||
args.Handled = true;
|
args.Handled = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue