From: sr55 Date: Wed, 7 Jan 2009 19:16:33 +0000 (+0000) Subject: WinGui: X-Git-Url: http://git.osdn.jp/view?a=commitdiff_plain;h=9ba34a9ce07ff789f1d32471bb2d9f0e9284ac3a;p=handbrake-jp%2Fhandbrake-jp-git.git WinGui: - Check the encoded sample actually exists before trying to play it in VLC! git-svn-id: svn://localhost/HandBrake/trunk@2067 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- diff --git a/win/C#/frmGenPreview.cs b/win/C#/frmGenPreview.cs index 0bc59e0d..1731a63b 100644 --- a/win/C#/frmGenPreview.cs +++ b/win/C#/frmGenPreview.cs @@ -35,21 +35,23 @@ namespace Handbrake currently_playing = ""; if (mainWindow.text_destination.Text != "") currently_playing = mainWindow.text_destination.Text.Replace(".m", "_sample.m").Replace(".avi", "_sample.avi").Replace(".ogm", "_sample.ogm"); - + // Launch VLC and play video. if (currently_playing != "") { - if (File.Exists(Properties.Settings.Default.VLC_Path)) - { - String args = "\"" + currently_playing + "\""; - ProcessStartInfo vlc = new ProcessStartInfo(Properties.Settings.Default.VLC_Path, args); - Process.Start(vlc); - lbl_status.Text = "VLC will now launch."; - } - else + if (File.Exists(currently_playing)) { - MessageBox.Show("Unable to detect VLC Player. \nPlease make sure VLC is installed and the directory specified in the program options is correct.", "VLC", MessageBoxButtons.OK, MessageBoxIcon.Information); - } + if (File.Exists(Properties.Settings.Default.VLC_Path)) + { + String args = "\"" + currently_playing + "\""; + ProcessStartInfo vlc = new ProcessStartInfo(Properties.Settings.Default.VLC_Path, args); + Process.Start(vlc); + lbl_status.Text = "VLC will now launch."; + } + else + MessageBox.Show("Unable to detect VLC Player. \nPlease make sure VLC is installed and the directory specified in the program options is correct.", "VLC", MessageBoxButtons.OK, MessageBoxIcon.Warning); + } else + MessageBox.Show("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); } }