[ros-diffs] [gedmurphy] 26697: don't try to boot with bad paths

gedmurphy at svn.reactos.org gedmurphy at svn.reactos.org
Fri May 11 15:41:41 CEST 2007


Author: gedmurphy
Date: Fri May 11 17:41:40 2007
New Revision: 26697

URL: http://svn.reactos.org/svn/reactos?rev=26697&view=rev
Log:
don't try to boot with bad paths

Modified:
    trunk/tools/Qemu GUI/AboutForm.Designer.cs
    trunk/tools/Qemu GUI/AboutForm.resx
    trunk/tools/Qemu GUI/MainForm.Designer.cs
    trunk/tools/Qemu GUI/MainForm.cs
    trunk/tools/Qemu GUI/Runner.cs

Modified: trunk/tools/Qemu GUI/AboutForm.Designer.cs
URL: http://svn.reactos.org/svn/reactos/trunk/tools/Qemu%20GUI/AboutForm.Designer.cs?rev=26697&r1=26696&r2=26697&view=diff
==============================================================================
--- trunk/tools/Qemu GUI/AboutForm.Designer.cs (original)
+++ trunk/tools/Qemu GUI/AboutForm.Designer.cs Fri May 11 17:41:40 2007
@@ -32,8 +32,8 @@
             this.button1 = new System.Windows.Forms.Button();
             this.tabControl1 = new System.Windows.Forms.TabControl();
             this.tabPage1 = new System.Windows.Forms.TabPage();
+            this.textBox1 = new System.Windows.Forms.TextBox();
             this.tabPage2 = new System.Windows.Forms.TabPage();
-            this.textBox1 = new System.Windows.Forms.TextBox();
             this.textBox2 = new System.Windows.Forms.TextBox();
             this.tabControl1.SuspendLayout();
             this.tabPage1.SuspendLayout();
@@ -71,6 +71,16 @@
             this.tabPage1.Text = "License";
             this.tabPage1.UseVisualStyleBackColor = true;
             // 
+            // textBox1
+            // 
+            this.textBox1.Location = new System.Drawing.Point(6, 6);
+            this.textBox1.Multiline = true;
+            this.textBox1.Name = "textBox1";
+            this.textBox1.ReadOnly = true;
+            this.textBox1.Size = new System.Drawing.Size(267, 207);
+            this.textBox1.TabIndex = 0;
+            this.textBox1.Text = resources.GetString("textBox1.Text");
+            // 
             // tabPage2
             // 
             this.tabPage2.Controls.Add(this.textBox2);
@@ -81,16 +91,6 @@
             this.tabPage2.TabIndex = 1;
             this.tabPage2.Text = "Credits";
             this.tabPage2.UseVisualStyleBackColor = true;
-            // 
-            // textBox1
-            // 
-            this.textBox1.Location = new System.Drawing.Point(6, 6);
-            this.textBox1.Multiline = true;
-            this.textBox1.Name = "textBox1";
-            this.textBox1.ReadOnly = true;
-            this.textBox1.Size = new System.Drawing.Size(267, 207);
-            this.textBox1.TabIndex = 0;
-            this.textBox1.Text = resources.GetString("textBox1.Text");
             // 
             // textBox2
             // 

Modified: trunk/tools/Qemu GUI/AboutForm.resx
URL: http://svn.reactos.org/svn/reactos/trunk/tools/Qemu%20GUI/AboutForm.resx?rev=26697&r1=26696&r2=26697&view=diff
==============================================================================
--- trunk/tools/Qemu GUI/AboutForm.resx (original)
+++ trunk/tools/Qemu GUI/AboutForm.resx Fri May 11 17:41:40 2007
@@ -117,14 +117,6 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
-  <data name="textBox2.Text" xml:space="preserve">
-    <value>ReactOS QEmu Manager was brought to you by:
-
-Magnus Olsen [greatlord at reactos.org]
-Christoph Von Widitch [Christoph_vW at ReactOS.org]
-Samuel Serapión [samcharly at hotmail.com]
-Ged Murphy [gedmurphy at reactos.org]</value>
-  </data>
   <data name="textBox1.Text" xml:space="preserve">
     <value>This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
 
