X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=win%2FC%23%2FProgram.cs;h=805d339afec6c97bcb44dcba9e7515eb54873b21;hb=bbadff781cdcb5c4676d26141c493939ea28b769;hp=6ab76bbaef04c08dca2ccf4ae06fe8804344659a;hpb=c552f75d33b65f0c72df07cf34470cd791cb2d49;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/win/C#/Program.cs b/win/C#/Program.cs index 6ab76bba..805d339a 100644 --- a/win/C#/Program.cs +++ b/win/C#/Program.cs @@ -1,49 +1,45 @@ -/* Program.cs - - This file is part of the HandBrake source code. - Homepage: . - It may be used under the terms of the GNU General Public License. */ - -using System; -using System.Windows.Forms; +/* Program.cs + This file is part of the HandBrake source code. + Homepage: . + It may be used under the terms of the GNU General Public License. */ namespace Handbrake { - static class Program + using System; + using System.IO; + using System.Windows.Forms; + using Presets; + + /// + /// HandBrake Starts Here + /// + public static class Program { /// /// The main entry point for the application. /// [STAThread] - static void Main() + public 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 1024x620 or greater", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + else { - // Make sure the screen resolution is not below 1024x768 - System.Windows.Forms.Screen scr = System.Windows.Forms.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 == true) - { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new frmMain()); } - else - Application.Exit(); } } - } \ No newline at end of file