X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=win%2FC%23%2FProgram.cs;h=f2bae9661dca1ac741e93f3ec45d0d47cc749a02;hb=6aa1d8aec5bac19ce4430415ea2021c11fb4bf3d;hp=ae9edec6f5a84c1f22d8a554699fc15e140498a0;hpb=83f94313f43f1e3c02159cbc86d3721c7c2da288;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/win/C#/Program.cs b/win/C#/Program.cs index ae9edec6..f2bae966 100644 --- a/win/C#/Program.cs +++ b/win/C#/Program.cs @@ -5,20 +5,9 @@ It may be used under the terms of the GNU General Public License. */ using System; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Text; using System.Windows.Forms; -using System.Net; using System.IO; -using System.Diagnostics; -using System.Threading; -using System.Runtime.InteropServices; -using System.Globalization; - +using Handbrake.Presets; namespace Handbrake { @@ -30,48 +19,46 @@ namespace Handbrake [STAThread] static void Main() { - // Development Code Expiry. - // Remember to comment out on public release!!! - //if (DateTime.Now > DateTime.Parse("2008/02/25", new CultureInfo("en-US"))) { MessageBox.Show("Sorry, This development build of Handbrake has expired."); return; } - // Check the system meets the system requirements. Boolean launch = true; try { // Make sure the screen resolution is not below 1024x768 - System.Windows.Forms.Screen scr = System.Windows.Forms.Screen.PrimaryScreen; + Screen scr = Screen.PrimaryScreen; if ((scr.Bounds.Width < 1024) || (scr.Bounds.Height < 720)) { - 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); - launch = false; - } - - // Make sure the system has enough RAM. 384MB or greater - Functions.SystemInfo info = new Functions.SystemInfo(); - uint memory = info.TotalPhysicalMemory(); - - if (memory < 256) - { - 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); + 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 1024x720 or greater", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); launch = false; } } catch (Exception exc) { - MessageBox.Show("frmMain.cs - systemCheck() " + exc.ToString()); + MessageBox.Show("frmMain.cs - systemCheck() " + exc); } // Either Launch or Close the Application - if (launch == true) + if (launch) { + string appDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake"; + if (!Directory.Exists(appDir)) + Directory.CreateDirectory(appDir); + + string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs"; + if (!Directory.Exists(logDir)) + Directory.CreateDirectory(logDir); + + if (!File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\presets.xml")) + { + PresetsHandler x = new PresetsHandler(); + x.updateBuiltInPresets(); + } + Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new frmMain()); } else - { Application.Exit(); - } } }