Skip to content

Commit 15a7a58

Browse files
committed
fix browse folder select
1 parent d28213b commit 15a7a58

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

Plugins/Flow.Launcher.Plugin.BrowserBookmark/ViewModels/CustomBrowserSettingViewModel.cs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
using System;
77
using System.ComponentModel;
88
using System.IO;
9-
using Microsoft.Win32;
109

1110
namespace Flow.Launcher.Plugin.BrowserBookmark.ViewModels;
1211

@@ -86,22 +85,20 @@ private void Cancel()
8685
[RelayCommand]
8786
private void BrowseDataDirectory()
8887
{
89-
var dialog = new OpenFileDialog
88+
var dialog = new System.Windows.Forms.FolderBrowserDialog
9089
{
91-
ValidateNames = false,
92-
CheckFileExists = false,
93-
CheckPathExists = true,
94-
FileName = "Folder Selection."
90+
Description = "Select the browser's profile data directory.",
91+
UseDescriptionForTitle = true
9592
};
9693

9794
if (!string.IsNullOrEmpty(EditableBrowser.DataDirectoryPath) && Directory.Exists(EditableBrowser.DataDirectoryPath))
9895
{
99-
dialog.InitialDirectory = EditableBrowser.DataDirectoryPath;
96+
dialog.SelectedPath = EditableBrowser.DataDirectoryPath;
10097
}
10198

102-
if (dialog.ShowDialog() == true)
99+
if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
103100
{
104-
var path = Path.GetDirectoryName(dialog.FileName);
101+
var path = dialog.SelectedPath;
105102
if (!string.IsNullOrEmpty(path))
106103
{
107104
EditableBrowser.DataDirectoryPath = path;

0 commit comments

Comments
 (0)