this["appcast_unstable"] = value;\r
}\r
}\r
+ \r
+ [global::System.Configuration.UserScopedSettingAttribute()]\r
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\r
+ [global::System.Configuration.DefaultSettingValueAttribute("Checked")]\r
+ public string drive_detection {\r
+ get {\r
+ return ((string)(this["drive_detection"]));\r
+ }\r
+ set {\r
+ this["drive_detection"] = value;\r
+ }\r
+ }\r
}\r
}\r
<Setting Name="appcast_unstable" Type="System.String" Scope="User">\r
<Value Profile="(Default)">http://handbrake.fr/appcast_unstable.xml</Value>\r
</Setting>\r
+ <Setting Name="drive_detection" Type="System.String" Scope="User">\r
+ <Value Profile="(Default)">Checked</Value>\r
+ </Setting>\r
</Settings>\r
</SettingsFile>
\ No newline at end of file
<setting name="appcast_unstable" serializeAs="String">\r
<value>http://handbrake.fr/appcast_unstable.xml</value>\r
</setting>\r
+ <setting name="drive_detection" serializeAs="String">\r
+ <value>Checked</value>\r
+ </setting>\r
</Handbrake.Properties.Settings>\r
</userSettings>\r
</configuration>
\ No newline at end of file
line = sr.ReadLine();\r
}\r
sr.Close();\r
-\r
+ sr.Dispose();\r
}\r
catch (Exception exc)\r
{\r
System.Windows.Forms.Label Label38;\r
System.Windows.Forms.ContextMenuStrip notifyIconMenu;\r
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMain));\r
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();\r
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();\r
this.btn_restore = new System.Windows.Forms.ToolStripMenuItem();\r
this.DVD_Save = new System.Windows.Forms.SaveFileDialog();\r
this.File_Save = new System.Windows.Forms.SaveFileDialog();\r
this.ToolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();\r
this.mnu_options = new System.Windows.Forms.ToolStripMenuItem();\r
this.PresetsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\r
- this.mnu_SelectDefault = new System.Windows.Forms.ToolStripMenuItem();\r
- this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();\r
this.mnu_presetReset = new System.Windows.Forms.ToolStripMenuItem();\r
+ this.mnu_delete_preset = new System.Windows.Forms.ToolStripMenuItem();\r
+ this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();\r
+ this.btn_new_preset = new System.Windows.Forms.ToolStripMenuItem();\r
+ this.mnu_SelectDefault = new System.Windows.Forms.ToolStripMenuItem();\r
this.HelpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\r
- this.OnlineDocumentationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\r
- this.mnu_wiki = new System.Windows.Forms.ToolStripMenuItem();\r
- this.mnu_faq = new System.Windows.Forms.ToolStripMenuItem();\r
- this.mnu_onlineDocs = new System.Windows.Forms.ToolStripMenuItem();\r
+ this.mnu_user_guide = new System.Windows.Forms.ToolStripMenuItem();\r
this.mnu_handbrake_home = new System.Windows.Forms.ToolStripMenuItem();\r
+ this.mnu_handbrake_forums = new System.Windows.Forms.ToolStripMenuItem();\r
this.ToolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();\r
this.mnu_UpdateCheck = new System.Windows.Forms.ToolStripMenuItem();\r
this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();\r
this.groupBox2 = new System.Windows.Forms.GroupBox();\r
this.treeView_presets = new System.Windows.Forms.TreeView();\r
this.toolStrip1 = new System.Windows.Forms.ToolStrip();\r
- this.toolStripDropDownButton1 = new System.Windows.Forms.ToolStripDropDownButton();\r
+ this.btn_source = new System.Windows.Forms.ToolStripDropDownButton();\r
this.btn_dvd_source = new System.Windows.Forms.ToolStripMenuItem();\r
this.btn_file_source = new System.Windows.Forms.ToolStripMenuItem();\r
+ this.mnu_dvd_drive = new System.Windows.Forms.ToolStripMenuItem();\r
this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator();\r
this.btn_start = new System.Windows.Forms.ToolStripButton();\r
this.btn_add2Queue = new System.Windows.Forms.ToolStripButton();\r
this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator();\r
this.lbl_encode = new System.Windows.Forms.ToolStripLabel();\r
this.notifyIcon = new System.Windows.Forms.NotifyIcon(this.components);\r
- this.mnu_delete_preset = new System.Windows.Forms.ToolStripMenuItem();\r
- this.btn_new_preset = new System.Windows.Forms.ToolStripMenuItem();\r
Label38 = new System.Windows.Forms.Label();\r
notifyIconMenu = new System.Windows.Forms.ContextMenuStrip(this.components);\r
notifyIconMenu.SuspendLayout();\r
// \r
// number\r
// \r
- dataGridViewCellStyle2.Format = "N0";\r
- dataGridViewCellStyle2.NullValue = null;\r
- this.number.DefaultCellStyle = dataGridViewCellStyle2;\r
+ dataGridViewCellStyle1.Format = "N0";\r
+ dataGridViewCellStyle1.NullValue = null;\r
+ this.number.DefaultCellStyle = dataGridViewCellStyle1;\r
this.number.HeaderText = "Chapter Number";\r
this.number.MaxInputLength = 3;\r
this.number.Name = "number";\r
this.PresetsToolStripMenuItem.Size = new System.Drawing.Size(61, 20);\r
this.PresetsToolStripMenuItem.Text = "&Presets";\r
// \r
- // mnu_SelectDefault\r
+ // mnu_presetReset\r
// \r
- this.mnu_SelectDefault.Name = "mnu_SelectDefault";\r
- this.mnu_SelectDefault.Size = new System.Drawing.Size(215, 22);\r
- this.mnu_SelectDefault.Text = "Select Default Preset";\r
- this.mnu_SelectDefault.ToolTipText = "Select HandBrake\'s default preset";\r
- this.mnu_SelectDefault.Click += new System.EventHandler(this.mnu_SelectDefault_Click);\r
+ this.mnu_presetReset.Name = "mnu_presetReset";\r
+ this.mnu_presetReset.Size = new System.Drawing.Size(215, 22);\r
+ this.mnu_presetReset.Text = "Update Built-in Presets";\r
+ this.mnu_presetReset.ToolTipText = "Resets all presets.";\r
+ this.mnu_presetReset.Click += new System.EventHandler(this.mnu_presetReset_Click);\r
+ // \r
+ // mnu_delete_preset\r
+ // \r
+ this.mnu_delete_preset.Name = "mnu_delete_preset";\r
+ this.mnu_delete_preset.Size = new System.Drawing.Size(215, 22);\r
+ this.mnu_delete_preset.Text = "Delete Built-in Presets";\r
+ this.mnu_delete_preset.Click += new System.EventHandler(this.mnu_delete_preset_Click);\r
// \r
// toolStripSeparator7\r
// \r
this.toolStripSeparator7.Name = "toolStripSeparator7";\r
this.toolStripSeparator7.Size = new System.Drawing.Size(212, 6);\r
// \r
- // mnu_presetReset\r
+ // btn_new_preset\r
// \r
- this.mnu_presetReset.Name = "mnu_presetReset";\r
- this.mnu_presetReset.Size = new System.Drawing.Size(215, 22);\r
- this.mnu_presetReset.Text = "Update Built-in Presets";\r
- this.mnu_presetReset.ToolTipText = "Resets all presets.";\r
- this.mnu_presetReset.Click += new System.EventHandler(this.mnu_presetReset_Click);\r
+ this.btn_new_preset.Name = "btn_new_preset";\r
+ this.btn_new_preset.Size = new System.Drawing.Size(215, 22);\r
+ this.btn_new_preset.Text = "New Preset";\r
+ this.btn_new_preset.Click += new System.EventHandler(this.btn_new_preset_Click);\r
+ // \r
+ // mnu_SelectDefault\r
+ // \r
+ this.mnu_SelectDefault.Name = "mnu_SelectDefault";\r
+ this.mnu_SelectDefault.Size = new System.Drawing.Size(215, 22);\r
+ this.mnu_SelectDefault.Text = "Select Default Preset";\r
+ this.mnu_SelectDefault.ToolTipText = "Select HandBrake\'s default preset";\r
+ this.mnu_SelectDefault.Click += new System.EventHandler(this.mnu_SelectDefault_Click);\r
// \r
// HelpToolStripMenuItem\r
// \r
this.HelpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {\r
- this.OnlineDocumentationToolStripMenuItem,\r
+ this.mnu_user_guide,\r
this.mnu_handbrake_home,\r
+ this.mnu_handbrake_forums,\r
this.ToolStripSeparator3,\r
this.mnu_UpdateCheck,\r
this.toolStripSeparator6,\r
this.HelpToolStripMenuItem.Size = new System.Drawing.Size(44, 20);\r
this.HelpToolStripMenuItem.Text = "&Help";\r
// \r
- // OnlineDocumentationToolStripMenuItem\r
- // \r
- this.OnlineDocumentationToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {\r
- this.mnu_wiki,\r
- this.mnu_faq,\r
- this.mnu_onlineDocs});\r
- this.OnlineDocumentationToolStripMenuItem.Name = "OnlineDocumentationToolStripMenuItem";\r
- this.OnlineDocumentationToolStripMenuItem.Size = new System.Drawing.Size(213, 22);\r
- this.OnlineDocumentationToolStripMenuItem.Text = "Online Documentation";\r
- // \r
- // mnu_wiki\r
- // \r
- this.mnu_wiki.Name = "mnu_wiki";\r
- this.mnu_wiki.Size = new System.Drawing.Size(217, 22);\r
- this.mnu_wiki.Text = "Wiki / User Guides";\r
- this.mnu_wiki.Click += new System.EventHandler(this.mnu_wiki_Click);\r
+ // mnu_user_guide\r
// \r
- // mnu_faq\r
- // \r
- this.mnu_faq.Name = "mnu_faq";\r
- this.mnu_faq.Size = new System.Drawing.Size(217, 22);\r
- this.mnu_faq.Text = "FAQ";\r
- this.mnu_faq.Click += new System.EventHandler(this.mnu_faq_Click);\r
- // \r
- // mnu_onlineDocs\r
- // \r
- this.mnu_onlineDocs.Name = "mnu_onlineDocs";\r
- this.mnu_onlineDocs.Size = new System.Drawing.Size(217, 22);\r
- this.mnu_onlineDocs.Text = "Full Documentation List";\r
- this.mnu_onlineDocs.Click += new System.EventHandler(this.mnu_onlineDocs_Click);\r
+ this.mnu_user_guide.Name = "mnu_user_guide";\r
+ this.mnu_user_guide.Size = new System.Drawing.Size(215, 22);\r
+ this.mnu_user_guide.Text = "HandBrake User Guide";\r
+ this.mnu_user_guide.Click += new System.EventHandler(this.mnu_user_guide_Click_1);\r
// \r
// mnu_handbrake_home\r
// \r
this.mnu_handbrake_home.Name = "mnu_handbrake_home";\r
- this.mnu_handbrake_home.Size = new System.Drawing.Size(213, 22);\r
+ this.mnu_handbrake_home.Size = new System.Drawing.Size(215, 22);\r
this.mnu_handbrake_home.Text = "HandBrake Homepage";\r
this.mnu_handbrake_home.Click += new System.EventHandler(this.mnu_handbrake_home_Click);\r
// \r
+ // mnu_handbrake_forums\r
+ // \r
+ this.mnu_handbrake_forums.Name = "mnu_handbrake_forums";\r
+ this.mnu_handbrake_forums.Size = new System.Drawing.Size(215, 22);\r
+ this.mnu_handbrake_forums.Text = "HandBrake Forums";\r
+ this.mnu_handbrake_forums.Click += new System.EventHandler(this.mnu_handbrake_forums_Click);\r
+ // \r
// ToolStripSeparator3\r
// \r
this.ToolStripSeparator3.Name = "ToolStripSeparator3";\r
- this.ToolStripSeparator3.Size = new System.Drawing.Size(210, 6);\r
+ this.ToolStripSeparator3.Size = new System.Drawing.Size(212, 6);\r
// \r
// mnu_UpdateCheck\r
// \r
this.mnu_UpdateCheck.Name = "mnu_UpdateCheck";\r
- this.mnu_UpdateCheck.Size = new System.Drawing.Size(213, 22);\r
+ this.mnu_UpdateCheck.Size = new System.Drawing.Size(215, 22);\r
this.mnu_UpdateCheck.Text = "Check for Updates";\r
this.mnu_UpdateCheck.Click += new System.EventHandler(this.mnu_UpdateCheck_Click);\r
// \r
// toolStripSeparator6\r
// \r
this.toolStripSeparator6.Name = "toolStripSeparator6";\r
- this.toolStripSeparator6.Size = new System.Drawing.Size(210, 6);\r
+ this.toolStripSeparator6.Size = new System.Drawing.Size(212, 6);\r
// \r
// mnu_about\r
// \r
this.mnu_about.Name = "mnu_about";\r
- this.mnu_about.Size = new System.Drawing.Size(213, 22);\r
+ this.mnu_about.Size = new System.Drawing.Size(215, 22);\r
this.mnu_about.Text = "About...";\r
this.mnu_about.Click += new System.EventHandler(this.mnu_about_Click);\r
// \r
// \r
this.toolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;\r
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\r
- this.toolStripDropDownButton1,\r
+ this.btn_source,\r
this.toolStripSeparator10,\r
this.btn_start,\r
this.btn_add2Queue,\r
this.toolStrip1.Name = "toolStrip1";\r
this.toolStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;\r
this.toolStrip1.Size = new System.Drawing.Size(931, 39);\r
- this.toolStrip1.TabIndex = 13;\r
+ this.toolStrip1.TabIndex = 0;\r
this.toolStrip1.Text = "toolStrip1";\r
// \r
- // toolStripDropDownButton1\r
+ // btn_source\r
// \r
- this.toolStripDropDownButton1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {\r
+ this.btn_source.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {\r
this.btn_dvd_source,\r
- this.btn_file_source});\r
- this.toolStripDropDownButton1.Image = global::Handbrake.Properties.Resources.Movies;\r
- this.toolStripDropDownButton1.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;\r
- this.toolStripDropDownButton1.ImageTransparentColor = System.Drawing.Color.Magenta;\r
- this.toolStripDropDownButton1.Name = "toolStripDropDownButton1";\r
- this.toolStripDropDownButton1.Size = new System.Drawing.Size(85, 36);\r
- this.toolStripDropDownButton1.Text = "Source";\r
+ this.btn_file_source,\r
+ this.mnu_dvd_drive});\r
+ this.btn_source.Image = global::Handbrake.Properties.Resources.Movies;\r
+ this.btn_source.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;\r
+ this.btn_source.ImageTransparentColor = System.Drawing.Color.Magenta;\r
+ this.btn_source.Name = "btn_source";\r
+ this.btn_source.Size = new System.Drawing.Size(85, 36);\r
+ this.btn_source.Text = "Source";\r
+ this.btn_source.Click += new System.EventHandler(this.btn_source_Click);\r
// \r
// btn_dvd_source\r
// \r
this.btn_file_source.Text = "Video File";\r
this.btn_file_source.Click += new System.EventHandler(this.btn_file_source_Click);\r
// \r
+ // mnu_dvd_drive\r
+ // \r
+ this.mnu_dvd_drive.Image = global::Handbrake.Properties.Resources.Disc;\r
+ this.mnu_dvd_drive.Name = "mnu_dvd_drive";\r
+ this.mnu_dvd_drive.Size = new System.Drawing.Size(197, 22);\r
+ this.mnu_dvd_drive.Text = "[No DVD Drive Ready]";\r
+ this.mnu_dvd_drive.Visible = false;\r
+ this.mnu_dvd_drive.Click += new System.EventHandler(this.mnu_dvd_drive_Click);\r
+ // \r
// toolStripSeparator10\r
// \r
this.toolStripSeparator10.Name = "toolStripSeparator10";\r
this.notifyIcon.Text = "HandBrake";\r
this.notifyIcon.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.notifyIcon_MouseDoubleClick);\r
// \r
- // mnu_delete_preset\r
- // \r
- this.mnu_delete_preset.Name = "mnu_delete_preset";\r
- this.mnu_delete_preset.Size = new System.Drawing.Size(215, 22);\r
- this.mnu_delete_preset.Text = "Delete Built-in Presets";\r
- this.mnu_delete_preset.Click += new System.EventHandler(this.mnu_delete_preset_Click);\r
- // \r
- // btn_new_preset\r
- // \r
- this.btn_new_preset.Name = "btn_new_preset";\r
- this.btn_new_preset.Size = new System.Drawing.Size(215, 22);\r
- this.btn_new_preset.Text = "New Preset";\r
- this.btn_new_preset.Click += new System.EventHandler(this.btn_new_preset_Click);\r
- // \r
// frmMain\r
// \r
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\r
internal System.Windows.Forms.ToolStripMenuItem PresetsToolStripMenuItem;\r
internal System.Windows.Forms.ToolStripMenuItem mnu_presetReset;\r
internal System.Windows.Forms.ToolStripMenuItem HelpToolStripMenuItem;\r
- internal System.Windows.Forms.ToolStripMenuItem OnlineDocumentationToolStripMenuItem;\r
- internal System.Windows.Forms.ToolStripMenuItem mnu_wiki;\r
- internal System.Windows.Forms.ToolStripMenuItem mnu_onlineDocs;\r
- internal System.Windows.Forms.ToolStripMenuItem mnu_faq;\r
internal System.Windows.Forms.ToolStripSeparator ToolStripSeparator3;\r
internal System.Windows.Forms.ToolStripMenuItem mnu_about;\r
internal System.Windows.Forms.MenuStrip frmMainMenu;\r
internal System.Windows.Forms.Label lbl_duration;\r
internal System.Windows.Forms.Label label_duration;\r
private System.Windows.Forms.ToolStripSeparator toolStripSeparator10;\r
- private System.Windows.Forms.ToolStripDropDownButton toolStripDropDownButton1;\r
private System.Windows.Forms.ToolStripMenuItem btn_dvd_source;\r
private System.Windows.Forms.ToolStripMenuItem btn_file_source;\r
private System.Windows.Forms.ToolStripLabel lbl_encode;\r
private System.Windows.Forms.ToolStripMenuItem mnu_delete_preset;\r
private System.Windows.Forms.ToolStripMenuItem btn_new_preset;\r
+ private System.Windows.Forms.ToolStripMenuItem mnu_handbrake_forums;\r
+ private System.Windows.Forms.ToolStripMenuItem mnu_user_guide;\r
+ private System.Windows.Forms.ToolStripMenuItem mnu_dvd_drive;\r
+ private System.Windows.Forms.ToolStripDropDownButton btn_source;\r
\r
}\r
}
\ No newline at end of file
\r
#region Help Menu\r
\r
- private void mnu_wiki_Click(object sender, EventArgs e)\r
+ private void mnu_handbrake_forums_Click(object sender, EventArgs e)\r
{\r
- Process.Start("http://handbrake.fr/trac");\r
+ Process.Start("http://forum.handbrake.fr/");\r
}\r
- private void mnu_faq_Click(object sender, EventArgs e)\r
+ private void mnu_user_guide_Click_1(object sender, EventArgs e)\r
{\r
- Process.Start("http://handbrake.fr/trac/wiki/SupportFAQ");\r
- }\r
- private void mnu_onlineDocs_Click(object sender, EventArgs e)\r
- {\r
- Process.Start("http://handbrake.fr/?article=documentation");\r
+ Process.Start("http://trac.handbrake.fr/wiki/HandBrakeGuide");\r
}\r
private void mnu_handbrake_home_Click(object sender, EventArgs e)\r
{\r
#region Actions\r
\r
// ToolBar\r
+ private void btn_source_Click(object sender, EventArgs e)\r
+ {\r
+ if (Properties.Settings.Default.drive_detection == "Checked")\r
+ {\r
+ mnu_dvd_drive.Visible = true;\r
+ Thread driveInfoThread = new Thread(getDriveInfoThread);\r
+ driveInfoThread.Start();\r
+ }\r
+ else\r
+ mnu_dvd_drive.Visible = false;\r
+ }\r
private void btn_start_Click(object sender, EventArgs e)\r
{\r
if (text_source.Text == "" || text_source.Text == "Click 'Source' to continue" || text_destination.Text == "")\r
\r
}\r
}\r
+ private void mnu_dvd_drive_Click(object sender, EventArgs e)\r
+ {\r
+ String filename = "";\r
+ if (mnu_dvd_drive.Text.Contains("VIDEO_TS"))\r
+ {\r
+ string[] path = mnu_dvd_drive.Text.Split(' ');\r
+ filename = path[0];\r
+ Form frmRD = new frmReadDVD(filename, this);\r
+ text_source.Text = filename;\r
+ frmRD.ShowDialog();\r
+ }\r
\r
+ // If there are no titles in the dropdown menu then the scan has obviously failed. Display an error message explaining to the user.\r
+ if (drp_dvdtitle.Items.Count == 0)\r
+ 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);\r
+\r
+ }\r
\r
private void drp_dvdtitle_Click(object sender, EventArgs e)\r
{\r
treeView_presets.Nodes.Add(preset_treeview);\r
}\r
}\r
+\r
+ // Source Button Drive Detection\r
+ private delegate void ProgressUpdateHandler();\r
+ private void getDriveInfoThread()\r
+ {\r
+ try\r
+ {\r
+ if (this.InvokeRequired)\r
+ {\r
+ this.BeginInvoke(new ProgressUpdateHandler(getDriveInfoThread));\r
+ return;\r
+ }\r
+\r
+ Boolean foundDrive = false;\r
+ DriveInfo[] theCollectionOfDrives = DriveInfo.GetDrives();\r
+ foreach (DriveInfo curDrive in theCollectionOfDrives)\r
+ {\r
+ if (curDrive.DriveType == DriveType.CDRom)\r
+ {\r
+ if (curDrive.IsReady)\r
+ {\r
+ if (File.Exists(curDrive.RootDirectory.ToString() + "VIDEO_TS\\VIDEO_TS.IFO"))\r
+ mnu_dvd_drive.Text = curDrive.RootDirectory.ToString() + "VIDEO_TS (" + curDrive.VolumeLabel + ")";\r
+ else\r
+ mnu_dvd_drive.Text = "[No DVD Drive Ready]";\r
+\r
+ foundDrive = true;\r
+\r
+ }\r
+ }\r
+ }\r
+\r
+ if (foundDrive == false)\r
+ mnu_dvd_drive.Text = "[No DVD Drive Ready]";\r
+ }\r
+ catch (Exception exc)\r
+ {\r
+ MessageBox.Show("Drive Detection Error. \n Error Information: \n\n " + exc.ToString());\r
+ }\r
+ }\r
#endregion\r
\r
#region Encoding and Queue\r
}\r
\r
#endregion\r
-\r
+ \r
// This is the END of the road ------------------------------------------------------------------------------\r
}\r
}
\ No newline at end of file
the list will not be populated with the correct amount of chapters.\r
Note: Do not change any of the chapter numbers!</value>\r
</data>\r
- <metadata name="number.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
- <value>True</value>\r
- </metadata>\r
- <metadata name="name.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
- <value>True</value>\r
- </metadata>\r
<metadata name="DVD_Open.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
<value>223, 15</value>\r
</metadata>\r
this.pictureBox2 = new System.Windows.Forms.PictureBox();\r
this.label7 = new System.Windows.Forms.Label();\r
this.pathFinder = new System.Windows.Forms.FolderBrowserDialog();\r
+ this.label6 = new System.Windows.Forms.Label();\r
+ this.btn_drive_detect = new System.Windows.Forms.CheckBox();\r
this.tab_options.SuspendLayout();\r
this.tab_general.SuspendLayout();\r
this.tabPage1.SuspendLayout();\r
this.btn_close.FlatAppearance.BorderColor = System.Drawing.Color.Black;\r
this.btn_close.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
this.btn_close.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));\r
- this.btn_close.Location = new System.Drawing.Point(324, 305);\r
+ this.btn_close.Location = new System.Drawing.Point(324, 327);\r
this.btn_close.Name = "btn_close";\r
this.btn_close.Size = new System.Drawing.Size(107, 22);\r
this.btn_close.TabIndex = 53;\r
this.tab_options.Location = new System.Drawing.Point(12, 63);\r
this.tab_options.Name = "tab_options";\r
this.tab_options.SelectedIndex = 0;\r
- this.tab_options.Size = new System.Drawing.Size(419, 236);\r
+ this.tab_options.Size = new System.Drawing.Size(419, 258);\r
this.tab_options.TabIndex = 58;\r
// \r
// tab_general\r
// \r
// tabPage1\r
// \r
+ this.tabPage1.Controls.Add(this.btn_drive_detect);\r
+ this.tabPage1.Controls.Add(this.label6);\r
this.tabPage1.Controls.Add(this.btn_browse);\r
this.tabPage1.Controls.Add(this.label10);\r
this.tabPage1.Controls.Add(this.text_an_path);\r
this.tabPage1.Controls.Add(this.label5);\r
this.tabPage1.Location = new System.Drawing.Point(4, 22);\r
this.tabPage1.Name = "tabPage1";\r
- this.tabPage1.Size = new System.Drawing.Size(411, 210);\r
+ this.tabPage1.Size = new System.Drawing.Size(411, 232);\r
this.tabPage1.TabIndex = 3;\r
this.tabPage1.Text = "General";\r
this.tabPage1.UseVisualStyleBackColor = true;\r
// \r
this.check_autoNaming.AutoSize = true;\r
this.check_autoNaming.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
- this.check_autoNaming.Location = new System.Drawing.Point(17, 103);\r
+ this.check_autoNaming.Location = new System.Drawing.Point(17, 101);\r
this.check_autoNaming.Name = "check_autoNaming";\r
this.check_autoNaming.Size = new System.Drawing.Size(340, 17);\r
this.check_autoNaming.TabIndex = 56;\r
this.label7.TabIndex = 59;\r
this.label7.Text = "Modify program options.";\r
// \r
+ // label6\r
+ // \r
+ this.label6.AutoSize = true;\r
+ this.label6.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+ this.label6.Location = new System.Drawing.Point(14, 182);\r
+ this.label6.Name = "label6";\r
+ this.label6.Size = new System.Drawing.Size(108, 13);\r
+ this.label6.TabIndex = 63;\r
+ this.label6.Text = "Drive Detection";\r
+ // \r
+ // btn_drive_detect\r
+ // \r
+ this.btn_drive_detect.AutoSize = true;\r
+ this.btn_drive_detect.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+ this.btn_drive_detect.Location = new System.Drawing.Point(17, 204);\r
+ this.btn_drive_detect.Name = "btn_drive_detect";\r
+ this.btn_drive_detect.Size = new System.Drawing.Size(383, 17);\r
+ this.btn_drive_detect.TabIndex = 64;\r
+ this.btn_drive_detect.Text = "Enable Drive Detection in the \"Source\" button dropdown menu";\r
+ this.btn_drive_detect.UseVisualStyleBackColor = true;\r
+ this.btn_drive_detect.CheckedChanged += new System.EventHandler(this.btn_drive_detect_CheckedChanged);\r
+ // \r
// frmOptions\r
// \r
- this.ClientSize = new System.Drawing.Size(443, 339);\r
+ this.ClientSize = new System.Drawing.Size(443, 357);\r
this.Controls.Add(this.label7);\r
this.Controls.Add(this.label8);\r
this.Controls.Add(this.pictureBox2);\r
internal System.Windows.Forms.Label Label11;\r
internal System.Windows.Forms.Label Label4;\r
internal System.Windows.Forms.ComboBox drp_processors;\r
+ internal System.Windows.Forms.CheckBox btn_drive_detect;\r
+ private System.Windows.Forms.Label label6;\r
}\r
}
\ No newline at end of file
public frmOptions()\r
{\r
InitializeComponent();\r
+ \r
if (Properties.Settings.Default.updateStatus == "Checked")\r
{\r
check_updateCheck.CheckState = CheckState.Checked;\r
check_autoNaming.CheckState = CheckState.Checked;\r
}\r
\r
+ if (Properties.Settings.Default.drive_detection == "Checked")\r
+ {\r
+ btn_drive_detect.CheckState = CheckState.Checked;\r
+ }\r
+\r
text_an_path.Text = Properties.Settings.Default.autoNamePath;\r
\r
if (text_an_path.Text == "")\r
pathFinder.ShowDialog();\r
text_an_path.Text = pathFinder.SelectedPath;\r
}\r
+ \r
+ private void btn_drive_detect_CheckedChanged(object sender, EventArgs e)\r
+ {\r
+ Properties.Settings.Default.drive_detection = btn_drive_detect.CheckState.ToString();\r
+ }\r
\r
private void text_an_path_TextChanged(object sender, EventArgs e)\r
{\r
}\r
#endregion\r
\r
+ \r
+\r
\r
\r
\r
this.Label3 = new System.Windows.Forms.Label();\r
this.lbl_status = new System.Windows.Forms.Label();\r
this.pictureBox1 = new System.Windows.Forms.PictureBox();\r
+ this.btn_cancel = new System.Windows.Forms.Button();\r
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();\r
this.SuspendLayout();\r
// \r
this.pictureBox1.TabIndex = 32;\r
this.pictureBox1.TabStop = false;\r
// \r
+ // btn_cancel\r
+ // \r
+ this.btn_cancel.FlatAppearance.BorderColor = System.Drawing.Color.Black;\r
+ this.btn_cancel.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+ this.btn_cancel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));\r
+ this.btn_cancel.Location = new System.Drawing.Point(323, 51);\r
+ this.btn_cancel.Name = "btn_cancel";\r
+ this.btn_cancel.Size = new System.Drawing.Size(58, 22);\r
+ this.btn_cancel.TabIndex = 33;\r
+ this.btn_cancel.TabStop = false;\r
+ this.btn_cancel.Text = "Cancel";\r
+ this.btn_cancel.UseVisualStyleBackColor = true;\r
+ this.btn_cancel.Click += new System.EventHandler(this.btn_cancel_Click);\r
+ // \r
// frmReadDVD\r
// \r
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 13F);\r
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\r
- this.ClientSize = new System.Drawing.Size(360, 81);\r
+ this.ClientSize = new System.Drawing.Size(393, 83);\r
this.ControlBox = false;\r
+ this.Controls.Add(this.btn_cancel);\r
this.Controls.Add(this.pictureBox1);\r
this.Controls.Add(this.lbl_status);\r
this.Controls.Add(this.Label3);\r
internal System.Windows.Forms.Label Label3;\r
internal System.Windows.Forms.Label lbl_status;\r
private System.Windows.Forms.PictureBox pictureBox1;\r
+ internal System.Windows.Forms.Button btn_cancel;\r
}\r
}
\ No newline at end of file
private frmMain mainWindow;\r
private Parsing.DVD thisDvd;\r
private delegate void UpdateUIHandler();\r
+ Process hbproc;\r
Functions.Common hb_common_func = new Functions.Common();\r
\r
public frmReadDVD(string inputFile, frmMain parent)\r
mainWindow.setStreamReader(thisDvd);\r
\r
mainWindow.drp_dvdtitle.Items.Clear();\r
- mainWindow.drp_dvdtitle.Items.AddRange(thisDvd.Titles.ToArray());\r
+ if (thisDvd.Titles.Count != 0)\r
+ mainWindow.drp_dvdtitle.Items.AddRange(thisDvd.Titles.ToArray());\r
mainWindow.drp_dvdtitle.Text = "Automatic";\r
mainWindow.drop_chapterFinish.Text = "Auto";\r
mainWindow.drop_chapterStart.Text = "Auto";\r
\r
// Now select the longest title\r
- hb_common_func.selectLongestTitle(mainWindow);\r
-\r
- \r
+ if (thisDvd.Titles.Count != 0)\r
+ hb_common_func.selectLongestTitle(mainWindow);\r
\r
this.Close();\r
}\r
\r
ProcessStartInfo hbParseDvd = new ProcessStartInfo("CMD.exe", strCmdLine);\r
hbParseDvd.WindowStyle = ProcessWindowStyle.Hidden;\r
- using (Process hbproc = Process.Start(hbParseDvd))\r
+ \r
+ using (hbproc = Process.Start(hbParseDvd))\r
{\r
hbproc.WaitForExit();\r
- // TODO: Verify exit code if the CLI supports it properly\r
}\r
\r
if (!File.Exists(dvdInfoPath))\r
}\r
\r
}\r
+\r
+ private void btn_cancel_Click(object sender, EventArgs e)\r
+ {\r
+ // This may seem like a long way of killing HandBrakeCLI, but for whatever reason,\r
+ // hbproc.kill/close just won't do the trick.\r
+ try\r
+ {\r
+ string AppName = "HandBrakeCLI";\r
+\r
+ AppName = AppName.ToUpper();\r
+\r
+ System.Diagnostics.Process[] prs = System.Diagnostics.Process.GetProcesses();\r
+ foreach (System.Diagnostics.Process proces in prs)\r
+ {\r
+ if (proces.ProcessName.ToUpper() == AppName)\r
+ {\r
+ proces.Refresh();\r
+ if (!proces.HasExited)\r
+ proces.Kill();\r
+ }\r
+ }\r
+ }\r
+ catch (Exception ex)\r
+ {\r
+ MessageBox.Show(ex.Message);\r
+ }\r
+ }\r
}\r
}
\ No newline at end of file