Skip to content

Commit a5034af

Browse files
authored
Prepared Version 0.4
1 parent a887483 commit a5034af

23 files changed

+479
-154
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1-
# EmuGUI (insert version here)
1+
# EmuGUI v0.4
22

33
- Updated TESTED.md
4+
- Commented the code
5+
- Fixed a raw issue
6+
- Added USB support
7+
- The USB Tablet checkbox is now depreciated and will be removed in a future update.
8+
- Added USB keyboard support
9+
- Added experimental ARM support
10+
- Added python-magic instructions to README.md
411

512
# EmuGUI v0.3
613

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ HDD: 2 GB¹
4949
8. After that is done, type: `python -m venv your-venv-name`. You can call it whatever you want, but don't forget that it is NOT allowed to get into the EmuGUI repository under any circumstances. That's why Git is only going to be used to clone the code, but not to commit - that's to be done manually.
5050
9. Wait until VS Code notices your venv and select it. You might need to restart the editor for it to recognize your virtual environment after it has been created.
5151
10. With your virtual environment selected, try to run a Python script. If it throws an error, that's okay. We just need to activate the venv anyway.
52-
11. Within the terminal VS Code just opened, type: `pip install --upgrade pip PyInstaller PyQt6 PyQt6-tools PySide6`
52+
11. Within the terminal VS Code just opened, type: `pip install --upgrade pip PyInstaller PyQt6 PyQt6-tools PySide6 python-magic-bin`
5353
12. After this is done, run the main.py script.
5454
13. To compile the program for users who don't have Python installed, type: `PyInstaller --onefile .\main.py`
5555
14. After that is finished, copy the code into the dist folder PyInstaller created.
352 Bytes
Binary file not shown.
181 Bytes
Binary file not shown.
768 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

dialogExecution/editVirtualMachine.py

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
class EditVirtualMachineDialog(QDialog, Ui_Dialog):
1212
def __init__(self, parent=None):
13+
# This is preparing the dialog required.
1314
super().__init__(parent)
1415
self.setupUi(self)
1516
self.connectSignalsSlots()
@@ -47,7 +48,7 @@ def connectSignalsSlots(self):
4748
self.pushButton_11.clicked.connect(self.vhdMenu)
4849
self.pushButton_12.clicked.connect(self.close)
4950

50-
# Page 2.4 (aarch64 machine preparation)
51+
# Page 2.4 (aarch64/arm machine preparation)
5152
self.pushButton_33.clicked.connect(self.firstStage)
5253
self.pushButton_34.clicked.connect(self.vhdMenu)
5354
self.pushButton_35.clicked.connect(self.close)
@@ -86,6 +87,8 @@ def connectSignalsSlots(self):
8687
self.pushButton_20.clicked.connect(self.finishCreation)
8788
self.pushButton_21.clicked.connect(self.close)
8889

90+
# First, it will check the architecture of your VM.
91+
8992
def machineCpuI386Amd64(self, machine, cpu):
9093
i = 0
9194

@@ -179,6 +182,8 @@ def readTempVmFile(self):
179182
vmSpecNew = vmSpec.replace("\n", "")
180183
vmSpecs.append(vmSpecNew)
181184

185+
# Setting VM variables
186+
182187
self.lineEdit.setText(vmSpecs[0])
183188

184189
if vmSpecs[1] == "i386":
@@ -201,7 +206,7 @@ def readTempVmFile(self):
201206
self.machineCpuPpc(vmSpecs[2], vmSpecs[3])
202207
self.spinBox_2.setValue(int(vmSpecs[4]))
203208

204-
elif vmSpecs[1] == "aarch64":
209+
elif vmSpecs[1] == "aarch64" or self.comboBox.currentText() == "arm":
205210
self.comboBox.setCurrentIndex(4)
206211
self.machineCpuAarch64(vmSpecs[2], vmSpecs[3])
207212
self.spinBox_5.setValue(int(vmSpecs[4]))
@@ -261,9 +266,23 @@ def readTempVmFile(self):
261266
self.lineEdit_8.setText(vmSpecs[18])
262267
self.spinBox_6.setValue(int(vmSpecs[17]))
263268

