Update for Qemu GUI by Samuel Serapión.

- Completely new interface.
- Graphics from Ged's WIP Qemu GUI.
- Many fixes and improvements.

svn path=/trunk/tools/Qemu GUI/; revision=369
This commit is contained in:
Peter Ward 2007-08-28 23:37:07 +00:00
parent a8682ccfd3
commit a0ae2bf79d
43 changed files with 2117 additions and 1782 deletions

88
Data.cs
View File

@ -1,5 +1,5 @@
using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
@ -256,7 +256,7 @@ namespace Qemu_GUI
/* No vga output */
if (this.VGA)
buffer += "-nographic ";
buffer += "-nographic "; //doesnt seem to work on windows
/* Fullscreen */
if (this.Fullscreen)
@ -526,10 +526,6 @@ namespace Qemu_GUI
{
[XmlAttribute("Image")]
public string Image;
[XmlAttribute("UseFromHost")]
public bool UseFromHost;
[XmlAttribute("HostDrive")]
public string HostDrive;
[XmlAttribute("Enabled")]
public bool Enabled;
@ -538,10 +534,7 @@ namespace Qemu_GUI
string buffer = "";
if (this.Enabled)
{
if (this.UseFromHost)
buffer = "-cdrom //./PhysicalDrive1 ";// + this.HostDrive + " ";//-cdrom //./d:
else if (this.Image.Length > 0)
if (this.Image.Length > 0)
buffer = "-cdrom \"" + this.Image + "\" ";
}
return buffer;
@ -566,60 +559,49 @@ namespace Qemu_GUI
public class Network
{
[XmlAttribute("Enabled")]
public bool Enabled;
[XmlAttribute("Count")]
public int Count;
[XmlAttribute("VNicString")]
public string VNicString;
[XmlArray("VNicStrings")]
[XmlArrayItem("VNicString")]
public string[] VNicStrings;
public string[] VNicStringReader()
public Network()
{
string[] buffer = new string[1];
int j = 0;
char[] chararray;
bool start = false;
/* we have no adaptors */
if (this.VNicString == null)
return null;
else
chararray = this.VNicString.ToCharArray();
/* This is not a real adaptor, skip it */
if (this.VNicString == "-net none ")
{
buffer[j] = "ignore";
j++; //if we are here there should NOT be any other -net options, but just in case...
}
else
for (int i = 0; i < chararray.Length; i++)
{
if (chararray[i] == '-') //we found the start of a -net string
start = true;
if (start == true)
{
buffer[j] += chararray[i];
}
else
{
start = false;
j++;
}
}
return buffer;
VNicStrings = new string[1];
Count = 0;
}
public void AddNetString(string lan)
{
Enabled = true;
Count++;
string[] temp = new string[Count];
for (int i = 0; i < Count; i++)
{
if (i == Count - 1)
temp[i] = lan;
else
temp[i] = VNicStrings[i];
}
VNicStrings = temp;
}
public string[] GetNetStrings()
{
return VNicStrings;
}
public override string ToString()
{
string buffer = "";
foreach(VLan lan in MainForm.VLanlist)
buffer += lan.ToString();
foreach(string lan in VNicStrings)
buffer += lan;
return buffer;
}
}

View File

@ -3,8 +3,6 @@ using System.IO;
using System.Diagnostics;
using System.Threading;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace Qemu_GUI
{
@ -26,18 +24,21 @@ namespace Qemu_GUI
}
public void Listen(Process p, string Talker)
{
if (p.HasExited)
return;
proc = p;
talker = Talker;
start = new ThreadStart(ThreadProc);
worker = new Thread(start);
worker.Priority = ThreadPriority.BelowNormal;//let other apps like qemu run before us.
worker.Priority = ThreadPriority.Normal;
this.Show();//show the dialog
worker.Start();
}
private void ThreadProc()
{
FileStream log;
FileStream log = null;
txtDebug.Text = "";
string buffer = "";
string temp = "";
@ -48,30 +49,30 @@ namespace Qemu_GUI
log = new FileStream(talker, FileMode.OpenOrCreate, FileAccess.Read, FileShare.ReadWrite);
while (!proc.HasExited)
{
int data = log.ReadByte();
if (data != -1)
{
worker.Priority = ThreadPriority.Normal;
buffer += Convert.ToChar(data);
if (buffer.Contains("\n"))
{
temp = txtDebug.Text + buffer;
txtDebug.Text = "";
txtDebug.SelectedText = temp;
buffer = "";
}
}
else
Thread.Sleep(250);//wait a 1/4 of a second for more data
if (buffer.Contains("\n"))
{
temp = txtDebug.Text + buffer;
txtDebug.Text = "";
txtDebug.SelectedText = temp;
buffer = "";
}
worker.Priority = ThreadPriority.Lowest;
//Thread.Sleep(50);//wait a 1/4 of a second for more data
}
temp = txtDebug.Text + buffer;
txtDebug.Text = "";
txtDebug.SelectedText = temp;
DeleteTalker();
log.Close();
DeleteTalker();
//txtDebug.Text += "QEMU GUI: Exited listener!" + Environment.NewLine;
}
catch (Exception e)
@ -79,36 +80,34 @@ namespace Qemu_GUI
/* fix me: writting to a form from a diferent thread, unsafe. */
try
{
log.Close();
txtDebug.Text += "QEMU GUI: Exited listener on exception!" + Environment.NewLine;
txtDebug.Text += e.Message;
}
catch
{}
DeleteTalker();
}
log.Close();
DeleteTalker();
}
private void DeleteTalker()
{
int attempts = 0;
/* sometimes it takes a while for qemu to free the handle to the file */
while (File.Exists(talker))
{
try
if (proc.HasExited)
{
File.Delete(talker);
}
catch
{
// if (File.Exists(data.Debug.SerialPort.FileName))
// MessageBox.Show("Warning temporary file still exists!");
}
attempts++;
Thread.Sleep(150);
if (attempts > 15)
{
break;//we've spent 2.25minutes here.. just give up.
worker.Priority = ThreadPriority.Lowest;
try
{
File.Delete(talker);
if (!File.Exists(talker))
break;
}
catch
{ }
}
}
//MessageBox.Show("Temp File deleted!");

View File

@ -117,6 +117,9 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="txtDebug.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="toolStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>

3121
MainForm.Designer.cs generated

File diff suppressed because it is too large Load Diff

View File

@ -41,21 +41,18 @@ namespace Qemu_GUI
{
/* remove all driveletters which are in use */
DriveLetters.Remove(drive.RootDirectory.ToString());
if (drive.DriveType == DriveType.CDRom)
cboCDROM.Items.Add(drive.RootDirectory);
}
/* add to vdk drop box */
foreach (object o in DriveLetters)
cboVDKDrive.Items.Add(o);
cboVDKDrive.SelectedIndex = 0;
cboCDROM.SelectedIndex = 0;
cboBootFrom.SelectedIndex = 1;
cboImageFormat.SelectedIndex = 4;
cboMachine.SelectedIndex = 0;
/* load default config file */
LoadConfigFile();
LoadDefaultConfig();
/* Find out which controls should be enabled or disabled */
chkSerialToFile_CheckedChanged(null, null);
@ -138,9 +135,6 @@ namespace Qemu_GUI
if (chkUseHDC.Checked == true)
{
optHostCDROM.Enabled = false;
cboCDROM.Enabled = false;
optCDImage.Enabled = false;
btnBrowseCDROM.Enabled = false;
txtCDROM.Enabled = false;
}
@ -156,23 +150,10 @@ namespace Qemu_GUI
txtHDC.Text = "Used for CD-ROM!";
txtHDC.Enabled = false;
txtCDROM.Enabled = true;
optCDImage.Enabled = true;
if (optCDImage.Checked == true)
{
cboCDROM.Enabled = false;
btnBrowseCDROM.Enabled = true;
}
else
{
cboCDROM.Enabled = true;
btnBrowseCDROM.Enabled = false;
}
btnBrowseCDROM.Enabled = true;
}
else
{
optHostCDROM.Enabled = false;
cboCDROM.Enabled = false;
optCDImage.Enabled = false;
btnBrowseCDROM.Enabled = false;
txtCDROM.Enabled = false;
chkUseHDC.Enabled = true;
@ -182,15 +163,12 @@ namespace Qemu_GUI
private void optHostCDROM_CheckedChanged(object sender, System.EventArgs e)
{
cboCDROM.Enabled = !optCDImage.Checked;
btnBrowseCDROM.Enabled = optCDImage.Checked;
txtCDROM.Enabled = false;
}
private void optCDImage_CheckedChanged(object sender, System.EventArgs e)
{
cboCDROM.Enabled = !optCDImage.Checked;
btnBrowseCDROM.Enabled = optCDImage.Checked;
txtCDROM.Enabled = true;
}
@ -333,7 +311,6 @@ namespace Qemu_GUI
{
folderBrowserDialog1.Description = "Select Qemu path";
folderBrowserDialog1.ShowNewFolderButton = false;
folderBrowserDialog1.RootFolder = Environment.SpecialFolder.Programs;
if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
{
@ -346,7 +323,6 @@ namespace Qemu_GUI
{
folderBrowserDialog1.Description = "Select VDK path";
folderBrowserDialog1.ShowNewFolderButton = false;
folderBrowserDialog1.RootFolder = Environment.SpecialFolder.Programs;
if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
{
@ -358,6 +334,50 @@ namespace Qemu_GUI
#endregion
#region Settings
private void LoadDefaultConfig()
{
/* Load the default config file */
bool bLoaded = false;
RegistryKey RegKey = Registry.CurrentUser.OpenSubKey(strRegKey);
if (RegKey != null)
{
string DefaultConfig = (string)RegKey.GetValue(strDefCon);
if (File.Exists(DefaultConfig))
{
XmlSerializer s = new XmlSerializer(typeof(Data));
TextReader r = new StreamReader(DefaultConfig);
data = (Data)s.Deserialize(r);
r.Close();
LoadSettings();
bLoaded = true;
this.Text += " - " +DefaultConfig;
}
else
{
MessageBox.Show("Unable to load the default config file");
}
RegKey.Close();
}
if (!bLoaded)
{
/* if no settings file found, fallback to hardcoded defaults */
/* Network */
VNic nic = new VNic("", NicModel.ne2k_pci);
VUser use = new VUser("reactos", 0);
data.Network.AddNetString(nic.ToString() + use.ToString());
string[] lans = data.Network.GetNetStrings();
listVLANs.Items.Add(lans[0]);
}
}
private void btnSave_Click(object sender, EventArgs e)
{
XmlSerializer s;
@ -378,22 +398,15 @@ namespace Qemu_GUI
catch (Exception ex)
{
ErrorForm error = new ErrorForm();
error.txtError.Text = "Error trying to save settings, contact developers with error log!";
error.txtError.Text = "Error trying to save settings!";
error.txtError.Text += "Exception Info:" + Environment.NewLine + ex.Message;
error.txtError.Text += Environment.NewLine + ex.StackTrace;
}
}
}
private void btnClose_Click(object sender, EventArgs e)
{
Close();
}
private void LoadSettings()
{
string[] temp;
/* General */
cboMachine.SelectedIndex = (int) data.General.Machine;
try
@ -402,7 +415,7 @@ namespace Qemu_GUI
}
catch (Exception)
{
numMemory.Value = 64;
numMemory.Value = 128;
}
try
{
@ -426,10 +439,8 @@ namespace Qemu_GUI
txtHDC.Text = "Used for CD-ROM!";
txtHDC.Enabled = false;
}
optHostCDROM.Checked = data.CDROM.UseFromHost;
optCDImage.Checked = !data.CDROM.UseFromHost;
txtCDROM.Text = data.CDROM.Image;
cboCDROM.Text = data.CDROM.HostDrive;
/* Floppies */
chkFloppyA.Checked = data.Floppies.FDD[0].Enabled;
@ -470,21 +481,12 @@ namespace Qemu_GUI
txtGDBPort.Text = data.Debug.GDBPort.ToString();
/* Network */
foreach (string a in data.Network.VNicStringReader())
string[] temp = data.Network.GetNetStrings();
listVLANs.Items.Clear();
if(temp[0] != null)
for (int i = 0; i < data.Network.Count; i++)
{
listVLANs.Items.Add(a.ToString());
temp = a.Split(' ');
if (temp[1].Contains("user"))
{
VUser vnic = new VUser();
vnic.vlan = Int32.Parse(temp[1].Substring(10, 1));
vnic.hostname = temp[1].Substring(21);
VLanlist.Add(vnic);
}
else
{
MessageBox.Show("unimplemented setting load for network!");
}
listVLANs.Items.Add(temp[i]);
}
/* Tools */
@ -521,9 +523,7 @@ namespace Qemu_GUI
data.Floppies.FDD[1].Path = txtFloppyB.Text;
/* CD-ROM */
data.CDROM.UseFromHost = optHostCDROM.Checked;
data.CDROM.Image = txtCDROM.Text;
data.CDROM.HostDrive = cboCDROM.Text;
data.CDROM.Enabled = chkUseCDROM.Checked;
/* Harddisks */
@ -553,11 +553,12 @@ namespace Qemu_GUI
data.Debug.GDBPort = Int32.Parse(txtGDBPort.Text);
/* Network */
for (int i = 0; i < VLanlist.Count; i++)
for (int i = 0; i < listVLANs.Items.Count; i++)
{
string vlan = VLanlist[i].ToString();
data.Network.VNicString += vlan;
if(data.Network.GetNetStrings()[i] != listVLANs.Items[i].Text)
data.Network.AddNetString(listVLANs.Items[i].ToString());
}
/* Tools */
data.Tools.vdk.Image = txtVDKImage.Text;
data.Tools.vdk.DriveLetter = cboVDKDrive.Text;
@ -605,9 +606,9 @@ namespace Qemu_GUI
data.Paths.VDK = txtVDKPath.Text;
/* Check out if we have a vdk path and a image path */
if (data.Tools.vdk.Image == "" || data.Paths.VDK == "")
if (!File.Exists(data.Tools.vdk.Image) || !Directory.Exists(data.Paths.VDK))
{
/* we don't do nothing */
MessageBox.Show("Error on vdk path or image target");
return;
}
runner = new Runner(data);
@ -634,38 +635,11 @@ namespace Qemu_GUI
#region Network
public static ArrayList VLanlist = new ArrayList();
/* Please fix this entire section */
private void btnNetAdd_Click(object sender, EventArgs e)
{
if (rbtnNetUser.Checked == true)
{
VUser item = new VUser();
if (txtNetHost.Text == "")
item.hostname = "host";
else
item.hostname = txtNetHost.Text;
item.vlan = VLanlist.Count;
listVLANs.Items.Add(item.ToString());
VLanlist.Add(item);
}
if (rbtnNetNic.Checked == true)
{
VNic item = new VNic();
if (txtNicMACaddr.Text == "")
item.macAddress = "";//???
else
item.macAddress = txtNicMACaddr.Text;
item.vlan = VLanlist.Count;
listVLANs.Items.Add(item.ToString());
VLanlist.Add(item);
}
}
@ -681,11 +655,11 @@ namespace Qemu_GUI
private void btnNetRemove_Click(object sender, EventArgs e)
{
for (int i = 0; i < listVLANs.SelectedIndices.Count; i++)
{
VLanlist.RemoveAt(listVLANs.SelectedIndices[i]);
listVLANs.Items.RemoveAt(listVLANs.SelectedIndices[i]);
}
//for (int i = 0; i < listVLANs.SelectedIndices.Count; i++)
//{
// VLanlist.RemoveAt(listVLANs.SelectedIndices[i]);
// listVLANs.Items.RemoveAt(listVLANs.SelectedIndices[i]);
//}
}
#endregion
@ -715,7 +689,7 @@ namespace Qemu_GUI
/* check the QEmu path */
if (!Directory.Exists(data.Paths.Qemu))
{
MessageBox.Show("\"" + data.Paths.Qemu + "\"" + " does not exist", "Error - QEmu path");
MessageBox.Show("Qemu path does not exist", "Error - Qemu path");
return;
}
@ -730,7 +704,7 @@ namespace Qemu_GUI
}
else
{
MessageBox.Show("\"" + data.Harddisks.HDD[i].Path + "\"" + " does not exist", "Error - Harddisk file");
MessageBox.Show("\"" + data.Harddisks.HDD[i].Path + "\"" + " image does not exist", "Error - Harddisk image");
return;
}
}
@ -746,35 +720,38 @@ namespace Qemu_GUI
}
else
{
MessageBox.Show("\"" + data.Floppies.FDD[i].Path + "\"" + " does not exist", "Error - Floppy File");
MessageBox.Show("\"" + data.Floppies.FDD[i].Path + "\"" + " image does not exist", "Error - Floppy image");
return;
}
}
}
/* ensure we have a correct CD image if we need to boot from it */
if (optCDImage.Enabled && txtCDROM.Text.Length > 0)
if ((txtCDROM.Text.Length > 0) && (File.Exists(data.CDROM.Image)))
{
if (!File.Exists(txtCDROM.Text))
{
MessageBox.Show("\"" + txtCDROM.Text + "\"" + " does not exist", "Error - CD-ROM image");
return;
}
data.CDROM.Enabled = true;
}
else
{
data.CDROM.Enabled = false;
}
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
{
/* we must know where to look for qemu */
if (data.Paths.Qemu.Length == 0)
MessageBox.Show("Please specify Qemu Path!", "Error");
else
{
runner = new Runner(data);
runner.StartQemu((Platforms)cboMachine.SelectedIndex);
}
MessageBox.Show("Must enable atleast 1 Hard disk, CD-Rom or Floppy disk!", "Error");
return;
}
if ((data.General.BootFrom == "Floppy" && !HasFDisk) || (data.General.BootFrom == "Hardisk" && !HasHDisk) ||
(data.General.BootFrom == "CD-ROM" && !data.CDROM.Enabled))
{
MessageBox.Show("Booting from invalid media!", "Error");
return;
}
runner = new Runner(data);
runner.StartQemu((Platforms)cboMachine.SelectedIndex);
}
private void loadConfigToolStripMenuItem_Click(object sender, EventArgs e)
@ -792,8 +769,8 @@ namespace Qemu_GUI
s = new XmlSerializer(typeof(Data));
r = new StreamReader(openFile.FileName);
data = (Data)s.Deserialize(r);
LoadSettings();
this.Text += " - " + openFile.FileName;
}
catch (Exception ex)
{
@ -860,46 +837,22 @@ namespace Qemu_GUI
RegKey.Close();
}
}
LoadDefaultConfig();
}
private void LoadConfigFile()
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
/* Load the default config file */
bool bLoaded = false;
RegistryKey RegKey = Registry.CurrentUser.OpenSubKey(strRegKey);
if (RegKey != null)
{
string DefaultConfig = (string)RegKey.GetValue(strDefCon);
if (File.Exists(DefaultConfig))
{
XmlSerializer s = new XmlSerializer(typeof(Data));
TextReader r = new StreamReader(DefaultConfig);
data = (Data)s.Deserialize(r);
r.Close();
LoadSettings();
bLoaded = true;
}
else
{
MessageBox.Show("Unable to load the default config file");
}
RegKey.Close();
}
if (!bLoaded)
{
/* if no settings file found, fallback to hardcoded defaults */
/* Network */
VUser def = new VUser();
def.vlan = 0;
def.hostname = "host";
listVLANs.Items.Add(def.ToString());
VLanlist.Add(def);
}
Application.Exit();
}
private void btnStop_Click(object sender, EventArgs e)
{
try
{
runner.StopQemu();
}
catch { }
}
}
}

