OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Wed, 2 Jan 2008 16:58:39 +0000 (16:58 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Wed, 2 Jan 2008 16:58:39 +0000 (16:58 +0000)
- Chapters.csv and dvdinfo.dat are now saved in the windows temporary folder. This should mean the application doesn't need admin rights on Vista. Thanks to "doubt" for the patch.
- Few UI theme tweaks.

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

win/C#/Functions/Common.cs
win/C#/HandBrakeCS.csproj
win/C#/frmDvdInfo.cs
win/C#/frmMain.Designer.cs
win/C#/frmMain.resx
win/C#/frmReadDVD.cs

index a0a7d72..ee4c4ca 100644 (file)
@@ -694,8 +694,7 @@ namespace Handbrake.Functions
                 }\r
                 else\r
                 {\r
-                    string path = Application.StartupPath.ToString();\r
-                    path = "\"" + path + "\\chapters.csv\" ";\r
+                    string path = Path.Combine(Path.GetTempPath(), "chapters.csv");\r
 \r
                     ChapterMarkers = " --markers=" + path;\r
                 }\r
@@ -784,10 +783,7 @@ namespace Handbrake.Functions
         {\r
             try\r
             {\r
-                string appPath = Application.StartupPath.ToString();\r
-                appPath = appPath + "\\";\r
-\r
-                string path = appPath + "chapters.csv";\r
+                string path = Path.Combine(Path.GetTempPath(), "chapters.csv");\r
 \r
                 StringBuilder csv = new StringBuilder();\r
 \r
index bfdf215..c6b7512 100644 (file)
@@ -65,6 +65,7 @@
     <Reference Include="System.Data" />\r
     <Reference Include="System.Deployment" />\r
     <Reference Include="System.Drawing" />\r
+    <Reference Include="System.Messaging" />\r
     <Reference Include="System.Windows.Forms" />\r
     <Reference Include="System.Xml" />\r
   </ItemGroup>\r
index 6015041..b37a12a 100644 (file)
@@ -42,9 +42,8 @@ namespace Handbrake
         {\r
             try\r
             {\r
-                string appPath = Application.StartupPath.ToString();\r
-                appPath = appPath + "\\";\r
-                StreamReader sr = new StreamReader(appPath + "dvdinfo.dat");\r
+                string dvdInfoPath = Path.Combine(Path.GetTempPath(), "dvdinfo.dat");\r
+                StreamReader sr = new StreamReader(dvdInfoPath);\r
 \r
                 string line = sr.ReadLine();\r
 \r
index 9a4721b..b2ebe35 100644 (file)
@@ -37,7 +37,7 @@ namespace Handbrake
             this.components = new System.ComponentModel.Container();\r
             System.Windows.Forms.Label Label38;\r
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMain));\r
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();\r
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();\r
             this.DVD_Save = new System.Windows.Forms.SaveFileDialog();\r
             this.File_Save = new System.Windows.Forms.SaveFileDialog();\r
             this.ToolTip = new System.Windows.Forms.ToolTip(this.components);\r
@@ -483,7 +483,7 @@ namespace Handbrake
             this.slider_videoQuality.Location = new System.Drawing.Point(435, 90);\r
             this.slider_videoQuality.Maximum = 100;\r
             this.slider_videoQuality.Name = "slider_videoQuality";\r
-            this.slider_videoQuality.Size = new System.Drawing.Size(167, 42);\r
+            this.slider_videoQuality.Size = new System.Drawing.Size(167, 45);\r
             this.slider_videoQuality.TabIndex = 14;\r
             this.slider_videoQuality.TickFrequency = 17;\r
             this.ToolTip.SetToolTip(this.slider_videoQuality, "Set the quality level of the video. (Around 70% is fine for most)");\r
@@ -594,7 +594,7 @@ namespace Handbrake
             this.slider_drc.Location = new System.Drawing.Point(317, 137);\r
             this.slider_drc.Maximum = 30;\r
             this.slider_drc.Name = "slider_drc";\r
-            this.slider_drc.Size = new System.Drawing.Size(241, 42);\r
+            this.slider_drc.Size = new System.Drawing.Size(241, 45);\r
             this.slider_drc.TabIndex = 18;\r
             this.slider_drc.TickFrequency = 10;\r
             this.ToolTip.SetToolTip(this.slider_drc, "Dynamic Range Compression");\r
@@ -602,7 +602,7 @@ namespace Handbrake
             // \r
             // rtf_h264advanced\r
             // \r
-            this.rtf_h264advanced.BorderStyle = System.Windows.Forms.BorderStyle.None;\r
+            this.rtf_h264advanced.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;\r
             this.rtf_h264advanced.Location = new System.Drawing.Point(16, 79);\r
             this.rtf_h264advanced.Name = "rtf_h264advanced";\r
             this.rtf_h264advanced.Size = new System.Drawing.Size(605, 123);\r
@@ -1077,6 +1077,7 @@ namespace Handbrake
             // label30\r
             // \r
             this.label30.AutoSize = true;\r
+            this.label30.BackColor = System.Drawing.Color.Transparent;\r
             this.label30.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.label30.Location = new System.Drawing.Point(470, 169);\r
             this.label30.Name = "label30";\r
@@ -1087,6 +1088,7 @@ namespace Handbrake
             // label29\r
             // \r
             this.label29.AutoSize = true;\r
+            this.label29.BackColor = System.Drawing.Color.Transparent;\r
             this.label29.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.label29.Location = new System.Drawing.Point(398, 169);\r
             this.label29.Name = "label29";\r
@@ -1097,6 +1099,7 @@ namespace Handbrake
             // label23\r
             // \r
             this.label23.AutoSize = true;\r
+            this.label23.BackColor = System.Drawing.Color.Transparent;\r
             this.label23.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.label23.Location = new System.Drawing.Point(543, 169);\r
             this.label23.Name = "label23";\r
@@ -1107,6 +1110,7 @@ namespace Handbrake
             // label7\r
             // \r
             this.label7.AutoSize = true;\r
+            this.label7.BackColor = System.Drawing.Color.Transparent;\r
             this.label7.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.label7.Location = new System.Drawing.Point(321, 169);\r
             this.label7.Name = "label7";\r
@@ -1139,13 +1143,14 @@ namespace Handbrake
             // check_forced\r
             // \r
             this.check_forced.AutoSize = true;\r
+            this.check_forced.BackColor = System.Drawing.Color.Transparent;\r
             this.check_forced.Enabled = false;\r
             this.check_forced.Location = new System.Drawing.Point(332, 215);\r
             this.check_forced.Name = "check_forced";\r
             this.check_forced.Size = new System.Drawing.Size(147, 17);\r
             this.check_forced.TabIndex = 17;\r
             this.check_forced.Text = "Forced Subtitles Only";\r
-            this.check_forced.UseVisualStyleBackColor = true;\r
+            this.check_forced.UseVisualStyleBackColor = false;\r
             // \r
             // drp_track2Audio\r
             // \r
@@ -1425,6 +1430,7 @@ namespace Handbrake
             // SliderValue\r
             // \r
             this.SliderValue.AutoSize = true;\r
+            this.SliderValue.BackColor = System.Drawing.Color.Transparent;\r
             this.SliderValue.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.SliderValue.Location = new System.Drawing.Point(599, 96);\r
             this.SliderValue.Name = "SliderValue";\r
@@ -1561,6 +1567,7 @@ namespace Handbrake
             // Label56\r
             // \r
             this.Label56.AutoSize = true;\r
+            this.Label56.BackColor = System.Drawing.Color.Transparent;\r
             this.Label56.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.Label56.ForeColor = System.Drawing.Color.Black;\r
             this.Label56.Location = new System.Drawing.Point(483, 38);\r
@@ -1572,6 +1579,7 @@ namespace Handbrake
             // lbl_Aspect\r
             // \r
             this.lbl_Aspect.AutoSize = true;\r
+            this.lbl_Aspect.BackColor = System.Drawing.Color.Transparent;\r
             this.lbl_Aspect.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.lbl_Aspect.Location = new System.Drawing.Point(412, 62);\r
             this.lbl_Aspect.Name = "lbl_Aspect";\r
@@ -1582,6 +1590,7 @@ namespace Handbrake
             // Label91\r
             // \r
             this.Label91.AutoSize = true;\r
+            this.Label91.BackColor = System.Drawing.Color.Transparent;\r
             this.Label91.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.Label91.Location = new System.Drawing.Point(311, 61);\r
             this.Label91.Name = "Label91";\r
@@ -1592,6 +1601,7 @@ namespace Handbrake
             // Label55\r
             // \r
             this.Label55.AutoSize = true;\r
+            this.Label55.BackColor = System.Drawing.Color.Transparent;\r
             this.Label55.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.Label55.ForeColor = System.Drawing.Color.Black;\r
             this.Label55.Location = new System.Drawing.Point(311, 37);\r
@@ -1900,9 +1910,9 @@ namespace Handbrake
             // \r
             // number\r
             // \r
-            dataGridViewCellStyle1.Format = "N0";\r
-            dataGridViewCellStyle1.NullValue = null;\r
-            this.number.DefaultCellStyle = dataGridViewCellStyle1;\r
+            dataGridViewCellStyle3.Format = "N0";\r
+            dataGridViewCellStyle3.NullValue = null;\r
+            this.number.DefaultCellStyle = dataGridViewCellStyle3;\r
             this.number.HeaderText = "Chapter Number";\r
             this.number.MaxInputLength = 3;\r
             this.number.Name = "number";\r
@@ -2017,6 +2027,7 @@ namespace Handbrake
             // \r
             // btn_clear\r
             // \r
+            this.btn_clear.BackColor = System.Drawing.SystemColors.ControlLight;\r
             this.btn_clear.FlatAppearance.BorderColor = System.Drawing.Color.Black;\r
             this.btn_clear.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
             this.btn_clear.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
@@ -2026,11 +2037,12 @@ namespace Handbrake
             this.btn_clear.Size = new System.Drawing.Size(75, 22);\r
             this.btn_clear.TabIndex = 4;\r
             this.btn_clear.Text = "Clear";\r
-            this.btn_clear.UseVisualStyleBackColor = true;\r
+            this.btn_clear.UseVisualStyleBackColor = false;\r
             this.btn_clear.Click += new System.EventHandler(this.btn_clear_Click);\r
             // \r
             // btn_copy2C\r
             // \r
+            this.btn_copy2C.BackColor = System.Drawing.SystemColors.ControlLight;\r
             this.btn_copy2C.FlatAppearance.BorderColor = System.Drawing.Color.Black;\r
             this.btn_copy2C.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
             this.btn_copy2C.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
@@ -2040,7 +2052,7 @@ namespace Handbrake
             this.btn_copy2C.Size = new System.Drawing.Size(136, 22);\r
             this.btn_copy2C.TabIndex = 3;\r
             this.btn_copy2C.Text = "Copy to clipboard";\r
-            this.btn_copy2C.UseVisualStyleBackColor = true;\r
+            this.btn_copy2C.UseVisualStyleBackColor = false;\r
             this.btn_copy2C.Click += new System.EventHandler(this.btn_copy2C_Click);\r
             // \r
             // label34\r
@@ -2055,6 +2067,7 @@ namespace Handbrake
             // \r
             // btn_generate_Query\r
             // \r
+            this.btn_generate_Query.BackColor = System.Drawing.SystemColors.ControlLight;\r
             this.btn_generate_Query.FlatAppearance.BorderColor = System.Drawing.Color.Black;\r
             this.btn_generate_Query.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
             this.btn_generate_Query.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
@@ -2064,7 +2077,7 @@ namespace Handbrake
             this.btn_generate_Query.Size = new System.Drawing.Size(126, 22);\r
             this.btn_generate_Query.TabIndex = 1;\r
             this.btn_generate_Query.Text = "Generate Query";\r
-            this.btn_generate_Query.UseVisualStyleBackColor = true;\r
+            this.btn_generate_Query.UseVisualStyleBackColor = false;\r
             this.btn_generate_Query.Click += new System.EventHandler(this.btn_generate_Query_Click);\r
             // \r
             // label33\r
@@ -2080,7 +2093,7 @@ namespace Handbrake
             // \r
             // rtf_query\r
             // \r
-            this.rtf_query.BorderStyle = System.Windows.Forms.BorderStyle.None;\r
+            this.rtf_query.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;\r
             this.rtf_query.Location = new System.Drawing.Point(16, 103);\r
             this.rtf_query.Name = "rtf_query";\r
             this.rtf_query.Size = new System.Drawing.Size(614, 108);\r
@@ -2146,7 +2159,7 @@ namespace Handbrake
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\r
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\r
             this.BackColor = System.Drawing.SystemColors.ControlLight;\r
-            this.ClientSize = new System.Drawing.Size(892, 582);\r
+            this.ClientSize = new System.Drawing.Size(892, 588);\r
             this.Controls.Add(this.label6);\r
             this.Controls.Add(this.groupBox2);\r
             this.Controls.Add(this.groupBox_dest);\r
index d8bc4d4..4f28a77 100644 (file)
@@ -141,10 +141,10 @@ Best used in conjunction with forced subtitles.</value>
     <value>223, 15</value>\r
   </metadata>\r
   <metadata name="File_Open.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
-    <value>331, 15</value>\r
+    <value>430, 18</value>\r
   </metadata>\r
   <metadata name="ISO_Open.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
-    <value>432, 15</value>\r
+    <value>329, 15</value>\r
   </metadata>\r
   <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />\r
   <data name="mnu_open.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">\r
@@ -181,7 +181,13 @@ Best used in conjunction with forced subtitles.</value>
 </value>\r
   </data>\r
   <metadata name="frmMainMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
-    <value>94, 17</value>\r
+    <value>106, 15</value>\r
+  </metadata>\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="number.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
     <value>True</value>\r
index d6da8fe..d7a0749 100644 (file)
@@ -81,17 +81,31 @@ namespace Handbrake
         {\r
             try\r
             {\r
-                string appPath = Application.StartupPath.ToString() + "\\";\r
-                string strCmdLine = "cmd /c " + '"' + '"' + appPath + "HandBrakeCLI.exe" + '"' + " -i " + '"' + inputFile + '"' + " -t0 -v >" + '"' + appPath + "dvdinfo.dat" + '"' + " 2>&1" + '"';\r
-                Process hbproc = Process.Start("CMD.exe", strCmdLine);\r
-                hbproc.WaitForExit();\r
-                hbproc.Dispose();\r
-                hbproc.Close();\r
+                string handbrakeCLIPath = Path.Combine(Application.StartupPath, "HandBrakeCLI.exe");\r
+                string dvdInfoPath = Path.Combine(Path.GetTempPath(), "dvdinfo.dat");\r
 \r
+                // Make we don't pick up a stale dvdinfo.dat (and that we have rights to the file)\r
+                if (File.Exists(dvdInfoPath))\r
+                    File.Delete(dvdInfoPath);\r
 \r
-                StreamReader sr = new StreamReader(appPath + "dvdinfo.dat");\r
-                thisDvd = Parsing.DVD.Parse(sr);\r
-                sr.Close();\r
+                string strCmdLine = String.Format(@"cmd /c """"{0}"" -i ""{1}"" -t0 -v >""{2}"" 2>&1""", handbrakeCLIPath, inputFile, dvdInfoPath);\r
+\r
+                using (Process hbproc = Process.Start("CMD.exe", strCmdLine))\r
+                {\r
+                    hbproc.WaitForExit();\r
+                    // TODO: Verify exit code if the CLI supports it properly\r
+                }\r
+\r
+\r
+                if (!File.Exists(dvdInfoPath))\r
+                {\r
+                    throw new Exception("Unable to retrieve the DVD Info. dvdinfo.dat missing.");\r
+                }\r
+\r
+                using (StreamReader sr = new StreamReader(dvdInfoPath))\r
+                {\r
+                    thisDvd = Parsing.DVD.Parse(sr);\r
+                }\r
 \r
                 updateUIElements();\r
             }\r