X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=win%2FC%23%2FProgram.cs;h=282f9f528e99a2ba756b823268533bcd19f3f3b3;hb=b8c7cf18f82ad8552e4a79ab3e93794a2e7759e5;hp=6f71b80f05f46c0ce37ff1cbfc6de6e9f96ea797;hpb=d388b5ce1f840eaad25a2c9ccdbcce862b72f988;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/win/C#/Program.cs b/win/C#/Program.cs index 6f71b80f..282f9f52 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,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 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.ToString()); - } - // Either Launch or Close the Application - if (launch == true) - { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new frmMain()); } - else - Application.Exit(); } }