mirror of
https://github.com/reactos/RosTE.git
synced 2024-11-26 21:00:31 +00:00
only allow the user to select qemu harddisks which are not already being used
svn path=/trunk/tools/RosTE/; revision=264
This commit is contained in:
parent
cc7ef61b33
commit
dcb849141e
@ -1,10 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.Collections;
|
||||
|
||||
namespace RosTEGUI
|
||||
{
|
||||
@ -35,9 +32,29 @@ namespace RosTEGUI
|
||||
get { return newhdBoot.Checked; }
|
||||
}
|
||||
|
||||
public NewHardDiskForm()
|
||||
public NewHardDiskForm(ArrayList curDrives)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
string[] allDrives = { "hda", "hdb", "hdd" };
|
||||
|
||||
foreach (string str in allDrives)
|
||||
{
|
||||
bool found = false;
|
||||
|
||||
foreach (string drive in curDrives)
|
||||
{
|
||||
if (string.Compare(drive, str, true) == 0)
|
||||
{
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
newhdDrive.Items.Add(str);
|
||||
}
|
||||
|
||||
if (newhdDrive.Items.Count > 0)
|
||||
newhdDrive.SelectedIndex = 0;
|
||||
}
|
||||
}
|
||||
}
|
@ -321,7 +321,15 @@ namespace RosTEGUI
|
||||
{
|
||||
if (harddiskLstBox.Items.Count < 3)
|
||||
{
|
||||
NewHardDiskForm hdf = new NewHardDiskForm();
|
||||
ArrayList curDrives = new ArrayList(3);
|
||||
ArrayList hardDisks = VirtMach.GetHardDisks();
|
||||
|
||||
foreach (VMHardDrive vmhd in hardDisks)
|
||||
{
|
||||
curDrives.Add(vmhd.Drive);
|
||||
}
|
||||
|
||||
NewHardDiskForm hdf = new NewHardDiskForm(curDrives);
|
||||
if (hdf.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
VMHardDrive vmhd = VirtMach.AddHardDisk(hdf.DiskName,
|
||||
|
Loading…
Reference in New Issue
Block a user