[rhel7-branch 1/2] Show the event box immediately when setting infobar messages.
dashea
installerbot-noreply at redhat.com
Mon Jul 6 13:56:12 UTC 2015
From: David Shea <dshea at redhat.com>
The only calls to set_info, set_warning and set_error that were not
immediately followed by a call to window.show_all() were bugs in that
the info bar would not be shown. Move the call to show() into the
widget, instead.
(cherry picked from commit 30036a04f72da85ba38eb6c4690d078f0c22c27d)
Related: rhbz#1238797
---
pyanaconda/ui/gui/helpers.py | 1 -
pyanaconda/ui/gui/hubs/__init__.py | 2 --
pyanaconda/ui/gui/spokes/custom.py | 20 --------------------
pyanaconda/ui/gui/spokes/datetime_spoke.py | 2 --
pyanaconda/ui/gui/spokes/network.py | 2 --
pyanaconda/ui/gui/spokes/storage.py | 2 --
widgets/src/BaseWindow.c | 1 +
7 files changed, 1 insertion(+), 29 deletions(-)
diff --git a/pyanaconda/ui/gui/helpers.py b/pyanaconda/ui/gui/helpers.py
index 11b4b15..320f933 100644
--- a/pyanaconda/ui/gui/helpers.py
+++ b/pyanaconda/ui/gui/helpers.py
@@ -90,7 +90,6 @@ def set_status(self, inputcheck):
self.clear_info()
if failed_check:
self.set_warning(failed_check.check_status)
- self.window.show_all()
# Implemented by GUIObject
@abstractmethod
diff --git a/pyanaconda/ui/gui/hubs/__init__.py b/pyanaconda/ui/gui/hubs/__init__.py
index cb24585..ab68893 100644
--- a/pyanaconda/ui/gui/hubs/__init__.py
+++ b/pyanaconda/ui/gui/hubs/__init__.py
@@ -222,12 +222,10 @@ def _updateContinue(self):
if len(self._incompleteSpokes) == 0:
if self._checker and not self._checker.check():
self.set_warning(self._checker.error_message)
- self.window.show_all()
else:
msg = _("Please complete items marked with this icon before continuing to the next step.")
self.set_warning(msg)
- self.window.show_all()
self._updateContinueButton()
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index d36d147..783299e 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -680,7 +680,6 @@ def _try_replace_device(self, selector, removed_device, new_device_info,
self._update_all_devices_in_selectors()
self._error = e
self.set_warning(_(DEVICE_CONFIGURATION_ERROR_MSG))
- self.window.show_all()
if not removed_device:
# nothing more to do
@@ -700,7 +699,6 @@ def _try_replace_device(self, selector, removed_device, new_device_info,
self.refresh() # this calls self.clear_errors
self._error = e
self.set_warning(_(UNRECOVERABLE_ERROR_MSG))
- self.window.show_all()
return False
@ui_storage_logged
@@ -761,7 +759,6 @@ def _handle_size_change(self, size, old_size, device, use_dev):
self._error = e
self.set_warning(_("Device resize request failed. "
"<a href=\"\">Click for details.</a>"))
- self.window.show_all()
else:
_changed_size = True
@@ -835,7 +832,6 @@ def _do_reformat(self, device, mountpoint, label, changed_encryption,
self._error = e
self.set_warning(_("Device reformat request failed. "
"<a href=\"\">Click for details.</a>"))
- self.window.show_all()
else:
# first, remove this selector from any old install page(s)
new_selector = None
@@ -963,7 +959,6 @@ def _save_right_side(self, selector):
if error:
self._error = error
self.set_warning(self._error)
- self.window.show_all()
self._populate_right_side(selector)
return
@@ -985,7 +980,6 @@ def _save_right_side(self, selector):
if error:
self._error = error
self.set_warning(self._error)
- self.window.show_all()
self._populate_right_side(selector)
return
@@ -1013,7 +1007,6 @@ def _save_right_side(self, selector):
raid_level)
if error:
self.set_warning(error)
- self.window.show_all()
self._populate_right_side(selector)
return
@@ -1527,7 +1520,6 @@ def _do_check(self):
# on_info_bar_clicked requires self._error to be set, so set it to the
# list of all errors and warnings that storage checking found.
- self.window.show_all()
self._error = "\n".join(self.errors + self.warnings)
return self._error == ""
@@ -1635,7 +1627,6 @@ def _add_device(self, dev_info):
self.set_info(_("Added new %(type)s to existing "
"container %(name)s.")
% {"type" : type_str, "name" : container.name})
- self.window.show_all()
e = None
# the factory's error handling has replaced all of the devices
@@ -1646,12 +1637,10 @@ def _add_device(self, dev_info):
self._error = e
self.set_error(_("Failed to add new device. <a href=\"\">Click for "
"details.</a>"))
- self.window.show_all()
except OverflowError as e:
log.error("invalid size set for partition")
self._error = e
self.set_error(_("Invalid partition size set. Use a valid integer."))
- self.window.show_all()
def on_add_clicked(self, button):
self._save_right_side(self._current_selector)
@@ -1762,7 +1751,6 @@ def _destroy_device(self, device):
self._error = e
self.set_warning(_("Device removal request failed. <a href=\"\">Click "
"for details.</a>"))
- self.window.show_all()
return
else:
if is_logical_partition:
@@ -1930,7 +1918,6 @@ def on_configure_clicked(self, button):
if not disks:
self._error = "No disks selected. Keeping previous disk set."
self.set_info(self._error)
- self.window.show_all()
return
if set(disks) != self._device_disks:
@@ -1989,7 +1976,6 @@ def run_container_editor(self, container=None, name=None):
if not disks:
self._error = "No disks selected. Not saving changes."
self.set_info(self._error)
- self.window.show_all()
return
log.debug("new container name: %s", name)
@@ -1997,7 +1983,6 @@ def run_container_editor(self, container=None, name=None):
self._error = _("Volume Group name %s is already in use. Not "
"saving changes.") % name
self.set_info(self._error)
- self.window.show_all()
return
if (set(disks) != set(self._device_disks) or
@@ -2258,20 +2243,17 @@ def _do_autopart(self):
log.error("doAutoPartition failed: %s", e)
self._error = e
self.set_error(_("No disks selected."))
- self.window.show_all()
except NotEnoughFreeSpaceError as e:
# No handling should be required for this.
log.error("doAutoPartition failed: %s", e)
self._error = e
self.set_error(_("Not enough free space on selected disks."))
- self.window.show_all()
except (StorageError, BootLoaderError) as e:
log.error("doAutoPartition failed: %s", e)
self._reset_storage()
self._error = e
self.set_error(_("Automatic partitioning failed. <a href=\"\">Click "
"for details.</a>"))
- self.window.show_all()
else:
self._devices = self._storage_playground.devices
# mark all new containers for automatic size management
@@ -2297,7 +2279,6 @@ def _do_autopart(self):
self._error = messages
self.set_error(_("Automatic partitioning failed. <a href=\"\">Click "
"for details.</a>"))
- self.window.show_all()
def on_create_clicked(self, button, autopartTypeCombo):
# Then do autopartitioning. We do not do any clearpart first. This is
@@ -2591,7 +2572,6 @@ def on_unlock_clicked(self, *args):
self._passphraseEntry.set_text("")
self.set_warning(_("Failed to unlock encrypted block device. "
"<a href=\"\">Click for details.</a>"))
- self.window.show_all()
return
log.info("unlocked %s, now going to populate devicetree...", device.name)
diff --git a/pyanaconda/ui/gui/spokes/datetime_spoke.py b/pyanaconda/ui/gui/spokes/datetime_spoke.py
index c7b866b..ade2c0e 100644
--- a/pyanaconda/ui/gui/spokes/datetime_spoke.py
+++ b/pyanaconda/ui/gui/spokes/datetime_spoke.py
@@ -1039,11 +1039,9 @@ def _set_date_time_setting_sensitive(self, sensitive):
def _show_no_network_warning(self):
self.set_warning(_("You need to set up networking first if you "\
"want to use NTP"))
- self.window.show_all()
def _show_no_ntp_server_warning(self):
self.set_warning(_("You have no working NTP server configured"))
- self.window.show_all()
def on_ntp_switched(self, switch, *args):
if switch.get_active():
diff --git a/pyanaconda/ui/gui/spokes/network.py b/pyanaconda/ui/gui/spokes/network.py
index a8660c8..a45b095 100644
--- a/pyanaconda/ui/gui/spokes/network.py
+++ b/pyanaconda/ui/gui/spokes/network.py
@@ -1477,7 +1477,6 @@ def on_back_clicked(self, button):
msg = _("Host name is not valid: %s") % error
self.set_warning(msg)
self.network_control_box.entry_hostname.grab_focus()
- self.window.show_all()
else:
self.clear_info()
NormalSpoke.on_back_clicked(self, button)
@@ -1547,7 +1546,6 @@ def _on_continue_clicked(self, window, user_data=None):
msg = _("Host name is not valid: %s") % error
self.set_warning(msg)
self.network_control_box.entry_hostname.grab_focus()
- self.window.show_all()
else:
self.clear_info()
StandaloneSpoke._on_continue_clicked(self, window, user_data)
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
index 2b19eb7..1b320fc 100644
--- a/pyanaconda/ui/gui/spokes/storage.py
+++ b/pyanaconda/ui/gui/spokes/storage.py
@@ -523,7 +523,6 @@ def refresh(self):
self.set_warning(_("Error checking storage configuration. <a href=\"\">Click for details.</a>"))
elif self.warnings:
self.set_warning(_("Warning checking storage configuration. <a href=\"\">Click for details.</a>"))
- self.window.show_all()
def initialize(self):
NormalSpoke.initialize(self)
@@ -710,7 +709,6 @@ def on_summary_clicked(self, button):
if self.data.bootloader.location == "none":
self.set_warning(_("You have chosen to skip boot loader installation. Your system may not be bootable."))
- self.window.show_all()
else:
self.clear_info()
diff --git a/widgets/src/BaseWindow.c b/widgets/src/BaseWindow.c
index 7a1528a..5652283 100644
--- a/widgets/src/BaseWindow.c
+++ b/widgets/src/BaseWindow.c
@@ -602,6 +602,7 @@ static void anaconda_base_window_set_info_bar(AnacondaBaseWindow *win, GtkMessag
gtk_container_add(GTK_CONTAINER(content_area), label);
gtk_info_bar_set_message_type(GTK_INFO_BAR(win->priv->info_bar), ty);
gtk_widget_show(win->priv->info_bar);
+ gtk_widget_show(win->priv->event_box);
win->priv->info_shown = TRUE;
}
--
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/4e5086203e22f715cf422d4d6e5592c86419476f
More information about the anaconda-patches
mailing list