OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Wed, 4 Jul 2007 19:04:21 +0000 (19:04 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Wed, 4 Jul 2007 19:04:21 +0000 (19:04 +0000)
- User can now set the default priority level for hbcli.exe from Tools > Options (set to normal by default)

git-svn-id: svn://localhost/HandBrake/trunk@649 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/Handbrake/My Project/Settings.Designer.vb
win/Handbrake/My Project/Settings.settings
win/Handbrake/app.config
win/Handbrake/frmMain.resx
win/Handbrake/frmMain.vb
win/Handbrake/frmOptions.Designer.vb
win/Handbrake/frmOptions.vb

index 7cb65f9..aba5a68 100644 (file)
@@ -508,6 +508,18 @@ Namespace My
                 Me("verbose") = value\r
             End Set\r
         End Property\r
+        \r
+        <Global.System.Configuration.UserScopedSettingAttribute(),  _\r
+         Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _\r
+         Global.System.Configuration.DefaultSettingValueAttribute("Normal")>  _\r
+        Public Property Priority() As String\r
+            Get\r
+                Return CType(Me("Priority"),String)\r
+            End Get\r
+            Set\r
+                Me("Priority") = value\r
+            End Set\r
+        End Property\r
     End Class\r
 End Namespace\r
 \r
index 1195a26..d968750 100644 (file)
     <Setting Name="verbose" Type="System.Int32" Scope="User">\r
       <Value Profile="(Default)" />\r
     </Setting>\r
+    <Setting Name="Priority" Type="System.String" Scope="User">\r
+      <Value Profile="(Default)">Normal</Value>\r
+    </Setting>\r
   </Settings>\r
 </SettingsFile>
\ No newline at end of file
index 6f69f12..fe54bf1 100644 (file)
             <setting name="largeFile" serializeAs="String">\r
                 <value />\r
             </setting>\r
+            <setting name="Priority" serializeAs="String">\r
+                <value>Normal</value>\r
+            </setting>\r
         </Handbrake.My.MySettings>\r
     </userSettings>\r
 </configuration>\r
index 752b751..653be2f 100644 (file)
   <metadata name="File_Save.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
     <value>234, 18</value>\r
   </metadata>\r
-  <metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
-    <value>639, 17</value>\r
-  </metadata>\r
   <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">\r
     <value>\r
         AAABAAYAMDAAAAEACACoDgAAZgAAACAgAAABAAgAqAgAAA4PAAAQEAAAAQAIAGgFAAC2FwAAMDAAAAEA\r
index 546d1ee..0145d23 100644 (file)
@@ -502,6 +502,25 @@ Public Class frmMain
                 Dim params As String = query\r
                 Dim proc As New System.Diagnostics.Process\r
                 proc = System.Diagnostics.Process.Start("""" + ApplicationPath + "\hbcli.exe""", params)\r
+                If My.Settings.Priority <> "Normal" Then\r
+                    Dim level As String\r
+                    level = My.Settings.Priority\r
+\r
+                    Select Case level\r
+                        Case "Realtime"\r
+                            proc.PriorityClass = ProcessPriorityClass.RealTime\r
+                        Case "High"\r
+                            proc.PriorityClass = ProcessPriorityClass.High\r
+                        Case "Above Normal"\r
+                            proc.PriorityClass = ProcessPriorityClass.AboveNormal\r
+                        Case "Below Normal"\r
+                            proc.PriorityClass = ProcessPriorityClass.BelowNormal\r
+                        Case "Low"\r
+                            proc.PriorityClass = ProcessPriorityClass.Idle\r
+                    End Select\r
+\r
+\r
+                End If\r
 \r
                 MessageBox.Show("The Handbrake encoder (CLI) will now start and should be encoding your video.", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)\r
 \r
@@ -676,6 +695,12 @@ Public Class frmMain
         text_height.BackColor = Color.White\r
     End Sub\r
 \r
+    Private Sub drp_dvdtitle_click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles drp_dvdtitle.Click\r
+        If drp_dvdtitle.Items.Count = 1 Then\r
+            MessageBox.Show("There are no titles to select. Please scan the DVD by clicking the 'browse' button above before trying to select a title.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning)\r
+        End If\r
+    End Sub\r
+\r
     Private Sub drp_dvdtitle_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles drp_dvdtitle.SelectedIndexChanged\r
         ' If the title changes then the following text values are no longer correct.\r
         ' Maybe automatically update these in later versions.\r
@@ -683,6 +708,9 @@ Public Class frmMain
         lbl_RecomendedCrop.Text = "Select a Title"\r
         QueryEditorText.Text = ""\r
 \r
+        ' Check if there are any titles and alert the user if there is not\r
+        \r
+\r
         ' If the title is not automatic then read the dvd.dat file and populate the Subtitles box depending on the title slected.\r
         If drp_dvdtitle.Text <> "Automatic" Then\r
             Dim temp() As String\r
index 7af2053..3aa5b4e 100644 (file)
@@ -34,6 +34,8 @@ Partial Class frmOptions
         Me.GroupBox3 = New System.Windows.Forms.GroupBox\r
         Me.drp_processors = New System.Windows.Forms.ComboBox\r
         Me.Label11 = New System.Windows.Forms.Label\r
+        Me.drp_Priority = New System.Windows.Forms.ComboBox\r
+        Me.Label4 = New System.Windows.Forms.Label\r
         Me.GroupBox1.SuspendLayout()\r
         Me.GroupBox2.SuspendLayout()\r
         Me.GroupBox3.SuspendLayout()\r
@@ -43,7 +45,7 @@ Partial Class frmOptions
         '\r
         Me.Label1.AutoSize = True\r
         Me.Label1.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))\r
