Author: cwittich
Date: Wed Jun 21 22:59:49 2006
New Revision: 22481
URL:
http://svn.reactos.ru/svn/reactos?rev=22481&view=rev
Log:
-added VDK stuff
Modified:
trunk/tools/Qemu GUI/QEmu.cs
trunk/tools/Qemu GUI/Qemu GUI.suo
trunk/tools/Qemu GUI/frmMain.cs
Modified: trunk/tools/Qemu GUI/QEmu.cs
URL:
http://svn.reactos.ru/svn/reactos/trunk/tools/Qemu%20GUI/QEmu.cs?rev=22481&…
==============================================================================
--- trunk/tools/Qemu GUI/QEmu.cs (original)
+++ trunk/tools/Qemu GUI/QEmu.cs Wed Jun 21 22:59:49 2006
@@ -30,6 +30,7 @@
private Debug m_Debug = new Debug();
private Paths m_Paths = new Paths();
private CDROM m_CDROM = new CDROM();
+ private Tools m_Tools = new Tools();
private string m_LastError = "";
public QEmu()
@@ -71,6 +72,55 @@
return m_LastError;
}
+ public bool MountImage()
+ {
+ Process p = new Process();
+ p.StartInfo.FileName = this.Paths.VDK + "\\vdk.exe";
+ p.StartInfo.WorkingDirectory = this.Paths.VDK;
+ p.StartInfo.Arguments = "open * " + "\"" +
this.Tools.vdk.Image + "\"" + @" /RW /L:" +
this.Tools.vdk.DriveLetter.Substring(0, 1);
+ Console.WriteLine(p.StartInfo.Arguments);
+ p.StartInfo.RedirectStandardOutput = true;
+ p.StartInfo.UseShellExecute = false;
+ p.StartInfo.CreateNoWindow = true;
+ try
+ {
+ p.Start();
+ m_LastError = p.StandardOutput.ReadToEnd();
+ if (m_LastError.Length > 0)
+ return false;
+ }
+ catch
+ {
+ m_LastError = "vdk not found!";
+ return false;
+ }
+ return true;
+ }
+
+ public bool UnmountImage()
+ {
+ Process p = new Process();
+ p.StartInfo.FileName = this.Paths.VDK + "\\vdk.exe";
+ p.StartInfo.WorkingDirectory = this.Paths.VDK;
+ p.StartInfo.Arguments = "CLOSE * /F";
+ p.StartInfo.RedirectStandardError = true;
+ p.StartInfo.UseShellExecute = false;
+ p.StartInfo.CreateNoWindow = true;
+ try
+ {
+ p.Start();
+ m_LastError = p.StandardError.ReadToEnd();
+ if (m_LastError.Length > 0)
+ return false;
+ }
+ catch
+ {
+ m_LastError = "vdk not found!";
+ return false;
+ }
+ return true;
+ }
+
public bool Start(Platforms Platform)
{
Process p = new Process();
@@ -117,6 +167,13 @@
{
get { return m_Misc; }
set { this.m_Misc = value; }
+ }
+
+ [XmlElement("Tools")]
+ public Tools Tools
+ {
+ get { return m_Tools; }
+ set { this.m_Tools = value; }
}
[XmlElement("Floppies")]
@@ -350,6 +407,34 @@
}
}
+ public class Tools
+ {
+ private VDK m_VDK = new VDK();
+
+ [XmlElement("VDK")]
+ public VDK vdk
+ {
+ get { return this.m_VDK; }
+ set { this.m_VDK = value; }
+ }
+
+ public Tools()
+ {
+ }
+ }
+
+ public class VDK
+ {
+ [XmlElement("Image")]
+ public string Image = "";
+ [XmlElement("DriveLetter")]
+ public string DriveLetter = "";
+
+ public VDK()
+ {
+ }
+ }
+
public class Audio
{
[XmlElement("Soundblaster")]
Modified: trunk/tools/Qemu GUI/Qemu GUI.suo
URL:
http://svn.reactos.ru/svn/reactos/trunk/tools/Qemu%20GUI/Qemu%20GUI.suo?rev…
==============================================================================
Binary files - no diff available.
Modified: trunk/tools/Qemu GUI/frmMain.cs
URL:
http://svn.reactos.ru/svn/reactos/trunk/tools/Qemu%20GUI/frmMain.cs?rev=224…
==============================================================================
--- trunk/tools/Qemu GUI/frmMain.cs (original)
+++ trunk/tools/Qemu GUI/frmMain.cs Wed Jun 21 22:59:49 2006
@@ -910,21 +910,21 @@
//
// btnUnmount
//
- this.btnUnmount.Enabled = false;
this.btnUnmount.Location = new System.Drawing.Point(353, 77);
this.btnUnmount.Name = "btnUnmount";
this.btnUnmount.Size = new System.Drawing.Size(93, 23);
this.btnUnmount.TabIndex = 5;
this.btnUnmount.Text = "Unmount";
+ this.btnUnmount.Click += new System.EventHandler(this.btnUnmount_Click);
//
// btnMount
//
- this.btnMount.Enabled = false;
this.btnMount.Location = new System.Drawing.Point(255, 77);
this.btnMount.Name = "btnMount";
this.btnMount.Size = new System.Drawing.Size(93, 23);
this.btnMount.TabIndex = 3;
this.btnMount.Text = "Mount";
+ this.btnMount.Click += new System.EventHandler(this.btnMount_Click);
//
// lblImage
//
@@ -1874,8 +1874,11 @@
chkSerialToFile.Checked = qemu.Debug.SerialPort.Redirect;
chkParallelToFile.Checked = qemu.Debug.ParallelPort.Redirect;
chkVBE30.Checked = qemu.Debug.VBE3;
- txtGDBPort.Text = qemu.Debug.GDBPort.ToString();
-
+ txtGDBPort.Text = qemu.Debug.GDBPort.ToString();
+
+ /* Tools */
+ txtVDKImage.Text = qemu.Tools.vdk.Image;
+ cboVDKDrive.Text = qemu.Tools.vdk.DriveLetter;
}
private void SaveSettings()
@@ -1927,6 +1930,10 @@
qemu.Debug.ParallelPort.Redirect = chkParallelToFile.Checked;
qemu.Debug.VBE3 = chkVBE30.Checked;
qemu.Debug.GDBPort = Int32.Parse(txtGDBPort.Text);
+
+ /* Tools */
+ qemu.Tools.vdk.Image = txtVDKImage.Text;
+ qemu.Tools.vdk.DriveLetter = cboVDKDrive.Text;
}
#endregion
@@ -1940,6 +1947,27 @@
}
}
+ private void btnUnmount_Click(object sender, EventArgs e)
+ {
+ if (!qemu.UnmountImage())
+ {
+ frmError fError = new frmError();
+ fError.txtError.Text = qemu.GetLastError();
+ fError.ShowDialog(this);
+ }
+ }
+
+ private void btnMount_Click(object sender, EventArgs e)
+ {
+ SaveSettings();
+ if (!qemu.MountImage())
+ {
+ frmError fError = new frmError();
+ fError.txtError.Text = qemu.GetLastError();
+ fError.ShowDialog(this);
+ }
+ }
+