예제 #1
0
파일: main.py 프로젝트: Dezaer/caribou
 def _show_no_a11y_dialogs(self):
     from gi.repository import Gtk
     msgdialog = Gtk.MessageDialog(
         None, Gtk.DialogFlags.MODAL, Gtk.MessageType.QUESTION,
         Gtk.ButtonsType.YES_NO,
         _("In order to use %s, accessibility needs "
           "to be enabled. Do you want to enable "
           "it now?") % 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)
         msgdialog2 = Gtk.MessageDialog(
             msgdialog, Gtk.DialogFlags.MODAL, Gtk.MessageType.INFO,
             Gtk.ButtonsType.OK,
             _("Accessibility has been enabled. "
               "Log out and back in again to use "
               "%s." % APP_NAME))
         msgdialog2.run()
         msgdialog2.destroy()
         msgdialog.destroy()
         quit()
예제 #2
0
파일: main.py 프로젝트: Dezaer/caribou
 def _show_no_a11y_dialogs(self):
     from gi.repository import Gtk
     msgdialog = Gtk.MessageDialog(None,
                                   Gtk.DialogFlags.MODAL,
                                   Gtk.MessageType.QUESTION,
                                   Gtk.ButtonsType.YES_NO,
                                   _("In order to use %s, accessibility needs "
                                     "to be enabled. Do you want to enable "
                                     "it now?") % 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)
         msgdialog2 = Gtk.MessageDialog(msgdialog,
                                        Gtk.DialogFlags.MODAL,
                                        Gtk.MessageType.INFO,
                                        Gtk.ButtonsType.OK,
                                        _("Accessibility has been enabled. "
                                          "Log out and back in again to use "
                                          "%s." % APP_NAME))
         msgdialog2.run()
         msgdialog2.destroy()
         msgdialog.destroy()
         quit()
예제 #3
0
파일: main.py 프로젝트: Dezaer/caribou
 def _show_error_dialog(self, message):
     from gi.repository import Gtk
     msgdialog = Gtk.MessageDialog(None, Gtk.DialogFlags.MODAL,
                                   Gtk.MessageType.ERROR,
                                   Gtk.ButtonsType.CLOSE,
                                   _("Error starting %s") % APP_NAME)
     msgdialog.format_secondary_text(message)
     msgdialog.run()
     quit()
예제 #4
0
파일: main.py 프로젝트: Dezaer/caribou
 def _show_error_dialog(self, message):
     from gi.repository import Gtk
     msgdialog = Gtk.MessageDialog(None,
                                   Gtk.DialogFlags.MODAL,
                                   Gtk.MessageType.ERROR,
                                   Gtk.ButtonsType.CLOSE,
                                   _("Error starting %s") % APP_NAME)
     msgdialog.format_secondary_text(message)
     msgdialog.run()
     quit()
예제 #5
0
파일: main.py 프로젝트: Dezaer/caribou
 def on_focus(self, event):
     acc = event.source
     source_role = acc.getRole()
     if acc.getState().contains(pyatspi.STATE_EDITABLE) or \
             source_role == pyatspi.ROLE_TERMINAL:
         if source_role in (pyatspi.ROLE_TEXT, pyatspi.ROLE_PARAGRAPH,
                            pyatspi.ROLE_PASSWORD_TEXT,
                            pyatspi.ROLE_TERMINAL, pyatspi.ROLE_ENTRY):
             if event.type.startswith("focus") or event.detail1 == 1:
                 self._set_entry_location(acc)
                 self._current_acc = event.source
                 if debug == True:
                     print "enter text widget in", event.host_application.name
             elif event.detail1 == 0 and acc == self._current_acc:
                 self.keyboard_proxy.Hide()
                 self._current_acc = None
                 if debug == True:
                     print "leave text widget in", event.host_application.name
         else:
             if debug == True:
                 print _("WARNING - Caribou: unhandled editable widget:"), \
                     event.source
예제 #6
0
파일: main.py 프로젝트: Dezaer/caribou
 def on_focus(self, event):
     acc = event.source
     source_role = acc.getRole()
     if acc.getState().contains(pyatspi.STATE_EDITABLE) or \
             source_role == pyatspi.ROLE_TERMINAL:
         if source_role in (pyatspi.ROLE_TEXT,
                            pyatspi.ROLE_PARAGRAPH,
                            pyatspi.ROLE_PASSWORD_TEXT,
                            pyatspi.ROLE_TERMINAL,
                            pyatspi.ROLE_ENTRY):
             if event.type.startswith("focus") or event.detail1 == 1:
                 self._set_entry_location(acc)
                 self._current_acc = event.source
                 if debug == True:
                     print "enter text widget in", event.host_application.name
             elif event.detail1 == 0 and acc == self._current_acc:
                 self.keyboard_proxy.Hide()
                 self._current_acc = None
                 if debug == True:
                     print "leave text widget in", event.host_application.name
         else:
             if debug == True:
                 print _("WARNING - Caribou: unhandled editable widget:"), \
                     event.source
