diff options
author | sr55 <[email protected]> | 2007-10-04 22:33:58 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2007-10-04 22:33:58 +0000 |
commit | 1ef4964589e409da57703fe68a202993b60315ac (patch) | |
tree | d248b9463bb662f92635dc665469730a3039de46 /win | |
parent | e20b60acb5d0fd0eec5c28b631c0f61286ee5961 (diff) |
WinGui:
-Code to expire development builds
-New show/hide options for the new preset system.
-Few bug fixes.
-Updated Installer
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1000 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win')
-rw-r--r-- | win/C#/HandBrakeCS.csproj | 1 | ||||
-rw-r--r-- | win/C#/Installer/Installer.nsi | 25 | ||||
-rw-r--r-- | win/C#/Program.cs | 12 | ||||
-rw-r--r-- | win/C#/Properties/Settings.Designer.cs | 18 | ||||
-rw-r--r-- | win/C#/Properties/Settings.settings | 5 | ||||
-rw-r--r-- | win/C#/app.config | 5 | ||||
-rw-r--r-- | win/C#/frmMain.Designer.cs | 134 | ||||
-rw-r--r-- | win/C#/frmMain.cs | 108 | ||||
-rw-r--r-- | win/C#/frmOptions.Designer.cs | 27 | ||||
-rw-r--r-- | win/C#/frmOptions.cs | 10 | ||||
-rw-r--r-- | win/C#/frmReadDVD.cs | 2 |
11 files changed, 209 insertions, 138 deletions
diff --git a/win/C#/HandBrakeCS.csproj b/win/C#/HandBrakeCS.csproj index dee639200..f0cafac2c 100644 --- a/win/C#/HandBrakeCS.csproj +++ b/win/C#/HandBrakeCS.csproj @@ -37,6 +37,7 @@ <WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<UseVSHostingProcess>false</UseVSHostingProcess>
+ <DocumentationFile>bin\Release\Handbrake.XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
diff --git a/win/C#/Installer/Installer.nsi b/win/C#/Installer/Installer.nsi index 66a3f73df..c1bda6f8c 100644 --- a/win/C#/Installer/Installer.nsi +++ b/win/C#/Installer/Installer.nsi @@ -2,7 +2,7 @@ ; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "Handbrake"
-!define PRODUCT_VERSION "2.4"
+!define PRODUCT_VERSION "2.4.1"
!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"
@@ -36,7 +36,7 @@ ; MUI end ------
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
-OutFile "Handbrake-Win.exe"
+OutFile "Handbrake-Setup.exe"
!include WordFunc.nsh
!insertmacro VersionCompare
@@ -73,9 +73,6 @@ Function GetDotNETVersion FunctionEnd
-
-
-
InstallDir "$PROGRAMFILES\Handbrake"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
ShowInstDetails show
@@ -93,6 +90,16 @@ Section "Handbrake" SEC01 File "hbcli.exe"
File "Handbrake.exe.config"
File "handbrakepineapple.ico"
+
+ SetOutPath "$INSTDIR\doc"
+ SetOverwrite ifnewer
+ File "doc\AUTHORS"
+ File "doc\BUILD"
+ File "doc\COPYING"
+ File "doc\CREDITS"
+ File "doc\NEWS"
+ File "doc\THANKS"
+ File "doc\TRANSLATIONS"
SectionEnd
Section -AdditionalIcons
@@ -127,6 +134,14 @@ Section Uninstall Delete "$INSTDIR\dvdinfo.dat"
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"
+ Delete "$INSTDIR\doc\THANKS"
+ Delete "$INSTDIR\doc\TRANSLATIONS"
+
Delete "$SMPROGRAMS\Handbrake\Uninstall.lnk"
Delete "$DESKTOP\Handbrake.lnk"
Delete "$SMPROGRAMS\Handbrake\Handbrake.lnk"
diff --git a/win/C#/Program.cs b/win/C#/Program.cs index 87fad342d..07c99e4ce 100644 --- a/win/C#/Program.cs +++ b/win/C#/Program.cs @@ -23,15 +23,9 @@ namespace Handbrake [STAThread]
static void Main()
{
-
- /* Some Code to allow development builds to expire.
- *
- * long start = DateTime.Now.Ticks;
- * 633286573227430160 today was long end = DateTime.Now.AddDays(31).Ticks;
- * if (start > 633286573227430160) { MessageBox.Show("Sorry, this Handbrake has expired"); return; }
- *
- */
-
+ // 633265950858281250 = 16:52 28-Sep-07 //864000000000 nanoseconds per day
+ //long start = DateTime.Now.Ticks;
+ //if (start > 633274593039531250) {MessageBox.Show("Sorry, This development build of Handbrake has expired."); return; } // Will Expire Oct 8th
// Check the system meets the system requirements.
Boolean launch = true;
diff --git a/win/C#/Properties/Settings.Designer.cs b/win/C#/Properties/Settings.Designer.cs index adf46c1d6..c05a31e91 100644 --- a/win/C#/Properties/Settings.Designer.cs +++ b/win/C#/Properties/Settings.Designer.cs @@ -601,12 +601,24 @@ namespace Handbrake.Properties { [global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
- public string SelectedPreset {
+ public string showPresets {
get {
- return ((string)(this["SelectedPreset"]));
+ return ((string)(this["showPresets"]));
}
set {
- this["SelectedPreset"] = value;
+ this["showPresets"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("")]
+ public string selectedPreset {
+ get {
+ return ((string)(this["selectedPreset"]));
+ }
+ set {
+ this["selectedPreset"] = value;
}
}
}
diff --git a/win/C#/Properties/Settings.settings b/win/C#/Properties/Settings.settings index 5758795a6..355fdc927 100644 --- a/win/C#/Properties/Settings.settings +++ b/win/C#/Properties/Settings.settings @@ -146,7 +146,10 @@ <Setting Name="BuiltInPresets" Type="System.Collections.Specialized.StringCollection" Scope="User">
<Value Profile="(Default)" />
</Setting>
- <Setting Name="SelectedPreset" Type="System.String" Scope="User">
+ <Setting Name="showPresets" Type="System.String" Scope="User">
+ <Value Profile="(Default)" />
+ </Setting>
+ <Setting Name="selectedPreset" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
</Settings>
diff --git a/win/C#/app.config b/win/C#/app.config index 92e8a7186..6becf29af 100644 --- a/win/C#/app.config +++ b/win/C#/app.config @@ -145,7 +145,10 @@ <setting name="CompletionOption" serializeAs="String">
<value>Do Nothing</value>
</setting>
- <setting name="SelectedPreset" serializeAs="String">
+ <setting name="showPresets" serializeAs="String">
+ <value />
+ </setting>
+ <setting name="selectedPreset" serializeAs="String">
<value />
</setting>
</Handbrake.Properties.Settings>
diff --git a/win/C#/frmMain.Designer.cs b/win/C#/frmMain.Designer.cs index 027a54839..1a0b62289 100644 --- a/win/C#/frmMain.Designer.cs +++ b/win/C#/frmMain.Designer.cs @@ -60,6 +60,9 @@ namespace Handbrake this.drp_subtitle = new System.Windows.Forms.ComboBox();
this.btn_presets = new System.Windows.Forms.Button();
this.btn_setDefault = new System.Windows.Forms.Button();
+ this.ListBox_Presets = new System.Windows.Forms.ListBox();
+ this.btn_removePreset = new System.Windows.Forms.Button();
+ this.btn_addPreset = new System.Windows.Forms.Button();
this.DVD_Open = new System.Windows.Forms.FolderBrowserDialog();
this.File_Open = new System.Windows.Forms.OpenFileDialog();
this.ISO_Open = new System.Windows.Forms.OpenFileDialog();
@@ -172,9 +175,6 @@ namespace Handbrake this.advancedOptions = new System.Windows.Forms.TabControl();
this.groupBox_dest = new System.Windows.Forms.GroupBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
- this.ListBox_Presets = new System.Windows.Forms.ListBox();
- this.btn_removePreset = new System.Windows.Forms.Button();
- this.btn_addPreset = new System.Windows.Forms.Button();
this.groupBox3 = new System.Windows.Forms.GroupBox();
Label38 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.slider_videoQuality)).BeginInit();
@@ -560,7 +560,7 @@ namespace Handbrake this.btn_presets.Size = new System.Drawing.Size(111, 22);
this.btn_presets.TabIndex = 102;
this.btn_presets.Text = "Show Presets";
- this.ToolTip.SetToolTip(this.btn_presets, "Step 4 - Select a location to save your encoded file.");
+ this.ToolTip.SetToolTip(this.btn_presets, "Show or Hide the preset section");
this.btn_presets.UseVisualStyleBackColor = true;
this.btn_presets.Click += new System.EventHandler(this.btn_presets_Click);
//
@@ -582,6 +582,69 @@ namespace Handbrake this.btn_setDefault.UseVisualStyleBackColor = false;
this.btn_setDefault.Click += new System.EventHandler(this.btn_setDefault_Click);
//
+ // ListBox_Presets
+ //
+ this.ListBox_Presets.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.ListBox_Presets.FormattingEnabled = true;
+ this.ListBox_Presets.Items.AddRange(new object[] {
+ "Animation",
+ "AppleTV",
+ "Bedlam",
+ "Blind",
+ "Broke",
+ "Classic",
+ "Constant Quality Rate",
+ "Deux Six Quatre",
+ "Film",
+ "iPhone",
+ "iPod High-Rez",
+ "iPod Low-Rez",
+ "Normal",
+ "PS3",
+ "PSP",
+ "QuickTime",
+ "Television"});
+ this.ListBox_Presets.Location = new System.Drawing.Point(11, 21);
+ this.ListBox_Presets.Name = "ListBox_Presets";
+ this.ListBox_Presets.Size = new System.Drawing.Size(174, 368);
+ this.ListBox_Presets.TabIndex = 104;
+ this.ToolTip.SetToolTip(this.ListBox_Presets, "To load a preset, simply click the preset you desire.");
+ this.ListBox_Presets.SelectedIndexChanged += new System.EventHandler(this.ListBox_Presets_SelectedIndexChanged);
+ //
+ // btn_removePreset
+ //
+ this.btn_removePreset.BackColor = System.Drawing.SystemColors.ControlLight;
+ this.btn_removePreset.FlatAppearance.BorderColor = System.Drawing.Color.Black;
+ this.btn_removePreset.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.btn_removePreset.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.btn_removePreset.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
+ this.btn_removePreset.Location = new System.Drawing.Point(59, 23);
+ this.btn_removePreset.Name = "btn_removePreset";
+ this.btn_removePreset.Size = new System.Drawing.Size(45, 22);
+ this.btn_removePreset.TabIndex = 106;
+ this.btn_removePreset.TabStop = false;
+ this.btn_removePreset.Text = "Save";
+ this.ToolTip.SetToolTip(this.btn_removePreset, "Save the current settings as a preset.");
+ this.btn_removePreset.UseVisualStyleBackColor = false;
+ this.btn_removePreset.Click += new System.EventHandler(this.btn_removePreset_Click);
+ //
+ // btn_addPreset
+ //
+ this.btn_addPreset.BackColor = System.Drawing.SystemColors.ControlLight;
+ this.btn_addPreset.FlatAppearance.BorderColor = System.Drawing.Color.Black;
+ this.btn_addPreset.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.btn_addPreset.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.btn_addPreset.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
+ this.btn_addPreset.Location = new System.Drawing.Point(8, 23);
+ this.btn_addPreset.Name = "btn_addPreset";
+ this.btn_addPreset.Size = new System.Drawing.Size(45, 22);
+ this.btn_addPreset.TabIndex = 105;
+ this.btn_addPreset.TabStop = false;
+ this.btn_addPreset.Text = "Open";
+ this.ToolTip.SetToolTip(this.btn_addPreset, "Open a preset which you have saved.");
+ this.btn_addPreset.UseVisualStyleBackColor = false;
+ this.btn_addPreset.Click += new System.EventHandler(this.btn_addPreset_Click);
+ //
// DVD_Open
//
this.DVD_Open.Description = "Select the \"VIDEO_TS\" folder from your DVD Drvie.";
@@ -1821,69 +1884,6 @@ namespace Handbrake this.groupBox2.TabStop = false;
this.groupBox2.Text = "Presets";
//
- // ListBox_Presets
- //
- this.ListBox_Presets.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.ListBox_Presets.FormattingEnabled = true;
- this.ListBox_Presets.Items.AddRange(new object[] {
- "Animation",
- "AppleTV",
- "Bedlam",
- "Blind",
- "Broke",
- "Classic",
- "Constant Quality Rate",
- "Deux Six Quatre",
- "Film",
- "iPhone",
- "iPod High-Rez",
- "iPod Low-Rez",
- "Normal",
- "PS3",
- "PSP",
- "QuickTime",
- "Television"});
- this.ListBox_Presets.Location = new System.Drawing.Point(11, 21);
- this.ListBox_Presets.Name = "ListBox_Presets";
- this.ListBox_Presets.Size = new System.Drawing.Size(174, 368);
- this.ListBox_Presets.TabIndex = 104;
- this.ToolTip.SetToolTip(this.ListBox_Presets, "To load a preset, simply click the preset you desire.");
- this.ListBox_Presets.SelectedIndexChanged += new System.EventHandler(this.ListBox_Presets_SelectedIndexChanged);
- //
- // btn_removePreset
- //
- this.btn_removePreset.BackColor = System.Drawing.SystemColors.ControlLight;
- this.btn_removePreset.FlatAppearance.BorderColor = System.Drawing.Color.Black;
- this.btn_removePreset.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.btn_removePreset.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.btn_removePreset.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
- this.btn_removePreset.Location = new System.Drawing.Point(59, 23);
- this.btn_removePreset.Name = "btn_removePreset";
- this.btn_removePreset.Size = new System.Drawing.Size(45, 22);
- this.btn_removePreset.TabIndex = 106;
- this.btn_removePreset.TabStop = false;
- this.btn_removePreset.Text = "Save";
- this.ToolTip.SetToolTip(this.btn_removePreset, "Save the current settings as a preset.");
- this.btn_removePreset.UseVisualStyleBackColor = false;
- this.btn_removePreset.Click += new System.EventHandler(this.btn_removePreset_Click);
- //
- // btn_addPreset
- //
- this.btn_addPreset.BackColor = System.Drawing.SystemColors.ControlLight;
- this.btn_addPreset.FlatAppearance.BorderColor = System.Drawing.Color.Black;
- this.btn_addPreset.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.btn_addPreset.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.btn_addPreset.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
- this.btn_addPreset.Location = new System.Drawing.Point(8, 23);
- this.btn_addPreset.Name = "btn_addPreset";
- this.btn_addPreset.Size = new System.Drawing.Size(45, 22);
- this.btn_addPreset.TabIndex = 105;
- this.btn_addPreset.TabStop = false;
- this.btn_addPreset.Text = "Open";
- this.ToolTip.SetToolTip(this.btn_addPreset, "Open a preset which you have saved.");
- this.btn_addPreset.UseVisualStyleBackColor = false;
- this.btn_addPreset.Click += new System.EventHandler(this.btn_addPreset_Click);
- //
// groupBox3
//
this.groupBox3.Controls.Add(this.btn_removePreset);
diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs index 4c3fdab13..e277a853e 100644 --- a/win/C#/frmMain.cs +++ b/win/C#/frmMain.cs @@ -27,12 +27,12 @@ namespace Handbrake private Process hbProc;
private Parsing.DVD thisDVD;
private frmQueue queueWindow = new frmQueue();
- //private frmDvdInfo dvdInfoWindow = new frmDvdInfo();
public frmMain()
{
- ThreadPool.QueueUserWorkItem(showSplash);
+ // Load the splash screen on another thread. Once completed wait for 1 second.
+ ThreadPool.QueueUserWorkItem(showSplash);
Thread.Sleep(1000);
InitializeComponent();
@@ -43,7 +43,7 @@ namespace Handbrake // **********************************************************************************************
// Set the Version number lable to the corect version.
- Version.Text = "Version " + Properties.Settings.Default.GuiVersion;
+ Version.Text = "Version " + Properties.Settings.Default.CliVersion;
// Run the update checker.
updateCheck();
@@ -60,20 +60,27 @@ namespace Handbrake // Hide the presets part of the window
this.Width = 590;
- // Create and initializes a new StringCollection.
+ showPresets();
+
+ /*
+ * This code can be used for storing preset and preset name information in future versions.
+ * Please ignore it for the moment.
+ // Create and initialize a new StringCollection.
StringCollection myCol = new StringCollection();
// Add a range of elements from an array to the end of the StringCollection.
String[] myArr = new String[] { "RED", "orange", "yellow", "RED", "green", "blue", "RED", "indigo", "violet", "RED" };
myCol.AddRange(myArr);
-
Properties.Settings.Default.BuiltInPresets = myCol;
+ MessageBox.Show(Properties.Settings.Default.BuiltInPresets.ToString());
+ */
}
private void showSplash(object sender)
{
+ // Display splash screen for 1.5 Seconds
Form splash = new frmSplashScreen();
splash.Show();
- Thread.Sleep(1500); // Display splash screen for 1.5 Seconds
+ Thread.Sleep(1500);
splash.Close(); // Then close.
}
@@ -81,6 +88,7 @@ namespace Handbrake {
try
{
+ // Load the users default settings or if the user has not got this option enabled, load the normal preset.
if (Properties.Settings.Default.defaultSettings == "Checked")
{
// Source
@@ -159,7 +167,7 @@ namespace Handbrake }
rtf_h264advanced.Text = Properties.Settings.Default.H264;
- groupBox_output.Text = "Output Settings (Preset: " + Properties.Settings.Default.SelectedPreset + ")";
+ groupBox_output.Text = "Output Settings (Preset: " + Properties.Settings.Default.selectedPreset + ")";
}
else
{
@@ -224,6 +232,16 @@ namespace Handbrake }
}
+ private void showPresets()
+ {
+ if (Properties.Settings.Default.showPresets == "Checked")
+ {
+ btn_presets.Visible = false;
+ this.Width = 881;
+ }
+
+ }
+
#endregion
// --------------------------------------------------------------
@@ -360,7 +378,7 @@ namespace Handbrake private void btn_Browse_Click(object sender, EventArgs e)
{
- String filename ="";
+ String filename = "";
text_source.Text = "";
frmDvdInfo dvdInfoWindow = new frmDvdInfo();
if (RadioDVD.Checked)
@@ -391,7 +409,8 @@ namespace Handbrake {
text_source.Text = "Click 'Browse' to continue";
}
-
+
+ // If there are no titles in the dropdown menu then the scan has obviously failed. Display an error message explaining to the user.
if (drp_dvdtitle.Items.Count == 0)
{
MessageBox.Show("No Title(s) found. Please make sure you have selected a valid, non-copy protected source. Please refer to the FAQ (see Help Menu).", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
@@ -400,8 +419,6 @@ namespace Handbrake private void btn_destBrowse_Click(object sender, EventArgs e)
{
- // TODO: Need to write some code to check if there is a reasonable amount of disk space left.
-
DVD_Save.ShowDialog();
text_destination.Text = DVD_Save.FileName;
@@ -431,7 +448,9 @@ namespace Handbrake private void btn_queue_Click(object sender, EventArgs e)
{
- if (text_destination.Text != "" && text_source.Text != "")
+ if (text_source.Text == "" || text_source.Text == "Click 'Browse' to continue" || text_destination.Text == "")
+ MessageBox.Show("No source OR destination selected.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+ else
{
string query;
if (QueryEditorText.Text == "")
@@ -445,10 +464,6 @@ namespace Handbrake queueWindow.list_queue.Items.Add(query);
queueWindow.Show();
}
- else
- {
- MessageBox.Show("No Source OR destination selected.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
}
private void btn_copy_Click(object sender, EventArgs e)
@@ -692,11 +707,17 @@ namespace Handbrake //H264 Tab
Properties.Settings.Default.CRF = CheckCRF.CheckState.ToString();
Properties.Settings.Default.H264 = rtf_h264advanced.Text;
- Properties.Settings.Default.SelectedPreset = ListBox_Presets.SelectedItem.ToString();
+ try
+ {
+ Properties.Settings.Default.selectedPreset = ListBox_Presets.SelectedItem.ToString();
+ }
+ catch (Exception exc)
+ {
+ // If the user has not selected an item, then an exception may be thrown. Catch and ignore.
+ }
Properties.Settings.Default.Save();
}
-
// Preset Seleciton
private void ListBox_Presets_SelectedIndexChanged(object sender, EventArgs e)
{
@@ -774,7 +795,6 @@ namespace Handbrake }
}
-
// Functions - It's a bit dirty but i'll sort this out later. Simply done to reduce the amount of code above.
private void setGuiSetttings(CheckState anamorphic, string width, string height, string vencoder, string bitrate, string filesize, int quality, string qpercent, string audioBit, CheckState chpt, string audioSample, string h264, string deinterlace, CheckState twopass, string crop, CheckState turbo, string audioCodec, string preset)
{
@@ -823,20 +843,25 @@ namespace Handbrake private void btn_encode_Click(object sender, EventArgs e)
{
- //btn_eCancel.Enabled = true;
- String query = "";
- if (QueryEditorText.Text == "")
- {
- query = GenerateTheQuery();
- }
+ if (text_source.Text == "" || text_source.Text == "Click 'Browse' to continue" || text_destination.Text == "")
+ MessageBox.Show("No source OR destination selected.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
else
{
- query = QueryEditorText.Text;
- }
+ btn_eCancel.Enabled = true;
+ String query = "";
+ if (QueryEditorText.Text == "")
+ {
+ query = GenerateTheQuery();
+ }
+ else
+ {
+ query = QueryEditorText.Text;
+ }
- ThreadPool.QueueUserWorkItem(procMonitor, query);
- lbl_encode.Visible = true;
- lbl_encode.Text = "Encoding in Progress";
+ ThreadPool.QueueUserWorkItem(procMonitor, query);
+ lbl_encode.Visible = true;
+ lbl_encode.Text = "Encoding in Progress";
+ }
}
private void btn_eCancel_Click(object sender, EventArgs e)
@@ -846,7 +871,6 @@ namespace Handbrake lbl_encode.Text = "Encoding Canceled";
}
-
[DllImport("user32.dll")]
public static extern void LockWorkStation();
[DllImport("user32.dll")]
@@ -866,7 +890,7 @@ namespace Handbrake try
{
-
+ /*
//*****************************************************************************************
// BUG!
// When the below code is used and standard error is set to true, hbcli is outputing a
@@ -875,7 +899,7 @@ namespace Handbrake //*****************************************************************************************
- /*Parsing.Parser encode = new Parsing.Parser(hbProc.StandardError.BaseStream);
+ Parsing.Parser encode = new Parsing.Parser(hbProc.StandardOutput.BaseStream);
encode.OnEncodeProgress += encode_OnEncodeProgress;
while (!encode.EndOfStream)
{
@@ -884,11 +908,13 @@ namespace Handbrake hbProc.WaitForExit();
process.closeCLI();
- */
+ */
+
}
- catch (Exception)
+ catch (Exception exc)
{
// Do nothing
+ MessageBox.Show(exc.ToString());
}
@@ -934,7 +960,7 @@ namespace Handbrake lbl_encode.Text = "Encoding Finished";
}
- /*private void encode_OnEncodeProgress(object Sender, int CurrentTask, int TaskCount, float PercentComplete, float CurrentFps, float AverageFps, TimeSpan TimeRemaining)
+ private void encode_OnEncodeProgress(object Sender, int CurrentTask, int TaskCount, float PercentComplete, float CurrentFps, float AverageFps, TimeSpan TimeRemaining)
{
if (this.InvokeRequired)
@@ -944,7 +970,7 @@ namespace Handbrake return;
}
lbl_encode.Text = string.Format("Encode Progress: {0}%, FPS: {1}, Avg FPS: {2}, Time Remaining: {3} ", PercentComplete, CurrentFps, AverageFps, TimeRemaining);
- }*/
+ }
#endregion
@@ -1377,12 +1403,7 @@ namespace Handbrake int totalChapters = drop_chapterFinish.Items.Count - 1;
string dvdChapter = "";
- if (source == "")
- MessageBox.Show("No Source has been selected.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- else
- {
- source = " -i " + '"' + source+ '"'; //'"'+
- }
+ source = " -i " + '"' + source+ '"';
if (dvdTitle == "Automatic")
dvdTitle = "";
@@ -1736,7 +1757,6 @@ namespace Handbrake #endregion
-
// This is the END of the road ------------------------------------------------------------------------------
}
}
diff --git a/win/C#/frmOptions.Designer.cs b/win/C#/frmOptions.Designer.cs index dc44870d0..732e7872a 100644 --- a/win/C#/frmOptions.Designer.cs +++ b/win/C#/frmOptions.Designer.cs @@ -46,6 +46,7 @@ namespace Handbrake this.groupBox4 = new System.Windows.Forms.GroupBox();
this.drp_completeOption = new System.Windows.Forms.ComboBox();
this.label5 = new System.Windows.Forms.Label();
+ this.check_showPreset = new System.Windows.Forms.CheckBox();
this.GroupBox2.SuspendLayout();
this.GroupBox3.SuspendLayout();
this.GroupBox1.SuspendLayout();
@@ -73,13 +74,14 @@ namespace Handbrake // GroupBox2
//
this.GroupBox2.BackColor = System.Drawing.SystemColors.ControlLight;
+ this.GroupBox2.Controls.Add(this.check_showPreset);
this.GroupBox2.Controls.Add(this.check_tooltip);
this.GroupBox2.Controls.Add(this.check_updateCheck);
this.GroupBox2.Controls.Add(this.check_userDefaultSettings);
this.GroupBox2.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.GroupBox2.Location = new System.Drawing.Point(12, 11);
this.GroupBox2.Name = "GroupBox2";
- this.GroupBox2.Size = new System.Drawing.Size(386, 103);
+ this.GroupBox2.Size = new System.Drawing.Size(386, 123);
this.GroupBox2.TabIndex = 55;
this.GroupBox2.TabStop = false;
this.GroupBox2.Text = "General Settings";
@@ -186,7 +188,7 @@ namespace Handbrake this.GroupBox3.Controls.Add(this.drp_processors);
this.GroupBox3.Controls.Add(this.Label11);
this.GroupBox3.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.GroupBox3.Location = new System.Drawing.Point(12, 191);
+ this.GroupBox3.Location = new System.Drawing.Point(12, 211);
this.GroupBox3.Name = "GroupBox3";
this.GroupBox3.Size = new System.Drawing.Size(386, 94);
this.GroupBox3.TabIndex = 56;
@@ -199,7 +201,7 @@ namespace Handbrake this.GroupBox1.Controls.Add(this.check_guiDebug);
this.GroupBox1.Controls.Add(this.check_verbose);
this.GroupBox1.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.GroupBox1.Location = new System.Drawing.Point(12, 291);
+ this.GroupBox1.Location = new System.Drawing.Point(12, 311);
this.GroupBox1.Name = "GroupBox1";
this.GroupBox1.Size = new System.Drawing.Size(386, 70);
this.GroupBox1.TabIndex = 54;
@@ -225,7 +227,7 @@ namespace Handbrake this.btn_close.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_close.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btn_close.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
- this.btn_close.Location = new System.Drawing.Point(291, 371);
+ this.btn_close.Location = new System.Drawing.Point(291, 391);
this.btn_close.Name = "btn_close";
this.btn_close.Size = new System.Drawing.Size(107, 22);
this.btn_close.TabIndex = 53;
@@ -238,7 +240,7 @@ namespace Handbrake this.groupBox4.Controls.Add(this.drp_completeOption);
this.groupBox4.Controls.Add(this.label5);
this.groupBox4.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.groupBox4.Location = new System.Drawing.Point(12, 120);
+ this.groupBox4.Location = new System.Drawing.Point(12, 140);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(386, 65);
this.groupBox4.TabIndex = 57;
@@ -274,10 +276,22 @@ namespace Handbrake this.label5.TabIndex = 42;
this.label5.Text = "When the encode completes:";
//
+ // check_showPreset
+ //
+ this.check_showPreset.AutoSize = true;
+ this.check_showPreset.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.check_showPreset.Location = new System.Drawing.Point(15, 94);
+ this.check_showPreset.Name = "check_showPreset";
+ this.check_showPreset.Size = new System.Drawing.Size(362, 17);
+ this.check_showPreset.TabIndex = 50;
+ this.check_showPreset.Text = "Always Show Presets (Hide\'s the Show/Hide preset button)";
+ this.check_showPreset.UseVisualStyleBackColor = true;
+ this.check_showPreset.CheckedChanged += new System.EventHandler(this.check_showPreset_CheckedChanged);
+ //
// frmOptions
//
this.BackColor = System.Drawing.SystemColors.ControlLight;
- this.ClientSize = new System.Drawing.Size(413, 403);
+ this.ClientSize = new System.Drawing.Size(413, 422);
this.Controls.Add(this.groupBox4);
this.Controls.Add(this.GroupBox2);
this.Controls.Add(this.GroupBox3);
@@ -321,5 +335,6 @@ namespace Handbrake private System.Windows.Forms.GroupBox groupBox4;
internal System.Windows.Forms.ComboBox drp_completeOption;
internal System.Windows.Forms.Label label5;
+ internal System.Windows.Forms.CheckBox check_showPreset;
}
}
\ No newline at end of file diff --git a/win/C#/frmOptions.cs b/win/C#/frmOptions.cs index cb5c73eb6..fe54d22a5 100644 --- a/win/C#/frmOptions.cs +++ b/win/C#/frmOptions.cs @@ -43,6 +43,11 @@ namespace Handbrake {
check_tooltip.CheckState = CheckState.Checked;
}
+
+ if (Properties.Settings.Default.showPresets == "Checked")
+ {
+ check_showPreset.CheckState = CheckState.Checked;
+ }
}
private void check_updateCheck_CheckedChanged(object sender, EventArgs e)
@@ -89,6 +94,11 @@ namespace Handbrake private void drp_completeOption_SelectedIndexChanged(object sender, EventArgs e)
{
Properties.Settings.Default.CompletionOption = drp_completeOption.Text;
+ }
+
+ private void check_showPreset_CheckedChanged(object sender, EventArgs e)
+ {
+ Properties.Settings.Default.showPresets = check_showPreset.CheckState.ToString();
}
diff --git a/win/C#/frmReadDVD.cs b/win/C#/frmReadDVD.cs index 8adfb1d2a..ff5027586 100644 --- a/win/C#/frmReadDVD.cs +++ b/win/C#/frmReadDVD.cs @@ -109,8 +109,6 @@ namespace Handbrake thisDvd = Parsing.DVD.Parse(sr);
sr.Close();
- Console.ReadLine();
-
updateUIElements();
}
catch (Exception exc)
|