Beispiel #1
0
        private void OnConfigureDevice(object o, EventArgs args)
        {
            IVirtualDevice dev = devview.GetSelectedDevice ();

            Dialog dialog = null;

            switch (dev.DeviceType) {
            case VirtualDeviceType.HardDisk:
                VirtualHardDisk disk = (dev as VirtualHardDisk);
                dialog = new HardDiskConfigDialog ((VirtualHardDisk) dev,
                                                   disk.FileName == null || !File.Exists (disk.FileName),
                                                   this);
                break;
            case VirtualDeviceType.Ethernet:
                dialog = new EthernetConfigDialog ((VirtualEthernet) dev, this);
                break;
            case VirtualDeviceType.CdRom:
                dialog = new CdConfigDialog ((VirtualCdDrive) dev, this);
                break;
            default:
                break;
            }

            if (dialog != null) {
                dialog.Response += delegate {
                    devview.QueueDraw ();
                };

                dialog.Show ();
            }
        }
Beispiel #2
0
        private void OnAddHardDisk(object o, EventArgs args)
        {
            VirtualHardDisk disk = new VirtualHardDisk (0, 0, DiskBusType.Ide, (long) 6 * 1024 * 1024 * 1024);

            HardDiskConfigDialog dialog = new HardDiskConfigDialog (disk, true, this);
            dialog.Response += delegate (object b, ResponseArgs rargs) {
                if (rargs.ResponseId == ResponseType.Ok) {
                    machine.AddHardDisk (disk);
                }
            };

            dialog.Show ();
        }