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,17 +387,12 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog):
#kernel
#in case VM is not Linux
#in case VM is HVM
if not hasattr(self.vm, "kernel"):
self.kernel_groupbox.setVisible(False)
return;
if self.vm.template is not None:
text = self.vm.kernel
self.kernel.insertItem(0, text)
self.kernel.setEnabled(False)
self.kernel_idx = 0
else:
# construct available kernels list
text = "default (" + self.qvm_collection.get_default_kernel() +")"
kernel_list = [text]
for k in os.listdir(qubes_kernels_base_dir):
@ -406,8 +401,10 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog):
self.kernel_idx = 0
# put available kernels to a combobox
for (i, k) in enumerate(kernel_list):
text = k
# 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):
text += " (current)"
self.kernel_idx = i