Author: gedmurphy
Date: Fri Jun 8 19:06:47 2007
New Revision: 27073
URL:
http://svn.reactos.org/svn/reactos?rev=27073&view=rev
Log:
- Add some public properties to feed wizard data back to the main form
- Add some experimental code for the introduction of an ADO data object
Modified:
trunk/tools/RosTE/GUI/Config.xsd
trunk/tools/RosTE/GUI/MainForm.Designer.cs
trunk/tools/RosTE/GUI/MainForm.cs
trunk/tools/RosTE/GUI/MainForm.resx
trunk/tools/RosTE/GUI/NewVMWizard.cs
trunk/tools/RosTE/GUI/VMDataBase.cs
Modified: trunk/tools/RosTE/GUI/Config.xsd
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosTE/GUI/Config.xsd?rev=270…
==============================================================================
--- trunk/tools/RosTE/GUI/Config.xsd (original)
+++ trunk/tools/RosTE/GUI/Config.xsd Fri Jun 8 19:06:47 2007
@@ -4,8 +4,7 @@
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:int" />
- <xs:element name="Name" type="xs:string" />
- <xs:element name="ConfPath" type="xs:string" />
+ <xs:element name="Path" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
Modified: trunk/tools/RosTE/GUI/MainForm.Designer.cs
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosTE/GUI/MainForm.Designer.…
==============================================================================
--- trunk/tools/RosTE/GUI/MainForm.Designer.cs (original)
+++ trunk/tools/RosTE/GUI/MainForm.Designer.cs Fri Jun 8 19:06:47 2007
@@ -25,7 +25,7 @@
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
- System.Windows.Forms.ListViewItem listViewItem2 = new
System.Windows.Forms.ListViewItem("ReactOS", 0);
+ System.Windows.Forms.ListViewItem listViewItem1 = new
System.Windows.Forms.ListViewItem("ReactOS", 0);
System.ComponentModel.ComponentResourceManager resources = new
System.ComponentModel.ComponentResourceManager(typeof(MainForm));
this.ImageListView = new System.Windows.Forms.ListView();
this.columnName = new System.Windows.Forms.ColumnHeader();
@@ -75,7 +75,7 @@
this.columnDebug});
this.ImageListView.FullRowSelect = true;
this.ImageListView.Items.AddRange(new System.Windows.Forms.ListViewItem[] {
- listViewItem2});
+ listViewItem1});
this.ImageListView.Location = new System.Drawing.Point(12, 52);
this.ImageListView.Name = "ImageListView";
this.ImageListView.Size = new System.Drawing.Size(516, 237);
@@ -154,7 +154,7 @@
this.toolbarImageAdd.Name = "toolbarImageAdd";
this.toolbarImageAdd.Size = new System.Drawing.Size(23, 22);
this.toolbarImageAdd.ToolTipText = "Adds a new image";
- this.toolbarImageAdd.Click += new
System.EventHandler(this.startNewVMWizard);
+ this.toolbarImageAdd.Click += new
System.EventHandler(this.CreateNewVirtMach);
//
// toolbarImageDel
//
@@ -264,7 +264,7 @@
this.newToolStripMenuItem.DropDownItems.AddRange(new
System.Windows.Forms.ToolStripItem[] {
this.virtualMachineToolStripMenuItem});
this.newToolStripMenuItem.Name = "newToolStripMenuItem";
- this.newToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+ this.newToolStripMenuItem.Size = new System.Drawing.Size(106, 22);
this.newToolStripMenuItem.Text = "New";
//
// virtualMachineToolStripMenuItem
@@ -272,12 +272,12 @@
this.virtualMachineToolStripMenuItem.Name =
"virtualMachineToolStripMenuItem";
this.virtualMachineToolStripMenuItem.Size = new System.Drawing.Size(157,
22);
this.virtualMachineToolStripMenuItem.Text = "Virtual Machine";
- this.virtualMachineToolStripMenuItem.Click += new
System.EventHandler(this.startNewVMWizard);
+ this.virtualMachineToolStripMenuItem.Click += new
System.EventHandler(this.CreateNewVirtMach);
//
// mainmenuFileExit
//
this.mainmenuFileExit.Name = "mainmenuFileExit";
- this.mainmenuFileExit.Size = new System.Drawing.Size(152, 22);
+ this.mainmenuFileExit.Size = new System.Drawing.Size(106, 22);
this.mainmenuFileExit.Text = "Exit";
this.mainmenuFileExit.Click += new
System.EventHandler(this.exitToolStripMenuItem_Click);
//
@@ -332,7 +332,8 @@
this.Name = "MainForm";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
- this.Text = "ReactOS Test Environment";
+ this.Text = "QEmu Manager";
+ this.FormClosing += new
System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing);
this.Load += new System.EventHandler(this.MainForm_Load);
this.mainToolbar.ResumeLayout(false);
this.mainToolbar.PerformLayout();
Modified: trunk/tools/RosTE/GUI/MainForm.cs
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosTE/GUI/MainForm.cs?rev=27…
==============================================================================
--- trunk/tools/RosTE/GUI/MainForm.cs (original)
+++ trunk/tools/RosTE/GUI/MainForm.cs Fri Jun 8 19:06:47 2007
@@ -13,7 +13,8 @@
{
public partial class MainForm : Form
{
- ArrayList VirtualMachines = new ArrayList();
+ private ArrayList VirtualMachines;
+ private MainConfig mainConf;
public MainForm()
{
@@ -28,7 +29,10 @@
private void MainForm_Load(object sender, EventArgs e)
{
// read config and load any existing vm's
- MainConfig mainConf = new MainConfig(this);
+ mainConf = new MainConfig();
+
+ if (mainConf.LoadMainConfig())
+ mainConf.LoadExistingImages(ImageListView);
}
private void MainMenuHelpAbout_Click(object sender, EventArgs e)
@@ -50,11 +54,21 @@
Close();
}
- private void startNewVMWizard(object sender, EventArgs e)
+ private void CreateNewVirtMach(object sender, EventArgs e)
{
NewVMWizard wizFrm = new NewVMWizard();
wizFrm.StartPosition = FormStartPosition.CenterScreen;
- wizFrm.Show();
+ if (wizFrm.ShowDialog() == DialogResult.OK)
+ {
+ mainConf.AddVirtMach(wizFrm.VMName);
+ mainConf.LoadNewImage(ImageListView);
+ }
+
+ }
+
+ private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
+ {
+ mainConf.SaveMainConfig();
}
}
}
Modified: trunk/tools/RosTE/GUI/MainForm.resx
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosTE/GUI/MainForm.resx?rev=…
==============================================================================
--- trunk/tools/RosTE/GUI/MainForm.resx (original)
+++ trunk/tools/RosTE/GUI/MainForm.resx Fri Jun 8 19:06:47 2007
@@ -184,12 +184,12 @@
<data name="toolbarImageAdd.Image" type="System.Drawing.Bitmap,
System.Drawing"
mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
- YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAPdJREFUOE/Fk8sK
- gkAUhiu6EdEruakYwl2Nl1y48zV8rizovqo23UntPSrr5C8F3UMhEj5mcM75z3/GYyz2q4cxljEMI2Wa
- ZiJKjTiXq1RmxaO/nrDXdT0bSkhSip7tbMhqNkhSagdRFHOhBFDdcW1qtizyk/ec8/xXAfQrCELSD07D
- +lVAqUs7TdMKHwXQ54UTqldEdnS3TuBA1WTv5jyIexLDS8fd+NiERKyg023f0e113gvg0gbDPvUHvY+8
- dfBoczwZEWCVMj7ntcXXDh57QsJ8MQuQ1ZIXeg4gsFovAyILzOZTApEEMDyyyg8Ae/wbXwfpLwFngenf
- oo2+XqwAAAAASUVORK5CYII=
+ YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAPxJREFUOE9jYKAV
+ 8PDwYE9LS2Otr69nIscOxtDw4P8ubk5/gfQ/EDs+Pp6DJIPCIpz+3L5z6/+u3Tv/h0WE/Pbx8eEiyQCQ
+ 7Xfu3v6/e8+u/0DNv0JDQ3kIGgDyr729PQtQMRvI6TADIqLCfkZHR/PhNQDkTyj+B7Ldw8vt7917d8Au
+ iIwO/4MkD1aHYRhI8M7dW0B8+z9II4gG4QMH96Pgg4cO4DYAFGhHjh7+f/jIIbwYpwvQnXnm7On/IOzm
+ 4QKKTpgXsbsA3U8gDVeuXgbj8EjnPySnA5AB129cA2OyDbh85dJ/ECbLAFDiCY8M/Q3CIDYobxBMSAOi
+ AAAnZ998TXTN7AAAAABJRU5ErkJggg==
</value>
</data>
<data name="toolbarImageDel.Image" type="System.Drawing.Bitmap,
System.Drawing"
mimetype="application/x-microsoft.net.object.bytearray.base64">
@@ -203,20 +203,20 @@
<data name="toolbarHelpContents.Image" type="System.Drawing.Bitmap,
System.Drawing"
mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
- YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAt9JREFUOE99U11I
- U2EYXllBF3VjW91JklGUmCnCxDIVR6ZJPwTmzUglUwIvZi4IOlJJkNOVzW3KpEX+gEoX9qOEtSCVWeGN
- WFAg2cxNZe78zbNzds7ezvuZkgs68HC+c77nfb/nfd7326KJe9ovlOZJ6cfKlJ27Tsc08j7c3qrZFkgQ
- uJHtX74+u943MBYfQ74pitrReVLv7Tt8SPnk8Sg8z4EkSSCKItB0CD68GVF6D6YoyEHupiT9/f0JnWlp
- /nfmG7Lk94Mw6QWGoSEUChIwTAjC42OwOj0NI9VXZeRizEaSzhPZ7wcqr0Sl2VlgqqqAzs0Fxv+LJGFZ
- GpjAAtAFBcCYG0CYmoJeozGKMSSB/WJpui15vyzMzABjNAKTnw/BsjIYPFsSVaVGEIPnSqOhykpgi4uB
- MZmAnxgHW1KS7DxfclzT2tTY7nnqjvGvXgKdkwMr5eXg0mljjqJCO/WI2o3oVNeuvbpYqLaWKOGGX4Pn
- +YBiuXPLobFaLT+CwWXVqBVgA34YKimRnAW5D+OdthvyWt7mnZL55UXCDahlYSy6HwmHeWIWvols9dT4
- BESNuicIq3+MpQmXJMCWYasEIfz/BI1URBQjhIsGkwQoY2lpUXWbBYFj4cW1atFZVNgcr8BpyG8dNpki
- oqqAZRlYWJhfKwGN8PR0K7zLBWxNDdCjo9CdnKw4iwzt6yY6zhhsPSkHFO77N2Cb7gFnewweh13BBmiw
-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OScz3b0C33QfG/gT8LqeEGqBCrehR
+ q2XWbAZSqwWWIIAKBGD4plmw2YkEwjBBCPGf8xD3eoEsKAC6thY86ekyGgGs1KstmAjm50O8pQXIwkJg
+ WlsBSRXFpAIRkgIPjK0LBzPKPExmZwOK2SwTjWXf8WMrwbw8YJqbgel24zrRFK6DAsZhxyejYMTdMsob
+ l8mr1X7u0WjkT+0WcWEhhN1GCIVCMGV5KPao98mI889l+ttx++VLRZ33bndbrZb5R9YHPAJao3/oqqd2
+ 5zcLty92UZRhWQAAAABJRU5ErkJggg==
</value>
</data>
<data name="toolbarExit.Image" type="System.Drawing.Bitmap,
System.Drawing"
mimetype="application/x-microsoft.net.object.bytearray.base64">
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 (original)
+++ trunk/tools/RosTE/GUI/NewVMWizard.cs Fri Jun 8 19:06:47 2007
@@ -11,6 +11,27 @@
{
public partial class NewVMWizard : Form
{
+ public string VMName
+ {
+ get { return nameTxtBox.Text; }
+ }
+ public string DefDir
+ {
+ get { return defaultDirTxtBox.Text; }
+ }
+ public int DiskSizeGB
+ {
+ get { return (int)harddiskUpDwn.Value; }
+ }
+ public string ExistImg
+ {
+ get { return imageLocTxtBox.Text; }
+ }
+ public int MemSizeMB
+ {
+ get { return (int)memoryUpDwn.Value; }
+ }
+
public NewVMWizard()
{
InitializeComponent();
Modified: trunk/tools/RosTE/GUI/VMDataBase.cs
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosTE/GUI/VMDataBase.cs?rev=…
==============================================================================
--- trunk/tools/RosTE/GUI/VMDataBase.cs (original)
+++ trunk/tools/RosTE/GUI/VMDataBase.cs Fri Jun 8 19:06:47 2007
@@ -1,32 +1,99 @@
using System.Data;
using System.IO;
using System.Xml;
+using System.Windows.Forms;
namespace RosTEGUI
{
public class MainConfig
{
- private DataSet mainConfig;
+ private DataSet data;
- public MainConfig(MainForm mf)
+ private int GetNumberOfVms()
+ {
+ DataTable dt = data.Tables["MainConfig"];
+ return dt.Rows.Count;
+ }
+
+ public MainConfig()
{
string filename = "Config.xsd";
- mainConfig = new DataSet();
+ data = new DataSet();
if (File.Exists(filename))
{
FileStream fs = new FileStream(filename, FileMode.Open,
FileAccess.Read);
XmlTextReader xtr = new XmlTextReader(fs);
- mainConfig.ReadXmlSchema(xtr);
+ data.ReadXmlSchema(xtr);
xtr.Close();
+
+ // FIXME: unfortunatley, .NET doesn't support binding of
+ // listview controls, we'll need to implement this manually
+ // and remove the need for LoadNewImage / LoadExistingImages
+ }
+ }
+
+ public void LoadExistingImages(ListView lv)
+ {
+ DataTable dt = data.Tables["MainConfig"];
+
+ int num = GetNumberOfVms();
+ for (int i = 0; i < num; i++)
+ {
+ DataRow dr = dt.Rows[i];
+ lv.Items.Add((string)dr["Path"], 0);
+ }
+ }
+
+ public void LoadNewImage(ListView lv)
+ {
+ DataTable dt = data.Tables["MainConfig"];
+
+ int num = GetNumberOfVms();
+
+ DataRow dr = dt.Rows[num - 1];
+ lv.Items.Add((string)dr["Path"], 0);
+
+ }
+
+ public void AddVirtMach(string Path)
+ {
+ int i;
+ DataRow dr;
+ DataTable dt = data.Tables["MainConfig"];
+ i = dt.Rows.Count + 1;
+ dr = dt.NewRow();
+ dr["ID"] = i;
+ dr["Path"] = Path;
+ dt.Rows.Add(dr);
+ }
+
+ public void SaveMainConfig()
+ {
+ string fileName = "Config.xml";
+ FileStream fs = new FileStream(fileName, FileMode.OpenOrCreate,
FileAccess.Write);
+ XmlTextWriter xtw = new XmlTextWriter(fs, System.Text.Encoding.Unicode);
+ data.WriteXml(xtw, System.Data.XmlWriteMode.WriteSchema);
+ xtw.Close();
+ }
+
+ public bool LoadMainConfig()
+ {
+ bool ret = false;
+ string fileName = "Config.xml";
+
+ if (File.Exists(fileName))
+ {
+ FileStream fs = new FileStream(fileName, FileMode.Open,
FileAccess.Read);
+ XmlTextReader xtr = new XmlTextReader(fs);
+ data.ReadXml(xtr, System.Data.XmlReadMode.ReadSchema);
+ xtr.Close();
+ ret = true;
}
- // Add the data bindings
- DataTable dt = mainConfig.Tables["MainConfig"];
-
- //mf.im
-
+ return ret;
}
}
+
public class VMConfig
{