diff options
author | sr55 <[email protected]> | 2008-08-24 17:57:54 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2008-08-24 17:57:54 +0000 |
commit | 163bce7432c717a0d102568a0d582375f507e3f7 (patch) | |
tree | a62dc6dbd0d64b31a79e2630db4133b37885d668 | |
parent | b4553cd70fde71ac12974aa83dec4508f8f690ab (diff) |
WinGui:
- Adds checkbox to enable decomb.
- Program Options updated with an option to customize decomb values.
- Queue Recovery feature. If you close the GUI without letting a queue complete, the user will be prompted if they'd like to recover the queue on next launch.
- Small bugfix with the queue HandBrakeCLI monitor thread not stopping when the GUI is closed.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1653 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | win/C#/Functions/Common.cs | 45 | ||||
-rw-r--r-- | win/C#/Functions/Queue.cs | 54 | ||||
-rw-r--r-- | win/C#/Properties/Settings.Designer.cs | 24 | ||||
-rw-r--r-- | win/C#/Properties/Settings.settings | 6 | ||||
-rw-r--r-- | win/C#/app.config | 6 | ||||
-rw-r--r-- | win/C#/frmMain.Designer.cs | 34 | ||||
-rw-r--r-- | win/C#/frmMain.cs | 22 | ||||
-rw-r--r-- | win/C#/frmOptions.Designer.cs | 96 | ||||
-rw-r--r-- | win/C#/frmOptions.cs | 12 | ||||
-rw-r--r-- | win/C#/frmQueue.Designer.cs | 85 | ||||
-rw-r--r-- | win/C#/frmQueue.cs | 17 | ||||
-rw-r--r-- | win/C#/frmQueue.resx | 3 |
12 files changed, 297 insertions, 107 deletions
diff --git a/win/C#/Functions/Common.cs b/win/C#/Functions/Common.cs index f0cab1cde..7ff2ec806 100644 --- a/win/C#/Functions/Common.cs +++ b/win/C#/Functions/Common.cs @@ -562,7 +562,13 @@ namespace Handbrake.Functions }
if (mainWindow.check_decomb.Checked)
- query += " --decomb ";
+ {
+ string decombValue = Properties.Settings.Default.decomb;
+ if (decombValue != "" && decombValue != Properties.Settings.Default.default_decomb)
+ query += " --decomb=\"" + decombValue + "\"";
+ else
+ query += " --decomb ";
+ }
if (mainWindow.check_grayscale.Checked)
query += " -g ";
@@ -1226,5 +1232,42 @@ namespace Handbrake.Functions }
#endregion
+
+ #region Queue
+ /// <summary>
+ /// Check if the queue recovery file contains records.
+ /// If it does, it means the last queue did not complete before HandBrake closed.
+ /// So, return a boolean if true.
+ /// </summary>
+ public Boolean check_queue_recovery()
+ {
+ try
+ {
+ string tempPath = Path.Combine(Path.GetTempPath(), "hb_queue_recovery.dat");
+ using (StreamReader reader = new StreamReader(tempPath))
+ {
+ string queue_item = reader.ReadLine();
+ if (queue_item == null)
+ {
+ reader.Close();
+ reader.Dispose();
+ return false;
+ }
+ else // There exists an item in the recovery queue file, so try and recovr it.
+ {
+ reader.Close();
+ reader.Dispose();
+ return true;
+ }
+ }
+ }
+ catch (Exception)
+ {
+ // Keep quiet about the error.
+ return false;
+ }
+ }
+ #endregion
+
}
}
\ No newline at end of file diff --git a/win/C#/Functions/Queue.cs b/win/C#/Functions/Queue.cs index e566c2e08..ad4ecaf44 100644 --- a/win/C#/Functions/Queue.cs +++ b/win/C#/Functions/Queue.cs @@ -2,6 +2,8 @@ using System.Collections.Generic;
using System.Text;
using System.Collections;
+using System.IO;
+using System.Windows.Forms;
namespace Handbrake.Functions
{
@@ -23,7 +25,7 @@ namespace Handbrake.Functions {
string query = queue[0].ToString();
lastQuery = query;
- remove(0);
+ remove(0); // Remove the item which we are about to pass out.
return query;
}
@@ -102,5 +104,55 @@ namespace Handbrake.Functions }
}
+ /// <summary>
+ /// Writes the current queue to disk. hb_queue_recovery.dat
+ /// This function is called after getNextItemForEncoding()
+ /// </summary>
+ public void write2disk()
+ {
+ try
+ {
+ string tempPath = Path.Combine(Path.GetTempPath(), "hb_queue_recovery.dat");
+ using (StreamWriter writer = new StreamWriter(tempPath))
+ {
+ foreach (string item in queue)
+ {
+ writer.WriteLine(item);
+ }
+ writer.Close();
+ writer.Dispose();
+ }
+ }
+ catch (Exception)
+ {
+ // Any Errors will be out of diskspace/permissions problems. Don't report them as they'll annoy the user.
+ }
+ }
+
+ /// <summary>
+ /// Recover the queue from hb_queue_recovery.dat
+ /// </summary>
+ public void recoverQueue()
+ {
+ try
+ {
+ string tempPath = Path.Combine(Path.GetTempPath(), "hb_queue_recovery.dat");
+ using (StreamReader reader = new StreamReader(tempPath))
+ {
+ string queue_item = reader.ReadLine();
+
+ while (queue_item != null)
+ {
+ this.add(queue_item);
+ queue_item = reader.ReadLine();
+ }
+ }
+ }
+ catch (Exception exc)
+ {
+ MessageBox.Show("HandBrake was unable to recover the queue. \nError Information:" + exc.ToString(),"Queue Recovery Error",MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+
}
}
diff --git a/win/C#/Properties/Settings.Designer.cs b/win/C#/Properties/Settings.Designer.cs index 9b7fc0668..487ee378c 100644 --- a/win/C#/Properties/Settings.Designer.cs +++ b/win/C#/Properties/Settings.Designer.cs @@ -226,5 +226,29 @@ namespace Handbrake.Properties { this["checkSnapshot"] = value;
}
}
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("4:10:15:9:10:35:9")]
+ public string decomb {
+ get {
+ return ((string)(this["decomb"]));
+ }
+ set {
+ this["decomb"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("4:10:15:9:10:35:9")]
+ public string default_decomb {
+ get {
+ return ((string)(this["default_decomb"]));
+ }
+ set {
+ this["default_decomb"] = value;
+ }
+ }
}
}
diff --git a/win/C#/Properties/Settings.settings b/win/C#/Properties/Settings.settings index 41a169028..db282ddad 100644 --- a/win/C#/Properties/Settings.settings +++ b/win/C#/Properties/Settings.settings @@ -53,5 +53,11 @@ <Setting Name="checkSnapshot" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
+ <Setting Name="decomb" Type="System.String" Scope="User">
+ <Value Profile="(Default)">4:10:15:9:10:35:9</Value>
+ </Setting>
+ <Setting Name="default_decomb" Type="System.String" Scope="User">
+ <Value Profile="(Default)">4:10:15:9:10:35:9</Value>
+ </Setting>
</Settings>
</SettingsFile>
\ No newline at end of file diff --git a/win/C#/app.config b/win/C#/app.config index 8d69ad837..2ade94d35 100644 --- a/win/C#/app.config +++ b/win/C#/app.config @@ -58,6 +58,12 @@ <setting name="checkSnapshot" serializeAs="String">
<value />
</setting>
+ <setting name="decomb" serializeAs="String">
+ <value>4:10:15:9:10:35:9</value>
+ </setting>
+ <setting name="default_decomb" serializeAs="String">
+ <value>4:10:15:9:10:35:9</value>
+ </setting>
</Handbrake.Properties.Settings>
</userSettings>
</configuration>
\ No newline at end of file diff --git a/win/C#/frmMain.Designer.cs b/win/C#/frmMain.Designer.cs index 7cc774290..255469be6 100644 --- a/win/C#/frmMain.Designer.cs +++ b/win/C#/frmMain.Designer.cs @@ -166,6 +166,7 @@ namespace Handbrake this.Label46 = new System.Windows.Forms.Label();
this.Label40 = new System.Windows.Forms.Label();
this.TabPage1 = new System.Windows.Forms.TabPage();
+ this.check_decomb = new System.Windows.Forms.CheckBox();
this.label6 = new System.Windows.Forms.Label();
this.drp_anamorphic = new System.Windows.Forms.ComboBox();
this.text_bottom = new System.Windows.Forms.NumericUpDown();
@@ -258,7 +259,6 @@ namespace Handbrake this.notifyIcon = new System.Windows.Forms.NotifyIcon(this.components);
this.StatusStrip = new System.Windows.Forms.StatusStrip();
this.lbl_encode = new System.Windows.Forms.ToolStripStatusLabel();
- this.check_decomb = new System.Windows.Forms.CheckBox();
Label38 = new System.Windows.Forms.Label();
notifyIconMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
notifyIconMenu.SuspendLayout();
@@ -1400,7 +1400,7 @@ namespace Handbrake this.TabPage2.Location = new System.Drawing.Point(4, 22);
this.TabPage2.Name = "TabPage2";
this.TabPage2.Padding = new System.Windows.Forms.Padding(3);
- this.TabPage2.Size = new System.Drawing.Size(697, 302);
+ this.TabPage2.Size = new System.Drawing.Size(697, 307);
this.TabPage2.TabIndex = 3;
this.TabPage2.Text = "Audio && Subtitles";
//
@@ -1740,7 +1740,7 @@ namespace Handbrake this.TabPage3.Location = new System.Drawing.Point(4, 22);
this.TabPage3.Name = "TabPage3";
this.TabPage3.Padding = new System.Windows.Forms.Padding(3);
- this.TabPage3.Size = new System.Drawing.Size(697, 302);
+ this.TabPage3.Size = new System.Drawing.Size(697, 307);
this.TabPage3.TabIndex = 2;
this.TabPage3.Text = "Video";
//
@@ -1899,6 +1899,18 @@ namespace Handbrake this.TabPage1.TabIndex = 0;
this.TabPage1.Text = "Picture Settings";
//
+ // check_decomb
+ //
+ this.check_decomb.AutoSize = true;
+ this.check_decomb.BackColor = System.Drawing.Color.Transparent;
+ this.check_decomb.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.check_decomb.Location = new System.Drawing.Point(314, 215);
+ this.check_decomb.Name = "check_decomb";
+ this.check_decomb.Size = new System.Drawing.Size(73, 17);
+ this.check_decomb.TabIndex = 32;
+ this.check_decomb.Text = "Decomb";
+ this.check_decomb.UseVisualStyleBackColor = false;
+ //
// label6
//
this.label6.AutoSize = true;
@@ -2248,7 +2260,7 @@ namespace Handbrake this.tab_chapters.Controls.Add(this.Check_ChapterMarkers);
this.tab_chapters.Location = new System.Drawing.Point(4, 22);
this.tab_chapters.Name = "tab_chapters";
- this.tab_chapters.Size = new System.Drawing.Size(697, 302);
+ this.tab_chapters.Size = new System.Drawing.Size(697, 307);
this.tab_chapters.TabIndex = 6;
this.tab_chapters.Text = "Chapters";
//
@@ -2875,7 +2887,7 @@ namespace Handbrake this.tabPage4.Controls.Add(this.rtf_query);
this.tabPage4.Location = new System.Drawing.Point(4, 22);
this.tabPage4.Name = "tabPage4";
- this.tabPage4.Size = new System.Drawing.Size(697, 302);
+ this.tabPage4.Size = new System.Drawing.Size(697, 307);
this.tabPage4.TabIndex = 7;
this.tabPage4.Text = "Query Editor";
//
@@ -3150,18 +3162,6 @@ namespace Handbrake this.lbl_encode.Size = new System.Drawing.Size(31, 17);
this.lbl_encode.Text = "{0}";
//
- // check_decomb
- //
- this.check_decomb.AutoSize = true;
- this.check_decomb.BackColor = System.Drawing.Color.Transparent;
- this.check_decomb.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.check_decomb.Location = new System.Drawing.Point(314, 215);
- this.check_decomb.Name = "check_decomb";
- this.check_decomb.Size = new System.Drawing.Size(73, 17);
- this.check_decomb.TabIndex = 32;
- this.check_decomb.Text = "Decomb";
- this.check_decomb.UseVisualStyleBackColor = false;
- //
// frmMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs index 16d9c54e4..d9a239d4c 100644 --- a/win/C#/frmMain.cs +++ b/win/C#/frmMain.cs @@ -116,6 +116,9 @@ namespace Handbrake // Some event Handlers. Used for minimize to taskbar
this.Resize += new EventHandler(frmMain_Resize);
+
+ // Queue Recovery
+ queueRecovery();
}
// Startup Functions
@@ -164,6 +167,24 @@ namespace Handbrake }
catch (Exception) { /* Do Nothing */ }
}
+ private void queueRecovery()
+ {
+ if (hb_common_func.check_queue_recovery() == true)
+ {
+ DialogResult result;
+ result = MessageBox.Show("HandBrake has detected unfinished items on the queue from the last time the application was launched. Would you like to recover these?","Queue Recovery Possible", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
+
+ if (result == DialogResult.Yes)
+ encodeQueue.recoverQueue(); // Start Recovery
+ else
+ {
+ // Remove the Queue recovery file if the user doesn't want to recovery the last queue.
+ string queuePath = Path.Combine(Path.GetTempPath(), "hb_queue_recovery.dat");
+ if (File.Exists(queuePath))
+ File.Delete(queuePath);
+ }
+ }
+ }
#endregion
@@ -343,6 +364,7 @@ namespace Handbrake query = rtf_query.Text;
encodeQueue.add(query);
+ encodeQueue.write2disk(); // Writes the queue to the recovery file, just incase the GUI crashes.
queueWindow.setQueue(encodeQueue);
queueWindow.Show();
diff --git a/win/C#/frmOptions.Designer.cs b/win/C#/frmOptions.Designer.cs index 4db4e7e1b..1e1623077 100644 --- a/win/C#/frmOptions.Designer.cs +++ b/win/C#/frmOptions.Designer.cs @@ -50,6 +50,9 @@ namespace Handbrake this.check_userDefaultSettings = new System.Windows.Forms.CheckBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
+ this.tab_picture = new System.Windows.Forms.TabPage();
+ this.txt_decomb = new System.Windows.Forms.TextBox();
+ this.label3 = new System.Windows.Forms.Label();
this.tab_cli = new System.Windows.Forms.TabPage();
this.check_cli_minimized = new System.Windows.Forms.CheckBox();
this.label12 = new System.Windows.Forms.Label();
@@ -58,16 +61,17 @@ namespace Handbrake this.drp_processors = new System.Windows.Forms.ComboBox();
this.Label4 = new System.Windows.Forms.Label();
this.tab_advanced = new System.Windows.Forms.TabPage();
+ this.lbl_appcastUnstable = new System.Windows.Forms.Label();
+ this.check_snapshot = new System.Windows.Forms.CheckBox();
this.btn_drive_detect = new System.Windows.Forms.CheckBox();
this.label6 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.pictureBox2 = new System.Windows.Forms.PictureBox();
this.pathFinder = new System.Windows.Forms.FolderBrowserDialog();
this.ToolTip = new System.Windows.Forms.ToolTip(this.components);
- this.check_snapshot = new System.Windows.Forms.CheckBox();
- this.lbl_appcastUnstable = new System.Windows.Forms.Label();
this.tab_options.SuspendLayout();
this.tab_general.SuspendLayout();
+ this.tab_picture.SuspendLayout();
this.tab_cli.SuspendLayout();
this.tab_advanced.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
@@ -110,6 +114,7 @@ namespace Handbrake // tab_options
//
this.tab_options.Controls.Add(this.tab_general);
+ this.tab_options.Controls.Add(this.tab_picture);
this.tab_options.Controls.Add(this.tab_cli);
this.tab_options.Controls.Add(this.tab_advanced);
this.tab_options.Location = new System.Drawing.Point(12, 55);
@@ -257,6 +262,36 @@ namespace Handbrake this.label2.TabIndex = 54;
this.label2.Text = "When Done:";
//
+ // tab_picture
+ //
+ this.tab_picture.Controls.Add(this.txt_decomb);
+ this.tab_picture.Controls.Add(this.label3);
+ this.tab_picture.Location = new System.Drawing.Point(4, 22);
+ this.tab_picture.Name = "tab_picture";
+ this.tab_picture.Size = new System.Drawing.Size(482, 236);
+ this.tab_picture.TabIndex = 5;
+ this.tab_picture.Text = "Picture";
+ this.tab_picture.UseVisualStyleBackColor = true;
+ //
+ // txt_decomb
+ //
+ this.txt_decomb.Location = new System.Drawing.Point(90, 16);
+ this.txt_decomb.Name = "txt_decomb";
+ this.txt_decomb.Size = new System.Drawing.Size(181, 21);
+ this.txt_decomb.TabIndex = 78;
+ this.ToolTip.SetToolTip(this.txt_decomb, "Default location where Auto named files are stored.");
+ this.txt_decomb.TextChanged += new System.EventHandler(this.txt_decomb_TextChanged);
+ //
+ // label3
+ //
+ this.label3.AutoSize = true;
+ this.label3.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.label3.Location = new System.Drawing.Point(21, 19);
+ this.label3.Name = "label3";
+ this.label3.Size = new System.Drawing.Size(63, 13);
+ this.label3.TabIndex = 77;
+ this.label3.Text = "Decomb:";
+ //
// tab_cli
//
this.tab_cli.Controls.Add(this.check_cli_minimized);
@@ -374,6 +409,31 @@ namespace Handbrake this.tab_advanced.Text = "Advanced";
this.tab_advanced.UseVisualStyleBackColor = true;
//
+ // lbl_appcastUnstable
+ //
+ this.lbl_appcastUnstable.AutoSize = true;
+ this.lbl_appcastUnstable.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.lbl_appcastUnstable.Location = new System.Drawing.Point(6, 42);
+ this.lbl_appcastUnstable.Name = "lbl_appcastUnstable";
+ this.lbl_appcastUnstable.Size = new System.Drawing.Size(64, 13);
+ this.lbl_appcastUnstable.TabIndex = 81;
+ this.lbl_appcastUnstable.Text = "Updates:";
+ //
+ // check_snapshot
+ //
+ this.check_snapshot.AutoSize = true;
+ this.check_snapshot.BackColor = System.Drawing.Color.Transparent;
+ this.check_snapshot.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.check_snapshot.Location = new System.Drawing.Point(76, 41);
+ this.check_snapshot.Name = "check_snapshot";
+ this.check_snapshot.Size = new System.Drawing.Size(273, 17);
+ this.check_snapshot.TabIndex = 80;
+ this.check_snapshot.Text = "Check for unstable development snapshots";
+ this.ToolTip.SetToolTip(this.check_snapshot, "Enables the built in update checker to check for the latest development snapshot " +
+ "builds.\r\nWarning: These are considered unstable builds and are not supported!");
+ this.check_snapshot.UseVisualStyleBackColor = false;
+ this.check_snapshot.CheckedChanged += new System.EventHandler(this.check_snapshot_CheckedChanged);
+ //
// btn_drive_detect
//
this.btn_drive_detect.AutoSize = true;
@@ -392,7 +452,7 @@ namespace Handbrake //
this.label6.AutoSize = true;
this.label6.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.label6.Location = new System.Drawing.Point(27, 19);
+ this.label6.Location = new System.Drawing.Point(35, 19);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(35, 13);
this.label6.TabIndex = 71;
@@ -424,31 +484,6 @@ namespace Handbrake this.ToolTip.ToolTipIcon = System.Windows.Forms.ToolTipIcon.Info;
this.ToolTip.ToolTipTitle = "Tooltip";
//
- // check_snapshot
- //
- this.check_snapshot.AutoSize = true;
- this.check_snapshot.BackColor = System.Drawing.Color.Transparent;
- this.check_snapshot.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.check_snapshot.Location = new System.Drawing.Point(76, 41);
- this.check_snapshot.Name = "check_snapshot";
- this.check_snapshot.Size = new System.Drawing.Size(273, 17);
- this.check_snapshot.TabIndex = 80;
- this.check_snapshot.Text = "Check for unstable development snapshots";
- this.ToolTip.SetToolTip(this.check_snapshot, "Enables the built in update checker to check for the latest development snapshot " +
- "builds.\r\nWarning: These are considered unstable builds and are not supported!");
- this.check_snapshot.UseVisualStyleBackColor = false;
- this.check_snapshot.CheckedChanged += new System.EventHandler(this.check_snapshot_CheckedChanged);
- //
- // lbl_appcastUnstable
- //
- this.lbl_appcastUnstable.AutoSize = true;
- this.lbl_appcastUnstable.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.lbl_appcastUnstable.Location = new System.Drawing.Point(6, 42);
- this.lbl_appcastUnstable.Name = "lbl_appcastUnstable";
- this.lbl_appcastUnstable.Size = new System.Drawing.Size(64, 13);
- this.lbl_appcastUnstable.TabIndex = 81;
- this.lbl_appcastUnstable.Text = "Updates:";
- //
// frmOptions
//
this.ClientSize = new System.Drawing.Size(514, 355);
@@ -467,6 +502,8 @@ namespace Handbrake this.tab_options.ResumeLayout(false);
this.tab_general.ResumeLayout(false);
this.tab_general.PerformLayout();
+ this.tab_picture.ResumeLayout(false);
+ this.tab_picture.PerformLayout();
this.tab_cli.ResumeLayout(false);
this.tab_cli.PerformLayout();
this.tab_advanced.ResumeLayout(false);
@@ -509,5 +546,8 @@ namespace Handbrake internal System.Windows.Forms.ToolTip ToolTip;
private System.Windows.Forms.Label lbl_appcastUnstable;
internal System.Windows.Forms.CheckBox check_snapshot;
+ private System.Windows.Forms.TabPage tab_picture;
+ private System.Windows.Forms.TextBox txt_decomb;
+ private System.Windows.Forms.Label label3;
}
}
\ No newline at end of file diff --git a/win/C#/frmOptions.cs b/win/C#/frmOptions.cs index d947a6354..fb48f803d 100644 --- a/win/C#/frmOptions.cs +++ b/win/C#/frmOptions.cs @@ -45,6 +45,8 @@ namespace Handbrake if (Properties.Settings.Default.defaultSettings == "Checked")
check_userDefaultSettings.CheckState = CheckState.Checked;
+ txt_decomb.Text = Properties.Settings.Default.decomb;
+
drp_processors.Text = Properties.Settings.Default.Processors;
drp_Priority.Text = Properties.Settings.Default.processPriority;
drp_completeOption.Text = Properties.Settings.Default.CompletionOption;
@@ -124,7 +126,12 @@ namespace Handbrake pathFinder.ShowDialog();
text_an_path.Text = pathFinder.SelectedPath;
}
-
+
+ private void txt_decomb_TextChanged(object sender, EventArgs e)
+ {
+ Properties.Settings.Default.decomb = txt_decomb.Text;
+ }
+
private void btn_drive_detect_CheckedChanged(object sender, EventArgs e)
{
Properties.Settings.Default.drive_detection = btn_drive_detect.CheckState.ToString();
@@ -152,8 +159,5 @@ namespace Handbrake }
#endregion
-
-
-
}
}
\ No newline at end of file diff --git a/win/C#/frmQueue.Designer.cs b/win/C#/frmQueue.Designer.cs index c7617df92..9c1f87ed0 100644 --- a/win/C#/frmQueue.Designer.cs +++ b/win/C#/frmQueue.Designer.cs @@ -63,12 +63,13 @@ namespace Handbrake this.Destination = new System.Windows.Forms.ColumnHeader();
this.EncoderVideo = new System.Windows.Forms.ColumnHeader();
this.Audio = new System.Windows.Forms.ColumnHeader();
- this.lbl_progressValue = new System.Windows.Forms.Label();
- this.progressBar = new System.Windows.Forms.ProgressBar();
- this.label2 = new System.Windows.Forms.Label();
- this.lbl_status = new System.Windows.Forms.Label();
+ this.statusStrip1 = new System.Windows.Forms.StatusStrip();
+ this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
+ this.progressBar = new System.Windows.Forms.ToolStripProgressBar();
+ this.lbl_progressValue = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
+ this.statusStrip1.SuspendLayout();
this.SuspendLayout();
//
// btn_down
@@ -77,7 +78,7 @@ namespace Handbrake this.btn_down.FlatAppearance.BorderColor = System.Drawing.Color.Black;
this.btn_down.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btn_down.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
- this.btn_down.Location = new System.Drawing.Point(610, 124);
+ this.btn_down.Location = new System.Drawing.Point(610, 129);
this.btn_down.Name = "btn_down";
this.btn_down.Size = new System.Drawing.Size(75, 22);
this.btn_down.TabIndex = 33;
@@ -92,7 +93,7 @@ namespace Handbrake this.btn_up.FlatAppearance.BorderColor = System.Drawing.Color.Black;
this.btn_up.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btn_up.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
- this.btn_up.Location = new System.Drawing.Point(539, 124);
+ this.btn_up.Location = new System.Drawing.Point(540, 129);
this.btn_up.Name = "btn_up";
this.btn_up.Size = new System.Drawing.Size(64, 22);
this.btn_up.TabIndex = 32;
@@ -107,7 +108,7 @@ namespace Handbrake this.btn_delete.FlatAppearance.BorderColor = System.Drawing.Color.Black;
this.btn_delete.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btn_delete.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
- this.btn_delete.Location = new System.Drawing.Point(692, 124);
+ this.btn_delete.Location = new System.Drawing.Point(692, 129);
this.btn_delete.Name = "btn_delete";
this.btn_delete.Size = new System.Drawing.Size(75, 22);
this.btn_delete.TabIndex = 31;
@@ -214,7 +215,7 @@ namespace Handbrake this.toolStrip1.Location = new System.Drawing.Point(0, 0);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
- this.toolStrip1.Size = new System.Drawing.Size(780, 49);
+ this.toolStrip1.Size = new System.Drawing.Size(779, 49);
this.toolStrip1.TabIndex = 71;
this.toolStrip1.Text = "toolStrip1";
//
@@ -319,54 +320,43 @@ namespace Handbrake this.Audio.Text = "Audio Encoder";
this.Audio.Width = 94;
//
- // lbl_progressValue
+ // statusStrip1
//
- this.lbl_progressValue.AutoSize = true;
- this.lbl_progressValue.Location = new System.Drawing.Point(737, 353);
- this.lbl_progressValue.Name = "lbl_progressValue";
- this.lbl_progressValue.Size = new System.Drawing.Size(30, 13);
- this.lbl_progressValue.TabIndex = 36;
- this.lbl_progressValue.Text = "0 %";
+ this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.toolStripStatusLabel1,
+ this.progressBar,
+ this.lbl_progressValue});
+ this.statusStrip1.Location = new System.Drawing.Point(0, 359);
+ this.statusStrip1.Name = "statusStrip1";
+ this.statusStrip1.Size = new System.Drawing.Size(779, 31);
+ this.statusStrip1.TabIndex = 73;
+ this.statusStrip1.Text = "statusStrip1";
+ //
+ // toolStripStatusLabel1
+ //
+ this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
+ this.toolStripStatusLabel1.Size = new System.Drawing.Size(53, 26);
+ this.toolStripStatusLabel1.Text = "Progress:";
//
// progressBar
//
- this.progressBar.Location = new System.Drawing.Point(76, 348);
this.progressBar.Name = "progressBar";
- this.progressBar.Size = new System.Drawing.Size(655, 23);
+ this.progressBar.Size = new System.Drawing.Size(500, 25);
this.progressBar.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
- this.progressBar.TabIndex = 34;
//
- // label2
- //
- this.label2.AutoSize = true;
- this.label2.Location = new System.Drawing.Point(9, 353);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(62, 13);
- this.label2.TabIndex = 35;
- this.label2.Text = "Progress:";
- //
- // lbl_status
+ // lbl_progressValue
//
- this.lbl_status.AutoSize = true;
- this.lbl_status.BackColor = System.Drawing.Color.Transparent;
- this.lbl_status.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.lbl_status.Location = new System.Drawing.Point(319, 353);
- this.lbl_status.Name = "lbl_status";
- this.lbl_status.Size = new System.Drawing.Size(176, 13);
- this.lbl_status.TabIndex = 42;
- this.lbl_status.Text = "Encode Queue Completed!";
- this.lbl_status.Visible = false;
+ this.lbl_progressValue.Name = "lbl_progressValue";
+ this.lbl_progressValue.Size = new System.Drawing.Size(30, 26);
+ this.lbl_progressValue.Text = " 0 %";
//
// frmQueue
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(780, 386);
- this.Controls.Add(this.lbl_status);
- this.Controls.Add(this.label2);
+ this.ClientSize = new System.Drawing.Size(779, 390);
+ this.Controls.Add(this.statusStrip1);
this.Controls.Add(this.list_queue);
- this.Controls.Add(this.progressBar);
- this.Controls.Add(this.lbl_progressValue);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.btn_down);
this.Controls.Add(this.btn_up);
@@ -384,12 +374,15 @@ namespace Handbrake this.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
+ this.MinimumSize = new System.Drawing.Size(787, 417);
this.Name = "frmQueue";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Encode Queue";
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
+ this.statusStrip1.ResumeLayout(false);
+ this.statusStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
@@ -424,9 +417,9 @@ namespace Handbrake private System.Windows.Forms.ColumnHeader Destination;
private System.Windows.Forms.ColumnHeader EncoderVideo;
private System.Windows.Forms.ColumnHeader Audio;
- private System.Windows.Forms.Label lbl_progressValue;
- private System.Windows.Forms.ProgressBar progressBar;
- private System.Windows.Forms.Label label2;
- private System.Windows.Forms.Label lbl_status;
+ private System.Windows.Forms.StatusStrip statusStrip1;
+ private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
+ private System.Windows.Forms.ToolStripProgressBar progressBar;
+ private System.Windows.Forms.ToolStripStatusLabel lbl_progressValue;
}
}
\ No newline at end of file diff --git a/win/C#/frmQueue.cs b/win/C#/frmQueue.cs index d239203a5..e331b70f6 100644 --- a/win/C#/frmQueue.cs +++ b/win/C#/frmQueue.cs @@ -97,7 +97,6 @@ namespace Handbrake {
if (queue.count() != 0)
{
- lbl_status.Visible = false;
btn_encode.Enabled = false;
}
cancel = false;
@@ -111,9 +110,9 @@ namespace Handbrake btn_stop.Visible = true;
progressBar.Value = 0;
lbl_progressValue.Text = "0 %";
- progressBar.Step = 100 / queue.count();
- progressBar.Update();
+ progressBar.Step = 100 / queue.count();
Thread theQ = new Thread(startProc);
+ theQ.IsBackground = true;
theQ.Start();
}
}
@@ -178,18 +177,14 @@ namespace Handbrake if (cancel == true)
{
- lbl_status.Visible = true;
- lbl_status.Text = "Encode Queue Cancelled!";
+ lbl_progressValue.Text = "Encode Queue Cancelled!";
}
else
{
- lbl_status.Visible = true;
- lbl_status.Text = "Encode Queue Completed!";
+ lbl_progressValue.Text = "Encode Queue Completed!";
}
- lbl_progressValue.Text = "0 %";
progressBar.Value = 0;
- progressBar.Update();
lbl_source.Text = "-";
lbl_dest.Text = "-";
@@ -228,7 +223,6 @@ namespace Handbrake progressBar.PerformStep();
lbl_progressValue.Text = string.Format("{0} %", progressBar.Value);
- progressBar.Update();
}
catch (Exception exc)
{
@@ -285,6 +279,7 @@ namespace Handbrake if (list_queue.SelectedIndices.Count != 0)
{
queue.moveUp(list_queue.SelectedIndices[0]);
+ queue.write2disk(); // Update the queue recovery file
redrawQueue();
}
}
@@ -295,6 +290,7 @@ namespace Handbrake if (list_queue.SelectedIndices.Count != 0)
{
queue.moveDown(list_queue.SelectedIndices[0]);
+ queue.write2disk(); // Update the queue recovery file
redrawQueue();
}
}
@@ -305,6 +301,7 @@ namespace Handbrake if (list_queue.SelectedIndices.Count != 0)
{
queue.remove(list_queue.SelectedIndices[0]);
+ queue.write2disk(); // Update the queue recovery file
redrawQueue();
}
}
diff --git a/win/C#/frmQueue.resx b/win/C#/frmQueue.resx index 11e5d9ba0..8e6968fbb 100644 --- a/win/C#/frmQueue.resx +++ b/win/C#/frmQueue.resx @@ -126,6 +126,9 @@ <metadata name="SaveFile.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>208, 17</value>
</metadata>
+ <metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>300, 17</value>
+ </metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
|