269+
i = 0
270+
271+
while i < self.comboBox_16.count():
272+
if self.comboBox_16.itemText(i) == vmSpecs[19]:
273+
self.comboBox_16.setCurrentIndex(i)
274+
break
275+
276+
i += 1
277+
278+
if vmSpecs[20] == "1":
279+
self.checkBox_3.setChecked(True)
280+
264281
return vmSpecs
265282

266283
def archSystem(self):
284+
# It checks name and architecture.
285+
267286
if platform.system() == "Windows":
268287
connection = platformSpecific.windowsSpecific.setupWindowsBackend()
269288

@@ -302,7 +321,7 @@ def archSystem(self):
302321
elif self.comboBox.currentText() == "mips64el":
303322
self.stackedWidget.setCurrentIndex(3)
304323

305-
elif self.comboBox.currentText() == "aarch64":
324+
elif self.comboBox.currentText() == "aarch64" or self.comboBox.currentText() == "arm":
306325
self.stackedWidget.setCurrentIndex(4)
307326

308327
except:
@@ -318,7 +337,7 @@ def archSystem(self):
318337
elif self.comboBox.currentText() == "mips64el":
319338
self.stackedWidget.setCurrentIndex(3)
320339

321-
elif self.comboBox.currentText() == "aarch64":
340+
elif self.comboBox.currentText() == "aarch64" or self.comboBox.currentText() == "arm":
322341
self.stackedWidget.setCurrentIndex(4)
323342

324343
except sqlite3.Error as e:
@@ -328,6 +347,8 @@ def vhdMenu(self):
328347
self.stackedWidget.setCurrentIndex(5)
329348

330349
def vhdBrowseLocation(self):
350+
# This code lets you browse the VHD location.
351+
331352
filename, filter = QFileDialog.getSaveFileName(parent=self, caption='Save VHD file', dir='.', filter='Hard disk file (*.img);;VirtualBox disk image (*.vdi);;VMware disk file (*.vmdk);;Virtual hard disk file with extra features (*.vhdx);;All files (*.*)')
332353

333354
if filename:
@@ -379,6 +400,8 @@ def win2kHacker(self):
379400
self.stackedWidget.setCurrentIndex(10)
380401

381402
def finishCreation(self):
403+
# This applies the changes to your VM.
404+
382405
if platform.system() == "Windows":
383406
connection = platformSpecific.windowsSpecific.setupWindowsBackend()
384407

@@ -402,7 +425,7 @@ def finishCreation(self):
402425
cpu = self.comboBox_7.currentText()
403426
ram = self.spinBox_3.value()
404427

405-
elif self.comboBox.currentText() == "aarch64":
428+
elif self.comboBox.currentText() == "aarch64" or self.comboBox.currentText() == "arm":
406429
machine = self.comboBox_14.currentText()
407430
cpu = self.comboBox_15.currentText()
408431
ram = self.spinBox_5.value()
@@ -479,14 +502,21 @@ def finishCreation(self):
479502
ext_bios_dir = self.lineEdit_3.text()
480503

481504
add_args = self.lineEdit_2.text()
505+
506+
if self.checkBox_3.isChecked():
507+
usb_support = 1
508+
509+
else:
510+
usb_support = 0
482511

483512
insert_into_vm_database = f"""
484513
UPDATE virtualmachines
485514
SET name = "{self.lineEdit.text()}", architecture = "{self.comboBox.currentText()}", machine = "{machine}", cpu = "{cpu}",
486515
ram = {ram}, hda = "{vhd}", vga = "{self.comboBox_10.currentText()}", net = "{networkAdapter}", usbtablet = {usbtablet},
487516
win2k = {win2k}, dirbios = "{ext_bios_dir}", additionalargs = "{add_args}", sound = "{self.comboBox_12.currentText()}",
488517
linuxkernel = "{self.lineEdit_4.text()}", linuxinitrid = "{self.lineEdit_5.text()}", linuxcmd = "{self.lineEdit_7.text()}",
489-
mousetype = "{self.comboBox_13.currentText()}", cores = {self.spinBox_6.value()}, filebios = "{self.lineEdit_8.text()}"
518+
mousetype = "{self.comboBox_13.currentText()}", cores = {self.spinBox_6.value()}, filebios = "{self.lineEdit_8.text()}",
519+
keyboardtype = "{self.comboBox_16.currentText()}", usbsupport = {usb_support}
490520
WHERE name = "{self.vmSpecs[0]}";
491521
"""
492522

