create: Hide aarch64 warning if we switch architectures

Simplest is to have a separate UI area for the arch warning, since
the standard startup warning may still apply too.

Reported-by: João Pirralha <joaopirralha@gmail.com>
This commit is contained in:
Cole Robinson 2015-09-23 16:46:33 -04:00
parent 2f775b6bf0
commit 8e58734699
2 changed files with 202 additions and 138 deletions

View File

@ -410,141 +410,6 @@
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkExpander" id="arch-expander">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="valign">start</property>
<property name="vexpand">True</property>
<child>
<object class="GtkAlignment" id="alignment13">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="top_padding">8</property>
<property name="left_padding">15</property>
<child>
<object class="GtkGrid" id="table6">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="row_spacing">6</property>
<property name="column_spacing">6</property>
<child>
<object class="GtkComboBox" id="arch">
<property name="visible">True</property>
<property name="can_focus">False</property>
<signal name="changed" handler="on_arch_changed" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="xen-type">
<property name="visible">True</property>
<property name="can_focus">False</property>
<signal name="changed" handler="on_xen_type_changed" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label28">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_Xen Type:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">xen-type</property>
<property name="xalign">1</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label30">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_Architecture:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">arch</property>
<property name="xalign">1</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label10">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_Machine Type:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">machine</property>
<property name="xalign">1</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="machine">
<property name="visible">True</property>
<property name="can_focus">False</property>
<signal name="changed" handler="on_machine_changed" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label31">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_Virt Type:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">virt-type</property>
<property name="xalign">1</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="virt-type">
<property name="visible">True</property>
<property name="can_focus">False</property>
<signal name="changed" handler="on_virt_type_changed" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="arch-expander-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Architecture options</property>
</object>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box1">
<property name="visible">True</property>
@ -577,7 +442,7 @@
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="hexpand">False</property>
<property name="label" translatable="yes">Error message
<property name="label">Error message
bar</property>
<property name="wrap">True</property>
<property name="max_width_chars">45</property>
@ -602,6 +467,198 @@ bar</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkGrid" id="box4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="row_spacing">6</property>
<child>
<object class="GtkGrid" id="arch-warning-box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="valign">start</property>
<property name="column_spacing">6</property>
<child>
<object class="GtkImage" id="image7">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="hexpand">False</property>
<property name="yalign">0</property>
<property name="stock">gtk-dialog-warning</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="arch-warning">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="hexpand">False</property>
<property name="label">Error message
bar</property>
<property name="wrap">True</property>
<property name="max_width_chars">45</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkExpander" id="arch-expander">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="valign">start</property>
<property name="vexpand">True</property>
<child>
<object class="GtkAlignment" id="alignment13">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="top_padding">8</property>
<property name="left_padding">15</property>
<child>
<object class="GtkGrid" id="table6">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="row_spacing">6</property>
<property name="column_spacing">6</property>
<child>
<object class="GtkComboBox" id="arch">
<property name="visible">True</property>
<property name="can_focus">False</property>
<signal name="changed" handler="on_arch_changed" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="xen-type">
<property name="visible">True</property>
<property name="can_focus">False</property>
<signal name="changed" handler="on_xen_type_changed" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label28">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_Xen Type:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">xen-type</property>
<property name="xalign">1</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label30">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_Architecture:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">arch</property>
<property name="xalign">1</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label10">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_Machine Type:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">machine</property>
<property name="xalign">1</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="machine">
<property name="visible">True</property>
<property name="can_focus">False</property>
<signal name="changed" handler="on_machine_changed" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label31">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_Virt Type:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">virt-type</property>
<property name="xalign">1</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="virt-type">
<property name="visible">True</property>
<property name="can_focus">False</property>
<signal name="changed" handler="on_virt_type_changed" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="arch-expander-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Architecture options</property>
</object>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
</packing>
</child>
</object>
</child>
<child type="tab">

View File

@ -266,7 +266,13 @@ class vmmCreate(vmmGObjectUI):
def _show_startup_warning(self, error):
self.widget("startup-error-box").show()
self.widget("startup-error").set_text("%s: %s" % (_("Warning"), error))
self.widget("startup-error").set_markup(
"<span size='small'>%s: %s</span>" % (_("Warning"), error))
def _show_arch_warning(self, error):
self.widget("arch-warning-box").show()
self.widget("arch-warning").set_markup(
"<span size='small'>%s: %s</span>" % (_("Warning"), error))
def _init_state(self):
@ -455,6 +461,7 @@ class vmmCreate(vmmGObjectUI):
Set state that is dependent on when capsinfo changes
"""
self._populate_machine()
self.widget("arch-warning-box").hide()
# Helper state
is_local = not self.conn.is_remote()
@ -479,7 +486,7 @@ class vmmCreate(vmmGObjectUI):
exc_info=True)
msg = _("Failed to setup UEFI for AArch64: %s\n"
"Install options are limited.") % e
self._show_startup_warning(msg)
self._show_arch_warning(msg)
# Install Options
method_tree = self.widget("method-tree")