@@ -132,4 +124,12 @@
 
 You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.</value>
   </data>
+  <data name="textBox2.Text" xml:space="preserve">
+    <value>ReactOS QEmu Manager was brought to you by:
+
+Magnus Olsen [greatlord at reactos.org]
+Christoph von Wittich [Christoph_vW at ReactOS.org]
+Samuel Serapión [samcharly at hotmail.com]
+Ged Murphy [gedmurphy at reactos.org]</value>
+  </data>
 </root>

Modified: trunk/tools/Qemu GUI/MainForm.Designer.cs
URL: http://svn.reactos.org/svn/reactos/trunk/tools/Qemu%20GUI/MainForm.Designer.cs?rev=26697&r1=26696&r2=26697&view=diff
==============================================================================
--- trunk/tools/Qemu GUI/MainForm.Designer.cs (original)
+++ trunk/tools/Qemu GUI/MainForm.Designer.cs Fri May 11 17:41:40 2007
@@ -358,9 +358,9 @@
             this.groupBox3.Controls.Add(this.btnBrowseBios);
             this.groupBox3.Controls.Add(this.txtABios);
             this.groupBox3.Enabled = false;
-            this.groupBox3.Location = new System.Drawing.Point(6, 65);
+            this.groupBox3.Location = new System.Drawing.Point(3, 65);
             this.groupBox3.Name = "groupBox3";
-            this.groupBox3.Size = new System.Drawing.Size(351, 57);
+            this.groupBox3.Size = new System.Drawing.Size(354, 57);
             this.groupBox3.TabIndex = 11;
             this.groupBox3.TabStop = false;
             this.groupBox3.Text = "BIOS";
@@ -475,9 +475,9 @@
             this.groupBox1.Controls.Add(this.btnBrowseLinuxK);
             this.groupBox1.Controls.Add(this.txtLinuxK);
             this.groupBox1.Enabled = false;
-            this.groupBox1.Location = new System.Drawing.Point(6, 6);
+            this.groupBox1.Location = new System.Drawing.Point(3, 6);
             this.groupBox1.Name = "groupBox1";
-            this.groupBox1.Size = new System.Drawing.Size(351, 53);
+            this.groupBox1.Size = new System.Drawing.Size(354, 53);
             this.groupBox1.TabIndex = 0;
             this.groupBox1.TabStop = false;
             this.groupBox1.Text = "Linux";
@@ -532,9 +532,9 @@
             this.grpVDK.Controls.Add(this.btnMount);
             this.grpVDK.Controls.Add(this.lblImage);
             this.grpVDK.Enabled = false;
-            this.grpVDK.Location = new System.Drawing.Point(4, 83);
+            this.grpVDK.Location = new System.Drawing.Point(3, 83);
             this.grpVDK.Name = "grpVDK";
-            this.grpVDK.Size = new System.Drawing.Size(501, 118);
+            this.grpVDK.Size = new System.Drawing.Size(502, 118);
             this.grpVDK.TabIndex = 7;
             this.grpVDK.TabStop = false;
             this.grpVDK.Text = "VDK";
@@ -619,9 +619,9 @@
             this.groupBox9.Controls.Add(this.lblImageSize);
             this.groupBox9.Controls.Add(this.btnCreateImage);
             this.groupBox9.Controls.Add(this.cboImageFormat);
-            this.groupBox9.Location = new System.Drawing.Point(4, 3);
+            this.groupBox9.Location = new System.Drawing.Point(3, 3);
             this.groupBox9.Name = "groupBox9";
-            this.groupBox9.Size = new System.Drawing.Size(501, 74);
+            this.groupBox9.Size = new System.Drawing.Size(502, 74);
             this.groupBox9.TabIndex = 6;
             this.groupBox9.TabStop = false;
             this.groupBox9.Text = "Harddisk Tools";
