Skip to content

Commit 6e36b08

Browse files
committed
Use api functions instead
1 parent 5626ab7 commit 6e36b08

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

Flow.Launcher/SelectFileManagerWindow.xaml.cs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using System.Windows;
88
using System.Windows.Controls;
99
using System.Windows.Documents;
10+
using System.Windows.Navigation;
1011
using CommunityToolkit.Mvvm.ComponentModel;
1112
using Flow.Launcher.Infrastructure.UserSettings;
1213
using Flow.Launcher.ViewModel;
@@ -33,6 +34,7 @@ public int SelectedCustomExplorerIndex
3334
public ObservableCollection<CustomExplorerViewModel> CustomExplorers { get; set; }
3435

3536
public CustomExplorerViewModel CustomExplorer => CustomExplorers[SelectedCustomExplorerIndex];
37+
3638
public SelectFileManagerWindow(Settings settings)
3739
{
3840
_settings = settings;
@@ -46,13 +48,9 @@ private void btnCancel_Click(object sender, RoutedEventArgs e)
4648
Close();
4749
}
4850

49-
private void Hyperlink_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e)
51+
private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
5052
{
51-
Process.Start(new ProcessStartInfo
52-
{
53-
FileName = e.Uri.AbsoluteUri,
54-
UseShellExecute = true
55-
});
53+
App.API.OpenUrl(e.Uri.AbsoluteUri);
5654
e.Handled = true;
5755
}
5856

@@ -62,9 +60,9 @@ private void btnDone_Click(object sender, RoutedEventArgs e)
6260
if (!IsFileManagerValid(CustomExplorer.Path))
6361
{
6462
var result = App.API.ShowMsgBox(
65-
string.Format((string)Application.Current.FindResource("fileManagerPathNotFound"),
63+
string.Format(App.API.GetTranslation("fileManagerPathNotFound"),
6664
CustomExplorer.Name, CustomExplorer.Path),
67-
(string)Application.Current.FindResource("fileManagerPathError"),
65+
App.API.GetTranslation("fileManagerPathError"),
6866
MessageBoxButton.YesNo,
6967
MessageBoxImage.Warning);
7068

@@ -136,11 +134,7 @@ private async void btnTips_Click(object sender, RoutedEventArgs e)
136134
hyperlink.Inlines.Add(url);
137135
hyperlink.RequestNavigate += (s, args) =>
138136
{
139-
Process.Start(new ProcessStartInfo
140-
{
141-
FileName = args.Uri.AbsoluteUri,
142-
UseShellExecute = true
143-
});
137+
App.API.OpenUrl(args.Uri.AbsoluteUri);
144138
args.Handled = true;
145139
};
146140

0 commit comments

Comments
 (0)