Author: gedmurphy
Date: Tue Jun 26 02:48:23 2007
New Revision: 27279
URL:
http://svn.reactos.org/svn/reactos?rev=27279&view=rev
Log:
- implement deleting of existing images
- add a few public properties for virtual machines
Modified:
trunk/tools/RosTE/GUI/MainForm.cs
trunk/tools/RosTE/GUI/VirtualMachine.cs
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 Tue Jun 26 02:48:23 2007
@@ -139,6 +139,12 @@
if (delFrm.ShowDialog() == DialogResult.OK)
{
+ if (delFrm.DeleteFullVM)
+ {
+ VirtualMachine vm = (VirtualMachine)lvi.Tag;
+ Directory.Delete(vm.DefDir, true);
+ }
+
mainConf.DeleteVirtMach(lvi.Index/*lvi.Tag*/);
VirtMachListView.Items.Remove(lvi);
vmConfigs.Remove(lvi.Tag);
Modified: trunk/tools/RosTE/GUI/VirtualMachine.cs
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosTE/GUI/VirtualMachine.cs?…
==============================================================================
--- trunk/tools/RosTE/GUI/VirtualMachine.cs (original)
+++ trunk/tools/RosTE/GUI/VirtualMachine.cs Tue Jun 26 02:48:23 2007
@@ -10,14 +10,13 @@
{
private Data data;
private DataRow dataRow;
- private string machine;
- private string cdrom;
- private char boot;
- private string snapshot;
- private int memory;
- private int processors;
- private bool localTime;
- private bool fullScreen;
+
+ #region Virtual machine properties
+
+ public int VirtMachID
+ {
+ get { return (int)dataRow["VirtMachID"]; }
+ }
public string Name
{
@@ -25,73 +24,85 @@
set { dataRow["Name"] = value; }
}
+ public string MachType
+ {
+ get { return (string)dataRow["MachType"]; }
+ set { dataRow["MachType"] = value; }
+ }
+
public string DefDir
{
get { return (string)dataRow["DefDir"]; }
- }
-
- public string Machine
- {
- get { return machine; }
- set { machine = value; }
- }
-
-
- public string Cdrom
- {
- get { return cdrom; }
- set { cdrom = value; }
- }
- public string Boot
- {
- get
- {
- switch (boot)
- {
- case 'a': return "floppy";
- case 'c': return "harddisk";
- case 'd': return "cdrom";
- case 'n': return "network";
- default: throw new ArgumentException("Boot");
- }
- }
- set
- {
- switch (value)
- {
- case "floppy": boot = 'a'; break;
- case "harddisk": boot = 'c'; break;
- case "cdrom": boot = 'd'; break;
- case "network": boot = 'n'; break;
- default: throw new ArgumentException("Boot");
- }
- }
- }
- public string SnapShot
- {
- get { return snapshot; }
- set { snapshot = value; }
- }
- public int Memory
- {
- get { return memory; }
- set { memory = value; }
- }
- public int Processors
- {
- get { return processors; }
- set { processors = value; }
- }
- public bool LocalTime
- {
- get { return localTime; }
- set { localTime = value; }
- }
- public bool FullScreen
- {
- get { return fullScreen; }
- set { fullScreen = value; }
- }
+ set { dataRow["DefDir"] = value; }
+ }
+
+ public int MemSize
+ {
+ get { return (int)dataRow["MemSize"]; }
+ set { dataRow["MemSize"] = value; }
+ }
+
+ public bool CdRomEnable
+ {
+ get { return (bool)dataRow["CdRomEnable"]; }
+ set { dataRow["CdRomEnable"] = value; }
+ }
+
+ public bool CdRomUsePhys
+ {
+ get { return (bool)dataRow["CdRomUsePhys"]; }
+ set { dataRow["CdRomUsePhys"] = value; }
+ }
+
+ public string CdRomPhysDrv
+ {
+ get { return (string)dataRow["CdRomPhysDrv"]; }
+ set { dataRow["CdRomPhysDrv"] = value; }
+ }
+
+ public bool CdRomUseIso
+ {
+ get { return (bool)dataRow["CdRomUseIso"]; }
+ set { dataRow["CdRomUseIso"] = value; }
+ }
+
+ public string CdRomIsoImg
+ {
+ get { return (string)dataRow["CdRomIsoImg"]; }
+ set { dataRow["CdRomIsoImg"] = value; }
+ }
+
+ public bool FloppyEnable
+ {
+ get { return (bool)dataRow["FloppyEnable"]; }
+ set { dataRow["FloppyEnable"] = value; }
+ }
+
+ public bool FloppyUsePhys
+ {
+ get { return (bool)dataRow["FloppyUsePhys"]; }
+ set { dataRow["FloppyUsePhys"] = value; }
+ }
+
+ public string FloppyPhysDrv
+ {
+ get { return (string)dataRow["FloppyPhysDrv"]; }
+ set { dataRow["FloppyPhysDrv"] = value; }
+ }
+
+ public bool FloppyUseIso
+ {
+ get { return (bool)dataRow["FloppyUseIso"]; }
+ set { dataRow["FloppyUseIso"] = value; }
+ }
+
+ public string FloppyIsoImg
+ {
+ get { return (string)dataRow["FloppyIsoImg"]; }
+ set { dataRow["FloppyIsoImg"] = value; }
+ }
+
+ #endregion
public override string ToString()
{