@@ -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