From c366805127de2bc9ef0b7377159dacecd427b3db Mon Sep 17 00:00:00 2001 From: sr55 Date: Wed, 1 Jul 2009 16:05:44 +0000 Subject: [PATCH] WinGui: - Fix for a scaling issue in the picture preview QT control - Add a warning if users try to preview a MKV with QT. - Misc updates to other files. git-svn-id: svn://localhost/HandBrake/trunk@2653 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/C#/HandBrakeCS.csproj | 3 +-- win/C#/Installer/Installer.nsi | 8 +++----- win/C#/frmPreview.cs | 44 ++++++++++++++++++++++++++---------------- win/C#/frmPreview.resx | 2 +- 4 files changed, 32 insertions(+), 25 deletions(-) diff --git a/win/C#/HandBrakeCS.csproj b/win/C#/HandBrakeCS.csproj index 3e90b712..824d9708 100644 --- a/win/C#/HandBrakeCS.csproj +++ b/win/C#/HandBrakeCS.csproj @@ -18,7 +18,7 @@ 2.0 - v3.5 + v3.0 false false publish\ @@ -94,7 +94,6 @@ - diff --git a/win/C#/Installer/Installer.nsi b/win/C#/Installer/Installer.nsi index f666e270..38d33fb6 100644 --- a/win/C#/Installer/Installer.nsi +++ b/win/C#/Installer/Installer.nsi @@ -8,7 +8,7 @@ ; HM NIS Edit Wizard helper defines !define PRODUCT_NAME "Handbrake" -!define PRODUCT_VERSION "0.9.4" +!define PRODUCT_VERSION "SVN 2592 Snapshot" !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\Handbrake.exe" !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" !define PRODUCT_UNINST_ROOT_KEY "HKLM" @@ -55,7 +55,7 @@ Function .onInit Call GetDotNETVersion Pop $0 ${If} $0 == "not found" - MessageBox MB_OK|MB_ICONSTOP ".NET runtime library is not installed. $\r$\n You can download .Net Framework 3.5 from the microsoft website. $\r$\n Alternatively you can use google for a direct download URL" + MessageBox MB_OK|MB_ICONSTOP ".NET runtime library is not installed. $\r$\n You can download .Net Framework 2.0 redistributable from the microsoft website. $\r$\n Alternatively you can use google for a direct download URL" Abort ${EndIf} @@ -63,7 +63,7 @@ Function .onInit ${VersionCompare} $0 "2.0" $1 ${If} $1 == 2 - MessageBox MB_OK|MB_ICONSTOP ".NET runtime library v3.5 or newer is required. You have $0. $\r$\n You can download .Net Framework 3.5 from the Microsoft website. $\r$\n Alternatively you can use google for a direct download URL" + MessageBox MB_OK|MB_ICONSTOP ".NET runtime library v2.0 or newer is required. You have $0. $\r$\n You can download .Net Framework 2.0 redistributable from the Microsoft website. $\r$\n Alternatively you can use google for a direct download URL" Abort ${EndIf} FunctionEnd @@ -103,7 +103,6 @@ Section "Handbrake" SEC01 SetOutPath "$INSTDIR\doc" SetOverwrite ifnewer File "doc\AUTHORS" - File "doc\BUILD" File "doc\COPYING" File "doc\CREDITS" File "doc\NEWS" @@ -146,7 +145,6 @@ Section Uninstall Delete "$INSTDIR\Handbrake.exe" Delete "$INSTDIR\Handbrake.exe.config" Delete "$INSTDIR\doc\AUTHORS" - Delete "$INSTDIR\doc\BUILD" Delete "$INSTDIR\doc\COPYING" Delete "$INSTDIR\doc\CREDITS" Delete "$INSTDIR\doc\NEWS" diff --git a/win/C#/frmPreview.cs b/win/C#/frmPreview.cs index f2356ae6..c1f2e73a 100644 --- a/win/C#/frmPreview.cs +++ b/win/C#/frmPreview.cs @@ -62,23 +62,33 @@ namespace Handbrake } private void btn_playQT_Click(object sender, EventArgs e) { - lbl_status.Visible = true; - try + if (mainWindow.text_destination.Text.Contains(".mkv")) { - QTControl.URL = ""; - if (File.Exists(currently_playing)) - File.Delete(currently_playing); + MessageBox.Show(this, + "The QuickTime Control does not support MKV files, It is recommended you use VLC option instead.", + "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); } - catch (Exception) + else { - MessageBox.Show(this, "Unable to delete previous preview file. You may need to restart the application.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); - } + lbl_status.Visible = true; + try + { + QTControl.URL = ""; + if (File.Exists(currently_playing)) + File.Delete(currently_playing); + } + catch (Exception) + { + MessageBox.Show(this, "Unable to delete previous preview file. You may need to restart the application.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } - btn_playQT.Enabled = false; - btn_playVLC.Enabled = false; - lbl_status.Text = "Encoding Sample for (QT) ..."; - String query = hb_common_func.generatePreviewQuery(mainWindow, cb_duration.Text, cb_preview.Text); - ThreadPool.QueueUserWorkItem(procMonitor, query); + btn_playQT.Enabled = false; + btn_playVLC.Enabled = false; + lbl_status.Text = "Encoding Sample for (QT) ..."; + String query = hb_common_func.generatePreviewQuery(mainWindow, cb_duration.Text, cb_preview.Text); + + ThreadPool.QueueUserWorkItem(procMonitor, query); + } } private void procMonitor(object state) { @@ -116,7 +126,7 @@ namespace Handbrake // Get the sample filename if (mainWindow.text_destination.Text != "") - currently_playing = mainWindow.text_destination.Text.Replace(".mp4", "_sample.mp4").Replace(".m4v", "_sample.m4v").Replace(".mkv", "_sample.mkv");; + currently_playing = mainWindow.text_destination.Text.Replace(".mp4", "_sample.mp4").Replace(".m4v", "_sample.m4v").Replace(".mkv", "_sample.mkv"); ; // Play back in QT or VLC if (playerSelection == "QT") @@ -163,7 +173,7 @@ namespace Handbrake 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 the program options is correct.", "VLC", MessageBoxButtons.OK, MessageBoxIcon.Warning); + 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); @@ -184,9 +194,9 @@ namespace Handbrake BeginInvoke(new UpdateUIHandler(OpenMovie)); return; } - QTControl.Sizing = QTSizingModeEnum.qtControlFitsMovie; QTControl.URL = currently_playing; - QTControl.Sizing = QTSizingModeEnum.qtMovieFitsControl; + QTControl.SetSizing(QTSizingModeEnum.qtControlFitsMovie, true); + QTControl.URL = currently_playing; QTControl.Show(); this.ClientSize = QTControl.Size; diff --git a/win/C#/frmPreview.resx b/win/C#/frmPreview.resx index ef2d4bca..f75a67ce 100644 --- a/win/C#/frmPreview.resx +++ b/win/C#/frmPreview.resx @@ -125,7 +125,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACFTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5BeEhvc3QrU3RhdGUBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAVQAAAAIB - AAAAAQAAAAAAAAAAAAAAAEAAAAAACAAAnQYAAJ0GAAATAA8AAIATAAAAAAADAAAAAAALAP//AwAAAAAA + AAAAAQAAAAAAAAAAAAAAAEAAAAAACAAAnQYAAHEHAAATAA8AAIATAAAAAAADAAAAAAALAP//AwAAAAAA CAACAAAAAAAIAAIAAAAAAAgAAgAAAAAACw== -- 2.11.0