]> granicus.if.org Git - handbrake/commitdiff
WinGui: Better default directory for Import SRT. #1661
authorsr55 <sr55.hb@outlook.com>
Sun, 4 Nov 2018 17:23:24 +0000 (17:23 +0000)
committersr55 <sr55.hb@outlook.com>
Sun, 4 Nov 2018 17:23:24 +0000 (17:23 +0000)
win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs

index 3d26296fd3d8226ad0a158d27849dff7c4b9ffaf..fb8dc838ceb6fa57655342abf6d308d592071c52 100644 (file)
@@ -244,6 +244,15 @@ namespace HandBrakeWPF.ViewModels
                     Multiselect = true\r
                 };\r
 \r
+            if (this.Task != null && this.Task.Source != null)\r
+            {\r
+                string path = Path.GetDirectoryName(this.Task.Source);\r
+                if (Directory.Exists(path))\r
+                {\r
+                    dialog.InitialDirectory = path;\r
+                }\r
+            }\r
+\r
             dialog.ShowDialog();\r
 \r
             this.AddInputSubtitles(dialog.FileNames);\r