From 6a1b02f3fb38da9c39a3dbb0adb8b6fe11bbbea6 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sun, 29 Nov 2009 19:32:16 +0000 Subject: WinGui: - Preview window: Check the x86 program files directory for VLC if VLC doesn't exist in the main program files directory. - Activate the Activity Window when the button is clicked on. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2991 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/C#/frmMain.cs | 1 + win/C#/frmPreview.cs | 23 ++++++++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) (limited to 'win/C#') diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs index 58ad36061..0de757e46 100644 --- a/win/C#/frmMain.cs +++ b/win/C#/frmMain.cs @@ -809,6 +809,7 @@ namespace Handbrake ActivityWindow.SetScanMode(); ActivityWindow.Show(); + ActivityWindow.Activate(); } #endregion diff --git a/win/C#/frmPreview.cs b/win/C#/frmPreview.cs index 078a15e4d..24a191463 100644 --- a/win/C#/frmPreview.cs +++ b/win/C#/frmPreview.cs @@ -43,7 +43,9 @@ namespace Handbrake lbl_status.Visible = true; try { - QTControl.URL = ""; + if (!noQT) + QTControl.URL = ""; + if (File.Exists(currently_playing)) File.Delete(currently_playing); } @@ -172,6 +174,22 @@ namespace Handbrake { if (File.Exists(currently_playing)) { + // Attempt to find VLC if it doesn't exist in the default set location. + if (!File.Exists(Properties.Settings.Default.VLC_Path)) + { + if (File.Exists("C:\\Program Files (x86)\\VideoLAN\\VLC\\vlc.exe")) + { + Properties.Settings.Default.VLC_Path = "C:\\Program Files (x86)\\VideoLAN\\VLC\\vlc.exe"; + Properties.Settings.Default.Save(); // Save this new path if it does + } + else + { + MessageBox.Show(this, + "Unable to detect VLC Player. \nPlease make sure VLC is installed and the directory specified in HandBrake's options is correct. (See: \"Tools Menu > Options > Picture Tab\") ", + "VLC", MessageBoxButtons.OK, MessageBoxIcon.Warning); + } + } + if (File.Exists(Properties.Settings.Default.VLC_Path)) { String args = "\"" + currently_playing + "\""; @@ -179,8 +197,7 @@ namespace Handbrake Process.Start(vlc); lbl_status.Text = "VLC will now launch."; } - else - MessageBox.Show(this, "Unable to detect VLC Player. \nPlease make sure VLC is installed and the directory specified in HandBrake's options is correct. (See: \"Tools Menu > Options > Picture Tab\") ", "VLC", MessageBoxButtons.OK, MessageBoxIcon.Warning); + } else MessageBox.Show(this, "Unable to find the preview file. Either the file was deleted or the encode failed. Check the activity log for details.", "VLC", MessageBoxButtons.OK, MessageBoxIcon.Warning); -- cgit v1.2.3