Author: zguo
Date: Sat May 31 20:22:57 2008
New Revision: 33794
URL:
http://svn.reactos.org/svn/reactos?rev=33794&view=rev
Log:
Update to the new VM wizard, to check for a valid path in creating one.
Modified:
trunk/tools/RosTE/GUI/NewVMWizard.cs
trunk/tools/RosTE/GUI/Properties/Resources.Designer.cs
Modified: trunk/tools/RosTE/GUI/NewVMWizard.cs
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosTE/GUI/NewVMWizard.cs?rev…
==============================================================================
--- trunk/tools/RosTE/GUI/NewVMWizard.cs [iso-8859-1] (original)
+++ trunk/tools/RosTE/GUI/NewVMWizard.cs [iso-8859-1] Sat May 31 20:22:57 2008
@@ -4,6 +4,7 @@
using System.Data;
using System.Drawing;
using System.Text;
+using System.Text.RegularExpressions;
using System.Windows.Forms;
using System.IO;
@@ -81,9 +82,9 @@
private void wizardDefaultDirPage_CloseFromNext(object sender,
Gui.Wizard.PageEventArgs e)
{
- if (defaultDirTxtBox.Text == "")
- {
- MessageBox.Show("You must enter a name", "Error");
+ if (!Directory.Exists(defaultDirTxtBox.Text))
+ {
+ MessageBox.Show("You must enter a valid path",
"Error");
e.Page = defaultDirInfoPage;
}
}
@@ -147,22 +148,22 @@
private void wizardHardDiskPage_Enter(object sender, EventArgs e)
{
- DriveInfo di = new DriveInfo(defaultDirTxtBox.Text);
- long AvailInMB = di.AvailableFreeSpace / (long)Math.Pow(1024, 2);
-
- if (AvailInMB > 20480) AvailInMB = 20480;
-
- harddiskTrkBar.Minimum = 100;
- harddiskTrkBar.Maximum = Convert.ToInt32(AvailInMB);
- harddiskTrkBar.SmallChange = 100;
- harddiskTrkBar.TickFrequency = 50;
- harddiskUpDwn.Minimum = 100;
- harddiskUpDwn.Maximum = harddiskTrkBar.Maximum;
- harddiskUpDwn.Increment = 100;
-
- harddiskDiskLab.Text = di.Name;
- harddiskDiskSizeLab.Text = Convert.ToString(AvailInMB) + " MB";
- harddiskRecMinLab.Text = "100 MB";
+ DriveInfo di = new DriveInfo(defaultDirTxtBox.Text);
+ long AvailInMB = di.AvailableFreeSpace / (long)Math.Pow(1024, 2);
+
+ if (AvailInMB > 20480) AvailInMB = 20480;
+
+ harddiskTrkBar.Minimum = 100;
+ harddiskTrkBar.Maximum = Convert.ToInt32(AvailInMB);
+ harddiskTrkBar.SmallChange = 100;
+ harddiskTrkBar.TickFrequency = 50;
+ harddiskUpDwn.Minimum = 100;
+ harddiskUpDwn.Maximum = harddiskTrkBar.Maximum;
+ harddiskUpDwn.Increment = 100;
+
+ harddiskDiskLab.Text = di.Name;
+ harddiskDiskSizeLab.Text = Convert.ToString(AvailInMB) + " MB";
+ harddiskRecMinLab.Text = "100 MB";
}
private void wizardMemoryPage_Enter(object sender, EventArgs e)
@@ -225,7 +226,8 @@
private void defaultDirInfoPage_Enter(object sender, EventArgs e)
{
- defaultDirTxtBox.Text = mainConf.DefVmPath + '\\' + VMName;
+ if(mainConf.DefVmPath != null && mainConf.DefVmPath != "")
+ defaultDirTxtBox.Text = mainConf.DefVmPath + '\\' + VMName;
}
}
}
Modified: trunk/tools/RosTE/GUI/Properties/Resources.Designer.cs
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosTE/GUI/Properties/Resourc…
==============================================================================
--- trunk/tools/RosTE/GUI/Properties/Resources.Designer.cs [iso-8859-1] (original)
+++ trunk/tools/RosTE/GUI/Properties/Resources.Designer.cs [iso-8859-1] Sat May 31
20:22:57 2008
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
-// Runtime Version:2.0.50727.312
+// Runtime Version:2.0.50727.1433
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.