예제 #7
0
from caribou.settings.setting_types import *
from caribou.i18n import _

CaribouSettings = SettingsTopGroup(
    _("Caribou Preferences"), "/org/gnome/caribou/", "org.gnome.caribou",
    [SettingsGroup("scanning", _("Scanning"), [
                BooleanSetting(
                    "scan_enabled", _("Enable scanning"), False,
                    _("Enable switch scanning"),
                    insensitive_when_false=["scanning_general",
                                            "scanning_input"]),
                SettingsGroup("scanning_general", _("General"), [
                        IntegerSetting("scan_grouping", _("Scanning mode"),
                                       1,
                                       _("Scanning type, subgroups, rows or linear"),
                                       allowed=[(1, _("Subgroups")),
                                                (2, _("Rows")),
                                                (3, _("Linear"))],
                                       entry_type=ENTRY_COMBO),
                        FloatSetting("step_time", _("Step time"), 1.0,
                                     _("Time between key transitions"),
                                     min=0.1, max=60.0),
                        BooleanSetting("inverse_scanning",
                                       _("Inverse scanning"), False,
                                       _("Step with the switch, activate by dwelling")),
                        BooleanSetting(
                            "autorestart",
                            _("Auto-restart scanning"), False,
                            _("Automatically restart scanning after item activation")),
                        IntegerSetting("scan_cycles", _("Scan cycles"),
                                       1, allowed=[(1, _("One")),
예제 #8
0
from caribou.settings.setting_types import *
from caribou.i18n import _

AntlerSettings = SettingsTopGroup(
    _("Antler Preferences"), "/org/gnome/antler/", "org.gnome.antler", [
        SettingsGroup("antler", _("Antler"), [
            SettingsGroup("appearance", _("Appearance"), [
                StringSetting(
                    "keyboard_type",
                    _("Keyboard Type"),
                    "touch",
                    _("The keyboard geometery Caribou should use"),
                    _("The keyboard geometery determines the shape "
                      "and complexity of the keyboard, it could range from "
                      "a 'natural' look and feel good for composing simple "
                      "text, to a fullscale keyboard."),
                    allowed=[(('touch'), _('Touch')),
                             (('fullscale'), _('Full scale')),
                             (('scan'), _('Scan'))]),
                BooleanSetting("use_system", _("Use System Theme"), True,
                               _("Use System Theme")),
                FloatSetting("min_alpha",
                             _("Minimum Alpha"),
                             0.2,
                             _("Minimal opacity of keyboard"),
                             min=0.0,
                             max=1.0),
                FloatSetting("max_alpha",
                             _("Maximum Alpha"),
                             1.0,
                             _("Maximal opacity of keyboard"),
예제 #9
0
from caribou.settings.setting_types import *
from caribou.i18n import _

AntlerSettings = SettingsTopGroup(
    _("Antler Preferences"), "/org/gnome/antler/", "org.gnome.antler",
    [SettingsGroup("antler", _("Antler"), [
                SettingsGroup("appearance", _("Appearance"), [
                        StringSetting(
                            "keyboard_type", _("Keyboard Type"), "touch",
                            _("The keyboard geometery Caribou should use"),
                            _("The keyboard geometery determines the shape "
                              "and complexity of the keyboard, it could range from "
                              "a 'natural' look and feel good for composing simple "
                              "text, to a fullscale keyboard."),
                            allowed=[(('touch'), _('Touch')),
                                     (('fullscale'), _('Full scale')),
                                     (('scan'), _('Scan'))]),
                        BooleanSetting("use_system", _("Use System Theme"),
                                       True, _("Use System Theme")),
                        FloatSetting("min_alpha", _("Minimum Alpha"),
                                     0.2, _("Minimal opacity of keyboard"),
                                     min=0.0, max=1.0),
                        FloatSetting("max_alpha", _("Maximum Alpha"),
                                     1.0, _("Maximal opacity of keyboard"),
                                     min=0.0, max=1.0),
                        IntegerSetting("max_distance", _("Maximum Distance"),
                                       100, _("Maximum distance when keyboard is hidden"),
                                     min=0, max=1024)
                        ])
                ])
     ])