Skip to content

Commit

Permalink
disk page new layout
Browse files Browse the repository at this point in the history
  • Loading branch information
rounk-ctrl committed May 5, 2023
1 parent d723268 commit 6201044
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 38 deletions.
76 changes: 46 additions & 30 deletions QEMUWF/Form3.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions QEMUWF/Form3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ private void trackBar1_Scroll(object sender, EventArgs e)
private void cretNew_CheckedChanged(object sender, EventArgs e)
{
Core.SetDynamicControls2(true, cretNew, choosExistig, label12, label14, numericUpDown2, textBox3, textBox2, button1, checkBox1);
if (cretNew.Checked)
{
comboBox6.Enabled = true;
}
else
comboBox6.Enabled = false;
}

private void button1_Click_1(object sender, EventArgs e)
Expand All @@ -87,8 +93,10 @@ private void button1_Click_1(object sender, EventArgs e)
fileDialog.Multiselect = false;
fileDialog.Filter =
"QEMU Copy On Write 2 (*.qcow2)|*.qcow2|QEMU Copy On Write (*.qcow)|*.qcow|Microsoft Virtual Hard Disk (*.vhd)|*.vhd|Microsoft Virtual Hard Disk Extended (*.vhdx)|*.vhdx|Raw disk (*.raw)|*.raw|Raw disk (*.img)|*.img|All files (*.*)|*.*";
fileDialog.ShowDialog();
textBox2.Text = fileDialog.FileName;
if (fileDialog.ShowDialog() == DialogResult.OK)
{
textBox2.Text = fileDialog.FileName;
}
}

private void comboBox4_SelectedIndexChanged(object sender, EventArgs e)
Expand Down Expand Up @@ -125,6 +133,7 @@ private void comboBox5_SelectedIndexChanged(object sender, EventArgs e)
private void Form3_Shown(object sender, EventArgs e)
{
Core.SetStaticControls(trackBar1, trackBar2, comboBox1, comboBox2, comboBox4, tabControl1, numericUpDown1);
comboBox6.SelectedIndex = 0;
}
}
}
27 changes: 21 additions & 6 deletions QEMUWF/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,27 @@ static void Main()
string s = Properties.Settings.Default.qemuPath;
if (string.IsNullOrEmpty(s) || !Directory.Exists(s) || (Directory.Exists(s) && !File.Exists(Path.Combine(s, "qemu-system-i386.exe"))))
{
FolderPicker dialog = new FolderPicker();
dialog.Title = "Select the folder where Qemu is installed.";
if (dialog.ShowDialog(IntPtr.Zero) == true)
{
Properties.Settings.Default.qemuPath = dialog.ResultPath;
Properties.Settings.Default.Save();
bool found = false;
while (!found)
{
FolderPicker dialog = new FolderPicker
{
Title = "Select the folder where QEMU is installed"
};
if (dialog.ShowDialog(IntPtr.Zero) == true)
{
if (File.Exists(Path.Combine(dialog.ResultPath, "qemu-system-i386.exe")))
{
Properties.Settings.Default.qemuPath = dialog.ResultPath;
Properties.Settings.Default.Save();
found = true;
break;
}
else
{
MessageBox.Show("QEMU not found");
}
}
}
}
Application.Run(new Form1());
Expand Down

0 comments on commit 6201044

Please sign in to comment.