OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Tue, 7 Apr 2009 11:24:43 +0000 (11:24 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Tue, 7 Apr 2009 11:24:43 +0000 (11:24 +0000)
- Fix small regex error in QueryParser.cs related to video framerate.

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

win/C#/Functions/QueryParser.cs
win/C#/frmMain.cs

index 4395791..4d40ef8 100644 (file)
@@ -655,7 +655,7 @@ namespace Handbrake.Functions
 \r
             //Video Settings Tab\r
             Match videoEncoder = Regex.Match(input, @"-e ([a-zA-Z0-9]*)");\r
-            Match videoFramerate = Regex.Match(input, @"-r ([0-9]*)");\r
+            Match videoFramerate = Regex.Match(input, @"-r ([0-9.]*)");\r
             Match videoBitrate = Regex.Match(input, @"-b ([0-9]*)");\r
             Match videoQuality = Regex.Match(input, @"-q ([0-9.]*)");\r
             Match videoFilesize = Regex.Match(input, @"-S ([0-9.]*)");\r
index 99a89b9..ba71346 100644 (file)
@@ -39,6 +39,7 @@ namespace Handbrake
         public int maxWidth;\r
         public int maxHeight;\r
         Process hbproc;\r
+        private Form splash;\r
 \r
         // Applicaiton Startup ************************************************\r
 \r
@@ -47,11 +48,11 @@ namespace Handbrake
         public frmMain()\r
         {\r
             // Load the splash screen in this thread\r
-            Form splash = new frmSplashScreen();\r
+            splash = new frmSplashScreen();\r
             splash.Show();\r
 \r
             //Create a label that can be updated from the parent thread.\r
-            Label lblStatus = new Label {Size = new Size(250, 20), Location = new Point(10, 280)};\r
+            Label lblStatus = new Label { Size = new Size(250, 20), Location = new Point(10, 280) };\r
             splash.Controls.Add(lblStatus);\r
             InitializeComponent();\r
 \r
@@ -72,6 +73,7 @@ namespace Handbrake
             {\r
                 lblStatus.Text = "Checking for updates ...";\r
                 Application.DoEvents();\r
+\r
                 Thread updateCheckThread = new Thread(startupUpdateCheck);\r
                 updateCheckThread.Start();\r
             }\r
@@ -103,7 +105,7 @@ namespace Handbrake
                         x264Panel.reset2Defaults();\r
 \r
                         // Send the query from the file to the Query Parser class, then load the preset\r
-                        Functions.QueryParser presetQuery = Functions.QueryParser.Parse(query);\r
+                        QueryParser presetQuery = QueryParser.Parse(query);\r
                         presetLoader.presetLoader(this, presetQuery, Properties.Settings.Default.defaultPreset, loadPictureSettings);\r
 \r
                         // The x264 widgets will need updated, so do this now:\r
@@ -157,7 +159,10 @@ namespace Handbrake
                     updateWindow.Show();\r
                 }\r
             }\r
