Adjusting to #488 (kernel settings available for appVMs)

This commit is contained in:
Agnieszka Kostrzewa 2012-04-24 15:02:19 +02:00
parent 6b22eb5a0f
commit 2f81711fc2

View File

@ -387,32 +387,29 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog):
#kernel #kernel
#in case VM is not Linux #in case VM is HVM
if not hasattr(self.vm, "kernel"): if not hasattr(self.vm, "kernel"):
self.kernel_groupbox.setVisible(False) self.kernel_groupbox.setVisible(False)
return; return;
if self.vm.template is not None: # construct available kernels list
text = self.vm.kernel text = "default (" + self.qvm_collection.get_default_kernel() +")"
self.kernel.insertItem(0, text) kernel_list = [text]
self.kernel.setEnabled(False) for k in os.listdir(qubes_kernels_base_dir):
self.kernel_idx = 0 kernel_list.append(k)
else: kernel_list.append("none")
text = "default (" + self.qvm_collection.get_default_kernel() +")"
kernel_list = [text] self.kernel_idx = 0
for k in os.listdir(qubes_kernels_base_dir):
kernel_list.append(k) # put available kernels to a combobox
kernel_list.append("none") for (i, k) in enumerate(kernel_list):
text = k
self.kernel_idx = 0 # and mark the current choice
if (text.startswith("default") and self.vm.uses_default_kernel) or ( self.vm.kernel == k and not self.vm.uses_default_kernel) or (k=="none" and self.vm.kernel==None):
for (i, k) in enumerate(kernel_list): text += " (current)"
text = k self.kernel_idx = i
if (text.startswith("default") and self.vm.uses_default_kernel) or ( self.vm.kernel == k and not self.vm.uses_default_kernel) or (k=="none" and self.vm.kernel==None): self.kernel.insertItem(i,text)
text += " (current)" self.kernel.setCurrentIndex(self.kernel_idx)
self.kernel_idx = i
self.kernel.insertItem(i,text)
self.kernel.setCurrentIndex(self.kernel_idx)
#kernel opts #kernel opts
if self.vm.uses_default_kernelopts: if self.vm.uses_default_kernelopts: