summaryrefslogtreecommitdiffstats
path: root/pyanaconda/ui/gui/__init__.py
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2012-09-24 12:57:42 -0400
committerChris Lumens <clumens@redhat.com>2012-09-25 09:59:27 -0400
commit745e0d36b35fa3f7a9a3ad14cf8212edc83825a5 (patch)
treec28f11b15e342aa593146cb1df29f332599d112a /pyanaconda/ui/gui/__init__.py
parent38b5bcd06095e1e25d10e74d0d9c650575785f5a (diff)
downloadanaconda-745e0d36b35fa3f7a9a3ad14cf8212edc83825a5.tar.gz
anaconda-745e0d36b35fa3f7a9a3ad14cf8212edc83825a5.tar.xz
anaconda-745e0d36b35fa3f7a9a3ad14cf8212edc83825a5.zip
GUI error handling dialogs need to be protected from threading deadlocks.
Diffstat (limited to 'pyanaconda/ui/gui/__init__.py')
-rw-r--r--pyanaconda/ui/gui/__init__.py40
1 files changed, 21 insertions, 19 deletions
diff --git a/pyanaconda/ui/gui/__init__.py b/pyanaconda/ui/gui/__init__.py
index 9e7341331..638772bdb 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)