OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Thu, 27 Sep 2007 16:22:12 +0000 (16:22 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Thu, 27 Sep 2007 16:22:12 +0000 (16:22 +0000)
- File > Open + Save changed to buttons below the preset list.
- Moved the System Requirements check to Program.cs ( Cleans things up alittle)

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

win/C#/Functions/CLI.cs
win/C#/Program.cs
win/C#/frmMain.Designer.cs
win/C#/frmMain.cs
win/C#/frmMain.resx

index c98d64f..30c8dd9 100644 (file)
@@ -29,7 +29,9 @@ namespace Handbrake.Functions
                 hbProc.StartInfo.RedirectStandardError = stderr;\r
                 hbProc.StartInfo.UseShellExecute = useShellExec;\r
                 hbProc.StartInfo.CreateNoWindow = noWindow;\r
+                hbProc.StartInfo.WindowStyle = ProcessWindowStyle.Minimized; // Why doesn't this work??\r
                 hbProc.Start();\r
+                \r
 \r
                 // Set the process Priority\r
                 switch (Properties.Settings.Default.processPriority)\r
@@ -53,6 +55,8 @@ namespace Handbrake.Functions
                         hbProc.PriorityClass = ProcessPriorityClass.BelowNormal;\r
                         break;\r
                 }\r
+\r
+                \r
             }\r
             catch\r
             {\r
index 0a4e40b..87fad34 100644 (file)
@@ -1,6 +1,17 @@
 using System;\r
 using System.Collections.Generic;\r
+using System.Collections.Specialized;\r
+using System.ComponentModel;\r
+using System.Data;\r
+using System.Drawing;\r
+using System.Text;\r
 using System.Windows.Forms;\r
+using System.Net;\r
+using System.IO;\r
+using System.Diagnostics;\r
+using System.Threading;\r
+using System.Runtime.InteropServices;\r
+\r
 \r
 namespace Handbrake\r
 {\r
@@ -12,9 +23,91 @@ namespace Handbrake
         [STAThread]\r
         static void Main()\r
         {\r
-            Application.EnableVisualStyles();\r
-            Application.SetCompatibleTextRenderingDefault(false);\r
-            Application.Run(new frmMain());\r
+            \r
+            /* Some Code to allow development builds to expire.\r
+             * \r
+             * long start = DateTime.Now.Ticks;\r
+             * 633286573227430160 today was long end = DateTime.Now.AddDays(31).Ticks;\r
+             * if (start > 633286573227430160) { MessageBox.Show("Sorry, this Handbrake has expired"); return; }\r
+             * \r
+             */\r
+\r
+\r
+            // Check the system meets the system requirements.\r
+            Boolean launch = true;\r
+            try\r
+            {\r
+                // Make sure the screen resolution is not below 1024x768\r
+                System.Windows.Forms.Screen scr = System.Windows.Forms.Screen.PrimaryScreen;\r
+                if ((scr.Bounds.Width < 1024) || (scr.Bounds.Height < 768))\r
+                {\r
+                    MessageBox.Show("Your system does not meet the minimum requirements for HandBrake. \n Screen resolution is too Low. Must be 1024x768 or greater", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);\r
+                    launch = false;\r
+                }\r
+\r
+                // Make sure the system has enough RAM. 384MB or greater\r
+                uint memory = MemoryCheck.CheckMemeory();\r
+\r
+                if (memory < 319) // Set to 319 to allow for 64MB dedicated to video Memory and Windows returnig the memory figure slightly out.\r
+                {\r
+                    MessageBox.Show("Your system does not meet the minimum requirements for HandBrake. \n Insufficient Memory. 384MB or greater required.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);\r
+                    launch = false;\r
+                }\r
+            }\r
+            catch (Exception exc)\r
+            {\r
+                if (Properties.Settings.Default.GuiDebug == "Checked")\r
+                {\r
+                    MessageBox.Show("frmMain.cs - systemCheck() " + exc.ToString());\r
+                }\r
+            }\r
+\r
+\r
+            // Either Launch or Close the Application\r
+            if (launch == true)\r
+            {\r
+                Application.EnableVisualStyles();\r
+                Application.SetCompatibleTextRenderingDefault(false);\r
+                Application.Run(new frmMain());\r
+            }\r
+            else\r
+            {\r
+                Application.Exit();\r
+            }\r
+        }\r
+    }\r
+\r
+    class MemoryCheck\r
+    {\r
+        public struct MEMORYSTATUS\r
+        {\r
+            public UInt32 dwLength;\r
+            public UInt32 dwMemoryLoad;\r
+            public UInt32 dwTotalPhys; // Used\r
+            public UInt32 dwAvailPhys;\r
+            public UInt32 dwTotalPageFile;\r
+            public UInt32 dwAvailPageFile;\r
+            public UInt32 dwTotalVirtual;\r
+            public UInt32 dwAvailVirtual;\r
+            // Aditional Varibles left in for future usage (JIC)\r
+        }\r
+\r
+        [DllImport("kernel32.dll")]\r
+        public static extern void GlobalMemoryStatus\r
+        (\r
+            ref MEMORYSTATUS lpBuffer\r
+        );\r
+\r
+        public static uint CheckMemeory()\r
+        {\r
+            // Call the native GlobalMemoryStatus method\r
+            // with the defined structure.\r
+            MEMORYSTATUS memStatus = new MEMORYSTATUS();\r
+            GlobalMemoryStatus(ref memStatus);\r
+\r
+            uint MemoryInfo = memStatus.dwTotalPhys;\r
+\r
+            return MemoryInfo;\r
         }\r
     }\r
 }
\ No newline at end of file
index 3e9fc7b..027a548 100644 (file)
@@ -64,9 +64,6 @@ namespace Handbrake
             this.File_Open = new System.Windows.Forms.OpenFileDialog();\r
             this.ISO_Open = new System.Windows.Forms.OpenFileDialog();\r
             this.FileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\r
-            this.mnu_open = new System.Windows.Forms.ToolStripMenuItem();\r
-            this.mnu_save = new System.Windows.Forms.ToolStripMenuItem();\r
-            this.ToolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();\r
             this.mnu_exit = new System.Windows.Forms.ToolStripMenuItem();\r
             this.mnu_open3 = new System.Windows.Forms.ToolStripMenuItem();\r
             this.ToolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\r
@@ -175,9 +172,10 @@ namespace Handbrake
             this.advancedOptions = new System.Windows.Forms.TabControl();\r
             this.groupBox_dest = new System.Windows.Forms.GroupBox();\r
             this.groupBox2 = new System.Windows.Forms.GroupBox();\r
-            this.btn_removePreset = new System.Windows.Forms.Button();\r
             this.ListBox_Presets = new System.Windows.Forms.ListBox();\r
+            this.btn_removePreset = new System.Windows.Forms.Button();\r
             this.btn_addPreset = new System.Windows.Forms.Button();\r
+            this.groupBox3 = new System.Windows.Forms.GroupBox();\r
             Label38 = new System.Windows.Forms.Label();\r
             ((System.ComponentModel.ISupportInitialize)(this.slider_videoQuality)).BeginInit();\r
             this.frmMainMenu.SuspendLayout();\r
@@ -191,6 +189,7 @@ namespace Handbrake
             this.advancedOptions.SuspendLayout();\r
             this.groupBox_dest.SuspendLayout();\r
             this.groupBox2.SuspendLayout();\r
+            this.groupBox3.SuspendLayout();\r
             this.SuspendLayout();\r
             // \r
             // Label38\r
@@ -572,7 +571,7 @@ namespace Handbrake
             this.btn_setDefault.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
             this.btn_setDefault.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.btn_setDefault.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));\r
