Skip to content
This repository was archived by the owner on Aug 23, 2025. It is now read-only.

Commit cdb8ead

Browse files
committed
Features and fixes for 1.4.0
Added sortable VM list from issue #9 Added import VM feature from issue #38 Added more VM management features from issue #2 Fixed issue #39 Fixed issue #46 Fixed issue #44 Various minor UI and code changes
1 parent 1fafe0f commit cdb8ead

File tree

11 files changed

+813
-142
lines changed

11 files changed

+813
-142
lines changed

86BoxManager/86BoxManager.csproj

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@
8989
<Compile Include="dlgAddVM.Designer.cs">
9090
<DependentUpon>dlgAddVM.cs</DependentUpon>
9191
</Compile>
92+
<Compile Include="dlgCloneVM.cs">
93+
<SubType>Form</SubType>
94+
</Compile>
95+
<Compile Include="dlgCloneVM.Designer.cs">
96+
<DependentUpon>dlgCloneVM.cs</DependentUpon>
97+
</Compile>
9298
<Compile Include="dlgEditVM.cs">
9399
<SubType>Form</SubType>
94100
</Compile>
@@ -117,6 +123,9 @@
117123
<EmbeddedResource Include="dlgAddVM.resx">
118124
<DependentUpon>dlgAddVM.cs</DependentUpon>
119125
</EmbeddedResource>
126+
<EmbeddedResource Include="dlgCloneVM.resx">
127+
<DependentUpon>dlgCloneVM.cs</DependentUpon>
128+
</EmbeddedResource>
120129
<EmbeddedResource Include="dlgEditVM.resx">
121130
<DependentUpon>dlgEditVM.cs</DependentUpon>
122131
</EmbeddedResource>

86BoxManager/dlgAbout.Designer.cs

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

86BoxManager/dlgAddVM.Designer.cs

Lines changed: 58 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

86BoxManager/dlgAddVM.cs

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ namespace _86boxManager
77
public partial class dlgAddVM : Form
88
{
99
private frmMain main = (frmMain)Application.OpenForms["frmMain"]; //Instance of frmMain
10+
private bool existingVM = false; //Is this importing an existing VM or not
1011

1112
public dlgAddVM()
1213
{
@@ -19,16 +20,28 @@ private void btnAdd_Click(object sender, EventArgs e)
1920
if (main.VMCheckIfExists(txtName.Text))
2021
{
2122
MessageBox.Show("A virtual machine with this name already exists. Please pick a different name.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
23+
return;
2224
}
23-
else if(txtName.Text.IndexOfAny(Path.GetInvalidFileNameChars()) >= 0)
25+
if (txtName.Text.IndexOfAny(Path.GetInvalidFileNameChars()) >= 0)
2426
{
2527
MessageBox.Show("There are invalid characters in the name you specified. You can't use the following characters: \\ / : * ? \" < > |", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
28+
return;
29+
}
30+
if (existingVM && string.IsNullOrWhiteSpace(txtImportPath.Text))
31+
{
32+
MessageBox.Show("If you wish to import VM files, you must specify a path.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
33+
return;
34+
}
35+
36+
if (existingVM)
37+
{
38+
main.VMImport(txtName.Text, txtDescription.Text, txtImportPath.Text, cbxOpenCFG.Checked, cbxStartVM.Checked);
2639
}
2740
else
2841
{
2942
main.VMAdd(txtName.Text, txtDescription.Text, cbxOpenCFG.Checked, cbxStartVM.Checked);
30-
Close();
3143
}
44+
Close();
3245
}
3346

3447
private void dlgAddVM_Load(object sender, EventArgs e)
@@ -60,5 +73,26 @@ private void txtName_TextChanged(object sender, EventArgs e)
6073
}
6174
}
6275
}
76+
77+
private void btnBrowse_Click(object sender, EventArgs e)
78+
{
79+
FolderBrowserDialog fbd = new FolderBrowserDialog();
80+
fbd.Description = "Select a folder with virtual machine files to import.";
81+
fbd.ShowNewFolderButton = true;
82+
fbd.RootFolder = Environment.SpecialFolder.MyComputer;
83+
DialogResult result = fbd.ShowDialog();
84+
if (result == DialogResult.OK)
85+
{
86+
txtImportPath.Text = fbd.SelectedPath;
87+
txtName.Text = Path.GetFileName(fbd.SelectedPath);
88+
}
89+
}
90+
91+
private void cbxImport_CheckedChanged(object sender, EventArgs e)
92+
{
93+
existingVM = true;
94+
txtImportPath.Enabled = cbxImport.Checked;
95+
btnBrowse.Enabled = cbxImport.Checked;
96+
}
6397
}
64-
}
98+
}

0 commit comments

Comments
 (0)