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,6 +410,114 @@
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkGrid" id="startup-error-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="image1">
<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="startup-error">
<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="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</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>
@ -540,69 +648,18 @@
</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>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkGrid" id="startup-error-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="image1">
<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="startup-error">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="hexpand">False</property>
<property name="label" translatable="yes">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="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</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">
<object class="GtkLabel" id="label4">

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")