-            this.btn_setDefault.Location = new System.Drawing.Point(113, 445);\r
+            this.btn_setDefault.Location = new System.Drawing.Point(110, 23);\r
             this.btn_setDefault.Name = "btn_setDefault";\r
             this.btn_setDefault.Size = new System.Drawing.Size(72, 22);\r
             this.btn_setDefault.TabIndex = 107;\r
@@ -602,42 +601,15 @@ namespace Handbrake
             // FileToolStripMenuItem\r
             // \r
             this.FileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {\r
-            this.mnu_open,\r
-            this.mnu_save,\r
-            this.ToolStripSeparator1,\r
             this.mnu_exit});\r
             this.FileToolStripMenuItem.Name = "FileToolStripMenuItem";\r
             this.FileToolStripMenuItem.Size = new System.Drawing.Size(35, 20);\r
             this.FileToolStripMenuItem.Text = "&File";\r
             // \r
-            // mnu_open\r
-            // \r
-            this.mnu_open.Image = ((System.Drawing.Image)(resources.GetObject("mnu_open.Image")));\r
-            this.mnu_open.ImageTransparentColor = System.Drawing.Color.Magenta;\r
-            this.mnu_open.Name = "mnu_open";\r
-            this.mnu_open.Size = new System.Drawing.Size(180, 22);\r
-            this.mnu_open.Text = "&Open Profile";\r
-            this.mnu_open.Click += new System.EventHandler(this.mnu_open_Click);\r
-            // \r
-            // mnu_save\r
-            // \r
-            this.mnu_save.Image = ((System.Drawing.Image)(resources.GetObject("mnu_save.Image")));\r
-            this.mnu_save.ImageTransparentColor = System.Drawing.Color.Magenta;\r
-            this.mnu_save.Name = "mnu_save";\r
-            this.mnu_save.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S)));\r
-            this.mnu_save.Size = new System.Drawing.Size(180, 22);\r
-            this.mnu_save.Text = "&Save Profile";\r
-            this.mnu_save.Click += new System.EventHandler(this.mnu_save_Click);\r
-            // \r
-            // ToolStripSeparator1\r
-            // \r
-            this.ToolStripSeparator1.Name = "ToolStripSeparator1";\r
-            this.ToolStripSeparator1.Size = new System.Drawing.Size(177, 6);\r
-            // \r
             // mnu_exit\r
             // \r
             this.mnu_exit.Name = "mnu_exit";\r
-            this.mnu_exit.Size = new System.Drawing.Size(180, 22);\r
+            this.mnu_exit.Size = new System.Drawing.Size(103, 22);\r
             this.mnu_exit.Text = "E&xit";\r
             this.mnu_exit.Click += new System.EventHandler(this.mnu_exit_Click);\r
             // \r
@@ -1840,35 +1812,15 @@ namespace Handbrake
             // \r
             // groupBox2\r
             // \r
-            this.groupBox2.Controls.Add(this.btn_setDefault);\r
-            this.groupBox2.Controls.Add(this.btn_removePreset);\r
             this.groupBox2.Controls.Add(this.ListBox_Presets);\r
