OSDN Git Service

import 0.9.4
[handbrake-jp/handbrake-jp.git] / win / C# / Program.cs
index ae9edec..282f9f5 100644 (file)
@@ -5,20 +5,9 @@
           It may be used under the terms of the GNU General Public License. */\r
 \r
 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
-using System.Globalization;\r
-\r
+using Handbrake.Presets;\r
 \r
 namespace Handbrake\r
 {\r
@@ -30,48 +19,25 @@ namespace Handbrake
         [STAThread]\r
         static void Main()\r
         {\r
-            // Development Code Expiry.\r
-            // Remember to comment out on public release!!!\r
-            //if (DateTime.Now > DateTime.Parse("2008/02/25", new CultureInfo("en-US"))) { MessageBox.Show("Sorry, This development build of Handbrake has expired."); return; } \r
-\r
-            // Check the system meets the system requirements.\r
-            Boolean launch = true;\r
-            try\r
+            Screen scr = Screen.PrimaryScreen;\r
+            if ((scr.Bounds.Width < 1024) || (scr.Bounds.Height < 620))\r
+                MessageBox.Show("Your system does not meet the minimum requirements for HandBrake. \n" + "Your screen is running at: " + scr.Bounds.Width + "x" + scr.Bounds.Height + " \nScreen resolution is too Low. Must be 1024x620 or greater", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);\r
+            else\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 < 720))\r
-                {\r
-                    MessageBox.Show("Your system does not meet the minimum requirements for HandBrake. \n" + "Your screen is running at: " + scr.Bounds.Width.ToString() + "x" + scr.Bounds.Height.ToString() + " \nScreen resolution is too Low. Must be 1024x720 or greater", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);\r
-                    launch = false;\r
-                }\r
+                string logDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"HandBrake\logs");\r
+                if (!Directory.Exists(logDir))\r
+                    Directory.CreateDirectory(logDir);\r
 \r
-                // Make sure the system has enough RAM. 384MB or greater\r
-                Functions.SystemInfo info = new Functions.SystemInfo();\r
-                uint memory = info.TotalPhysicalMemory();\r
-                \r
-                if (memory < 256)\r
+                if (!File.Exists(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"HandBrake\presets.xml")))\r
                 {\r
-                    MessageBox.Show("Your system does not meet the minimum requirements for HandBrake. \n Insufficient RAM. 384MB or greater required. You have: " + memory.ToString() + "MB", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);\r
-                    launch = false;\r
+                    PresetsHandler x = new PresetsHandler();\r
+                    x.UpdateBuiltInPresets();\r
                 }\r
-            }\r
-            catch (Exception exc)\r
-            {\r
-                MessageBox.Show("frmMain.cs - systemCheck() " + exc.ToString());\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