Selaa lähdekoodia

Add warning about potential license issues with template HVM

Marek Marczykowski-Górecki 10 vuotta sitten
vanhempi
commit
c40beed213
2 muutettua tiedostoa jossa 36 lisäystä ja 13 poistoa
  1. 29 13
      newappvmdlg.ui
  2. 7 0
      qubesmanager/create_new_vm.py

+ 29 - 13
newappvmdlg.ui

@@ -105,17 +105,33 @@
     </widget>
    </item>
    <item>
-    <spacer name="verticalSpacer">
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
+    <widget class="QFrame" name="hvmtemplatewarningbox">
+     <property name="frameShape">
+      <enum>QFrame::NoFrame</enum>
      </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>20</width>
-       <height>40</height>
-      </size>
+     <property name="frameShadow">
+      <enum>QFrame::Raised</enum>
      </property>
-    </spacer>
+     <widget class="QLabel" name="hvmtemplatewarning">
+      <property name="enabled">
+       <bool>true</bool>
+      </property>
+      <property name="geometry">
+       <rect>
+        <x>0</x>
+        <y>0</y>
+        <width>482</width>
+        <height>30</height>
+       </rect>
+      </property>
+      <property name="text">
+       <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600; color:#ff0000;&quot;&gt;Make sure that the license of the OS installed in a template VM grants you permission to run multiple instances of an installed system.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+      </property>
+      <property name="wordWrap">
+       <bool>true</bool>
+      </property>
+     </widget>
+    </widget>
    </item>
    <item>
     <widget class="QDialogButtonBox" name="buttonBox">
@@ -138,8 +154,8 @@
    <slot>accept()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>248</x>
-     <y>254</y>
+     <x>257</x>
+     <y>190</y>
     </hint>
     <hint type="destinationlabel">
      <x>157</x>
@@ -154,8 +170,8 @@
    <slot>reject()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>316</x>
-     <y>260</y>
+     <x>325</x>
+     <y>190</y>
     </hint>
     <hint type="destinationlabel">
      <x>286</x>

+ 7 - 0
qubesmanager/create_new_vm.py

@@ -79,6 +79,8 @@ class NewVmDlg (QDialog, Ui_NewVMDlg):
         self.vmname.selectAll()
         self.vmname.setFocus()
 
+        self.hvmtemplatewarningbox.hide()
+
     def fill_template_list(self):
         def filter_template(vm):
             if vm.internal:
@@ -126,6 +128,11 @@ class NewVmDlg (QDialog, Ui_NewVMDlg):
         else:
             self.template_name.setEnabled(True)
 
+        if not checked and self.hvm_radio.isChecked():
+            self.hvmtemplatewarningbox.show()
+        else:
+            self.hvmtemplatewarningbox.hide()
+
     def reject(self):
         self.done(0)