-            this.groupBox2.Controls.Add(this.btn_addPreset);\r
             this.groupBox2.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.groupBox2.Location = new System.Drawing.Point(674, 35);\r
             this.groupBox2.Name = "groupBox2";\r
-            this.groupBox2.Size = new System.Drawing.Size(193, 478);\r
+            this.groupBox2.Size = new System.Drawing.Size(193, 404);\r
             this.groupBox2.TabIndex = 103;\r
             this.groupBox2.TabStop = false;\r
             this.groupBox2.Text = "Presets";\r
             // \r
-            // btn_removePreset\r
-            // \r
-            this.btn_removePreset.BackColor = System.Drawing.SystemColors.ControlLight;\r
-            this.btn_removePreset.FlatAppearance.BorderColor = System.Drawing.Color.Black;\r
-            this.btn_removePreset.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
-            this.btn_removePreset.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.btn_removePreset.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));\r
-            this.btn_removePreset.Location = new System.Drawing.Point(52, 445);\r
-            this.btn_removePreset.Name = "btn_removePreset";\r
-            this.btn_removePreset.Size = new System.Drawing.Size(55, 22);\r
-            this.btn_removePreset.TabIndex = 106;\r
-            this.btn_removePreset.TabStop = false;\r
-            this.btn_removePreset.Text = "Remove";\r
-            this.btn_removePreset.UseVisualStyleBackColor = false;\r
-            this.btn_removePreset.Visible = false;\r
-            this.btn_removePreset.Click += new System.EventHandler(this.btn_removePreset_Click);\r
-            // \r
             // ListBox_Presets\r
             // \r
             this.ListBox_Presets.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
@@ -1891,12 +1843,30 @@ namespace Handbrake
             "PSP",\r
             "QuickTime",\r
             "Television"});\r
-            this.ListBox_Presets.Location = new System.Drawing.Point(11, 19);\r
+            this.ListBox_Presets.Location = new System.Drawing.Point(11, 21);\r
             this.ListBox_Presets.Name = "ListBox_Presets";\r
-            this.ListBox_Presets.Size = new System.Drawing.Size(174, 420);\r
+            this.ListBox_Presets.Size = new System.Drawing.Size(174, 368);\r
             this.ListBox_Presets.TabIndex = 104;\r
+            this.ToolTip.SetToolTip(this.ListBox_Presets, "To load a preset, simply click the preset you desire.");\r
             this.ListBox_Presets.SelectedIndexChanged += new System.EventHandler(this.ListBox_Presets_SelectedIndexChanged);\r
             // \r
+            // btn_removePreset\r
+            // \r
+            this.btn_removePreset.BackColor = System.Drawing.SystemColors.ControlLight;\r
+            this.btn_removePreset.FlatAppearance.BorderColor = System.Drawing.Color.Black;\r
+            this.btn_removePreset.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
+            this.btn_removePreset.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.btn_removePreset.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));\r
+            this.btn_removePreset.Location = new System.Drawing.Point(59, 23);\r
+            this.btn_removePreset.Name = "btn_removePreset";\r
+            this.btn_removePreset.Size = new System.Drawing.Size(45, 22);\r
+            this.btn_removePreset.TabIndex = 106;\r
+            this.btn_removePreset.TabStop = false;\r
+            this.btn_removePreset.Text = "Save";\r
+            this.ToolTip.SetToolTip(this.btn_removePreset, "Save the current settings as a preset.");\r
+            this.btn_removePreset.UseVisualStyleBackColor = false;\r
+            this.btn_removePreset.Click += new System.EventHandler(this.btn_removePreset_Click);\r
+            // \r
             // btn_addPreset\r
             // \r
             this.btn_addPreset.BackColor = System.Drawing.SystemColors.ControlLight;\r
@@ -1904,22 +1874,36 @@ namespace Handbrake
             this.btn_addPreset.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
             this.btn_addPreset.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.btn_addPreset.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));\r
-            this.btn_addPreset.Location = new System.Drawing.Point(11, 445);\r
+            this.btn_addPreset.Location = new System.Drawing.Point(8, 23);\r
             this.btn_addPreset.Name = "btn_addPreset";\r
-            this.btn_addPreset.Size = new System.Drawing.Size(35, 22);\r
+            this.btn_addPreset.Size = new System.Drawing.Size(45, 22);\r
             this.btn_addPreset.TabIndex = 105;\r
             this.btn_addPreset.TabStop = false;\r
-            this.btn_addPreset.Text = "Add";\r
+            this.btn_addPreset.Text = "Open";\r
+            this.ToolTip.SetToolTip(this.btn_addPreset, "Open a preset which you have saved.");\r
             this.btn_addPreset.UseVisualStyleBackColor = false;\r
-            this.btn_addPreset.Visible = false;\r
             this.btn_addPreset.Click += new System.EventHandler(this.btn_addPreset_Click);\r
             // \r
+            // groupBox3\r
+            // \r
+            this.groupBox3.Controls.Add(this.btn_removePreset);\r
+            this.groupBox3.Controls.Add(this.btn_setDefault);\r
+            this.groupBox3.Controls.Add(this.btn_addPreset);\r
+            this.groupBox3.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.groupBox3.Location = new System.Drawing.Point(674, 448);\r
+            this.groupBox3.Name = "groupBox3";\r
+            this.groupBox3.Size = new System.Drawing.Size(193, 61);\r
+            this.groupBox3.TabIndex = 108;\r
+            this.groupBox3.TabStop = false;\r
+            this.groupBox3.Text = "Preset Functions";\r
+            // \r
             // frmMain\r
             // \r
             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(873, 564);\r
