Skip to content

Commit b9ab265

Browse files
committed
Implement edit VM
1 parent d492c55 commit b9ab265

File tree

2 files changed

+12
-25
lines changed

2 files changed

+12
-25
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
- Clicking the corresponding button should start it now.
9292
- The main dialog is now opening that instead of the old one.
9393
- The vmdata converter has been removed again.
94+
- Editing the VM is now implemented.
9495

9596
## Known issues
9697

emugui.py

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2287,7 +2287,7 @@ def editVM(self):
22872287
get_vm_to_start = f"""
22882288
SELECT architecture, machine, cpu, ram, hda, vga, net, usbtablet, win2k, dirbios, additionalargs, sound, linuxkernel,
22892289
linuxinitrid, linuxcmd, mousetype, cores, filebios, keyboardtype, usbsupport, usbcontroller, kbdtype, acceltype,
2290-
storagecontrollercd1, storagecontrollercd2, hdacontrol, cd1, cd2, floppy
2290+
storagecontrollercd1, storagecontrollercd2, hdacontrol, cd1, cd2, floppy, timemgr, bootfrom
22912291
FROM virtualmachines WHERE name = '{selectedVM}'
22922292
"""
22932293

@@ -2298,32 +2298,18 @@ def editVM(self):
22982298

22992299
print(result)
23002300

2301+
vmdata = vmd.VirtualMachineData(
2302+
selectedVM, result[0][0], result[0][1], result[0][2], result[0][16], result[0][3], result[0][5], result[0][6],
2303+
result[0][9], result[0][17], result[0][11], result[0][12], result[0][13], result[0][14], result[0][15], result[0][18],
2304+
result[0][21], result[0][19], result[0][20], result[0][22], result[0][23], result[0][24], result[0][25], result[0][26],
2305+
result[0][27], result[0][28], result[0][29], result[0][30], result[0][4], result[0][10]
2306+
)
2307+
23012308
architecture_of_vm = result[0][0]
2302-
machine_of_vm = result[0][1]
23032309
cpu_of_vm = result[0][2]
2304-
ram_of_vm = result[0][3]
2305-
hda_of_vm = result[0][4]
2306-
vga_of_vm = result[0][5]
2307-
net_of_vm = result[0][6]
23082310
usbtablet_wanted = result[0][7]
23092311
os_is_win2k = result[0][8]
2310-
dir_bios = result[0][9]
2311-
additional_arguments = result[0][10]
2312-
sound_card = result[0][11]
2313-
linux_kernel = result[0][12]
2314-
linux_initrid = result[0][13]
2315-
linux_cmd = result[0][14]
2316-
mouse_type = result[0][15]
2317-
cpu_cores = result[0][16]
2318-
file_bios = result[0][17]
2319-
kbd_type = result[0][18]
2320-
usb_support = result[0][19]
2321-
usb_controller = result[0][20]
2322-
kbd_layout = result[0][21]
23232312
accel_type = result[0][22]
2324-
cd_control1 = result[0][23]
2325-
cd_control2 = result[0][24]
2326-
hda_control = result[0][25]
23272313

23282314
except sqlite3.Error as e:
23292315
print(f"The SQLite module encountered an error: {e}.")
@@ -2350,7 +2336,7 @@ def editVM(self):
23502336
else:
23512337
tempVmDef = platformSpecific.unixSpecific.unixTempVmStarterFile()
23522338

2353-
try:
2339+
""" try:
23542340
with open(tempVmDef, "w+") as tempVmDefFile:
23552341
tempVmDefFile.write(selectedVM + "\n")
23562342
tempVmDefFile.write(architecture_of_vm + "\n")
@@ -2395,7 +2381,7 @@ def editVM(self):
23952381
)
23962382
23972383
dialog = ErrDialog(self)
2398-
dialog.exec()
2384+
dialog.exec() """
23992385

24002386
i = 0
24012387

@@ -2415,7 +2401,7 @@ def editVM(self):
24152401
dialog.exec()
24162402

24172403
else:
2418-
dialog = EditVMNewDialog(self)
2404+
dialog = EditVMNewDialog(vmdata, self)
24192405
dialog.exec()
24202406

24212407
break

0 commit comments

Comments
 (0)