diff options
author | Jiro Matsuzawa <matsuzawa.jr@gmail.com> | 2011-03-28 16:52:40 +0900 |
---|---|---|
committer | Eitan Isaacson <eitan@monotonous.org> | 2011-04-14 11:39:53 -0700 |
commit | 78dedf94463f8c0d9b8f441e7d70345bfff9a38e (patch) | |
tree | 0006bd89708f120c5a9809d3b244de538c004384 /caribou | |
parent | 40e0b0b84645627dedf352e042bfeedee4f19818 (diff) | |
download | caribou-78dedf94463f8c0d9b8f441e7d70345bfff9a38e.tar.gz |
Ask user to enable accessibility on startup.
(written originally by Parag Nemade, and modified by Jiro Matsuzawa)
https://bugzilla.gnome.org/show_bug.cgi?id=645890
Diffstat (limited to 'caribou')
-rw-r--r-- | caribou/ui/main.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/caribou/ui/main.py b/caribou/ui/main.py index 1a6ac9e..f155f41 100644 --- a/caribou/ui/main.py +++ b/caribou/ui/main.py @@ -52,7 +52,19 @@ class Caribou: kb_factory=CaribouKeyboard, window_factory=CaribouWindowEntry): if not self._get_a11y_enabled(): - raise Exception, "AT-SPI 1 or 2 needs to be enabled." + msgdialog = Gtk.MessageDialog(None, + Gtk.DialogFlags.MODAL, + Gtk.MessageType.QUESTION, + Gtk.ButtonsType.YES_NO, + _("Accessibility needs to be enabled. Do you want to enable it and run %s?") % const.APP_NAME) + resp = msgdialog.run() + if resp == Gtk.ResponseType.NO: + msgdialog.destroy() + quit() + if resp == Gtk.ResponseType.YES: + settings = Gio.Settings('org.gnome.desktop.interface') + atspi = settings.set_boolean("toolkit-accessibility", True) + msgdialog.destroy() self.__current_acc = None self.window_factory = window_factory self.kb_factory = kb_factory |