-        Me.Label1.Location = New System.Drawing.Point(17, 27)\r
+        Me.Label1.Location = New System.Drawing.Point(13, 22)\r
         Me.Label1.Name = "Label1"\r
         Me.Label1.Size = New System.Drawing.Size(151, 13)\r
         Me.Label1.TabIndex = 0\r
@@ -53,7 +55,7 @@ Partial Class frmOptions
         '\r
         Me.check_updateCheck.AutoSize = True\r
         Me.check_updateCheck.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))\r
-        Me.check_updateCheck.Location = New System.Drawing.Point(20, 48)\r
+        Me.check_updateCheck.Location = New System.Drawing.Point(16, 43)\r
         Me.check_updateCheck.Name = "check_updateCheck"\r
         Me.check_updateCheck.Size = New System.Drawing.Size(71, 17)\r
         Me.check_updateCheck.TabIndex = 1\r
@@ -66,7 +68,7 @@ Partial Class frmOptions
         Me.btn_close.FlatStyle = System.Windows.Forms.FlatStyle.Flat\r
         Me.btn_close.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))\r
         Me.btn_close.ForeColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(128, Byte), Integer), CType(CType(0, Byte), Integer))\r
-        Me.btn_close.Location = New System.Drawing.Point(292, 387)\r
+        Me.btn_close.Location = New System.Drawing.Point(291, 403)\r
         Me.btn_close.Name = "btn_close"\r
         Me.btn_close.Size = New System.Drawing.Size(107, 22)\r
         Me.btn_close.TabIndex = 45\r
@@ -77,7 +79,7 @@ Partial Class frmOptions
         '\r
         Me.check_userDefaultSettings.AutoSize = True\r
         Me.check_userDefaultSettings.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))\r
-        Me.check_userDefaultSettings.Location = New System.Drawing.Point(20, 98)\r
+        Me.check_userDefaultSettings.Location = New System.Drawing.Point(16, 93)\r
         Me.check_userDefaultSettings.Name = "check_userDefaultSettings"\r
         Me.check_userDefaultSettings.Size = New System.Drawing.Size(71, 17)\r
         Me.check_userDefaultSettings.TabIndex = 47\r