View File

@ -4,46 +4,74 @@ using System.Text;
namespace Qemu_GUI
{
public enum NicModel
{
ne2k_pci,//rtl8029
ne2k_isa,//rtl8029
rtl8139,
//smc91c11,
pcnet
};
public abstract class VLan
{
public int vlan;
public abstract override string ToString();
public VLan()
{
}
public VLan() { }
}
public class VUser : VLan
{
public string hostname;
public VUser() { }
public VUser(string host, int vl)
{
hostname = host;
vlan = vl;
}
public override string ToString()
{
return "-net user,vlan=" + vlan + ",hostname=" + hostname + " ";
//-net user[,vlan=n][,hostname=host]
return "-net user,vlan=" + vlan + ",hostname=" + hostname + " ";
}
}
public class VNic : VLan
{
public string macAddress;
public string NicModel;
public NicModel _NicModel;
public VNic() { }
public VNic(string mac, NicModel mod)
{
macAddress = mac;
_NicModel = mod;
}
public override string ToString()
{
return " ";
//-net nic[,vlan=n][,macaddr=addr][,model=type]
if(macAddress != "")
return "-net nic,vlan=" + vlan + ",macaddr=" + macAddress + ",model=" + _NicModel + " ";
else
return "-net nic,vlan=" + vlan + ",model=" + _NicModel + " ";
}
}
/* FIXME: Unimplemented */
public class VTap : VLan
{
public override string ToString()
{
return " ";
}
}
/* Unimplemented */
//public class VTap : VLan
//{
// public override string ToString()
// {
// return " ";
// }
//}
/* FIXME: Unimplemented */
/* Unimplemented */
//public class Socket : VLan
//{
// public override string ToString()

View File

View File

@ -1 +0,0 @@

View File

@ -60,6 +60,13 @@ namespace Qemu_GUI.Properties {
}
}
internal static System.Drawing.Bitmap advanced {
get {
object obj = ResourceManager.GetObject("advanced", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap audio {
get {
object obj = ResourceManager.GetObject("audio", resourceCulture);
@ -67,6 +74,13 @@ namespace Qemu_GUI.Properties {
}
}
internal static System.Drawing.Bitmap cdrom {
get {
object obj = ResourceManager.GetObject("cdrom", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap copy {
get {
object obj = ResourceManager.GetObject("copy", resourceCulture);
@ -74,11 +88,102 @@ namespace Qemu_GUI.Properties {
}
}
internal static System.Drawing.Bitmap debug {
get {
object obj = ResourceManager.GetObject("debug", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap harddisk {
get {
object obj = ResourceManager.GetObject("harddisk", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap launch {
get {
object obj = ResourceManager.GetObject("launch", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap machine {
get {
object obj = ResourceManager.GetObject("machine", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap MainSaveIcon {
get {
object obj = ResourceManager.GetObject("MainSaveIcon", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap memory {
get {
object obj = ResourceManager.GetObject("memory", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap mount {
get {
object obj = ResourceManager.GetObject("mount", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap network {
get {
object obj = ResourceManager.GetObject("network", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap power {
get {
object obj = ResourceManager.GetObject("power", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap preferences_system {
get {
object obj = ResourceManager.GetObject("preferences-system", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap save {
get {
object obj = ResourceManager.GetObject("save", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap screenshot {
get {
object obj = ResourceManager.GetObject("screenshot", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap snapshot {
get {
object obj = ResourceManager.GetObject("snapshot", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap stop {
get {
object obj = ResourceManager.GetObject("stop", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

View File

@ -119,12 +119,57 @@
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="copy" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\copy.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<value>..\resources\copy.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="launch" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\launch.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="memory" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\direct\memory.ico;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="audio" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\audio.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<value>..\resources\audio.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="snapshot" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\snapshot.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="stop" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\stop.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="advanced" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\direct\advanced.ico;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="cdrom" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\direct\cdrom.ico;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="power" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\direct\power.ico;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="MainSaveIcon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\save.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<value>..\Resources\save.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="save" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\save.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="harddisk" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\direct\harddisk.ico;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="preferences-system" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\preferences-system.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="debug" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\direct\debug.ico;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="screenshot" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\screenshot.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="mount" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\mount.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="machine" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\machine.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="network" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\direct\network.ico;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

View File

@ -174,10 +174,29 @@
<SubType>Designer</SubType>
<DependentUpon>AboutForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Resources\audio.bmp" />
<Content Include="Resources\copy.bmp" />
<Content Include="Resources\add.png" />
<Content Include="Resources\audio.png" />
<Content Include="Resources\copy.png" />
<Content Include="Resources\del.png" />
<None Include="Resources\direct\advanced.ico" />
<None Include="Resources\direct\memory.ico" />
<None Include="Resources\direct\power.ico" />
<None Include="Resources\direct\harddisk.ico" />
<None Include="Resources\direct\cdrom.ico" />
<None Include="Resources\direct\debug.ico" />
<None Include="Resources\direct\network.ico" />
<Content Include="Resources\exit.png" />
<Content Include="Resources\help.png" />
<Content Include="Resources\machine.png" />
<Content Include="Resources\launch.png" />
<Content Include="Resources\MainSaveIcon.bmp" />
<Content Include="Resources\mount.png" />
<Content Include="Resources\preferences-system.png" />
<Content Include="Resources\save.png" />
<Content Include="Resources\screenshot.png" />
<Content Include="Resources\snapshot.png" />
<Content Include="Resources\stop.png" />
<Content Include="ros.ico" />
<None Include="Resources\save.bmp" />
</ItemGroup>
<ItemGroup>
<BaseApplicationManifest Include="Properties\app.manifest" />
@ -189,4 +208,4 @@
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>
</Project>

View File

@ -1,58 +0,0 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<LastOpenVersion>7.10.3077</LastOpenVersion>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ReferencePath>
</ReferencePath>
<CopyProjectDestinationFolder>
</CopyProjectDestinationFolder>
<CopyProjectUncPath>
</CopyProjectUncPath>
<CopyProjectOption>0</CopyProjectOption>
<ProjectView>ProjectFiles</ProjectView>
<ProjectTrust>0</ProjectTrust>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<EnableASPDebugging>false</EnableASPDebugging>
<EnableASPXDebugging>false</EnableASPXDebugging>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
<EnableSQLServerDebugging>false</EnableSQLServerDebugging>
<RemoteDebugEnabled>false</RemoteDebugEnabled>
<RemoteDebugMachine>
</RemoteDebugMachine>
<StartAction>Project</StartAction>
<StartArguments>
</StartArguments>
<StartPage>
</StartPage>
<StartProgram>
</StartProgram>
<StartURL>
</StartURL>
<StartWorkingDirectory>
</StartWorkingDirectory>
<StartWithIE>true</StartWithIE>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<EnableASPDebugging>false</EnableASPDebugging>
<EnableASPXDebugging>false</EnableASPXDebugging>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
<EnableSQLServerDebugging>false</EnableSQLServerDebugging>
<RemoteDebugEnabled>false</RemoteDebugEnabled>
<RemoteDebugMachine>
</RemoteDebugMachine>
<StartAction>Project</StartAction>
<StartArguments>
</StartArguments>
<StartPage>
</StartPage>
<StartProgram>
</StartProgram>
<StartURL>
</StartURL>
<StartWorkingDirectory>
</StartWorkingDirectory>
<StartWithIE>false</StartWithIE>
</PropertyGroup>
</Project>

Binary file not shown.

BIN
Resources/add.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 400 B

BIN
Resources/audio.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 B

BIN
Resources/copy.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 824 B

BIN
Resources/del.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
Resources/direct/audio.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
Resources/direct/cdrom.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
Resources/direct/debug.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
Resources/direct/floppy.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
Resources/direct/memory.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
Resources/direct/power.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
Resources/exit.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 B

BIN
Resources/help.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 916 B

BIN
Resources/launch.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 447 B

BIN
Resources/machine.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 463 B

BIN
Resources/mount.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 908 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 511 B

BIN
Resources/save.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 824 B

BIN
Resources/screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 688 B

BIN
Resources/snapshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 776 B

BIN
Resources/stop.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 456 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -4,6 +4,8 @@ using System.Text;
using System.Threading;
using System.Diagnostics;
using System.Windows.Forms;
using System.Security.Permissions;
using System.Security.Principal;
namespace Qemu_GUI
{
@ -26,10 +28,14 @@ namespace Qemu_GUI
p.EnableRaisingEvents = true;
p.Exited += new EventHandler(ProcessStop);
//FIXME: remove when pipe client works
temp_path = Application.StartupPath + "\\";
}
public void StopQemu()
{
p.CloseMainWindow();
}
public bool StartQemu(Platforms Platform)
{
switch (Platform)
@ -58,10 +64,15 @@ namespace Qemu_GUI
break;
}
if (!File.Exists(p.StartInfo.FileName))
{
MessageBox.Show("Required qemu executable does not exist in path", "Error - Qemu path");
return false;
}
if (data.Debug.SerialPort.SRedirect)
{
/* create a random name */
//FIXME: rewrite when pipe client works
string filename = "serial" + DateTime.UtcNow.Ticks.ToString() + ".txt";
data.Debug.SerialPort.FileName = temp_path + filename;
}
@ -75,18 +86,9 @@ namespace Qemu_GUI
output = new DebugForm();
/* create a random name */
//FIXME: rewrite when pipe client works
/* create a unic name */
string filename = "serial" + DateTime.UtcNow.Ticks.ToString() + ".txt";
data.Debug.SerialPort.FileName = temp_path + filename;
if (File.Exists(data.Debug.SerialPort.FileName))
{
try
{
File.Delete(data.Debug.SerialPort.FileName);
}
catch { }
}
}
p.StartInfo.Arguments = data.GetArgv();
}
@ -125,6 +127,12 @@ namespace Qemu_GUI
string argv = " create -f " + Format + " \"" + FileName + "\" " + d.ToString();
p.StartInfo.FileName = data.Paths.Qemu + "\\qemu-img.exe";
if (!File.Exists(p.StartInfo.FileName))
{
MessageBox.Show("qemu-img.exe does not existin path", "Error - Qemu path");
return false;
}
p.StartInfo.WorkingDirectory = data.Paths.Qemu;
p.StartInfo.Arguments = argv;
try
@ -150,6 +158,19 @@ namespace Qemu_GUI
public bool MountImage()
{
WindowsPrincipal prin = new WindowsPrincipal(WindowsIdentity.GetCurrent());
PrincipalPermission perm = new PrincipalPermission(prin.Identity.ToString(), WindowsBuiltInRole.Administrator.ToString());
try
{
perm.Demand();
}
catch
{
MessageBox.Show("Request for Administrator privilages failed.\n VDK may not function.","Info");
//return false;
}
bool success = StartVdkService();
if (success == true)
@ -168,8 +189,7 @@ namespace Qemu_GUI
success = false;
}
}
if (success == false)
else
{
ErrorForm error = new ErrorForm();
error.txtError.Text = ErrBuffer;
@ -198,9 +218,10 @@ namespace Qemu_GUI
error.ShowDialog();
return false;
}
StopVdkService();
return true;
}
private bool StartVdkService()
{
string buffer;
@ -227,7 +248,21 @@ namespace Qemu_GUI
}
else
return true;
}
private void StopVdkService()
{
p.StartInfo.FileName = data.Paths.VDK + "\\vdk.exe";
p.StartInfo.WorkingDirectory = data.Paths.VDK;
p.StartInfo.Arguments = "stop";
try
{
p.Start();
}
catch
{
//if we cant execute vdk.exe, this doesnt matter.
//if we failed to stop the vdk for some other reason, we cant do anything about it.
}
}
public void ProcessStop(object sender, EventArgs e)

0
res/.gitignore vendored
View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB