[PATCH 3/5] GUI error handling dialogs need to be protected from threading deadlocks.
Chris Lumens
clumens at redhat.com
Mon Sep 24 19:27:25 UTC 2012
---
pyanaconda/ui/gui/__init__.py | 40 +++++++++++++++++++++-------------------
1 file changed, 21 insertions(+), 19 deletions(-)
diff --git a/pyanaconda/ui/gui/__init__.py b/pyanaconda/ui/gui/__init__.py
index 9e73413..638772b 100644
--- a/pyanaconda/ui/gui/__init__.py
+++ b/pyanaconda/ui/gui/__init__.py
@@ -24,7 +24,7 @@ import meh.ui.gui
from gi.repository import Gdk
from pyanaconda.ui import UserInterface, common
-from pyanaconda.ui.gui.utils import enlightbox
+from pyanaconda.ui.gui.utils import enlightbox, gdk_threaded
import gettext
_ = lambda x: gettext.ldgettext("anaconda", x)
@@ -120,29 +120,31 @@ class GraphicalUserInterface(UserInterface):
def showError(self, message):
from gi.repository import AnacondaWidgets, Gtk
- dlg = Gtk.MessageDialog(flags=Gtk.DialogFlags.MODAL,
- message_type=Gtk.MessageType.ERROR,
- buttons=Gtk.ButtonsType.NONE,
- message_format=message)
- dlg.add_button(_("_Exit Installer"), 0)
+ with gdk_threaded():
+ dlg = Gtk.MessageDialog(flags=Gtk.DialogFlags.MODAL,
+ message_type=Gtk.MessageType.ERROR,
+ buttons=Gtk.ButtonsType.NONE,
+ message_format=message)
+ dlg.add_button(_("_Exit Installer"), 0)
- with enlightbox(self._actions[0].window, dlg):
- dlg.run()
- dlg.destroy()
+ with enlightbox(self._actions[0].window, dlg):
+ dlg.run()
+ dlg.destroy()
def showYesNoQuestion(self, message):
from gi.repository import AnacondaWidgets, Gtk
- dlg = Gtk.MessageDialog(flags=Gtk.DialogFlags.MODAL,
- message_type=Gtk.MessageType.QUESTION,
- buttons=Gtk.ButtonsType.NONE,
- message_format=message)
- dlg.add_buttons(_("_No"), 0, _("_Yes"), 1)
- dlg.set_default_response(1)
-
- with enlightbox(self._actions[0].window, dlg):
- rc = dlg.run()
- dlg.destroy()
+ with gdk_threaded():
+ dlg = Gtk.MessageDialog(flags=Gtk.DialogFlags.MODAL,
+ message_type=Gtk.MessageType.QUESTION,
+ buttons=Gtk.ButtonsType.NONE,
+ message_format=message)
+ dlg.add_buttons(_("_No"), 0, _("_Yes"), 1)
+ dlg.set_default_response(1)
+
+ with enlightbox(self._actions[0].window, dlg):
+ rc = dlg.run()
+ dlg.destroy()
return bool(rc)
--
1.7.11.2
More information about the anaconda-patches
mailing list