X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=win%2FC%23%2FProgram.cs;h=71f1385f28d8fdb67c7336e03bae3969c72ebaa0;hb=2157ff283ee677c229c017d13a84805b0ab24fd3;hp=809626df5059ca5fff6d2303c1bc58ef7647550d;hpb=0e61880bf8378c2991ab08024a7426c99194a681;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/win/C#/Program.cs b/win/C#/Program.cs index 809626df..71f1385f 100644 --- a/win/C#/Program.cs +++ b/win/C#/Program.cs @@ -6,6 +6,8 @@ using System; using System.Windows.Forms; +using System.IO; +using Handbrake.Presets; namespace Handbrake { @@ -17,32 +19,25 @@ namespace Handbrake [STAThread] static void Main() { - // Check the system meets the system requirements. - Boolean launch = true; - try + Screen scr = Screen.PrimaryScreen; + if ((scr.Bounds.Width < 1024) || (scr.Bounds.Height < 620)) + 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); + else { - // Make sure the screen resolution is not below 1024x768 - System.Windows.Forms.Screen scr = Screen.PrimaryScreen; - if ((scr.Bounds.Width < 1024) || (scr.Bounds.Height < 720)) + string logDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"HandBrake\logs"); + if (!Directory.Exists(logDir)) + Directory.CreateDirectory(logDir); + + if (!File.Exists(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"HandBrake\presets.xml"))) { - 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; + PresetsHandler x = new PresetsHandler(); + x.UpdateBuiltInPresets(); } - } - catch (Exception exc) - { - MessageBox.Show("frmMain.cs - systemCheck() " + exc); - } - // Either Launch or Close the Application - if (launch) - { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new frmMain()); } - else - Application.Exit(); } }