+            this.Controls.Add(this.groupBox3);\r
             this.Controls.Add(this.btn_presets);\r
             this.Controls.Add(this.groupBox2);\r
             this.Controls.Add(this.groupBox_dest);\r
@@ -1959,6 +1943,7 @@ namespace Handbrake
             this.groupBox_dest.ResumeLayout(false);\r
             this.groupBox_dest.PerformLayout();\r
             this.groupBox2.ResumeLayout(false);\r
+            this.groupBox3.ResumeLayout(false);\r
             this.ResumeLayout(false);\r
             this.PerformLayout();\r
 \r
@@ -1972,8 +1957,6 @@ namespace Handbrake
         internal System.Windows.Forms.OpenFileDialog ISO_Open;\r
         internal System.Windows.Forms.ToolStripMenuItem FileToolStripMenuItem;\r
         internal System.Windows.Forms.ToolStripMenuItem mnu_open3;\r
-        internal System.Windows.Forms.ToolStripMenuItem mnu_save;\r
-        internal System.Windows.Forms.ToolStripSeparator ToolStripSeparator1;\r
         internal System.Windows.Forms.ToolStripMenuItem mnu_exit;\r
         internal System.Windows.Forms.ToolStripMenuItem ToolsToolStripMenuItem;\r
         internal System.Windows.Forms.ToolStripMenuItem mnu_encode;\r
@@ -2087,7 +2070,6 @@ namespace Handbrake
         internal System.Windows.Forms.TabControl advancedOptions;\r
         internal System.Windows.Forms.Label Label46;\r
         internal System.Windows.Forms.FolderBrowserDialog DVD_Open;\r
-        private System.Windows.Forms.ToolStripMenuItem mnu_open;\r
         private System.Windows.Forms.GroupBox groupBox_dest;\r
         internal System.Windows.Forms.ComboBox drp_subtitle;\r
         internal System.Windows.Forms.Label Label19;\r
@@ -2113,6 +2095,7 @@ namespace Handbrake
         private System.Windows.Forms.ToolStripMenuItem mnu_SelectDefault;\r
         private System.Windows.Forms.ToolStripMenuItem mnu_UpdateCheck;\r
         private System.Windows.Forms.ToolStripSeparator toolStripSeparator6;\r
+        private System.Windows.Forms.GroupBox groupBox3;\r
 \r
     }\r
 }
\ No newline at end of file
index ff1ec3b..4c3fdab 100644 (file)
@@ -29,7 +29,6 @@ namespace Handbrake
         private frmQueue queueWindow = new frmQueue();  \r
         //private frmDvdInfo dvdInfoWindow = new frmDvdInfo();\r
 \r
\r
         public frmMain()\r
         {\r
 \r
@@ -43,9 +42,6 @@ namespace Handbrake
             //dvdInfoWindow.Hide();\r
             // **********************************************************************************************\r
 \r
-            // System Requirements Check\r
-            systemCheck();\r
-\r
             // Set the Version number lable to the corect version.\r
             Version.Text = "Version " + Properties.Settings.Default.GuiVersion;\r
 \r
@@ -61,7 +57,6 @@ namespace Handbrake
             // Enable or disable tooltips\r
             tooltip();\r
 \r
-\r
             // Hide the presets part of the window\r
             this.Width = 590;\r
 \r
@@ -72,13 +67,8 @@ namespace Handbrake
             myCol.AddRange(myArr);\r
 \r
             Properties.Settings.Default.BuiltInPresets = myCol;\r
-  \r
-\r
         }\r
 \r
-        // Functions to preform tasks required on startup.\r
-        #region Initializeation Functions\r
-        \r
         private void showSplash(object sender)\r
         {\r
             Form splash = new frmSplashScreen();\r
@@ -183,7 +173,6 @@ namespace Handbrake
             }\r
         }\r
 \r
-        // This is a re-usable function.\r
         private Boolean updateCheck()\r
         {\r
             try\r
@@ -235,88 +224,6 @@ namespace Handbrake
             }\r
         }\r
 \r
