@@ -42,7 +42,7 @@ def __init__(self, parent=None):
4242 self .connectSignalsSlots ()
4343 self .timer = QTimer ()
4444 self .timer .timeout .connect (self .updateVmList )
45- self .label_8 .setText ("EmuGUI v0.9.0.5300 " )
45+ self .label_8 .setText ("EmuGUI v0.9.0.5301_dev (pre-release, not for production) " )
4646 self .setWindowTitle ("EmuGUI" )
4747 self .languageInUse = "system"
4848
@@ -52,7 +52,7 @@ def __init__(self, parent=None):
5252 except :
5353 pass
5454
55- self .versionCode = 5300
55+ self .versionCode = 5301
5656
5757 if platform .system () == "Windows" :
5858 self .connection = platformSpecific .windowsSpecific .setupWindowsBackend ()
@@ -176,7 +176,8 @@ def prepareDatabase(self, connection):
176176 filebios TEXT DEFAULT "" NOT NULL,
177177 keyboardtype TEXT NOT NULL,
178178 usbsupport INT DEFAULT 0 NOT NULL,
179- usbcontroller TEXT DEFAULT "pci-ohci" NOT NULL
179+ usbcontroller TEXT DEFAULT "pci-ohci" NOT NULL,
180+ kbdtype TEXT DEFAULT "en-us" NOT NULL
180181 );
181182 """
182183
@@ -212,6 +213,11 @@ def prepareDatabase(self, connection):
212213 SELECT usbcontroller FROM virtualmachines;
213214 """
214215
216+ # The v0.9 feature set
217+ select09ColumnsVM = """
218+ SELECT kbdtype FROM virtualmachines;
219+ """
220+
215221 insertSoundColVM = """
216222 ALTER TABLE virtualmachines
217223 ADD COLUMN sound TEXT DEFAULT "none" NOT NULL;
@@ -262,6 +268,11 @@ def prepareDatabase(self, connection):
262268 ADD COLUMN usbcontroller TEXT DEFAULT "pci-ohci" NOT NULL;
263269 """
264270
271+ insertKbdLayoutVM = """
272+ ALTER TABLE virtualmachines
273+ ADD COLUMN kbdtype TEXT DEFAULT "en-us" NOT NULL;
274+ """
275+
265276 insert_qemu_img = """
266277 INSERT INTO settings (
267278 name
@@ -1092,6 +1103,27 @@ def prepareDatabase(self, connection):
10921103 except sqlite3 .Error as e :
10931104 print (f"The SQLite module encountered an error: { e } ." )
10941105
1106+ try :
1107+ cursor .execute (select09ColumnsVM )
1108+ connection .commit ()
1109+ result = cursor .fetchall ()
1110+
1111+ try :
1112+ qemu_img_slot = str (result [0 ])
1113+ print ("The query was executed successfully. The v0.5 feature columns already are in the VM table." )
1114+
1115+ except :
1116+ pass
1117+
1118+ except sqlite3 .Error as e :
1119+ try :
1120+ cursor .execute (insertKbdLayoutVM )
1121+ connection .commit ()
1122+ print ("The queries were executed successfully. The missing features have been added to the database." )
1123+
1124+ except sqlite3 .Error as e :
1125+ print (f"The SQLite module encountered an error: { e } ." )
1126+
10951127 try :
10961128 cursor .execute (debug_db_settings )
10971129 connection .commit ()
@@ -1158,7 +1190,7 @@ def startVM(self):
11581190
11591191 get_vm_to_start = f"""
11601192 SELECT architecture, machine, cpu, ram, hda, vga, net, usbtablet, win2k, dirbios, additionalargs, sound, linuxkernel,
1161- linuxinitrid, linuxcmd, mousetype, cores, filebios, keyboardtype, usbsupport, usbcontroller FROM virtualmachines
1193+ linuxinitrid, linuxcmd, mousetype, cores, filebios, keyboardtype, usbsupport, usbcontroller, kbdtype FROM virtualmachines
11621194 WHERE name = '{ selectedVM } '
11631195 """
11641196
@@ -1190,6 +1222,7 @@ def startVM(self):
11901222 kbd_type = result [0 ][18 ]
11911223 usb_support = result [0 ][19 ]
11921224 usb_controller = result [0 ][20 ]
1225+ kbd_layout = result [0 ][21 ]
11931226
11941227 except sqlite3 .Error as e :
11951228 print (f"The SQLite module encountered an error: { e } ." )
@@ -1223,6 +1256,7 @@ def startVM(self):
12231256 tempVmDefFile .write (kbd_type + "\n " )
12241257 tempVmDefFile .write (str (usb_support ) + "\n " )
12251258 tempVmDefFile .write (usb_controller + "\n " )
1259+ tempVmDefFile .write (kbd_layout + "\n " )
12261260
12271261 if usbtablet_wanted == 1 :
12281262 dialog3 = UsbTabletDepreciated (self )
@@ -1324,7 +1358,7 @@ def editVM(self):
13241358
13251359 get_vm_to_start = f"""
13261360 SELECT architecture, machine, cpu, ram, hda, vga, net, usbtablet, win2k, dirbios, additionalargs, sound, linuxkernel,
1327- linuxinitrid, linuxcmd, mousetype, cores, filebios, keyboardtype, usbsupport, usbcontroller FROM virtualmachines
1361+ linuxinitrid, linuxcmd, mousetype, cores, filebios, keyboardtype, usbsupport, usbcontroller, kbdtype FROM virtualmachines
13281362 WHERE name = '{ selectedVM } '
13291363 """
13301364
@@ -1356,6 +1390,7 @@ def editVM(self):
13561390 kbd_type = result [0 ][18 ]
13571391 usb_support = result [0 ][19 ]
13581392 usb_controller = result [0 ][20 ]
1393+ kbd_layout = result [0 ][21 ]
13591394
13601395 except sqlite3 .Error as e :
13611396 print (f"The SQLite module encountered an error: { e } ." )
@@ -1389,6 +1424,7 @@ def editVM(self):
13891424 tempVmDefFile .write (kbd_type + "\n " )
13901425 tempVmDefFile .write (str (usb_support ) + "\n " )
13911426 tempVmDefFile .write (usb_controller + "\n " )
1427+ tempVmDefFile .write (kbd_layout + "\n " )
13921428
13931429 i = 0
13941430
0 commit comments