Skip to content

Commit 61fa2a8

Browse files
committed
Fixed editing VM architecture bug
1 parent 95e13c5 commit 61fa2a8

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# EmuGUI v0.6.1
22

33
- A spacing mistake has been fixed.
4+
- The editing VM dialog had a bug which sometimes didn't apply the actual architecture of the VM.
45

56
# EmuGUI v0.6
67

-39 Bytes
Binary file not shown.

dialogExecution/editVirtualMachine.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -295,28 +295,28 @@ def readTempVmFile(self):
295295
self.lineEdit.setText(vmSpecs[0])
296296
self.setWindowTitle(f"EmuGUI - Edit {vmSpecs[0]}")
297297

298-
if vmSpecs[1] == "i386":
299-
self.comboBox.setCurrentIndex(0)
300-
self.machineCpuI386Amd64(vmSpecs[2], vmSpecs[3])
301-
self.spinBox.setValue(int(vmSpecs[4]))
298+
i = 0
299+
300+
while i < self.comboBox.count():
301+
if self.comboBox.itemText(i) == vmSpecs[1]:
302+
self.comboBox.setCurrentIndex(i)
303+
break
304+
305+
i += 1
302306

303-
elif vmSpecs[1] == "x86_64":
304-
self.comboBox.setCurrentIndex(1)
307+
if vmSpecs[1] == "i386" or vmSpecs[1] == "x86_64":
305308
self.machineCpuI386Amd64(vmSpecs[2], vmSpecs[3])
306309
self.spinBox.setValue(int(vmSpecs[4]))
307310

308311
elif vmSpecs[1] == "mips64el" or vmSpecs[1] == "mipsel":
309-
self.comboBox.setCurrentIndex(2)
310312
self.machineCpuMips64el(vmSpecs[2], vmSpecs[3])
311313
self.spinBox_3.setValue(int(vmSpecs[4]))
312314

313315
elif vmSpecs[1] == "ppc" or vmSpecs[1] == "ppc64":
314-
self.comboBox.setCurrentIndex(3)
315316
self.machineCpuPpc(vmSpecs[2], vmSpecs[3])
316317
self.spinBox_2.setValue(int(vmSpecs[4]))
317318

318-
elif vmSpecs[1] == "aarch64" or self.comboBox.currentText() == "arm":
319-
self.comboBox.setCurrentIndex(4)
319+
elif vmSpecs[1] == "aarch64" or vmSpecs[1] == "arm":
320320
self.machineCpuAarch64(vmSpecs[2], vmSpecs[3])
321321
self.spinBox_5.setValue(int(vmSpecs[4]))
322322

0 commit comments

Comments
 (0)