@@ -88,7 +90,7 @@ Partial Class frmOptions
         '\r
         Me.Label2.AutoSize = True\r
         Me.Label2.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))\r
-        Me.Label2.Location = New System.Drawing.Point(17, 77)\r
+        Me.Label2.Location = New System.Drawing.Point(13, 72)\r
         Me.Label2.Name = "Label2"\r
         Me.Label2.Size = New System.Drawing.Size(229, 13)\r
         Me.Label2.TabIndex = 46\r
@@ -98,7 +100,7 @@ Partial Class frmOptions
         '\r
         Me.check_readDVDWindow.AutoSize = True\r
         Me.check_readDVDWindow.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))\r
-        Me.check_readDVDWindow.Location = New System.Drawing.Point(20, 151)\r
+        Me.check_readDVDWindow.Location = New System.Drawing.Point(16, 146)\r
         Me.check_readDVDWindow.Name = "check_readDVDWindow"\r
         Me.check_readDVDWindow.Size = New System.Drawing.Size(71, 17)\r
         Me.check_readDVDWindow.TabIndex = 49\r
@@ -109,7 +111,7 @@ Partial Class frmOptions
         '\r
         Me.Label3.AutoSize = True\r
         Me.Label3.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))\r
-        Me.Label3.Location = New System.Drawing.Point(17, 129)\r
+        Me.Label3.Location = New System.Drawing.Point(13, 124)\r
         Me.Label3.Name = "Label3"\r
         Me.Label3.Size = New System.Drawing.Size(215, 13)\r
         Me.Label3.TabIndex = 48\r
@@ -119,7 +121,7 @@ Partial Class frmOptions
         '\r
         Me.GroupBox1.Controls.Add(Me.check_verbose)\r
         Me.GroupBox1.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))\r
-        Me.GroupBox1.Location = New System.Drawing.Point(12, 306)\r
+        Me.GroupBox1.Location = New System.Drawing.Point(12, 327)\r
         Me.GroupBox1.Name = "GroupBox1"\r
         Me.GroupBox1.Size = New System.Drawing.Size(386, 70)\r
         Me.GroupBox1.TabIndex = 50\r
@@ -148,7 +150,7 @@ Partial Class frmOptions
         Me.GroupBox2.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))\r
         Me.GroupBox2.Location = New System.Drawing.Point(12, 12)\r
         Me.GroupBox2.Name = "GroupBox2"\r
-        Me.GroupBox2.Size = New System.Drawing.Size(386, 193)\r
+        Me.GroupBox2.Size = New System.Drawing.Size(386, 175)\r
         Me.GroupBox2.TabIndex = 51\r
         Me.GroupBox2.TabStop = False\r
         Me.GroupBox2.Text = "General Settings"\r
@@ -160,12 +162,14 @@ Partial Class frmOptions
         '\r
         'GroupBox3\r
         '\r
+        Me.GroupBox3.Controls.Add(Me.drp_Priority)\r
+        Me.GroupBox3.Controls.Add(Me.Label4)\r
         Me.GroupBox3.Controls.Add(Me.drp_processors)\r
         Me.GroupBox3.Controls.Add(Me.Label11)\r
         Me.GroupBox3.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))\r
-        Me.GroupBox3.Location = New System.Drawing.Point(13, 211)\r
+        Me.GroupBox3.Location = New System.Drawing.Point(13, 193)\r
         Me.GroupBox3.Name = "GroupBox3"\r
-        Me.GroupBox3.Size = New System.Drawing.Size(386, 89)\r
+        Me.GroupBox3.Size = New System.Drawing.Size(386, 128)\r
         Me.GroupBox3.TabIndex = 52\r
         Me.GroupBox3.TabStop = False\r
         Me.GroupBox3.Text = "Processor Detection"\r
