File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
Plugins/Flow.Launcher.Plugin.BrowserBookmark/ViewModels Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change 6
6
using System ;
7
7
using System . ComponentModel ;
8
8
using System . IO ;
9
- using Microsoft . Win32 ;
10
9
11
10
namespace Flow . Launcher . Plugin . BrowserBookmark . ViewModels ;
12
11
@@ -86,22 +85,20 @@ private void Cancel()
86
85
[ RelayCommand ]
87
86
private void BrowseDataDirectory ( )
88
87
{
89
- var dialog = new OpenFileDialog
88
+ var dialog = new System . Windows . Forms . FolderBrowserDialog
90
89
{
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
95
92
} ;
96
93
97
94
if ( ! string . IsNullOrEmpty ( EditableBrowser . DataDirectoryPath ) && Directory . Exists ( EditableBrowser . DataDirectoryPath ) )
98
95
{
99
- dialog . InitialDirectory = EditableBrowser . DataDirectoryPath ;
96
+ dialog . SelectedPath = EditableBrowser . DataDirectoryPath ;
100
97
}
101
98
102
- if ( dialog . ShowDialog ( ) == true )
99
+ if ( dialog . ShowDialog ( ) == System . Windows . Forms . DialogResult . OK )
103
100
{
104
- var path = Path . GetDirectoryName ( dialog . FileName ) ;
101
+ var path = dialog . SelectedPath ;
105
102
if ( ! string . IsNullOrEmpty ( path ) )
106
103
{
107
104
EditableBrowser . DataDirectoryPath = path ;
You can’t perform that action at this time.
0 commit comments