Merge remote-tracking branch 'origin/pr/260'
* origin/pr/260: Less intrusive max mem / init mem warning in VM Setting
This commit is contained in:
commit
fdf4f87fdb
@ -166,6 +166,7 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtWidgets.QDialog):
|
|||||||
self.include_in_balancing_changed)
|
self.include_in_balancing_changed)
|
||||||
self.init_mem.editingFinished.connect(self.check_mem_changes)
|
self.init_mem.editingFinished.connect(self.check_mem_changes)
|
||||||
self.max_mem_size.editingFinished.connect(self.check_mem_changes)
|
self.max_mem_size.editingFinished.connect(self.check_mem_changes)
|
||||||
|
self.check_mem_changes()
|
||||||
self.boot_from_device_button.clicked.connect(
|
self.boot_from_device_button.clicked.connect(
|
||||||
self.boot_from_cdrom_button_pressed)
|
self.boot_from_cdrom_button_pressed)
|
||||||
|
|
||||||
@ -596,6 +597,7 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtWidgets.QDialog):
|
|||||||
return msg
|
return msg
|
||||||
|
|
||||||
def check_mem_changes(self):
|
def check_mem_changes(self):
|
||||||
|
self.warn_too_much_mem_label.setVisible(False)
|
||||||
if not self.include_in_balancing.isChecked():
|
if not self.include_in_balancing.isChecked():
|
||||||
# do not interfere with settings if the VM is not included in memory
|
# do not interfere with settings if the VM is not included in memory
|
||||||
# balancing
|
# balancing
|
||||||
@ -621,13 +623,7 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtWidgets.QDialog):
|
|||||||
|
|
||||||
if is_linux and \
|
if is_linux and \
|
||||||
self.init_mem.value() * 10 < self.max_mem_size.value():
|
self.init_mem.value() * 10 < self.max_mem_size.value():
|
||||||
self.init_mem.setValue((self.max_mem_size.value() + 9) // 10)
|
self.warn_too_much_mem_label.setVisible(True)
|
||||||
QtWidgets.QMessageBox.warning(
|
|
||||||
self,
|
|
||||||
self.tr("Warning!"),
|
|
||||||
self.tr("For Linux qubes, Initial memory can not be less than "
|
|
||||||
"one tenth Max memory.<br>Setting initial memory "
|
|
||||||
"to the minimum allowed value."))
|
|
||||||
|
|
||||||
def check_warn_dispvmnetvm(self):
|
def check_warn_dispvmnetvm(self):
|
||||||
if not hasattr(self.vm, 'default_dispvm'):
|
if not hasattr(self.vm, 'default_dispvm'):
|
||||||
|
@ -472,19 +472,6 @@ border-width: 1px;</string>
|
|||||||
<property name="topMargin">
|
<property name="topMargin">
|
||||||
<number>15</number>
|
<number>15</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="2" column="1">
|
|
||||||
<widget class="QSpinBox" name="vcpus">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<number>1</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QLabel" name="label_4">
|
<widget class="QLabel" name="label_4">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@ -526,6 +513,19 @@ border-width: 1px;</string>
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QSpinBox" name="vcpus">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QSpinBox" name="init_mem">
|
<widget class="QSpinBox" name="init_mem">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
@ -551,17 +551,7 @@ border-width: 1px;</string>
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0" colspan="2">
|
<item row="5" column="0" colspan="3">
|
||||||
<widget class="QCheckBox" name="include_in_balancing">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Include in memory balancing</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="0" colspan="3">
|
|
||||||
<widget class="QLabel" name="dmm_warning_adv">
|
<widget class="QLabel" name="dmm_warning_adv">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
@ -616,6 +606,127 @@ border-width: 1px;</string>
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="3" column="0" colspan="2">
|
||||||
|
<widget class="QCheckBox" name="include_in_balancing">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Include in memory balancing</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0" colspan="3">
|
||||||
|
<widget class="QLabel" name="warn_too_much_mem_label">
|
||||||
|
<property name="palette">
|
||||||
|
<palette>
|
||||||
|
<active>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>239</red>
|
||||||
|
<green>41</green>
|
||||||
|
<blue>41</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
<colorrole role="Text">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>239</red>
|
||||||
|
<green>41</green>
|
||||||
|
<blue>41</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
<colorrole role="PlaceholderText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="128">
|
||||||
|
<red>239</red>
|
||||||
|
<green>41</green>
|
||||||
|
<blue>41</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</active>
|
||||||
|
<inactive>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>239</red>
|
||||||
|
<green>41</green>
|
||||||
|
<blue>41</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
<colorrole role="Text">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>239</red>
|
||||||
|
<green>41</green>
|
||||||
|
<blue>41</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
<colorrole role="PlaceholderText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="128">
|
||||||
|
<red>239</red>
|
||||||
|
<green>41</green>
|
||||||
|
<blue>41</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</inactive>
|
||||||
|
<disabled>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>190</red>
|
||||||
|
<green>190</green>
|
||||||
|
<blue>190</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
<colorrole role="Text">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>190</red>
|
||||||
|
<green>190</green>
|
||||||
|
<blue>190</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
<colorrole role="PlaceholderText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="128">
|
||||||
|
<red>0</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</disabled>
|
||||||
|
</palette>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<weight>75</weight>
|
||||||
|
<italic>true</italic>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Linux qubes cannot utilize more than 10 times the initial memory. Setting maximum memory higher leads to unused RAM.</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignJustify|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
Loading…
Reference in New Issue
Block a user