예제 #1
0
    def __init__(self):
        Gtk.Box.__init__(self, orientation=Gtk.Orientation.VERTICAL, spacing=3)
        self._option_objects = []
        ok = False
        try:
            self._kbdsettings = GSettingsSetting(self.XKB_GSETTINGS_SCHEMA)
            self._kdb_settings_id = self._kbdsettings.connect("changed::"+self.XKB_GSETTINGS_NAME, self._on_changed)
            self._xkb_info = GnomeDesktop.XkbInfo()
            ok = True
            self.loaded = True
        except GSettingsMissingError:
            logging.info("Typing missing schema %s" % self.XKB_GSETTINGS_SCHEMA)
            self.loaded = False
        except AttributeError:
            logging.warning("Typing missing GnomeDesktop.gir with Xkb support")
            self.loaded = False
        finally:
            if ok:
                for opt in set(self._xkb_info.get_all_option_groups()) - self.XKB_OPTIONS_BLACKLIST:
                    obj = _XkbOption(opt, self._kbdsettings, self._xkb_info)
                    self._option_objects.append(obj)
                self._option_objects.sort(key=lambda item_desc: item_desc.name)
                for item in self._option_objects: self.pack_start(item, False, False, 0)
        TweakGroup.__init__(self, _("Typing"), *self._option_objects)

        self.connect("destroy", self._on_destroy)
예제 #2
0
 def __init__(self):
     Gtk.Box.__init__(self, orientation=Gtk.Orientation.VERTICAL, spacing=3)
     self._option_objects = []
     self._sg = Gtk.SizeGroup(mode=Gtk.SizeGroupMode.HORIZONTAL)
     ok = False
     try:
         self._kbdsettings = GSettingsSetting(self.XKB_GSETTINGS_SCHEMA)
         self._kbdsettings.connect("changed::" + self.XKB_GSETTINGS_NAME,
                                   self._on_changed)
         self._xkb_info = GnomeDesktop.XkbInfo()
         ok = True
         self.loaded = True
     except GSettingsMissingError:
         logging.info("Typing missing schema %s" %
                      self.XKB_GSETTINGS_SCHEMA)
         self.loaded = False
     except AttributeError:
         logging.warning("Typing missing GnomeDesktop.gir with Xkb support")
         self.loaded = False
     finally:
         if ok:
             for opt in set(self._xkb_info.get_all_option_groups()
                            ) - self.XKB_OPTIONS_BLACKLIST:
                 obj = _XkbOption(opt, self._kbdsettings, self._xkb_info)
                 self._sg.add_widget(obj._combo)
                 self._option_objects.append(obj)
                 self.pack_start(obj, False, False, 0)
     TweakGroup.__init__(self, _("Typing"), *self._option_objects)
    def __init__(self):
        TweakGroup.__init__(self, _("Shell Extensions"))

        extension_tweaks = []
        sg = build_horizontal_sizegroup()

        #check the shell is running
        try:
            shell = GnomeShellFactory().get_shell()

            #add the extension installer
            extension_tweaks.append(
                _ShellExtensionInstallerTweak(shell, size_group=sg))

            try:
                #add a tweak for each installed extension
                for extension in shell.list_extensions().values():
                    try:
                        extension_tweaks.append(
                            _ShellExtensionTweak(shell, extension, size_group=sg))
                    except:
                        logging.warning("Invalid extension", exc_info=True)
            except:
                logging.warning("Error listing extensions", exc_info=True)
        except:
            logging.warning("Error detecting shell", exc_info=True)

        self.set_tweaks(*extension_tweaks)
예제 #4
0
 def __init__(self):
     Gtk.Box.__init__(self, orientation=Gtk.Orientation.VERTICAL, spacing=3)
     self._option_objects = []
     self._sg = Gtk.SizeGroup(mode=Gtk.SizeGroupMode.HORIZONTAL)
     ok = False
     try:
         self._kbdsettings = GSettingsSetting(self.XKB_GSETTINGS_SCHEMA)
         self._kbdsettings.connect("changed::"+self.XKB_GSETTINGS_NAME, self._on_changed)
         self._xkb_info = GnomeDesktop.XkbInfo()
         ok = True
         self.loaded = True
     except GSettingsMissingError:
         logging.info("Typing missing schema %s" % self.XKB_GSETTINGS_SCHEMA)
         self.loaded = False            
     except AttributeError:
         logging.warning("Typing missing GnomeDesktop.gir with Xkb support")
         self.loaded = False
     finally:
         if ok:
             for opt in set(self._xkb_info.get_all_option_groups()) - self.XKB_OPTIONS_BLACKLIST:
                 obj = _XkbOption(opt, self._kbdsettings, self._xkb_info)
                 self._sg.add_widget(obj._combo)
                 self._option_objects.append(obj)
                 self.pack_start(obj, False, False, 0)
     TweakGroup.__init__(self, _("Typing"), *self._option_objects)
예제 #5
0
    def __init__(self, name, *tweaks, **options):
        if 'uid' not in options:
            options['uid'] = self.__class__.__name__
        Gtk.ListBox.__init__(self,
                        selection_mode=Gtk.SelectionMode.NONE,
                        name=options['uid'])
        self.get_style_context().add_class(
                        options.get('css_class','tweak-group'))
        self.props.vexpand = False
        self.props.valign = Gtk.Align.START

        self._sg = Gtk.SizeGroup(mode=Gtk.SizeGroupMode.HORIZONTAL)
        self._sg.props.ignore_hidden = True

        TweakGroup.__init__(self, name, **options)

        for t in tweaks:
            self.add_tweak_row(t)
예제 #6
0
    def __init__(self, name, *tweaks, **options):
        if 'uid' not in options:
            options['uid'] = self.__class__.__name__
        Gtk.ListBox.__init__(self,
                             selection_mode=Gtk.SelectionMode.NONE,
                             name=options['uid'])
        self.get_style_context().add_class(
            options.get('css_class', 'tweak-group'))
        self.props.vexpand = False
        self.props.valign = Gtk.Align.START

        self._sg = Gtk.SizeGroup(mode=Gtk.SizeGroupMode.HORIZONTAL)
        self._sg.props.ignore_hidden = True

        TweakGroup.__init__(self, name, **options)

        for t in tweaks:
            self.add_tweak_row(t)
예제 #7
0
    def __init__(self):
        TweakGroup.__init__(self, N_("Wacom"))

        try:
            configs = WacomConfigs()
        except:
            return

        tweaks = ()
        for config in configs.get_matched_isd_devices():
            summary = '%(tablet_name)s: Tablet PC mode' % {'tablet_name': config.get(DEVICE_SECTION, 'Name')}
            tweaks += (WacomSwitchTweak(config,
                                        configs.machine_id,
                                        SCHEMA_NAME,
                                        TABLET_PC_KEY,
                                        schema_filename=SCHEMA_NAME + '.gschema.xml',
                                        summary=summary),
                       )
        self.set_tweaks(*tweaks)
예제 #8
0
    def __init__(self):
        TweakGroup.__init__(self, N_("Wacom"))

        try:
            configs = WacomConfigs()
        except:
            return

        tweaks = ()
        for config in configs.get_matched_isd_devices():
            summary = '%(tablet_name)s: Tablet PC mode' % {'tablet_name': config.get(DEVICE_SECTION, 'Name')}
            tweaks += (WacomSwitchTweak(config,
                                        configs.machine_id,
                                        SCHEMA_NAME,
                                        TABLET_PC_KEY,
                                        schema_filename=SCHEMA_NAME + '.gschema.xml',
                                        summary=summary),
                       )
        self.set_tweaks(*tweaks)