better folder browser code

This commit is contained in:
Frank Skare
2021-09-05 21:59:05 +02:00
parent 7a6b2011e4
commit 333d0ee62f
5 changed files with 91 additions and 171 deletions

View File

@@ -74,8 +74,11 @@ namespace mpvnet
foreach (string arg in args)
{
if (arg == "append") append = true;
if (arg == "no-folder") loadFolder = false;
if (arg == "append")
append = true;
if (arg == "no-folder")
loadFolder = false;
}
App.InvokeOnMainThread(new Action(() => {
@@ -88,9 +91,10 @@ namespace mpvnet
public static void Open_DVD_Or_BD_Folder()
{
App.InvokeOnMainThread(new Action(() => {
using (var dialog = new FolderBrowser())
if (dialog.ShowDialog() == DialogResult.OK)
Core.LoadDiskFolder(dialog.SelectedPath);
var dialog = new FolderBrowser();
if (dialog.Show())
Core.LoadDiskFolder(dialog.SelectedPath);
}));
}