dialogExecution/newVirtualMachine.py

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
class NewVirtualMachineDialog(QDialog, Ui_Dialog):
1212
def __init__(self, parent=None):
13+
# Initializing the dialog for creating the VM.
14+
1315
super().__init__(parent)
1416
self.setupUi(self)
1517
self.setWindowTitle("EmuGUI - Create new VM")
@@ -46,7 +48,7 @@ def connectSignalsSlots(self):
4648
self.pushButton_11.clicked.connect(self.vhdMenu)
4749
self.pushButton_12.clicked.connect(self.close)
4850

49-
# Page 2.4 (aarch64 machine preparation)
51+
# Page 2.4 (aarch64/arm machine preparation)
5052
self.pushButton_33.clicked.connect(self.firstStage)
5153
self.pushButton_34.clicked.connect(self.vhdMenu)
5254
self.pushButton_35.clicked.connect(self.close)
@@ -86,6 +88,8 @@ def connectSignalsSlots(self):
8688
self.pushButton_21.clicked.connect(self.close)
8789

8890
def archSystem(self):
91+
# Here, it checks the name first, than the architecture.
92+
8993
if platform.system() == "Windows":
9094
connection = platformSpecific.windowsSpecific.setupWindowsBackend()
9195

@@ -122,7 +126,7 @@ def archSystem(self):
122126
elif self.comboBox.currentText() == "mips64el":
123127
self.stackedWidget.setCurrentIndex(3)
124128

125-
elif self.comboBox.currentText() == "aarch64":
129+
elif self.comboBox.currentText() == "aarch64" or self.comboBox.currentText() == "arm":
126130
self.stackedWidget.setCurrentIndex(4)
127131

128132
except sqlite3.Error as e:
@@ -132,6 +136,8 @@ def vhdMenu(self):
132136
self.stackedWidget.setCurrentIndex(5)
133137

134138
def vhdBrowseLocation(self):
139+
# This code makes it possible to search a location for your VHD.
140+
135141
filename, filter = QFileDialog.getSaveFileName(parent=self, caption='Save VHD file', dir='.', filter='Hard disk file (*.img);;VirtualBox disk image (*.vdi);;VMware disk file (*.vmdk);;Virtual hard disk file with extra features (*.vhdx);;All files (*.*)')
136142

137143
if filename:
@@ -183,6 +189,8 @@ def win2kHacker(self):
183189
self.stackedWidget.setCurrentIndex(10)
184190

185191
def finishCreation(self):
192+
# This creates your VM in the first place
193+
186194
if platform.system() == "Windows":
187195
connection = platformSpecific.windowsSpecific.setupWindowsBackend()
188196

@@ -206,7 +214,7 @@ def finishCreation(self):
206214
cpu = self.comboBox_7.currentText()
207215
ram = self.spinBox_3.value()
208216

209-
elif self.comboBox.currentText() == "aarch64":
217+
elif self.comboBox.currentText() == "aarch64" or self.comboBox.currentText() == "arm":
210218
machine = self.comboBox_14.currentText()
211219
cpu = self.comboBox_15.currentText()
212220
ram = self.spinBox_5.value()
@@ -283,6 +291,12 @@ def finishCreation(self):
283291
ext_bios_dir = self.lineEdit_3.text()
284292

285293
add_args = self.lineEdit_2.text()
294+
295+
if self.checkBox_3.isChecked():
296+
usb_support = 1
297+
298+
else:
299+
usb_support = 0
286300

287301
insert_into_vm_database = f"""
288302
INSERT INTO virtualmachines (
@@ -304,7 +318,9 @@ def finishCreation(self):
304318
linuxcmd,
305319
mousetype,
306320
cores,
307-
filebios
321+
filebios,
322+
keyboardtype,
323+
usbsupport
308324
) VALUES (
309325
"{self.lineEdit.text()}",
310326
"{self.comboBox.currentText()}",
@@ -324,7 +340,9 @@ def finishCreation(self):
324340
"{self.lineEdit_7.text()}",
325341
"{self.comboBox_13.currentText()}",
326342
{self.spinBox_6.value()},
327-
"{self.lineEdit_8.text()}"
343+
"{self.lineEdit_8.text()}",
344+
"{self.comboBox_16.currentText()}",
345+
{usb_support}
328346
);
329347
"""
330348

0 commit comments

Comments
 (0)