-            catch (Exception) { /* Do Nothing*/ }\r
+            catch (Exception exc)\r
+            {\r
+                MessageBox.Show(splash, "Unable to perform update check. If this problem persists, you can turn of update checking in the program options. \nError Information: \n\n" + exc, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);\r
+            }\r
         }\r
         private void queueRecovery()\r
         {\r
@@ -716,8 +721,11 @@ namespace Handbrake
             if (FormWindowState.Minimized == this.WindowState)\r
             {\r
                 notifyIcon.Visible = true;\r
-                notifyIcon.BalloonTipText = lbl_encode.Text != "" ? lbl_encode.Text : "Not Encoding";\r
-                notifyIcon.ShowBalloonTip(500);\r
+                if (!encodeQueue.isEncoding)\r
+                {\r
+                    notifyIcon.BalloonTipText = lbl_encode.Text != "" ? lbl_encode.Text : "Not Encoding";\r
+                    notifyIcon.ShowBalloonTip(500);\r
+                }\r
                 this.Hide();\r
             }\r
             else if (FormWindowState.Normal == this.WindowState)\r
@@ -760,7 +768,6 @@ namespace Handbrake
                     MessageBox.Show("Sorry, HandBrake does not support UNC file paths. \nTry mounting the share as a network drive in My Computer", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
                 else\r
                 {\r
-\r
                     if (filename != "")\r
                     {\r
                         setupGUIforScan(filename);\r
@@ -982,10 +989,6 @@ namespace Handbrake
                 DVD_Save.FilterIndex = 2;\r
             else if (drop_format.SelectedIndex.Equals(2))\r
                 DVD_Save.FilterIndex = 3;\r
-            else if (drop_format.SelectedIndex.Equals(3))\r
-                DVD_Save.FilterIndex = 4;\r
-            else if (drop_format.SelectedIndex.Equals(4))\r
-                DVD_Save.FilterIndex = 5;\r
 \r
             if (DVD_Save.ShowDialog() == DialogResult.OK)\r
             {\r
@@ -1601,8 +1604,7 @@ namespace Handbrake
 \r
                 string strCmdLine = String.Format(@"cmd /c """"{0}"" -i ""{1}"" -t0 -v >""{2}"" 2>&1""", handbrakeCLIPath, inputFile, dvdInfoPath);\r
 \r
-                ProcessStartInfo hbParseDvd = new ProcessStartInfo("CMD.exe", strCmdLine)\r
-                                                  {WindowStyle = ProcessWindowStyle.Hidden};\r
+                ProcessStartInfo hbParseDvd = new ProcessStartInfo("CMD.exe", strCmdLine) { WindowStyle = ProcessWindowStyle.Hidden };\r
 \r
                 using (hbproc = Process.Start(hbParseDvd))\r
                 {\r
@@ -1744,17 +1746,13 @@ namespace Handbrake
                 DriveInfo[] theCollectionOfDrives = DriveInfo.GetDrives();\r
                 foreach (DriveInfo curDrive in theCollectionOfDrives)\r
                 {\r
-                    if (curDrive.DriveType == DriveType.CDRom)\r
+                    if (curDrive.DriveType == DriveType.CDRom && curDrive.IsReady)\r
                     {\r
-                        if (curDrive.IsReady)\r
+                        if (File.Exists(curDrive.RootDirectory + "VIDEO_TS\\VIDEO_TS.IFO"))\r
                         {\r
-                            if (File.Exists(curDrive.RootDirectory + "VIDEO_TS\\VIDEO_TS.IFO"))\r
-                            {\r
-                                mnu_dvd_drive.Text = curDrive.RootDirectory + "VIDEO_TS (" + curDrive.VolumeLabel + ")";\r
-                                foundDrive = true;\r
-                                break;\r
-                            }\r
-\r
+                            mnu_dvd_drive.Text = curDrive.RootDirectory + "VIDEO_TS (" + curDrive.VolumeLabel + ")";\r
+                            foundDrive = true;\r
+                            break;\r
                         }\r
                     }\r
                 }\r
@@ -1772,11 +1770,9 @@ namespace Handbrake
         #region Audio Panel Code Helpers\r
         private void setAudioByContainer(String path)\r
         {\r
-            string oldval;\r
-\r
             if ((path.Contains("MP4")) || (path.Contains("M4V")))\r
             {\r
-                oldval = drp_audenc_1.Text;\r
+                string oldval = drp_audenc_1.Text;\r
                 drp_audenc_1.Items.Clear();\r
                 drp_audenc_1.Items.Add("AAC");\r
                 drp_audenc_1.Items.Add("AC3");\r
@@ -2057,7 +2053,7 @@ namespace Handbrake
             List<string> presetNames = presetHandler.getUserPresetNames();\r
             foreach (string preset in presetNames)\r
             {\r
-                preset_treeview = new TreeNode(preset) {ForeColor = Color.Black};\r
+                preset_treeview = new TreeNode(preset) { ForeColor = Color.Black };\r
 \r
                 // Now Fill Out List View with Items\r
                 treeView_presets.Nodes.Add(preset_treeview);\r