@@ -1315,9 +1315,9 @@
             this.grpHarddisk.Controls.Add(this.btnBrowseHDA);
             this.grpHarddisk.Controls.Add(this.chkUseHDB);
             this.grpHarddisk.Controls.Add(this.chkUseHDA);
-            this.grpHarddisk.Location = new System.Drawing.Point(5, 3);
+            this.grpHarddisk.Location = new System.Drawing.Point(3, 3);
             this.grpHarddisk.Name = "grpHarddisk";
-            this.grpHarddisk.Size = new System.Drawing.Size(500, 195);
+            this.grpHarddisk.Size = new System.Drawing.Size(502, 195);
             this.grpHarddisk.TabIndex = 5;
             this.grpHarddisk.TabStop = false;
             this.grpHarddisk.Text = " Harddisks";

Modified: trunk/tools/Qemu GUI/MainForm.cs
URL: http://svn.reactos.org/svn/reactos/trunk/tools/Qemu%20GUI/MainForm.cs?rev=26697&r1=26696&r2=26697&view=diff
==============================================================================
--- trunk/tools/Qemu GUI/MainForm.cs (original)
+++ trunk/tools/Qemu GUI/MainForm.cs Fri May 11 17:41:40 2007
@@ -697,18 +697,56 @@
             bool HasHDisk = false;
             bool HasFDisk = false;
 
+            /* check the QEmu path */
+            if (!Directory.Exists(data.Paths.Qemu))
+            {
+                MessageBox.Show("\"" + data.Paths.Qemu + "\"" + " does not exist", "Error - QEmu path");
+                return;
+            }
+
             /* There must be atleast one source of OS */
             for (int i = 0; i < data.Harddisks.HDD.Length; i++)
             {
                 if (data.Harddisks.HDD[i].Enabled == true)
-                    HasHDisk = true;
+                {
+                    if (File.Exists(data.Harddisks.HDD[i].Path))
+                    {
+                        HasHDisk = true;
+                    }
+                    else
+                    {
+                        MessageBox.Show("\"" + data.Harddisks.HDD[i].Path + "\"" + " does not exist", "Error - Harddisk file");
+                        return;
+                    }
+                }
             }
 
             for (int i = 0; i < data.Floppies.FDD.Length; i++)
             {
                 if (data.Floppies.FDD[i].Enabled == true)
-                    HasFDisk = true;
-            }
+                {
+                    if (File.Exists(data.Floppies.FDD[i].Path))
+                    {
+                        HasFDisk = true;
+                    }
+                    else
+                    {
+                        MessageBox.Show("\"" + data.Floppies.FDD[i].Path + "\"" + " does not exist", "Error - Floppy File");
+                        return;
+                    }
+                }
+            }
+
+            /* ensure we have a correct CD image if we need to boot from it */
+            if (optCDImage.Enabled && txtCDROM.Text.Length > 0)
+            {
+                if (!File.Exists(txtCDROM.Text))
+                {
+                    MessageBox.Show("\"" + txtCDROM.Text + "\"" + " does not exist", "Error - CD-ROM image");
+                    return;
+                }
+            }
+
             if (HasHDisk == false && data.CDROM.Enabled == false && HasFDisk == false)
                 MessageBox.Show("Must enable atleast 1 Hard disk, CD-Rom or Floppy disk!", "Error");//or specify linux kernel image???
             else

Modified: trunk/tools/Qemu GUI/Runner.cs
URL: http://svn.reactos.org/svn/reactos/trunk/tools/Qemu%20GUI/Runner.cs?rev=26697&r1=26696&r2=26697&view=diff
==============================================================================
--- trunk/tools/Qemu GUI/Runner.cs (original)
+++ trunk/tools/Qemu GUI/Runner.cs Fri May 11 17:41:40 2007
@@ -79,7 +79,6 @@
                         }
                         catch { }
                     }
-
                 }
                 p.StartInfo.Arguments = data.GetArgv();
             }




More information about the Ros-diffs mailing list