OSDN Git Service

WinGui:
[handbrake-jp/handbrake-jp-git.git] / win / C# / frmMain.cs
index 6f971eb..b7a1697 100644 (file)
@@ -47,80 +47,73 @@ namespace Handbrake
 \r
         public frmMain()\r
         {\r
-            try\r
-            {\r
-                // Load the splash screen in this thread\r
-                Form splash = new frmSplashScreen();\r
-                splash.Show();\r
-\r
-                //Create a label that can be updated from the parent thread.\r
-                Label lblStatus = new Label();\r
-                lblStatus.Size = new Size(250, 20);\r
-                lblStatus.Location = new Point(10, 280);\r
-                splash.Controls.Add(lblStatus);\r
-                InitializeComponent();\r
-\r
-                // Update the users config file with the CLI version data.\r
-                lblStatus.Text = "Setting Version Data ...";\r
+            // Load the splash screen in this thread\r
+            Form splash = new frmSplashScreen();\r
+            splash.Show();\r
+\r
+            //Create a label that can be updated from the parent thread.\r
+            Label lblStatus = new Label();\r
+            lblStatus.Size = new Size(250, 20);\r
+            lblStatus.Location = new Point(10, 280);\r
+            splash.Controls.Add(lblStatus);\r
+            InitializeComponent();\r
+\r
+            // Update the users config file with the CLI version data.\r
+            lblStatus.Text = "Setting Version Data ...";\r
+            Application.DoEvents();\r
+            ArrayList x = hb_common_func.getCliVersionData();\r
+            Properties.Settings.Default.hb_build = int.Parse(x[1].ToString());\r
+            Properties.Settings.Default.hb_version = x[0].ToString();\r
+\r
+            // show the form, but leave disabled until preloading is complete then show the main form\r
+            this.Enabled = false;\r
+            this.Show();\r
+            Application.DoEvents(); // Forces frmMain to draw\r
+\r
+            // update the status\r
+            if (Properties.Settings.Default.updateStatus == "Checked")\r
+            {\r
+                lblStatus.Text = "Checking for updates ...";\r
                 Application.DoEvents();\r
-                ArrayList x = hb_common_func.getCliVersionData();\r
-                Properties.Settings.Default.hb_build = int.Parse(x[1].ToString());\r
-                Properties.Settings.Default.hb_version = x[0].ToString();\r
-\r
-                // show the form, but leave disabled until preloading is complete then show the main form\r
-                this.Enabled = false;\r
-                this.Show();\r
-                Application.DoEvents(); // Forces frmMain to draw\r
-\r
-                // update the status\r
-                if (Properties.Settings.Default.updateStatus == "Checked")\r
-                {\r
-                    lblStatus.Text = "Checking for updates ...";\r
-                    Application.DoEvents();\r
-                    Thread updateCheckThread = new Thread(startupUpdateCheck);\r
-                    updateCheckThread.Start();\r
-                }\r
+                Thread updateCheckThread = new Thread(startupUpdateCheck);\r
+                updateCheckThread.Start();\r
+            }\r
 \r
-                // Setup the GUI components\r
-                lblStatus.Text = "Setting up the GUI ...";\r
-                Application.DoEvents();\r
-                x264PanelFunctions.reset2Defaults(this); // Initialize all the x264 widgets to their default values\r
-                loadPresetPanel();                       // Load the Preset Panel\r
-                treeView_presets.ExpandAll();\r
-                lbl_encode.Text = "";\r
-                queueWindow = new frmQueue(this);        // Prepare the Queue\r
+            // Setup the GUI components\r
+            lblStatus.Text = "Setting up the GUI ...";\r
+            Application.DoEvents();\r
+            x264PanelFunctions.reset2Defaults(this); // Initialize all the x264 widgets to their default values\r
+            loadPresetPanel();                       // Load the Preset Panel\r
+            treeView_presets.ExpandAll();\r
+            lbl_encode.Text = "";\r
+            queueWindow = new frmQueue(this);        // Prepare the Queue\r
 \r
-                // Load the user's default settings or Normal Preset\r
-                if (Properties.Settings.Default.defaultSettings == "Checked" && Properties.Settings.Default.defaultUserSettings != "")\r
-                {\r
-                    Functions.QueryParser presetQuery = Functions.QueryParser.Parse(Properties.Settings.Default.defaultUserSettings);\r
-                    presetLoader.presetLoader(this, presetQuery, "User Defaults ");\r
-                }\r
-                else\r
-                    loadNormalPreset();\r
+            // Load the user's default settings or Normal Preset\r
+            if (Properties.Settings.Default.defaultSettings == "Checked" && Properties.Settings.Default.defaultUserSettings != "")\r
+            {\r
+                Functions.QueryParser presetQuery = Functions.QueryParser.Parse(Properties.Settings.Default.defaultUserSettings);\r
+                presetLoader.presetLoader(this, presetQuery, "User Defaults ");\r
+            }\r
+            else\r
+                loadNormalPreset();\r
 \r
-                // Enabled GUI tooltip's if Required\r
-                if (Properties.Settings.Default.tooltipEnable == "Checked")\r
-                    ToolTip.Active = true;\r
+            // Enabled GUI tooltip's if Required\r
+            if (Properties.Settings.Default.tooltipEnable == "Checked")\r
+                ToolTip.Active = true;\r
 \r
-                //Finished Loading\r
-                lblStatus.Text = "Loading Complete!";\r
-                Application.DoEvents();\r
-                splash.Close();\r
-                splash.Dispose();\r
-                this.Enabled = true;\r
+            //Finished Loading\r
+            lblStatus.Text = "Loading Complete!";\r
+            Application.DoEvents();\r
+            splash.Close();\r
+            splash.Dispose();\r
+            this.Enabled = true;\r
 \r
-                // Event Handlers\r
-                if (Properties.Settings.Default.MainWindowMinimize == "Checked")\r
-                    this.Resize += new EventHandler(frmMain_Resize);\r
+            // Event Handlers\r
+            if (Properties.Settings.Default.MainWindowMinimize == "Checked")\r
+                this.Resize += new EventHandler(frmMain_Resize);\r
 \r
-                // Queue Recovery\r
-                queueRecovery();\r
-            }\r
-            catch (Exception e)\r
-            {\r
-                MessageBox.Show("Error at startup: \n\n" + e);\r
-            }\r
+            // Queue Recovery\r
+            queueRecovery();\r
         }\r
 \r
         // Startup Functions\r