-        #region Memory Check\r
-\r
-        public struct MEMORYSTATUS\r
-        {\r
-            public UInt32 dwLength;\r
-            public UInt32 dwMemoryLoad;\r
-            public UInt32 dwTotalPhys; // Used\r
-            public UInt32 dwAvailPhys;\r
-            public UInt32 dwTotalPageFile;\r
-            public UInt32 dwAvailPageFile;\r
-            public UInt32 dwTotalVirtual;\r
-            public UInt32 dwAvailVirtual;\r
-            // Aditional Varibles left in for future usage (JIC)\r
-        }\r
-\r
-        [DllImport("kernel32.dll")]\r
-        public static extern void GlobalMemoryStatus\r
-        (\r
-            ref MEMORYSTATUS lpBuffer\r
-        );\r
-\r
-        public uint CheckMemeory()\r
-        {\r
-            // Call the native GlobalMemoryStatus method\r
-            // with the defined structure.\r
-            MEMORYSTATUS memStatus = new MEMORYSTATUS();\r
-            GlobalMemoryStatus(ref memStatus);\r
-\r
-            // Use a StringBuilder for the message box string.\r
-            uint MemoryInfo = memStatus.dwTotalPhys;\r
-\r
-            // Return the Ram Information\r
-            return MemoryInfo;\r
-\r
-        }\r
-\r
-\r
-        #endregion\r
-        Boolean preventLaunch = false;\r
-        private void systemCheck()\r
-        {\r
-            try\r
-            {\r
-                // Make sure the screen resolution is not below 1024x768\r
-                System.Windows.Forms.Screen scr = System.Windows.Forms.Screen.PrimaryScreen;\r
-                if ((scr.Bounds.Width < 1024) || (scr.Bounds.Height < 768))\r
-                {\r
-                    MessageBox.Show("Your system does not meet the minimum requirements for HandBrake. \n Screen resolution is too Low. Must be 1024x768 or greater", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);\r
-                    preventLaunch = true;\r
-                }\r
-\r
-                // Make sure the system has enough RAM. 384MB or greater\r
-                uint memory = CheckMemeory();\r
-\r
-                if (memory < 319) // Set to 319 to allow for 64MB dedicated to video Memory and Windows returnig the memory figure slightly out.\r
-                {\r
-                    MessageBox.Show("Your system does not meet the minimum requirements for HandBrake. \n Insufficient Memory. 384MB or greater required.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);\r
-                    preventLaunch = true;\r
-                }\r
-            }\r
-            catch (Exception exc)\r
-            {\r
-                if (Properties.Settings.Default.GuiDebug == "Checked")\r
-                {\r
-                    MessageBox.Show("frmMain.cs - systemCheck() " + exc.ToString());\r
-                }\r
-            }\r
-        }\r
-\r
-        #endregion\r
-\r
-        // Close the Application on main window load if required by the system Check\r
-        #region Form Load\r
-            private void frmMain_Load(object sender, EventArgs e)\r
-        {\r
-            if (preventLaunch == true)\r
-            {\r
-                Application.Exit();\r
-            }\r
-        }\r
-        #endregion\r
-\r
         #endregion\r
 \r
         // -------------------------------------------------------------- \r
@@ -325,166 +232,6 @@ namespace Handbrake
 \r
         #region File Menu\r
 \r
-        private void mnu_open_Click(object sender, EventArgs e)\r
-        {\r
-            string filename;\r
-            File_Open.ShowDialog();\r
-            filename = File_Open.FileName;\r
-            if (filename != "")\r
-            {\r
-                try\r
-                {\r
-                    // Create StreamReader & open file\r
-                    StreamReader line = new StreamReader(filename);\r
-                    string temporyLine; // Used for reading the line into a varible before processing on the checkState items below.\r
-                    \r
-                    // Read in the data and set the correct GUI component with the setting.\r
-                    text_source.Text = line.ReadLine();\r
-                    drp_dvdtitle.Text = line.ReadLine();\r
-                    drop_chapterStart.Text = line.ReadLine();\r
-                    drop_chapterFinish.Text = line.ReadLine();\r
-                    text_destination.Text = line.ReadLine();\r
-                    drp_videoEncoder.Text = line.ReadLine();\r
-                    drp_audioCodec.Text = line.ReadLine();\r
-                    text_width.Text = line.ReadLine();\r
-                    text_height.Text = line.ReadLine();\r
-                    text_top.Text = line.ReadLine();\r
-                    text_bottom.Text = line.ReadLine();\r
-                    text_left.Text = line.ReadLine();\r
-                    text_right.Text = line.ReadLine();\r
-                    drp_subtitle.Text = line.ReadLine();\r
-                    text_bitrate.Text = line.ReadLine();\r
-                    text_filesize.Text = line.ReadLine();\r
-                    slider_videoQuality.Value = int.Parse(line.ReadLine());\r
-\r
-                    temporyLine = line.ReadLine();\r
-                    if (temporyLine == "Checked")\r
-                    {\r
-                        check_2PassEncode.CheckState = CheckState.Checked;\r
-                    }\r
-\r
-                    drp_deInterlace_option.Text = line.ReadLine();\r
-\r
-                    temporyLine = line.ReadLine();\r
-                    if (temporyLine == "Checked")\r
-                    {\r
-                        check_grayscale.CheckState = CheckState.Checked;\r
-                    }\r
-\r
-                    drp_videoFramerate.Text = line.ReadLine();\r
-\r
-                    temporyLine = line.ReadLine();\r
-                    if (temporyLine == "Checked")\r
-                    {\r
-                        Check_ChapterMarkers.CheckState = CheckState.Checked;\r
-                    }\r
-\r
-                    temporyLine = line.ReadLine();\r
-                    if (temporyLine == "Checked")\r
-                    {\r
-                        CheckPixelRatio.CheckState = CheckState.Checked;\r
-                    }\r
-\r
-                    temporyLine = line.ReadLine();\r
-                    if (temporyLine == "Checked")\r
-                    {\r
-                        check_turbo.CheckState = CheckState.Checked;\r
-                    }\r
-\r
-                    temporyLine = line.ReadLine();\r
-                    if (temporyLine == "Checked")\r
-                    {\r
-                        check_largeFile.CheckState = CheckState.Checked;\r
-                    }\r
-   \r
-                    drp_audioBitrate.Text = line.ReadLine();\r
-                    drp_audioSampleRate.Text = line.ReadLine();\r
-                    drp_audioChannels.Text = line.ReadLine();\r
-                    drp_audioMixDown.Text = line.ReadLine();\r
-                    \r
-                    // Advanced H264 Options\r
-                    temporyLine = line.ReadLine();\r
-                    if (temporyLine == "Checked")\r
-                    {\r
-                        CheckCRF.CheckState = CheckState.Checked;\r
-                    }\r
-                    rtf_h264advanced.Text = line.ReadLine();\r
-\r
-                    // Close the stream\r
-                    line.Close();\r
-\r
-\r
-                    // Fix for SliderValue not appearing when Opening saved file\r
-                    SliderValue.Text = slider_videoQuality.Value + "%";\r
-\r
-                } catch (Exception){\r
-                    MessageBox.Show("Unable to load profile.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);\r
-                }\r
-            }\r
-        }\r
-\r
-        private void mnu_save_Click(object sender, EventArgs e)\r
-        {\r
-\r
-            string filename;\r
-            File_Save.ShowDialog();\r
-            filename = File_Save.FileName;\r
-            if (filename != "")\r
-            {\r
-                try\r
-                {\r
-                    // Create a StreamWriter and open the file\r
-                    StreamWriter line = new StreamWriter(filename);\r
-\r
-                    //Source\r
-                    line.WriteLine(text_source.Text);\r
-                    line.WriteLine(drp_dvdtitle.Text);\r
-                    line.WriteLine(drop_chapterStart.Text);\r
-                    line.WriteLine(drop_chapterFinish.Text);\r
-                    //Destination\r
-                    line.WriteLine(text_destination.Text);\r
-                    line.WriteLine(drp_videoEncoder.Text);\r
-                    line.WriteLine(drp_audioCodec.Text);\r
-                    line.WriteLine(text_width.Text);\r
-                    line.WriteLine(text_height.Text);\r
-                    //Picture Settings Tab\r
-                    line.WriteLine(text_top.Text);\r
-                    line.WriteLine(text_bottom.Text);\r
-                    line.WriteLine(text_left.Text);\r
-                    line.WriteLine(text_right.Text);\r
-                    line.WriteLine(drp_subtitle.Text);\r
-                    //Video Settings Tab\r
-                    line.WriteLine(text_bitrate.Text);\r
-                    line.WriteLine(text_filesize.Text);\r
-                    line.WriteLine(slider_videoQuality.Value.ToString());\r
-                    line.WriteLine(check_2PassEncode.CheckState.ToString());\r
-                    line.WriteLine(drp_deInterlace_option.Text);\r
-                    line.WriteLine(check_grayscale.CheckState.ToString());\r
-                    line.WriteLine(drp_videoFramerate.Text);\r
-                    line.WriteLine(Check_ChapterMarkers.CheckState.ToString());\r
-                    line.WriteLine(CheckPixelRatio.CheckState.ToString());\r
-                    line.WriteLine(check_turbo.CheckState.ToString());\r
-                    line.WriteLine(check_largeFile.CheckState.ToString());\r
-                    //Audio Settings Tab\r
-                    line.WriteLine(drp_audioBitrate.Text);\r
-                    line.WriteLine(drp_audioSampleRate.Text);\r
-                    line.WriteLine(drp_audioChannels.Text);\r
-                    line.WriteLine(drp_audioMixDown.Text);\r
-                    //H264 Tab\r
-                    line.WriteLine(CheckCRF.CheckState.ToString());\r
-                    line.WriteLine(rtf_h264advanced.Text);\r
-                    // close the stream\r
-                    line.Close();\r
-                    MessageBox.Show("Your profile has been sucessfully saved.", "Status", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);\r
-                }\r
-                catch(Exception)\r
-                {\r
-                    MessageBox.Show("Unable to write to the file. Please make sure the location has the correct permissions for file writing.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);\r
-                }\r
-                \r
-            }\r
-        }\r
-\r
         private void mnu_exit_Click(object sender, EventArgs e)\r
         {\r
             Application.Exit();\r
@@ -745,12 +492,163 @@ namespace Handbrake
 \r
         private void btn_addPreset_Click(object sender, EventArgs e)\r
         {\r
+            string filename;\r
+            File_Open.ShowDialog();\r
+            filename = File_Open.FileName;\r
+            if (filename != "")\r
+            {\r
+                try\r
+                {\r
+                    // Create StreamReader & open file\r
+                    StreamReader line = new StreamReader(filename);\r
+                    string temporyLine; // Used for reading the line into a varible before processing on the checkState items below.\r
+\r
+                    // Read in the data and set the correct GUI component with the setting.\r
+                    text_source.Text = line.ReadLine();\r
+                    drp_dvdtitle.Text = line.ReadLine();\r
+                    drop_chapterStart.Text = line.ReadLine();\r
+                    drop_chapterFinish.Text = line.ReadLine();\r
+                    text_destination.Text = line.ReadLine();\r
+                    drp_videoEncoder.Text = line.ReadLine();\r
+                    drp_audioCodec.Text = line.ReadLine();\r
+                    text_width.Text = line.ReadLine();\r
+                    text_height.Text = line.ReadLine();\r
+                    text_top.Text = line.ReadLine();\r
+                    text_bottom.Text = line.ReadLine();\r
+                    text_left.Text = line.ReadLine();\r
+                    text_right.Text = line.ReadLine();\r
+                    drp_subtitle.Text = line.ReadLine();\r
+                    text_bitrate.Text = line.ReadLine();\r
+                    text_filesize.Text = line.ReadLine();\r
+                    slider_videoQuality.Value = int.Parse(line.ReadLine());\r
+\r
+                    temporyLine = line.ReadLine();\r
+                    if (temporyLine == "Checked")\r
+                    {\r
+                        check_2PassEncode.CheckState = CheckState.Checked;\r
+                    }\r
+\r
+                    drp_deInterlace_option.Text = line.ReadLine();\r
+\r
+                    temporyLine = line.ReadLine();\r
+                    if (temporyLine == "Checked")\r
+                    {\r
+                        check_grayscale.CheckState = CheckState.Checked;\r
+                    }\r
+\r
+                    drp_videoFramerate.Text = line.ReadLine();\r
+\r
+                    temporyLine = line.ReadLine();\r
+                    if (temporyLine == "Checked")\r
+                    {\r
+                        Check_ChapterMarkers.CheckState = CheckState.Checked;\r
+                    }\r
+\r
+                    temporyLine = line.ReadLine();\r
+                    if (temporyLine == "Checked")\r
+                    {\r
+                        CheckPixelRatio.CheckState = CheckState.Checked;\r
+                    }\r
+\r
+                    temporyLine = line.ReadLine();\r
+                    if (temporyLine == "Checked")\r
+                    {\r
+                        check_turbo.CheckState = CheckState.Checked;\r
+                    }\r
+\r
+                    temporyLine = line.ReadLine();\r
+                    if (temporyLine == "Checked")\r
+                    {\r
+                        check_largeFile.CheckState = CheckState.Checked;\r
+                    }\r
+\r
+                    drp_audioBitrate.Text = line.ReadLine();\r
+                    drp_audioSampleRate.Text = line.ReadLine();\r
+                    drp_audioChannels.Text = line.ReadLine();\r
+                    drp_audioMixDown.Text = line.ReadLine();\r
+\r
+                    // Advanced H264 Options\r
+                    temporyLine = line.ReadLine();\r
+                    if (temporyLine == "Checked")\r
+                    {\r
+                        CheckCRF.CheckState = CheckState.Checked;\r
+                    }\r
+                    rtf_h264advanced.Text = line.ReadLine();\r
+\r
+                    // Close the stream\r
+                    line.Close();\r
 \r
+\r
+                    // Fix for SliderValue not appearing when Opening saved file\r
+                    SliderValue.Text = slider_videoQuality.Value + "%";\r
+\r
+                }\r
+                catch (Exception)\r
+                {\r
+                    MessageBox.Show("Unable to load profile.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);\r
+                }\r
+            }\r
         }\r
 \r
         private void btn_removePreset_Click(object sender, EventArgs e)\r
         {\r
-            ListBox_Presets.Items.Remove(ListBox_Presets.SelectedItem);\r
+            string filename;\r
+            File_Save.ShowDialog();\r
+            filename = File_Save.FileName;\r
+            if (filename != "")\r
+            {\r
+                try\r
+                {\r
+                    // Create a StreamWriter and open the file\r
+                    StreamWriter line = new StreamWriter(filename);\r
+\r
+                    //Source\r
+                    line.WriteLine(text_source.Text);\r
+                    line.WriteLine(drp_dvdtitle.Text);\r
+                    line.WriteLine(drop_chapterStart.Text);\r
+                    line.WriteLine(drop_chapterFinish.Text);\r
+                    //Destination\r
+                    line.WriteLine(text_destination.Text);\r
+                    line.WriteLine(drp_videoEncoder.Text);\r
+                    line.WriteLine(drp_audioCodec.Text);\r
+                    line.WriteLine(text_width.Text);\r
+                    line.WriteLine(text_height.Text);\r
+                    //Picture Settings Tab\r
+                    line.WriteLine(text_top.Text);\r
+                    line.WriteLine(text_bottom.Text);\r
+                    line.WriteLine(text_left.Text);\r
+                    line.WriteLine(text_right.Text);\r
+                    line.WriteLine(drp_subtitle.Text);\r
+                    //Video Settings Tab\r
+                    line.WriteLine(text_bitrate.Text);\r
+                    line.WriteLine(text_filesize.Text);\r
+                    line.WriteLine(slider_videoQuality.Value.ToString());\r
+                    line.WriteLine(check_2PassEncode.CheckState.ToString());\r
+                    line.WriteLine(drp_deInterlace_option.Text);\r
+                    line.WriteLine(check_grayscale.CheckState.ToString());\r
+                    line.WriteLine(drp_videoFramerate.Text);\r
+                    line.WriteLine(Check_ChapterMarkers.CheckState.ToString());\r
+                    line.WriteLine(CheckPixelRatio.CheckState.ToString());\r
+                    line.WriteLine(check_turbo.CheckState.ToString());\r
+                    line.WriteLine(check_largeFile.CheckState.ToString());\r
+                    //Audio Settings Tab\r
+                    line.WriteLine(drp_audioBitrate.Text);\r
+                    line.WriteLine(drp_audioSampleRate.Text);\r
+                    line.WriteLine(drp_audioChannels.Text);\r
+                    line.WriteLine(drp_audioMixDown.Text);\r
+                    //H264 Tab\r
+                    line.WriteLine(CheckCRF.CheckState.ToString());\r
+                    line.WriteLine(rtf_h264advanced.Text);\r
+                    // close the stream\r
+                    line.Close();\r
+                    MessageBox.Show("Your profile has been sucessfully saved.", "Status", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);\r
+                }\r
+                catch (Exception)\r
+                {\r
+                    MessageBox.Show("Unable to write to the file. Please make sure the location has the correct permissions for file writing.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);\r
+                }\r
+\r
+            }\r
         }\r
 \r
         private void btn_setDefault_Click(object sender, EventArgs e)\r
@@ -877,9 +775,6 @@ namespace Handbrake
         }\r
 \r
 \r
-\r
-\r
-\r
         // Functions - It's a bit dirty but i'll sort this out later. Simply done to reduce the amount of code above.\r
         private void setGuiSetttings(CheckState anamorphic, string width, string height, string vencoder, string bitrate, string filesize, int quality, string qpercent, string audioBit, CheckState chpt, string audioSample, string h264, string deinterlace, CheckState twopass, string crop, CheckState turbo, string audioCodec, string preset)\r
         {\r
@@ -1841,6 +1736,7 @@ namespace Handbrake
 \r
         #endregion\r
 \r
+\r
         // This is the END of the road ------------------------------------------------------------------------------\r
     }\r
 }\r
index f8feed8..8561386 100644 (file)
   <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
   </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
-    <value>\r
-        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\r
-        YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAlpJREFUOE+tk21I\r
-        k1EYhif0oyA0sqIQCix/+GcQFFH9CCmiUBTLLEjShJofVBgL2fxoU9Pp5ubUlS5rU9f8rCyjsA+pUCRC\r
-        TR1ppmVFUSlmhq78unrnQF1KGHTg/nEOz30993PO+7qJFrmUeiv2n+Mij+XLRLLYULdF2pxlEVIDcw0p\r
-        AsyxD5fmI/rQ94pqi26eOlsfuZj+7BgSm01QdA4ih7m73Yx9qGpavwatjPebqCzOprPt8YKQgzFagqL0\r
-        BEjyEFWVaBkdLHMxT34uYNwWR9nVTEoL0zHlp2DMSeaSRk6eKt4VWm5WM/rVPNN5SjDTLQebZEHNA1wr\r
-        UvHjk3E6tsNcV62e1r3KLGqtKm6WplNpSsVqVFJsOM8VfSKFWjkGtcyZptSYzvC7XByx3zQoqCnTMvlG\r
-        CX1prnornPUmQJcUXsbSVhGK5bIOkcmQyveeTHiv4VZ5Nk33Nc6iuSO8CIfmECYa/bE/8ON1iRipJNh5\r
-        F0V6Bd86lfQ1JlFj1TDVq4COKCegLVIwHmGiKRB7/V6G7+5koHozymgfYRy5E1CgTWKgXcZ1i5qWp0KS\r
-        rjgBcAJawph6FszYk/2M1O1isGYLX8p9ab6wgqP+3rMvYciS01GfzA1LFvQkQ6sQ9/khxhoCGHnox1Dt\r
-        NvorxXw0b8Km8UQh2cip6GOzgNyMeKqKM7HdjqFZJ5pRk2YJ9aql3EnxoCJxNaZ4Ly6e3UDY3O6OEXRp\r
-        59ApTpIhiyDh9GHORAZyPHQPB/ZtZ/cOMVvFPvh6e7F+3SrWrHRnraf7Xz/xf/rJ/kvxb84I3U1y+9/W\r
-        AAAAAElFTkSuQmCC\r
-</value>\r
-  </data>\r
-  <data name="mnu_save.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">\r
-    <value>\r
-        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\r
-        YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAixJREFUOE+tk91L\r
-        k3EUx/cvdN9N0EW3NTWGa7EaPOUcyqphWBG9PZEv5dJlmqhYmUYtXyBb4dJJy+kknFT4BqZIjaFMJUsz\r
-        V7TEoabYRDD49ju/6Pm1Mi+iH5zLz+c855zvo1L9j/fsaRRUvvZltHmX8Ni9gMaGCO47ZlBb8wn22yHc\r
-        KJ9CackECgteIy93FBfOB6H0JrC3B6ipXsVGb2V1Dca0XhxOe8JLEXhbF7mgsuLLX3mCIwsr2G1+DrVa\r
-        huWQRwjcj+a5oLTk87qCn/D78CLiTD4UXJ7GAXOTEDjrZ7ngku3dH4Jf4ZHJCLZJXlhzxpGa4hSCurth\r
-        LsjOGo0R/A4PBsPYrHdDlgMwmRxCUF31kQvkMwFFsB7c4/+ATYkNOHL0BZKSaoXgZuU0urvATgkcP/kK\r
-        lmMDfNu0MJqZPps6/4D7cNDSCUmyC8HVskl0+MAyADS5vrG7f0X59Tm+VFoYzZyZEVTg5NR2GAwVQnCl\r
-        cByeZuChc40FJwpjek5MmU/YkH6uiHdOTmHwfg/0+jIhsOWNMRiouhPlnUnAQoI4rYSht7MYm5qDnHsN\r
-        e41tHNbucUGnKxICiqXjHpTPJgHBZ/Nv4U1oHqGZJVwstiNe72JwI+J3PYA2MV8IMjOG2dzLfOatBg+2\r
-        7JDQ0tEPX9cguvv8GHg5hH0mC9S6eiQweLumDhqNVQgo06dP9fN4UsIoJHRnOhVtmxZGM1NXKoJ3JmTH\r
-        Cv71r/4OTrQ4xWMwWlcAAAAASUVORK5CYII=\r
-</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
   </metadata>\r
   <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
     <value>56</value>\r
   </metadata>\r
+  <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />\r
   <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">\r
     <value>\r
         AAABAAYAMDAAAAEACACoDgAAZgAAACAgAAABAAgAqAgAAA4PAAAQEAAAAQAIAGgFAAC2FwAAMDAAAAEA\r