@@ -176,7 +180,7 @@ Partial Class frmOptions
         Me.drp_processors.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))\r
         Me.drp_processors.FormattingEnabled = True\r
         Me.drp_processors.Items.AddRange(New Object() {"Automatic", "1", "2", "3", "4", "5", "6", "7", "8"})\r
-        Me.drp_processors.Location = New System.Drawing.Point(19, 50)\r
+        Me.drp_processors.Location = New System.Drawing.Point(15, 40)\r
         Me.drp_processors.Name = "drp_processors"\r
         Me.drp_processors.Size = New System.Drawing.Size(111, 21)\r
         Me.drp_processors.TabIndex = 41\r
@@ -185,17 +189,38 @@ Partial Class frmOptions
         '\r
         Me.Label11.AutoSize = True\r
         Me.Label11.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))\r
-        Me.Label11.Location = New System.Drawing.Point(16, 27)\r
+        Me.Label11.Location = New System.Drawing.Point(12, 22)\r
         Me.Label11.Name = "Label11"\r
         Me.Label11.Size = New System.Drawing.Size(142, 13)\r
         Me.Label11.TabIndex = 40\r
         Me.Label11.Text = "Number of processors: "\r
         '\r
+        'drp_Priority\r
+        '\r
+        Me.drp_Priority.FlatStyle = System.Windows.Forms.FlatStyle.Flat\r
+        Me.drp_Priority.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))\r
+        Me.drp_Priority.FormattingEnabled = True\r
+        Me.drp_Priority.Items.AddRange(New Object() {"Realtime", "High", "Above Normal", "Normal", "Below Normal", "Low"})\r
+        Me.drp_Priority.Location = New System.Drawing.Point(15, 91)\r
+        Me.drp_Priority.Name = "drp_Priority"\r
+        Me.drp_Priority.Size = New System.Drawing.Size(111, 21)\r
+        Me.drp_Priority.TabIndex = 43\r
+        '\r
+        'Label4\r
+        '\r
+        Me.Label4.AutoSize = True\r
+        Me.Label4.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))\r
+        Me.Label4.Location = New System.Drawing.Point(12, 73)\r
+        Me.Label4.Name = "Label4"\r
+        Me.Label4.Size = New System.Drawing.Size(132, 13)\r
+        Me.Label4.TabIndex = 42\r
+        Me.Label4.Text = "Default Priority Level:"\r
+        '\r
         'frmOptions\r
         '\r
         Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 13.0!)\r
         Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font\r
-        Me.ClientSize = New System.Drawing.Size(411, 421)\r
+        Me.ClientSize = New System.Drawing.Size(411, 435)\r
         Me.Controls.Add(Me.GroupBox3)\r
         Me.Controls.Add(Me.GroupBox2)\r
         Me.Controls.Add(Me.GroupBox1)\r
@@ -227,4 +252,6 @@ Partial Class frmOptions
     Friend WithEvents GroupBox3 As System.Windows.Forms.GroupBox\r
     Friend WithEvents drp_processors As System.Windows.Forms.ComboBox\r
     Friend WithEvents Label11 As System.Windows.Forms.Label\r
+    Friend WithEvents drp_Priority As System.Windows.Forms.ComboBox\r
+    Friend WithEvents Label4 As System.Windows.Forms.Label\r
 End Class\r
index a3158e8..f9e4326 100644 (file)
@@ -36,6 +36,7 @@ Public Class frmOptions
             End If\r
 \r
             drp_processors.Text = My.Settings.Processors\r
+            drp_Priority.Text = My.Settings.Priority\r
 \r
         Catch ex As Exception\r
             MessageBox.Show("ERROR:  " & ex.ToString)\r
@@ -115,4 +116,8 @@ Public Class frmOptions
     Private Sub drp_processors_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles drp_processors.SelectedIndexChanged\r
         My.Settings.Processors = drp_processors.Text\r
     End Sub\r
+\r
+    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles drp_Priority.SelectedIndexChanged\r
+        My.Settings.Priority = drp_Priority.Text\r
+    End Sub\r
 End Class
\ No newline at end of file