fixes from @marmarek's review
This commit is contained in:
parent
c58e9850e9
commit
96fc9c192c
@ -43,7 +43,7 @@ class AppListWidgetItem(QListWidgetItem):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_line(cls, line):
|
def from_line(cls, line):
|
||||||
ident, name = line.strip().split(maxsplit=2)
|
ident, icon_name, name = line.strip().split(maxsplit=2)
|
||||||
return cls(name=name, ident=ident)
|
return cls(name=name, ident=ident)
|
||||||
|
|
||||||
|
|
||||||
|
@ -412,9 +412,9 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog):
|
|||||||
# self.vcpus.setMaximum(QubesHost().no_cpus)
|
# self.vcpus.setMaximum(QubesHost().no_cpus)
|
||||||
self.vcpus.setValue(int(self.vm.vcpus))
|
self.vcpus.setValue(int(self.vm.vcpus))
|
||||||
|
|
||||||
self.include_in_balancing.setEnabled(not self.vm.hvm)
|
self.include_in_balancing.setEnabled(True)
|
||||||
self.include_in_balancing.setChecked(not self.vm.hvm
|
self.include_in_balancing.setChecked(
|
||||||
and self.vm.features.get('services.meminfo-writer', True))
|
self.vm.features.get('services.meminfo-writer', True))
|
||||||
self.max_mem_size.setEnabled(self.include_in_balancing.isChecked())
|
self.max_mem_size.setEnabled(self.include_in_balancing.isChecked())
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -476,35 +476,17 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog):
|
|||||||
|
|
||||||
self.other_groupbox.setVisible(False)
|
self.other_groupbox.setVisible(False)
|
||||||
|
|
||||||
# if not hasattr(self.vm, "dispvm_netvm"):
|
if not hasattr(self.vm, 'default_dispvm'):
|
||||||
# self.other_groupbox.setVisible(False)
|
self.other_groupbox.setVisible(False)
|
||||||
# else:
|
else:
|
||||||
# self.other_groupbox.setVisible(True)
|
self.other_groupbox.setVisible(True)
|
||||||
# netvm_list = [vm for vm in self.app.values() if not vm.internal and vm.is_netvm() and vm.qid != 0]
|
self.default_dispvm_list, self.default_dispvm_idx = \
|
||||||
# self.dispvm_netvm_idx = -1
|
utils.prepare_vm_choice(
|
||||||
|
self.default_dispvm,
|
||||||
# text = "default (same as VM own NetVM)"
|
self.vm, 'default_dispvm',
|
||||||
# if self.vm.uses_default_dispvm_netvm:
|
self.vm.app.default_dispvm,
|
||||||
# text += self.tr(" (current)")
|
(lambda vm: isinstance(vm, qubesadmin.vm.DispVM)),
|
||||||
# self.dispvm_netvm_idx = 0
|
allow_default=True, allow_none=True)
|
||||||
# self.dispvm_netvm.insertItem(0, text)
|
|
||||||
|
|
||||||
# for (i, vm) in enumerate(netvm_list):
|
|
||||||
# text = vm.name
|
|
||||||
# if self.vm.dispvm_netvm is not None and vm.qid == \
|
|
||||||
# self.vm.dispvm_netvm.qid and not \
|
|
||||||
# self.vm.uses_default_dispvm_netvm:
|
|
||||||
# self.dispvm_netvm_idx = i+1
|
|
||||||
# text += self.tr(" (current)")
|
|
||||||
# self.dispvm_netvm.insertItem(i+1, text)
|
|
||||||
|
|
||||||
# none_text = "none"
|
|
||||||
# if self.vm.dispvm_netvm is None:
|
|
||||||
# none_text += self.tr(" (current)")
|
|
||||||
# self.dispvm_netvm_idx = len(netvm_list)+1
|
|
||||||
# self.dispvm_netvm.insertItem(len(netvm_list)+1, none_text)
|
|
||||||
|
|
||||||
# self.dispvm_netvm.setCurrentIndex(self.dispvm_netvm_idx)
|
|
||||||
|
|
||||||
def __apply_advanced_tab__(self):
|
def __apply_advanced_tab__(self):
|
||||||
msg = []
|
msg = []
|
||||||
@ -552,6 +534,15 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog):
|
|||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
msg.append(str(ex))
|
msg.append(str(ex))
|
||||||
|
|
||||||
|
#vm default_dispvm changed
|
||||||
|
try:
|
||||||
|
if self.default_dispvm.currentIndex() != self.default_dispvm_idx:
|
||||||
|
self.vm.default_dispvm = \
|
||||||
|
self.default_dispvm_list[self.default_dispvm.currentIndex()]
|
||||||
|
self.anything_changed = True
|
||||||
|
except Exception as ex:
|
||||||
|
msg.append(str(ex))
|
||||||
|
|
||||||
return msg
|
return msg
|
||||||
|
|
||||||
def drive_path_button_pressed(self):
|
def drive_path_button_pressed(self):
|
||||||
|
@ -607,15 +607,15 @@
|
|||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="label_26">
|
<widget class="QLabel" name="label_26">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>NetVM for DispVM:</string>
|
<string>Default DispVM:</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="buddy">
|
<property name="buddy">
|
||||||
<cstring>dispvm_netvm</cstring>
|
<cstring>default_dispvm</cstring>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QComboBox" name="dispvm_netvm"/>
|
<widget class="QComboBox" name="default_dispvm"/>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
Loading…
Reference in New Issue
Block a user