Esempio n. 1
0
    def __init__(self, item):
        GObject.GObject.__init__(self)

        self.show_button = WidgetFactory.create("CheckButton",
                                                label=item["label"],
                                                key=item["visible_key"],
                                                backend="gsettings")
        self.show_button.connect('toggled', self.on_show_button_changed)
        self.pack_start(self.show_button, False, False, 0)

        self.show_hbox = Gtk.HBox(spacing=12)
        self.pack_start(self.show_hbox, False, False, 0)

        if not self.show_button.get_active():
            self.show_hbox.set_sensitive(False)

        icon = Gtk.Image.new_from_icon_name(item["icon_name"], Gtk.IconSize.DIALOG)
        self.show_hbox.pack_start(icon, False, False, 0)

        self.rename_button = WidgetFactory.create("StringCheckButton",
                                                  label=_('Rename'),
                                                  key=item["name_key"],
                                                  backend="gsettings")
        self.rename_button.connect('toggled', self.on_show_button_changed)
        vbox = Gtk.VBox(spacing=6)
        self.show_hbox.pack_start(vbox, False, False, 0)
        vbox.pack_start(self.rename_button, False, False, 0)

        self.entry = WidgetFactory.create("Entry", key=item["name_key"], backend="gsettings")
        self.entry.connect('insert-at-cursor', self.on_entry_focus_out)
        if not self.rename_button.get_active():
            self.entry.set_sensitive(False)
        vbox.pack_start(self.entry, False, False, 0)
Esempio n. 2
0
    def __init__(self):
        TweakModule.__init__(self)

        valid_themes = self._get_valid_themes()

        theme_box = GridPack(
                        WidgetFactory.create('Switch',
                            label=self.utext_event_sounds,
                            key='org.gnome.desktop.sound.event-sounds',
                            backend='gsettings'),
                        WidgetFactory.create('Switch',
                            label=self.utext_login_sound,
                            key='50_unity-greeter.gschema.override::com.canonical.unity-greeter#play-ready-sound',
                            backend='systemconfig'),
                        WidgetFactory.create('Switch',
                            label=self.utext_input_feedback,
                            key='org.gnome.desktop.sound.input-feedback-sounds',
                            backend='gsettings'),
                        WidgetFactory.create('ComboBox',
                            label=self.utext_sound_theme,
                            key='org.gnome.desktop.sound.theme-name',
                            backend='gsettings',
                            texts=valid_themes,
                            values=valid_themes),
                        )

        self.add_start(theme_box, False, False, 0)
Esempio n. 3
0
    def __init__(self, item):
        GObject.GObject.__init__(self)

        self.show_button = WidgetFactory.create("CheckButton",
                                                label=item["label"],
                                                key=item["visible_key"],
                                                backend="gsettings")
        self.show_button.connect('toggled', self.on_show_button_changed)
        self.pack_start(self.show_button, False, False, 0)

        self.show_hbox = Gtk.HBox(spacing=12)
        self.pack_start(self.show_hbox, False, False, 0)

        if not self.show_button.get_active():
            self.show_hbox.set_sensitive(False)

        icon = Gtk.Image.new_from_icon_name(item["icon_name"], Gtk.IconSize.DIALOG)
        self.show_hbox.pack_start(icon, False, False, 0)

        self.rename_button = WidgetFactory.create("StringCheckButton",
                                                  label=_('Rename'),
                                                  key=item["name_key"],
                                                  backend="gsettings")
        self.rename_button.connect('toggled', self.on_show_button_changed)
        vbox = Gtk.VBox(spacing=6)
        self.show_hbox.pack_start(vbox, False, False, 0)
        vbox.pack_start(self.rename_button, False, False, 0)

        self.entry = WidgetFactory.create("Entry", key=item["name_key"], backend="gsettings")
        self.entry.connect('insert-at-cursor', self.on_entry_focus_out)
        if not self.rename_button.get_active():
            self.entry.set_sensitive(False)
        vbox.pack_start(self.entry, False, False, 0)
Esempio n. 4
0
    def __init__(self):
        TweakModule.__init__(self)

        hibernate_box = WidgetFactory.create('CheckButton',
                                      label=_('Lock screen on hibernate'),
                                      enable_reset=True,
                                      backend=GConf,
                                      key='/apps/gnome-power-manager/lock/hibernate')
        suspend_box = WidgetFactory.create('CheckButton',
                                      label=_('Lock screen on suspend'),
                                      enable_reset=True,
                                      backend=GConf,
                                      key='/apps/gnome-power-manager/lock/suspend')
        screensaver_box = WidgetFactory.create('CheckButton',
                                      label=_('Use Screensaver lock settings'),
                                      enable_reset=True,
                                      backend=GConf,
                                      key='/apps/gnome-power-manager/lock/use_screensaver_settings')
        hibernate_button = hibernate_box.get_data('widget')
        suspend_button = suspend_box.get_data('widget')
        screensaver_button = screensaver_box.get_data('widget')
        screensaver_button.connect('toggled', self.on_screensaver_button_toggled,
                                   (hibernate_button, suspend_button))
        self.on_screensaver_button_toggled(screensaver_button, (hibernate_button, suspend_button))

        box = TablePack(_('Advanced Power Management Settings'), (
                WidgetFactory.create('CheckButton',
                                      label=_('Enable "Lock screen" when "Blank Screen" activates'),
                                      enable_reset=True,
                                      backend=GConf,
                                      key='/apps/gnome-power-manager/lock/blank_screen'),
                screensaver_box, hibernate_box, suspend_box
        ))
        self.add_start(box, False, False, 0)
Esempio n. 5
0
    def __init__(self):
        TweakModule.__init__(self)

        box = ListPack(_("System Security options"), (
                    WidgetFactory.create("CheckButton",
                                         label=_('Disable "Lock Screen"'),
                                         key="org.gnome.desktop.lockdown.disable-lock-screen",
                                         backend="gsettings",
                                         enable_reset=True),
                    WidgetFactory.create("CheckButton",
                                         label=_("Disable printing"),
                                         key="org.gnome.desktop.lockdown.disable-printing",
                                         backend="gsettings",
                                         enable_reset=True),
                    WidgetFactory.create("CheckButton",
                                         label=_("Disable printer settings"),
                                         key="org.gnome.desktop.lockdown.disable-print-setup",
                                         backend="gsettings",
                                         enable_reset=True),
                    WidgetFactory.create("CheckButton",
                                         label=_("Disable save to disk"),
                                         key="org.gnome.desktop.lockdown.disable-save-to-disk",
                                         backend="gsettings",
                                         enable_reset=True),
                    WidgetFactory.create("CheckButton",
                                         label=_('Disable "Fast User Switching"'),
                                         key="org.gnome.desktop.lockdown.disable-user-switching",
                                         backend="gsettings",
                                         enable_reset=True),
            ), padding=2)

        self.add_start(box, False, False, 0)
Esempio n. 6
0
    def __init__(self):
        TweakModule.__init__(self)

        valid_themes = self._get_valid_themes()

        theme_box = GridPack(
            WidgetFactory.create('Switch',
                                 label=self.utext_event_sounds,
                                 key='org.gnome.desktop.sound.event-sounds',
                                 backend='gsettings'),
            WidgetFactory.create(
                'Switch',
                label=self.utext_login_sound,
                key=
                '50_unity-greeter.gschema.override::com.canonical.unity-greeter#play-ready-sound',
                backend='systemconfig'),
            WidgetFactory.create(
                'Switch',
                label=self.utext_input_feedback,
                key='org.gnome.desktop.sound.input-feedback-sounds',
                backend='gsettings'),
            WidgetFactory.create('ComboBox',
                                 label=self.utext_sound_theme,
                                 key='org.gnome.desktop.sound.theme-name',
                                 backend='gsettings',
                                 texts=valid_themes,
                                 values=valid_themes),
        )

        self.add_start(theme_box, False, False, 0)
Esempio n. 7
0
    def __init__(self):
        TweakModule.__init__(self)

        valid_themes = theme.get_valid_themes()
        valid_icon_themes = theme.get_valid_icon_themes()
        valid_cursor_themes = theme.get_valid_cursor_themes()
        valid_window_themes = theme.get_valid_window_themes()

        theme_choose_button = Gtk.FileChooserButton()
        theme_choose_button.connect('file-set', self.on_file_set)

        icon_label, self.icon_theme, icon_reset_button = WidgetFactory.create('ComboBox',
                            label=self.utext_icon_theme,
                            key='org.gnome.desktop.interface.icon-theme',
                            backend='gsettings',
                            texts=valid_icon_themes,
                            values=valid_icon_themes,
                            enable_reset=True)

        if system.CODENAME == 'precise':
            window_theme_label, window_theme_combox, window_theme_reset_button = WidgetFactory.create('ComboBox',
                            label=self.utext_window_theme,
                            key='/apps/metacity/general/theme',
                            backend='gconf',
                            texts=valid_window_themes,
                            values=valid_window_themes,
                            enable_reset=True)
        else:
            window_theme_label, window_theme_combox, window_theme_reset_button = WidgetFactory.create('ComboBox',
                            label=self.utext_window_theme,
                            key='org.gnome.desktop.wm.preferences.theme',
                            backend='gsettings',
                            texts=valid_window_themes,
                            values=valid_window_themes,
                            enable_reset=True)


        theme_box = GridPack(
                        WidgetFactory.create('ComboBox',
                            label=self.utext_gtk_theme,
                            key='org.gnome.desktop.interface.gtk-theme',
                            backend='gsettings',
                            texts=valid_themes,
                            values=valid_themes,
                            enable_reset=True),
                        (icon_label, self.icon_theme, icon_reset_button),
                        WidgetFactory.create('ComboBox',
                            label=self.utext_cursor_theme,
                            key='org.gnome.desktop.interface.cursor-theme',
                            backend='gsettings',
                            texts=valid_cursor_themes,
                            values=valid_cursor_themes,
                            enable_reset=True),
                        (window_theme_label, window_theme_combox, window_theme_reset_button),
                        Gtk.Separator(),
                        (Gtk.Label(_('Install theme:')), theme_choose_button),
                        )

        self.add_start(theme_box, False, False, 0)
Esempio n. 8
0
    def __init__(self):
        TweakModule.__init__(self, "loginsettings.ui")

        log.debug('Start to build "Session Options"')
        self.options_box = ListPack(
            _("Login Options"),
            (
                WidgetFactory.create(
                    "UserCheckButton",
                    user="******",
                    label=_("Disable user list in GDM"),
                    enable_reset=True,
                    key="/apps/gdm/simple-greeter/disable_user_list",
                ),
                WidgetFactory.create(
                    "UserCheckButton",
                    user="******",
                    label=_("Play sound at login"),
                    enable_reset=True,
                    key="/desktop/gnome/sound/event_sounds",
                ),
                WidgetFactory.create(
                    "UserCheckButton",
                    user="******",
                    label=_("Disable showing the restart button"),
                    enable_reset=True,
                    key="/apps/gdm/simple-greeter/disable_restart_buttons",
                ),
            ),
        )
        for item in self.options_box.items:
            log.debug("Set widget %s to sensitive False", item)
            item.set_sensitive(False)
        log.debug('Build "Session Options" finished')

        self.add_start(self.options_box, False, False, 0)

        self.icon_setting = UserGconfSetting("/apps/gdm/simple-greeter/logo_icon_name")
        self.icon_theme_setting = UserGconfSetting("/desktop/gnome/interface/icon_theme")
        self._setup_logo_image()
        self._setup_background_image()
        self.vbox1.unparent()
        self.vbox1.set_sensitive(False)

        box = ListPack(_("Login Theme"), (self.vbox1))
        self.add_start(box, False, False, 0)

        hbox = Gtk.HBox(spacing=12)
        polkit_button = PolkitButton(PK_ACTION_TWEAK)
        polkit_button.connect("authenticated", self.on_polkit_action)
        hbox.pack_end(polkit_button, False, False, 0)
        self.add_start(hbox, False, False, 0)
Esempio n. 9
0
    def __init__(self):
        TweakModule.__init__(self, 'loginsettings.ui')

        valid_themes = theme.get_valid_themes()
        valid_icon_themes = theme.get_valid_icon_themes()

        notes_label = Gtk.Label()
        notes_label.set_property('halign', Gtk.Align.START)
        notes_label.set_markup('<span size="smaller">%s</span>' % \
                _('Note: you may need to reboot to take effect'))
        notes_label._ut_left = 1

        self.login_box = GridPack(
                        WidgetFactory.create('Switch',
                            label=self.utext_allow_guest,
                            key='/etc/lightdm/lightdm.conf::SeatDefaults#allow-guest',
                            default=True,
                            backend='systemconfig'),
                        notes_label,
                        WidgetFactory.create('Switch',
                            label=self.utext_draw_grid,
                            key='50_unity-greeter.gschema.override::com.canonical.unity-greeter#draw-grid',
                            backend='systemconfig'),
                        WidgetFactory.create('Switch',
                            label=self.utext_login_sound,
                            key='50_unity-greeter.gschema.override::com.canonical.unity-greeter#play-ready-sound',
                            backend='systemconfig'),
                        WidgetFactory.create('ComboBox',
                            label=self.utext_gtk_theme,
                            key='50_unity-greeter.gschema.override::com.canonical.unity-greeter#theme-name',
                            backend='systemconfig',
                            texts=valid_themes,
                            values=valid_themes),
                        WidgetFactory.create('ComboBox',
                            label=self.utext_icon_theme,
                            key='50_unity-greeter.gschema.override::com.canonical.unity-greeter#icon-theme-name',
                            backend='systemconfig',
                            texts=valid_icon_themes,
                            values=valid_icon_themes),
                        )

        self.login_box.set_sensitive(False)
        self.add_start(self.login_box, False, False, 0)

        if system.CODENAME != 'saucy':
            self.add_start(Gtk.Separator(), False, False, 6)

            self._setup_logo_image()
            self._setup_background_image()

            box = ListPack('', (self.main_vbox))
            self.add_start(box, False, False, 0)
Esempio n. 10
0
    def __init__(self):
        TweakModule.__init__(self)

        valid_themes = theme.get_valid_themes()
        valid_icon_themes = theme.get_valid_icon_themes()
        valid_cursor_themes = theme.get_valid_cursor_themes()
        valid_window_themes = theme.get_valid_window_themes()

        theme_choose_button = Gtk.FileChooserButton()
        theme_choose_button.connect('file-set', self.on_file_set)

        icon_label, self.icon_theme, icon_reset_button = WidgetFactory.create(
            'ComboBox',
            label=self.utext_icon_theme,
            key='org.gnome.desktop.interface.icon-theme',
            backend='gsettings',
            texts=valid_icon_themes,
            values=valid_icon_themes,
            enable_reset=True)

        theme_box = GridPack(
            WidgetFactory.create('ComboBox',
                                 label=self.utext_gtk_theme,
                                 key='org.gnome.desktop.interface.gtk-theme',
                                 backend='gsettings',
                                 texts=valid_themes,
                                 values=valid_themes,
                                 enable_reset=True),
            (icon_label, self.icon_theme, icon_reset_button),
            WidgetFactory.create(
                'ComboBox',
                label=self.utext_cursor_theme,
                key='org.gnome.desktop.interface.cursor-theme',
                backend='gsettings',
                texts=valid_cursor_themes,
                values=valid_cursor_themes,
                enable_reset=True),
            WidgetFactory.create('ComboBox',
                                 label=self.utext_window_theme,
                                 key='/apps/metacity/general/theme',
                                 backend='gconf',
                                 texts=valid_window_themes,
                                 values=valid_window_themes,
                                 enable_reset=True),
            Gtk.Separator(),
            (Gtk.Label(_('Install theme:')), theme_choose_button),
        )

        self.add_start(theme_box, False, False, 0)
Esempio n. 11
0
    def __init__(self):
        TweakModule.__init__(self)

        show_permission_button, show_permission_reset = WidgetFactory.create("CheckButton",
                                       label=self.utext_advanced_properties,
                                       enable_reset=True,
                                       key="org.gnome.nautilus.preferences.show-advanced-permissions",
                                       backend="gsettings")

        box = GridPack(
                    (Gtk.Label(_("File browser:")), show_permission_button, show_permission_reset),
                    WidgetFactory.create("CheckButton",
                        label=self.utext_pathbar,
                        enable_reset=True,
                        blank_label=True,
                        key="org.gnome.nautilus.preferences.always-use-location-entry",
                        backend="gsettings"),
                    Gtk.Separator(),
                    WidgetFactory.create('Switch',
                                         key='org.gnome.desktop.media-handling.automount',
                                         enable_reset=True,
                                         label=self.utext_automount,
                                         backend="gsettings"),
                    WidgetFactory.create('Switch',
                                         key='org.gnome.desktop.media-handling.automount-open',
                                         enable_reset=True,
                                         label=self.utext_open,
                                         backend="gsettings"),
                    WidgetFactory.create('Switch',
                        key='org.gnome.desktop.media-handling.autorun-never',
                        enable_reset=True,
                        reverse=True,
                        label=self.utext_prompt,
                        backend="gsettings"),
                    Gtk.Separator(),
                    WidgetFactory.create('Scale',
                        key='org.gnome.nautilus.icon-view.thumbnail-size',
                        enable_reset=True,
                        min=16, max=512,
                        step=16,
                        label=self.utext_thumbnail_icon_size,
                        backend="gsettings"),
                    WidgetFactory.create('Scale',
                        key='org.gnome.desktop.thumbnail-cache.maximum-age',
                        enable_reset=True,
                        min=-1, max=180,
                        step=1,
                        label=self.utext_thumbnail_cache_age,
                        backend="gsettings"),
                    WidgetFactory.create('Scale',
                        key='org.gnome.desktop.thumbnail-cache.maximum-size',
                        enable_reset=True,
                        min=-1, max=512,
                        step=1,
                        label=self.utext_thumbnail_cache_size,
                        backend="gsettings"),
        )
        self.add_start(box, False, False, 0)
Esempio n. 12
0
    def __init__(self):
        TweakModule.__init__(self)

        self.show_button = WidgetFactory.create(
            "CheckButton", label=_("Show desktop icons"), key="/apps/nautilus/preferences/show_desktop", backend=GConf
        )
        self.show_button.connect("toggled", self.on_show_button_changed)
        self.add_start(self.show_button, False, False, 0)

        self.show_button_box = Gtk.HBox(spacing=12)
        self.add_start(self.show_button_box, False, False, 0)

        if not self.show_button.get_active():
            self.show_button_box.set_sensitive(False)

        label = Gtk.Label(label=" ")
        self.show_button_box.pack_start(label, False, False, 0)

        vbox = Gtk.VBox(spacing=6)
        self.show_button_box.pack_start(vbox, False, False, 0)

        for item in desktop_icons:
            vbox.pack_start(DesktopIcon(item), False, False, 0)

        button = WidgetFactory.create(
            "CheckButton",
            label=_('Show "Network" icon on desktop'),
            key="/apps/nautilus/desktop/network_icon_visible",
            backend=GConf,
        )
        vbox.pack_start(button, False, False, 0)

        button = WidgetFactory.create(
            "CheckButton",
            label=_("Show mounted volumes on desktop"),
            key="/apps/nautilus/desktop/volumes_visible",
            backend=GConf,
        )
        vbox.pack_start(button, False, False, 0)

        button = WidgetFactory.create(
            "CheckButton",
            label=_('Show contents of "Home Folder" on desktop (Logout for changes to take effect)'),
            key="/apps/nautilus/preferences/desktop_is_home_dir",
            backend=GConf,
        )
        vbox.pack_start(button, False, False, 0)
Esempio n. 13
0
    def __init__(self):
        TweakModule.__init__(self)

        box = ListPack(
            _("System Security options"),
            (
                WidgetFactory.create(
                    "CheckButton",
                    label=_('Disable "Lock Screen"'),
                    key="/desktop/gnome/lockdown/disable_lock_screen",
                    backend=GConf,
                    enable_reset=True,
                ),
                WidgetFactory.create(
                    "CheckButton",
                    label=_("Disable printing"),
                    key="/desktop/gnome/lockdown/disable_printing",
                    backend=GConf,
                    enable_reset=True,
                ),
                WidgetFactory.create(
                    "CheckButton",
                    label=_("Disable printer settings"),
                    key="/desktop/gnome/lockdown/disable_print_setup",
                    backend=GConf,
                    enable_reset=True,
                ),
                WidgetFactory.create(
                    "CheckButton",
                    label=_("Disable save to disk"),
                    key="/desktop/gnome/lockdown/disable_save_to_disk",
                    backend=GConf,
                    enable_reset=True,
                ),
                WidgetFactory.create(
                    "CheckButton",
                    label=_('Disable "Fast User Switching"'),
                    key="/desktop/gnome/lockdown/disable_user_switching",
                    backend=GConf,
                    enable_reset=True,
                ),
            ),
            padding=2,
        )

        self.add_start(box, False, False, 0)
Esempio n. 14
0
    def __init__(self):
        TweakModule.__init__(self)

        box = ListPack(_("File Browser"), (
                  WidgetFactory.create("CheckButton",
                                       label=_('Show advanced permissions in the Nautilus "File Properties" window'),
                                       enable_reset=True,
                                       key="org.gnome.nautilus.preferences.show-advanced-permissions",
                                       backend="gsettings"),
                  WidgetFactory.create("CheckButton",
                                       label=_('Always use the location entry, instead of the pathbar'),
                                       enable_reset=True,
                                       key="org.gnome.nautilus.preferences.always-use-location-entry",
                                       backend="gsettings")))
        self.add_start(box, False, False, 0)

        box = TablePack(_('Thumbnail Settings'), (
                    WidgetFactory.create('SpinButton',
                                         key='org.gnome.nautilus.icon-view.thumbnail-size',
                                         enable_reset=True,
                                         min=16, max=512, step=16,
                                         label=_('Default thumbnail icon size (pixels)'),
                                         backend="gsettings"),
                    WidgetFactory.create('SpinButton',
                                         key='org.gnome.desktop.thumbnail-cache.maximum-size',
                                         enable_reset=True,
                                         min=-1, max=512, step=1,
                                         label=_('Maximum thumbnail cache size (megabytes)'),
                                         backend="gsettings"),
                    WidgetFactory.create('SpinButton',
                                          key='org.gnome.desktop.thumbnail-cache.maximum-age',
                                          enable_reset=True,
                                          min=-1, max=180, step=1,
                                          label=_('Thumbnail cache time (days)'),
                                          backend="gsettings"),
            ))
        self.add_start(box, False, False, 0)

        box = TablePack(_('Automatically Mount Settings'), (
                    WidgetFactory.create('CheckButton',
                                         key='org.gnome.desktop.media-handling.automount',
                                         enable_reset=True,
                                         label=_('Whether to automatically mount media'),
                                         backend="gsettings"),
                    WidgetFactory.create('CheckButton',
                                         key='org.gnome.desktop.media-handling.automount-open',
                                         enable_reset=True,
                                         label=_('Whether to automatically open a folder for automounted media'),
                                         backend="gsettings"),
                    WidgetFactory.create('CheckButton',
                                          key='org.gnome.desktop.media-handling.autorun-never',
                                          enable_reset=True,
                                          label=_('Never prompt or autorun/autostart programs when media are inserted'),
                                          backend="gsettings"),
            ))
        self.add_start(box, False, False, 0)
Esempio n. 15
0
    def __init__(self):
        TweakModule.__init__(self)

        box = GridPack(
                    WidgetFactory.create("Switch",
                        label=self.utext_pathbar,
                        enable_reset=True,
                        key="org.gnome.nautilus.preferences.always-use-location-entry",
                        backend="gsettings"),
                    WidgetFactory.create('Switch',
                        key='org.gnome.nautilus.preferences.enable-interactive-search',
                        enable_reset=True,
                        reverse=True,
                        label=self.recursive_search,
                        backend="gsettings"),
                    WidgetFactory.create('Switch',
                        key='org.gnome.desktop.media-handling.automount',
                        enable_reset=True,
                        label=self.utext_automount,
                        backend="gsettings"),
                    WidgetFactory.create('Switch',
                        key='org.gnome.desktop.media-handling.automount-open',
                        enable_reset=True,
                        label=self.utext_open,
                        backend="gsettings"),
                    WidgetFactory.create('Switch',
                        key='org.gnome.desktop.media-handling.autorun-never',
                        enable_reset=True,
                        reverse=True,
                        label=self.utext_prompt,
                        backend="gsettings"),
                    Gtk.Separator(),
                    WidgetFactory.create('Scale',
                        key='org.gnome.nautilus.icon-view.thumbnail-size',
                        enable_reset=True,
                        min=16, max=512,
                        step=16,
                        label=self.utext_thumbnail_icon_size,
                        backend="gsettings"),
                    WidgetFactory.create('Scale',
                        key='org.gnome.desktop.thumbnail-cache.maximum-age',
                        enable_reset=True,
                        min=-1, max=180,
                        step=1,
                        label=self.utext_thumbnail_cache_age,
                        backend="gsettings"),
                    WidgetFactory.create('Scale',
                        key='org.gnome.desktop.thumbnail-cache.maximum-size',
                        enable_reset=True,
                        min=-1, max=512,
                        step=1,
                        label=self.utext_thumbnail_cache_size,
                        backend="gsettings"),
        )
        self.add_start(box, False, False, 0)
Esempio n. 16
0
    def test_widget_factory(self):
        # Normal case
        user_indicator_label, user_menu_switch, reset_button = WidgetFactory.create(
            "Switch",
            label='user-indicator',
            enable_reset=True,
            backend="gsettings",
            key='com.canonical.indicator.session.user-show-menu')

        self.assertTrue(isinstance(user_indicator_label, Gtk.Label))
        self.assertTrue(isinstance(user_menu_switch, Gtk.Switch))
        self.assertTrue(isinstance(reset_button, Gtk.Button))

        # No reset case
        user_indicator_label, user_menu_switch = WidgetFactory.create(
            "Switch",
            label='user-indicator',
            backend="gsettings",
            key='com.canonical.indicator.session.user-show-menu')
        self.assertTrue(isinstance(user_indicator_label, Gtk.Label))
        self.assertTrue(isinstance(user_menu_switch, Gtk.Switch))

        # Failed case, no reset
        user_indicator_label, user_menu_switch = WidgetFactory.create(
            "Switch",
            label='user-indicator',
            backend="gsettings",
            key='org.canonical.indicator.session.user-show-menu')
        self.assertFalse(user_indicator_label)
        self.assertFalse(user_menu_switch)

        # Failed case, reset
        user_indicator_label, user_menu_switch, reset_button = WidgetFactory.create(
            "Switch",
            label='user-indicator',
            enable_reset=True,
            backend="gsettings",
            key='org.canonical.indicator.session.user-show-menu')

        self.assertFalse(user_indicator_label)
        self.assertFalse(user_menu_switch)
        self.assertFalse(reset_button)
Esempio n. 17
0
    def __init__(self):
        TweakModule.__init__(self)

        show_label, show_switch = WidgetFactory.create(
            "Switch",
            label=self.utext_show_icon,
            key="org.gnome.desktop.background.show-desktop-icons",
            backend="gsettings",
        )

        setting_list = []
        show_switch.connect("notify::active", self.on_show_button_changed, setting_list)

        for item in desktop_icons:
            setting_list.append(DesktopIcon(item))

        volumes_button = WidgetFactory.create(
            "CheckButton",
            label=self.utext_mount_volume,
            key="org.gnome.nautilus.desktop.volumes-visible",
            backend="gsettings",
        )
        setting_list.append(volumes_button)

        home_contents_button = WidgetFactory.create(
            "CheckButton",
            label=self.utext_home_folder,
            key="org.gnome.nautilus.preferences.desktop-is-home-dir",
            backend="gsettings",
        )
        setting_list.append(home_contents_button)

        notes_label = Gtk.Label()
        notes_label.set_property("halign", Gtk.Align.START)
        notes_label.set_markup(
            '<span size="smaller">%s</span>' % _("Note: switch off this option will make the desktop unclickable")
        )
        notes_label._ut_left = 1

        grid_box = GridPack((show_label, show_switch), notes_label, *setting_list)
        self.add_start(grid_box)
        self.on_show_button_changed(show_switch, None, setting_list)
Esempio n. 18
0
    def __init__(self):
        TweakModule.__init__(self)

        show_label, show_switch = WidgetFactory.create(
            "Switch",
            label=self.utext_show_icon,
            key="org.gnome.desktop.background.show-desktop-icons",
            backend="gsettings")

        setting_list = []
        show_switch.connect('notify::active', self.on_show_button_changed,
                            setting_list)

        for item in desktop_icons:
            setting_list.append(DesktopIcon(item))

        volumes_button = WidgetFactory.create(
            "CheckButton",
            label=self.utext_mount_volume,
            key="org.gnome.nautilus.desktop.volumes-visible",
            backend="gsettings")
        setting_list.append(volumes_button)

        if system.CODENAME != 'saucy':
            home_contents_button = WidgetFactory.create(
                "CheckButton",
                label=self.utext_home_folder,
                key="org.gnome.nautilus.preferences.desktop-is-home-dir",
                backend="gsettings")
            setting_list.append(home_contents_button)

        notes_label = Gtk.Label()
        notes_label.set_property('halign', Gtk.Align.START)
        notes_label.set_markup('<span size="smaller">%s</span>' % \
                _('Note: switch off this option will make the desktop unclickable'))
        notes_label._ut_left = 1

        grid_box = GridPack((show_label, show_switch), notes_label,
                            *setting_list)
        self.add_start(grid_box)
        self.on_show_button_changed(show_switch, None, setting_list)
Esempio n. 19
0
    def __init__(self):
        TweakModule.__init__(self)

        box = ListPack(
            _("Session Menu Options"),
            (
                WidgetFactory.create(
                    "CheckButton",
                    label=_("Remove the log out item from the session menu"),
                    enable_reset=True,
                    backend="gsettings",
                    key="com.canonical.indicator.session.suppress-logout-menuitem",
                ),
                WidgetFactory.create(
                    "CheckButton",
                    label=_("Remove the restart item from the session menu"),
                    enable_reset=True,
                    backend="gsettings",
                    key="com.canonical.indicator.session.suppress-restart-menuitem",
                ),
                WidgetFactory.create(
                    "CheckButton",
                    label=_("Remove the shutdown item from the session menu"),
                    enable_reset=True,
                    backend="gsettings",
                    key="com.canonical.indicator.session.suppress-shutdown-menuitem",
                ),
                WidgetFactory.create(
                    "CheckButton",
                    label=_("Suppress the dialog to confirm logout, restart and shutdown action"),
                    enable_reset=True,
                    backend="gsettings",
                    key="com.canonical.indicator.session.suppress-logout-restart-shutdown",
                ),
            ),
        )

        self.add_start(box, False, False, 0)

        box = ListPack(
            _("User Menu Options"),
            (
                WidgetFactory.create(
                    "CheckButton",
                    label=_("Show user menu"),
                    enable_reset=True,
                    backend="gsettings",
                    key="com.canonical.indicator.session.user-show-menu",
                ),
                WidgetFactory.create(
                    "CheckButton",
                    label=_("Show user's real name on the panel"),
                    enable_reset=True,
                    backend="gsettings",
                    key="com.canonical.indicator.session.show-real-name-on-panel",
                ),
            ),
        )
        self.add_start(box, False, False, 0)
Esempio n. 20
0
    def __init__(self):
        TweakModule.__init__(self)

        self.is_arabic = os.getenv('LANG').startswith('ar')

        hbox = Gtk.HBox(spacing=12)
        hbox.pack_start(self.create_edge_setting(), True, False, 0)
        self.add_start(hbox, False, False, 0)

        self.add_start(Gtk.Separator(), False, False, 6)

        grid_pack = GridPack(
                WidgetFactory.create("Scale",
                             label=self.utext_edge_delay,
                             key="core.edge_delay",
                             backend="compiz",
                             min=0,
                             max=1000,
                             step=50,
                             enable_reset=True),
                WidgetFactory.create("Scale",
                             label=self.utext_hsize,
                             key="core.hsize",
                             backend="compiz",
                             min=1,
                             max=16,
                             step=1,
                             enable_reset=True),
                WidgetFactory.create("Scale",
                             label=self.utext_vsize,
                             key="core.vsize",
                             backend="compiz",
                             min=1,
                             max=16,
                             step=1,
                             enable_reset=True),
                )

        self.add_start(grid_pack, False, False, 0)
Esempio n. 21
0
    def __init__(self):
        TweakModule.__init__(self)

        valid_themes = self._get_valid_themes()
        valid_icon_themes = self._get_valid_icon_themes()
        valid_cursor_themes = self._get_valid_cursor_themes()
        valid_window_themes = self._get_valid_window_themes()

        self.theme_box = TablePack(_('Desktop theme'), (
                            WidgetFactory.create('ComboBox',
                                                 label='Gtk theme',
                                                 key='org.gnome.desktop.interface.gtk-theme',
                                                 backend='gsettings',
                                                 texts=valid_themes,
                                                 values=valid_themes,
                                                 ),
                            WidgetFactory.create('ComboBox',
                                                 label='Icon theme',
                                                 key='org.gnome.desktop.interface.icon-theme',
                                                 backend='gsettings',
                                                 texts=valid_icon_themes,
                                                 values=valid_icon_themes,
                                                 ),
                            WidgetFactory.create('ComboBox',
                                                 label='Cursor theme',
                                                 key='org.gnome.desktop.interface.cursor-theme',
                                                 backend='gsettings',
                                                 texts=valid_cursor_themes,
                                                 values=valid_cursor_themes,
                                                 ),
                            WidgetFactory.create('ComboBox',
                                                 label='Window theme',
                                                 key='/apps/metacity/general/theme',
                                                 backend='gconf',
                                                 texts=valid_window_themes,
                                                 values=valid_window_themes,
                                                 ),
                            ))
        self.add_start(self.theme_box, False, False, 0)
Esempio n. 22
0
    def __init__(self):
        TweakModule.__init__(self, 'loginsettings.ui')

        if system.CODENAME != 'oneiric':
            valid_themes = theme.get_valid_themes()
            valid_icon_themes = theme.get_valid_icon_themes()

            self.login_box = GridPack(
                            WidgetFactory.create('Switch',
                                label=self.utext_draw_grid,
                                key='50_unity-greeter.gschema.override::com.canonical.unity-greeter#draw-grid',
                                backend='systemconfig'),
                            WidgetFactory.create('Switch',
                                label=self.utext_login_sound,
                                key='50_unity-greeter.gschema.override::com.canonical.unity-greeter#play-ready-sound',
                                backend='systemconfig'),
                            WidgetFactory.create('ComboBox',
                                label=self.utext_gtk_theme,
                                key='50_unity-greeter.gschema.override::com.canonical.unity-greeter#theme-name',
                                backend='systemconfig',
                                texts=valid_themes,
                                values=valid_themes),
                            WidgetFactory.create('ComboBox',
                                label=self.utext_icon_theme,
                                key='50_unity-greeter.gschema.override::com.canonical.unity-greeter#icon-theme-name',
                                backend='systemconfig',
                                texts=valid_icon_themes,
                                values=valid_icon_themes),
                            )

            self.login_box.set_sensitive(False)
            self.add_start(self.login_box, False, False, 0)
            self.add_start(Gtk.Separator(), False, False, 6)

        self._setup_logo_image()
        self._setup_background_image()

        box = ListPack('', (self.main_vbox))
        self.add_start(box, False, False, 0)
Esempio n. 23
0
    def __init__(self):
        TweakModule.__init__(self)

        if system.CODENAME == 'quantal':
            user_indicator_label, user_menu_switch, reset_button = None, None, None
        else:
            user_indicator_label, user_menu_switch, reset_button = WidgetFactory.create(
                "Switch",
                label=self.utext_user_indicator,
                enable_reset=True,
                backend="gsettings",
                key='com.canonical.indicator.session.user-show-menu')

        lockscreen_button, lockscreen_reset_button = WidgetFactory.create(
            "CheckButton",
            label=self.utext_lock_screen,
            key="org.gnome.desktop.lockdown.disable-lock-screen",
            backend="gsettings",
            enable_reset=True)

        box = GridPack(
            (user_indicator_label, user_menu_switch, reset_button),
            WidgetFactory.create(
                "CheckButton",
                label=self.utext_real_name,
                enable_reset=True,
                blank_label=True,
                backend="gsettings",
                key="com.canonical.indicator.session.show-real-name-on-panel"),
            Gtk.Separator(),
            (Gtk.Label(_("Session indicator:")), lockscreen_button,
             lockscreen_reset_button),
            WidgetFactory.create(
                "CheckButton",
                label=self.utext_logout,
                enable_reset=True,
                blank_label=True,
                backend="gsettings",
                key="com.canonical.indicator.session.suppress-logout-menuitem"
            ),
            WidgetFactory.create(
                "CheckButton",
                label=self.utext_shutdown,
                enable_reset=True,
                blank_label=True,
                backend="gsettings",
                key="com.canonical.indicator.session.suppress-shutdown-menuitem"
            ),
            WidgetFactory.create(
                "CheckButton",
                label=self.utext_suppress_logout,
                enable_reset=True,
                blank_label=True,
                backend="gsettings",
                key=
                "com.canonical.indicator.session.suppress-logout-restart-shutdown"
            ),
        )
        self.add_start(box, False, False, 0)
Esempio n. 24
0
    def test_widget_factory(self):
        # Normal case
        user_indicator_label, user_menu_switch, reset_button = WidgetFactory.create("Switch",
                                  label='user-indicator',
                                  enable_reset=True,
                                  backend="gsettings",
                                  key='com.canonical.indicator.session.user-show-menu')

        self.assertTrue(isinstance(user_indicator_label, Gtk.Label))
        self.assertTrue(isinstance(user_menu_switch, Gtk.Switch))
        self.assertTrue(isinstance(reset_button, Gtk.Button))

        # No reset case
        user_indicator_label, user_menu_switch = WidgetFactory.create("Switch",
                                  label='user-indicator',
                                  backend="gsettings",
                                  key='com.canonical.indicator.session.user-show-menu')
        self.assertTrue(isinstance(user_indicator_label, Gtk.Label))
        self.assertTrue(isinstance(user_menu_switch, Gtk.Switch))

        # Failed case, no reset
        user_indicator_label, user_menu_switch = WidgetFactory.create("Switch",
                                  label='user-indicator',
                                  backend="gsettings",
                                  key='org.canonical.indicator.session.user-show-menu')
        self.assertFalse(user_indicator_label)
        self.assertFalse(user_menu_switch)

        # Failed case, reset
        user_indicator_label, user_menu_switch, reset_button = WidgetFactory.create("Switch",
                                  label='user-indicator',
                                  enable_reset=True,
                                  backend="gsettings",
                                  key='org.canonical.indicator.session.user-show-menu')

        self.assertFalse(user_indicator_label)
        self.assertFalse(user_menu_switch)
        self.assertFalse(reset_button)
Esempio n. 25
0
    def __init__(self):
        TweakModule.__init__(self)

        box = TablePack(_("Launcher"), (
                    WidgetFactory.create("Scale",
                                         label=_('Icon size'),
                                         key="unityshell.icon_size",
                                         min=32,
                                         max=64,
                                         backend="compiz",
                                         enable_reset=True),
                    WidgetFactory.create("Scale",
                                         label=_('Launcher opacity'),
                                         key="unityshell.launcher_opacity",
                                         min=0,
                                         max=1,
                                         digits=2,
                                         backend="compiz",
                                         enable_reset=True),
                    WidgetFactory.create("Scale",
                                         label=_('Launcher reveal edge timeout'),
                                         key="unityshell.launcher_reveal_edge_timeout",
                                         min=1,
                                         max=1000,
                                         backend="compiz",
                                         enable_reset=True),
                    WidgetFactory.create("ComboBox",
                                         label=_('Launcher hide mode'),
                                         key="unityshell.launcher_hide_mode",
                                         texts=(_('Never'), _('Auto Hide'),
                                                _('Dodge Window'), _('Dodge Active Window')),
                                         values=(0, 1, 2, 3),
                                         type='int',
                                         backend="compiz",
                                         enable_reset=True),
            ))

        self.add_start(box, False, False, 0)
Esempio n. 26
0
    def __init__(self):
        TweakModule.__init__(self)

        box = ListPack(_("File Browser"), (
                  WidgetFactory.create("CheckButton",
                                       label=_('Show advanced permissions in the Nautilus "File Properties" window'),
                                       enable_reset=True,
                                       key="/apps/nautilus/preferences/show_advanced_permissions",
                                       backend=GConf),
                  WidgetFactory.create("CheckButton",
                                       label=_('Always use the location entry, instead of the pathbar'),
                                       enable_reset=True,
                                       key="/apps/nautilus/preferences/always_use_location_entry",
                                       backend=GConf)))
        self.add_start(box, False, False, 0)

        box = TablePack(_('Thumbnail Settings'), (
                    WidgetFactory.create('SpinButton',
                                         key='/apps/nautilus/icon_view/thumbnail_size',
                                         enable_reset=True,
                                         min=16, max=512, step=16,
                                         label=_('Default thumbnail icon size (pixels)'),
                                         backend=GConf),
                    WidgetFactory.create('SpinButton',
                                         key='/desktop/gnome/thumbnail_cache/maximum_size',
                                         enable_reset=True,
                                         min=-1, max=512, step=1,
                                         label=_('Maximum thumbnail cache size (megabytes)'),
                                         backend=GConf),
                    WidgetFactory.create('SpinButton',
                                          key='/desktop/gnome/thumbnail_cache/maximum_age',
                                          enable_reset=True,
                                          min=-1, max=180, step=1,
                                          label=_('Thumbnail cache time (days)'),
                                          backend=GConf),
            ))
        self.add_start(box, False, False, 0)
Esempio n. 27
0
    def __init__(self):
        TweakModule.__init__(self)

        self.show_button = WidgetFactory.create("CheckButton",
                                                label=_("Show desktop icons"),
                                                key="org.gnome.desktop.background.show-desktop-icons",
                                                backend="gsettings")
        self.show_button.connect('toggled', self.on_show_button_changed)
        self.add_start(self.show_button, False, False, 0)

        self.show_button_box = Gtk.HBox(spacing=12)
        self.add_start(self.show_button_box, False, False, 0)

        if not self.show_button.get_active():
            self.show_button_box.set_sensitive(False)

        label = Gtk.Label(label=" ")
        self.show_button_box.pack_start(label, False, False, 0)

        vbox = Gtk.VBox(spacing=6)
        self.show_button_box.pack_start(vbox, False, False, 0)

        for item in desktop_icons:
            vbox.pack_start(DesktopIcon(item), False, False, 0)

        button = WidgetFactory.create("CheckButton",
                                      label=_("Show mounted volumes on desktop"),
                                      key="org.gnome.nautilus.desktop.volumes-visible",
                                      backend="gsettings")
        vbox.pack_start(button, False, False, 0)

        button = WidgetFactory.create("CheckButton",
                                      label=_('Show contents of "Home Folder" on desktop'),
                                      key="org.gnome.nautilus.preferences.desktop-is-home-dir",
                                      backend="gsettings")
        vbox.pack_start(button, False, False, 0)
Esempio n. 28
0
    def __init__(self):
        TweakModule.__init__(self)

        self.theme_box = TablePack(_('Buttons and Menus'), (
                            WidgetFactory.create('CheckButton',
                                                 label=_('Buttons have icons'),
                                                 key='org.gnome.desktop.interface.buttons-have-icons',
                                                 backend='gsettings',
                                                 ),
                            WidgetFactory.create('CheckButton',
                                                 label=_('Menus have icons'),
                                                 key='org.gnome.desktop.interface.menus-have-icons',
                                                 backend='gsettings',
                                                 ),
                            WidgetFactory.create('CheckButton',
                                                 label=_("Show Input Method menu in the context menu"),
                                                 key='org.gnome.desktop.interface.show-input-method-menu',
                                                 backend='gsettings',
                                                 ),
                            WidgetFactory.create('CheckButton',
                                                 label=_("Show Unicode Control Character menu in the context menu"),
                                                 key='org.gnome.desktop.interface.show-unicode-menu',
                                                 backend='gsettings',
                                                 ),
                            ))
        self.add_start(self.theme_box, False, False, 0)

        self.theme_box = TablePack(_('Miscellaneous'), (
                            WidgetFactory.create('CheckButton',
                                                 label='Cursor blink',
                                                 key='org.gnome.desktop.interface.cursor-blink',
                                                 backend='gsettings',
                                                 ),
                            WidgetFactory.create('Scale',
                                                 label='Cursor blink time',
                                                 key='org.gnome.desktop.interface.cursor-blink-time',
                                                 backend='gsettings',
                                                 min=100,
                                                 max=2500,
                                                 type=int,
                                                 ),
                            WidgetFactory.create('SpinButton',
                                                 label='Cursor blink timeout',
                                                 key='org.gnome.desktop.interface.cursor-blink-timeout',
                                                 backend='gsettings',
                                                 min=1,
                                                 max=2147483647,
                                                 ),
                            ))
        self.add_start(self.theme_box, False, False, 0)
Esempio n. 29
0
    def __init__(self):
        TweakModule.__init__(self)

        box = GridPack(
                    WidgetFactory.create("Switch",
                            label=self.utext_pathbar,
                            enable_reset=True,
                            key="org.gnome.nautilus.preferences.always-use-location-entry",
                            backend="gsettings"),
                    WidgetFactory.create('Switch',
                                         key='org.gnome.desktop.media-handling.automount',
                                         enable_reset=True,
                                         label=self.utext_automount,
                                         backend="gsettings"),
                    WidgetFactory.create('Switch',
                                         key='org.gnome.desktop.media-handling.automount-open',
                                         enable_reset=True,
                                         label=self.utext_open,
                                         backend="gsettings"),
                    WidgetFactory.create('Switch',
                        key='org.gnome.desktop.media-handling.autorun-never',
                        enable_reset=True,
                        reverse=True,
                        label=self.utext_prompt,
                        backend="gsettings"),
                    Gtk.Separator(),
                    WidgetFactory.create('Scale',
                        key='org.gnome.nautilus.icon-view.thumbnail-size',
                        enable_reset=True,
                        min=16, max=512,
                        step=16,
                        label=self.utext_thumbnail_icon_size,
                        backend="gsettings"),
                    WidgetFactory.create('Scale',
                        key='org.gnome.desktop.thumbnail-cache.maximum-age',
                        enable_reset=True,
                        min=-1, max=180,
                        step=1,
                        label=self.utext_thumbnail_cache_age,
                        backend="gsettings"),
                    WidgetFactory.create('Scale',
                        key='org.gnome.desktop.thumbnail-cache.maximum-size',
                        enable_reset=True,
                        min=-1, max=512,
                        step=1,
                        label=self.utext_thumbnail_cache_size,
                        backend="gsettings"),
        )
        self.add_start(box, False, False, 0)
Esempio n. 30
0
    def __init__(self, parent):
        GuiBuilder.__init__(self, file_name='preferences.ui')

        self.preferences_dialog.set_transient_for(parent)
        self.clips_setting = GSetting('com.ubuntu-tweak.tweak.clips')
        self.tweaks_setting = GSetting('com.ubuntu-tweak.tweak.tweaks')
        self.admins_setting = GSetting('com.ubuntu-tweak.tweak.admins')
        self.janitor_setting = GSetting('com.ubuntu-tweak.janitor.plugins')
        self.clips_location_setting = GSetting('com.ubuntu-tweak.tweak.last-clip-location')
        
        auto_scan_label, auto_scan_switch = WidgetFactory.create("Switch",
                                                label=_("Auto scan:"),
                                                key='com.ubuntu-tweak.janitor.auto-scan',
                                                backend="gsettings")
        pack = GridPack((auto_scan_label, auto_scan_switch))
        self.generic_alignment.add(pack)

        self.generic_alignment.show_all()
Esempio n. 31
0
    def __init__(self):
        TweakModule.__init__(self)

        self.fix_theme_button = Gtk.Switch()
        self.fix_theme_label = Gtk.Label(self.utext_fix_theme)
        self.set_fix_theme_button_status()

        self.fix_theme_button.connect('notify::active', self.on_fix_theme_button_toggled)

        box = GridPack(
                (self.fix_theme_label, self.fix_theme_button),
                WidgetFactory.create("Switch",
                                     label=self.utext_chinese_gedit,
                                     key="org.gnome.gedit.preferences.encodings.auto-detected",
                                     on=['GB18030', 'UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16'],
                                     off=['UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16'],
                                     backend="gsettings",
                                     enable_reset=True)
            )
        self.add_start(box)
Esempio n. 32
0
    def __init__(self, parent):
        GuiBuilder.__init__(self, file_name='preferences.ui')

        self.preferences_dialog.set_transient_for(parent)
        self.clips_setting = GSetting('com.ubuntu-tweak.tweak.clips')
        self.tweaks_setting = GSetting('com.ubuntu-tweak.tweak.tweaks')
        self.admins_setting = GSetting('com.ubuntu-tweak.tweak.admins')
        self.janitor_setting = GSetting('com.ubuntu-tweak.janitor.plugins')
        self.clips_location_setting = GSetting(
            'com.ubuntu-tweak.tweak.last-clip-location')

        auto_scan_label, auto_scan_switch = WidgetFactory.create(
            "Switch",
            label=_("Auto scan:"),
            key='com.ubuntu-tweak.janitor.auto-scan',
            backend="gsettings")
        pack = GridPack((auto_scan_label, auto_scan_switch))
        self.generic_alignment.add(pack)

        self.generic_alignment.show_all()
Esempio n. 33
0
    def __init__(self):
        TweakModule.__init__(self)

        if system.CODENAME == 'quantal':
            user_indicator_label, user_menu_switch, reset_button = None, None, None
        else:
            user_indicator_label, user_menu_switch, reset_button = WidgetFactory.create("Switch",
                                      label=self.utext_user_indicator,
                                      enable_reset=True,
                                      backend="gsettings",
                                      key='com.canonical.indicator.session.user-show-menu')

        lockscreen_button, lockscreen_reset_button = WidgetFactory.create("CheckButton",
                     label=self.utext_lock_screen,
                     key="org.gnome.desktop.lockdown.disable-lock-screen",
                     backend="gsettings",
                     enable_reset=True)

        box = GridPack(
                (user_indicator_label, user_menu_switch, reset_button),
                  WidgetFactory.create("CheckButton",
                                  label=self.utext_real_name,
                                  enable_reset=True,
                                  blank_label=True,
                                  backend="gsettings",
                                  key="com.canonical.indicator.session.show-real-name-on-panel"),
                  Gtk.Separator(),
                  (Gtk.Label(_("Session indicator:")), lockscreen_button, lockscreen_reset_button),
                  WidgetFactory.create("CheckButton",
                      label=self.utext_logout,
                      enable_reset=True,
                      blank_label=True,
                      backend="gsettings",
                      key="com.canonical.indicator.session.suppress-logout-menuitem"),
                  WidgetFactory.create("CheckButton",
                      label=self.utext_shutdown,
                      enable_reset=True,
                      blank_label=True,
                      backend="gsettings",
                      key="com.canonical.indicator.session.suppress-shutdown-menuitem"),
                  WidgetFactory.create("CheckButton",
                      label=self.utext_suppress_logout,
                      enable_reset=True,
                      blank_label=True,
                      backend="gsettings",
                      key="com.canonical.indicator.session.suppress-logout-restart-shutdown"),
          )
        self.add_start(box, False, False, 0)
Esempio n. 34
0
    def __init__(self):
        TweakModule.__init__(self)

        self.fix_theme_button = Gtk.Switch()
        self.fix_theme_label = Gtk.Label(self.utext_fix_theme)
        self.set_fix_theme_button_status()

        self.fix_theme_button.connect('notify::active',
                                      self.on_fix_theme_button_toggled)

        box = GridPack(
            (self.fix_theme_label, self.fix_theme_button),
            WidgetFactory.create(
                "Switch",
                label=self.utext_chinese_gedit,
                key="org.gnome.gedit.preferences.encodings.auto-detected",
                on=['GB18030', 'UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16'],
                off=['UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16'],
                backend="gsettings",
                enable_reset=True))
        self.add_start(box)
Esempio n. 35
0
    def __init__(self):
        TweakModule.__init__(self, 'window.ui')

        close_pattern = re.compile('\w+')

        only_close_switch = Gtk.Switch()
        only_close_switch.connect('notify::active', self.on_switch_activate)
        button_value = self.config.get_value()
        if len(close_pattern.findall(
                button_value)) == 1 and 'close' in button_value:
            only_close_switch.set_active(True)
        only_close_label = Gtk.Label(self.utext_only_close_button)

        if system.CODENAME == 'quantal' and system.DESKTOP == 'ubuntu':
            box = GridPack(
                        (Gtk.Label(self.utext_window_button),
                         self.place_hbox),
                        (only_close_label, only_close_switch),
                        Gtk.Separator(),
                        WidgetFactory.create('ComboBox',
                            label=self.utext_titlebar_wheel,
                            key='org.compiz.gwd.mouse-wheel-action',
                            enable_reset=True,
                            backend='gsettings',
                            texts=[_('None'), _('Roll up')],
                            values=['none', 'shade']),
                        WidgetFactory.create('ComboBox',
                            label=self.utext_titlebar_double,
                            key='org.gnome.desktop.wm.preferences.action-double-click-titlebar',
                            enable_reset=True,
                            backend='gsettings',
                            texts=[_('None'), _('Maximize'), \
                                   _('Minimize'), _('Roll up'), \
                                   _('Lower'), _('Menu')],
                            values=['none', 'toggle-maximize', \
                                    'minimize', 'toggle-shade', \
                                    'lower', 'menu']),
                        WidgetFactory.create('ComboBox',
                            label=self.utext_titlebar_middle,
                            key='org.gnome.desktop.wm.preferences.action-middle-click-titlebar',
                            enable_reset=True,
                            backend="gsettings",
                            texts=[_('None'), _('Maximize'), \
                                   _('Minimize'), _('Roll up'), \
                                   _('Lower'), _('Menu')],
                            values=['none', 'toggle-maximize', \
                                    'minimize', 'toggle-shade', \
                                    'lower', 'menu']),
                        WidgetFactory.create('ComboBox',
                            label=self.utext_titlebar_right,
                            key='org.gnome.desktop.wm.preferences.action-right-click-titlebar',
                            enable_reset=True,
                            backend="gsettings",
                            texts=[_('None'), _('Maximize'), \
                                   _('Minimize'), _('Roll up'), \
                                   _('Lower'), _('Menu')],
                            values=['none', 'toggle-maximize', \
                                    'minimize', 'toggle-shade', \
                                    'lower', 'menu']),
                        )

            self.add_start(box)
        else:
            box = GridPack(
                        (Gtk.Label(self.utext_window_button),
                         self.place_hbox),
                        (only_close_label, only_close_switch),
                        Gtk.Separator(),
                        WidgetFactory.create('ComboBox',
                            label=self.utext_titlebar_wheel,
                            key='/apps/gwd/mouse_wheel_action',
                            enable_reset=True,
                            backend='gconf',
                            texts=[_('None'), _('Roll up')],
                            values=['none', 'shade']),
                        WidgetFactory.create('ComboBox',
                            label=self.utext_titlebar_double,
                            key='/apps/metacity/general/action_double_click_titlebar',
                            enable_reset=True,
                            backend='gconf',
                            texts=[_('None'), _('Maximize'), \
                                    _('Minimize'), _('Roll up'), \
                                    _('Lower'), _('Menu')],
                            values=['none', 'toggle_maximize', \
                                    'minimize', 'toggle_shade', \
                                    'lower', 'menu']),
                        WidgetFactory.create('ComboBox',
                            label=self.utext_titlebar_middle,
                            key='/apps/metacity/general/action_middle_click_titlebar',
                            enable_reset=True,
                            backend="gconf",
                            texts=[_('None'), _('Maximize'), \
                                   _('Maximize Horizontally'), \
                                   _('Maximize Vertically'), \
                                   _('Minimize'), _('Roll up'), \
                                   _('Lower'), _('Menu')],
                                   values=['none', 'toggle_maximize', \
                                           'toggle_maximize_horizontally', \
                                           'toggle_maximize_vertically', \
                                           'minimize', 'toggle_shade', \
                                           'lower', 'menu']),
                        WidgetFactory.create('ComboBox',
                            label=self.utext_titlebar_right,
                            key='/apps/metacity/general/action_right_click_titlebar',
                            enable_reset=True,
                            backend="gconf",
                            texts=[_('None'), _('Maximize'), \
                                    _('Maximize Horizontally'), \
                                    _('Maximize Vertically'), \
                                    _('Minimize'), _('Roll up'), \
                                    _('Lower'), _('Menu')],
                            values=['none', 'toggle_maximize', \
                                    'toggle_maximize_horizontally', \
                                    'toggle_maximize_vertically', \
                                    'minimize', 'toggle_shade', \
                                    'lower', 'menu']),
                    )

            self.add_start(box)
Esempio n. 36
0
    def __init__(self):
        TweakModule.__init__(self, "metacity.ui")

        swindow = Gtk.ScrolledWindow()
        swindow.set_size_request(-1, 54)
        swindow.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
        self.buttonview = ButtonView()
        swindow.add(self.buttonview)
        self.vbox2.pack_start(swindow, False, False, 0)

        for value, label in ButtonView.get_control_items():
            button = WindowControlButton(label, value, self.buttonview)
            self.control_hbox.pack_start(button, False, False, 0)

        box = ListPack(_("Window Titlebar Button Layout"), [child for child in self.main_vbox.get_children()])
        self.add_start(box, False, False, 0)
        self.init_control_buttons()

        table = TablePack(
            _("Window Titlebar Actions"),
            (
                WidgetFactory.create(
                    "ComboBox",
                    label=_("Titlebar mouse wheel action"),
                    key="/apps/gwd/mouse_wheel_action",
                    enable_reset=True,
                    backend=GConf,
                    texts=[_("None"), _("Roll up")],
                    values=["none", "shade"],
                ),
                # TODO the toggle_maximize_horizontally and vertically may not work
                WidgetFactory.create(
                    "ComboBox",
                    label=_("Titlebar double-click action"),
                    key="/apps/metacity/general/action_double_click_titlebar",
                    enable_reset=True,
                    backend=GConf,
                    texts=[
                        _("None"),
                        _("Maximize"),
                        _("Maximize Horizontally"),
                        _("Maximize Vertically"),
                        _("Minimize"),
                        _("Roll up"),
                        _("Lower"),
                        _("Menu"),
                    ],
                    values=[
                        "none",
                        "toggle_maximize",
                        "toggle_maximize_horizontally",
                        "toggle_maximize_vertically",
                        "minimize",
                        "toggle_shade",
                        "lower",
                        "menu",
                    ],
                ),
                WidgetFactory.create(
                    "ComboBox",
                    label=_("Titlebar middle-click action"),
                    key="/apps/metacity/general/action_middle_click_titlebar",
                    enable_reset=True,
                    backend=GConf,
                    texts=[
                        _("None"),
                        _("Maximize"),
                        _("Maximize Horizontally"),
                        _("Maximize Vertically"),
                        _("Minimize"),
                        _("Roll up"),
                        _("Lower"),
                        _("Menu"),
                    ],
                    values=[
                        "none",
                        "toggle_maximize",
                        "toggle_maximize_horizontally",
                        "toggle_maximize_vertically",
                        "minimize",
                        "toggle_shade",
                        "lower",
                        "menu",
                    ],
                ),
                WidgetFactory.create(
                    "ComboBox",
                    label=_("Titlebar right-click action"),
                    key="/apps/metacity/general/action_right_click_titlebar",
                    enable_reset=True,
                    backend=GConf,
                    texts=[
                        _("None"),
                        _("Maximize"),
                        _("Maximize Horizontally"),
                        _("Maximize Vertically"),
                        _("Minimize"),
                        _("Roll up"),
                        _("Lower"),
                        _("Menu"),
                    ],
                    values=[
                        "none",
                        "toggle_maximize",
                        "toggle_maximize_horizontally",
                        "toggle_maximize_vertically",
                        "minimize",
                        "toggle_shade",
                        "lower",
                        "menu",
                    ],
                ),
            ),
        )

        self.add_start(table, False, False, 0)

        box = TablePack(
            _("Window Decoration Effects"),
            (
                WidgetFactory.create(
                    "CheckButton",
                    label=_("Use Metacity window theme"),
                    enable_reset=True,
                    backend=GConf,
                    key="/apps/gwd/use_metacity_theme",
                ),
                WidgetFactory.create(
                    "CheckButton",
                    label=_("Enable active window transparency"),
                    backend=GConf,
                    enable_reset=True,
                    key="/apps/gwd/metacity_theme_active_shade_opacity",
                ),
                WidgetFactory.create(
                    "Scale",
                    label=_("Active window transparency level"),
                    key="/apps/gwd/metacity_theme_active_opacity",
                    backend=GConf,
                    enable_reset=True,
                    min=0,
                    max=1,
                    digits=2,
                ),
                WidgetFactory.create(
                    "CheckButton",
                    label=_("Enable inactive window transparency"),
                    enable_reset=True,
                    backend=GConf,
                    key="/apps/gwd/metacity_theme_shade_opacity",
                ),
                WidgetFactory.create(
                    "Scale",
                    label=_("Inactive window shade transparency level"),
                    backend=GConf,
                    key="/apps/gwd/metacity_theme_opacity",
                    enable_reset=True,
                    min=0,
                    max=1,
                    digits=2,
                ),
            ),
        )
        self.add_start(box, False, False, 0)

        button = WidgetFactory.create(
            "CheckButton",
            label=_("Enable Metacity's compositing feature"),
            enable_reset=True,
            backend=GConf,
            signal_dict={"toggled": self.on_compositing_button_toggled},
            key="/apps/metacity/general/compositing_manager",
        )
        if button:
            box = ListPack(_("Compositing Manager"), (button,))
            self.add_start(box, False, False, 0)
Esempio n. 37
0
    def __init__(self):
        TweakModule.__init__(self)
        fb = Gtk.FontButton()
        fb.set_font_name('Monospace 24')
        fb.set_show_size(False)
        fb.set_use_size(13)

        box = GridPack(
                    WidgetFactory.create("Scale",
                        label=self.utext_text_scaling,
                        key="org.gnome.desktop.interface.text-scaling-factor",
                        min=0.5,
                        max=3.0,
                        step=0.1,
                        digits=1,
                        backend="gsettings",
                        enable_reset=True),
                    WidgetFactory.create("FontButton",
                        label=self.utext_default_font,
                        key="org.gnome.desktop.interface.font-name",
                        backend="gsettings",
                        enable_reset=True),
                    WidgetFactory.create("FontButton",
                        label=_("Desktop font:"),
                        key="org.gnome.nautilus.desktop.font",
                        backend="gsettings",
                        default="Ubuntu 11",
                        enable_reset=True),
                    WidgetFactory.create("FontButton",
                        label=self.utext_monospace_font,
                        key="org.gnome.desktop.interface.monospace-font-name",
                        backend="gsettings",
                        enable_reset=True),
                    WidgetFactory.create("FontButton",
                        label=self.utext_document_font,
                        key="org.gnome.desktop.interface.document-font-name",
                        backend="gsettings",
                        enable_reset=True),
                    WidgetFactory.create("FontButton",
                        label=self.utext_window_title_font,
                        key="/apps/metacity/general/titlebar_font",
                        backend="gconf",
                        enable_reset=True),
                    Gtk.Separator(),
                    WidgetFactory.create("ComboBox",
                        label=self.utext_hinting,
                        key="org.gnome.settings-daemon.plugins.xsettings.hinting",
                        values=('none', 'slight', 'medium', 'full'),
                        texts=(_('No hinting'),
                               _('Basic'),
                               _('Moderate'),
                               _('Maximum')),
                        backend="gsettings",
                        enable_reset=True),
                    WidgetFactory.create("ComboBox",
                        label=self.utext_antialiasing,
                        key="org.gnome.settings-daemon.plugins.xsettings.antialiasing",
                        values=('none', 'grayscale', 'rgba'),
                        texts=(_('No antialiasing'),
                               _('Standard grayscale antialiasing'),
                               _('Subpixel antialiasing (LCD screens only)')), 
                        backend="gsettings",
                        enable_reset=True),
            )

        self.add_start(box, False, False, 0)
Esempio n. 38
0
    def __init__(self):
        TweakModule.__init__(self)

        version_pattern = re.compile('\d.\d+.\d')

        if system.DESKTOP == 'ubuntu':
            if system.CODENAME == 'oneiric':
                hide_texts = (_('Never'), _('Auto Hide'), _('Dodge Window'),
                              _('Dodge Active Window'))
                hide_values = (0, 1, 2, 3)
            else:
                hide_texts = (_('Never'), _('Auto Hide'))
                hide_values = (0, 1)

            grid_pack = GridPack(
                WidgetFactory.create("Switch",
                                     label=self.utext_hud,
                                     key="unityshell.show_hud",
                                     on='<Alt>',
                                     off='Disabled',
                                     backend="compiz",
                                     enable_reset=True),
                WidgetFactory.create("Switch",
                                     label=self.utext_overlay,
                                     key="unityshell.shortcut_overlay",
                                     backend="compiz",
                                     enable_reset=True),
                WidgetFactory.create(
                    "Switch",
                    label=self.utext_web_apps_integration,
                    key="com.canonical.unity.webapps.integration-allowed",
                    backend="gsettings",
                    enable_reset=True),
                Gtk.Separator(),
                WidgetFactory.create("Switch",
                                     label=self.utext_show_desktop_icon,
                                     key="unityshell.show_desktop_icon",
                                     backend="compiz",
                                     enable_reset=True),
                WidgetFactory.create(
                    "Switch",
                    label=self.utext_disable_show_desktop_switcher,
                    key="unityshell.disable_show_desktop",
                    backend="compiz",
                    enable_reset=True),
                WidgetFactory.create("Scale",
                                     label=self.utext_launcher_size,
                                     key="unityshell.icon_size",
                                     min=32,
                                     max=64,
                                     step=16,
                                     backend="compiz",
                                     enable_reset=True),
                WidgetFactory.create("Scale",
                                     label=self.utext_launcher_opacity,
                                     key="unityshell.launcher_opacity",
                                     min=0,
                                     max=1,
                                     step=0.1,
                                     digits=2,
                                     backend="compiz",
                                     enable_reset=True),
                WidgetFactory.create("ComboBox",
                                     label=self.utext_launcher_hide,
                                     key="unityshell.launcher_hide_mode",
                                     texts=hide_texts,
                                     values=hide_values,
                                     type=int,
                                     backend="compiz",
                                     enable_reset=True),
                WidgetFactory.create(
                    "ComboBox",
                    label=self.utext_launcher_backlight,
                    key="unityshell.backlight_mode",
                    texts=(_('Backlight Always On'), _('Backlight Toggles'),
                           _('Backlight Always Off'),
                           _('Edge Illumination Toggles'),
                           _('Backlight and Edge Illumination Toggles')),
                    values=(0, 1, 2, 3, 4),
                    type=int,
                    backend="compiz",
                    enable_reset=True),
                WidgetFactory.create("ComboBox",
                                     label=self.utext_device,
                                     key="unityshell.devices_option",
                                     texts=(_('Never'), _('Only Mounted'),
                                            _('Always')),
                                     values=(0, 1, 2),
                                     type=int,
                                     backend="compiz",
                                     enable_reset=True),
                Gtk.Separator(),
                WidgetFactory.create("ComboBox",
                                     label=self.utext_dash_size,
                                     key="com.canonical.Unity.form-factor",
                                     texts=(_('Automatic'), _('Desktop'),
                                            _('Netbook')),
                                     values=('Automatic', 'Desktop',
                                             'Netbook'),
                                     backend="gsettings",
                                     enable_reset=True),
                WidgetFactory.create("ComboBox",
                                     label=self.utext_blur_type,
                                     key="unityshell.dash_blur_experimental",
                                     texts=(_('No blur'), _('Static blur'),
                                            _('Active blur')),
                                     values=(0, 1, 2),
                                     type=int,
                                     backend="compiz",
                                     enable_reset=True),
                WidgetFactory.create("Scale",
                                     label=self.utext_panel_opacity,
                                     key="unityshell.panel_opacity",
                                     min=0,
                                     max=1,
                                     step=0.1,
                                     digits=2,
                                     backend="compiz",
                                     enable_reset=True),
                WidgetFactory.create(
                    "Switch",
                    label=self.utext_panel_toggle_max,
                    key="unityshell.panel_opacity_maximized_toggle",
                    backend="compiz",
                    reverse=True,
                    enable_reset=True),
            )

            self.add_start(grid_pack, False, False, 0)
        else:
            notes_label = Gtk.Label()
            notes_label.set_property('halign', Gtk.Align.START)
            notes_label.set_markup('<span size="smaller">%s</span>' % \
                    _('Note: you may need to log out to take effect'))
            notes_label._ut_left = 1

            box = GridPack(
                WidgetFactory.create("Switch",
                                     label=self.utext_hud,
                                     key="unityshell.show_hud",
                                     on='<Alt>',
                                     off='Disabled',
                                     backend="compiz",
                                     enable_reset=True),
                WidgetFactory.create(
                    "Switch",
                    label=self.utext_fullscreen,
                    key="com.canonical.Unity2d.Dash.full-screen",
                    backend="gsettings",
                    enable_reset=True),
                WidgetFactory.create(
                    "Switch",
                    label=self.utext_super_key,
                    key="com.canonical.Unity2d.Launcher.super-key-enable",
                    backend="gsettings",
                    enable_reset=True),
                WidgetFactory.create(
                    "ComboBox",
                    label=self.utext_launcher_hide,
                    key="com.canonical.Unity2d.Launcher.hide-mode",
                    texts=(_('Never'), _('Auto Hide'), _('Intellihide')),
                    values=(0, 1, 2),
                    type=int,
                    backend="gsettings",
                    enable_reset=True),
                Gtk.Separator(),
                WidgetFactory.create(
                    "Switch",
                    label=self.utext_compositing_manager,
                    key="/apps/metacity/general/compositing_manager",
                    backend="gconf",
                    signal_dict={
                        'notify::active': self.on_compositing_enabled
                    },
                    enable_reset=True),
                notes_label,
                WidgetFactory.create(
                    "Scale",
                    label=self.utext_num_workspaces,
                    key="/apps/metacity/general/num_workspaces",
                    backend="gconf",
                    min=1,
                    max=36,
                    step=1,
                    type=int,
                    enable_reset=True),
            )

            self.add_start(box, False, False, 0)
Esempio n. 39
0
    def __init__(self):
        TweakModule.__init__(self)

        self.natural_scrolling_switch = Gtk.Switch()
        self.set_the_natural_status()
        self.natural_scrolling_switch.connect(
            'notify::active', self.on_natural_scrolling_changed)

        notes_label = Gtk.Label()
        notes_label.set_property('halign', Gtk.Align.START)
        notes_label.set_markup('<span size="smaller">%s</span>' % \
                _('Note: you may need to log out to take effect'))
        notes_label._ut_left = 1

        if system.CODENAME == 'precise':
            overlay_label, overlay_widget = WidgetFactory.create(
                'Switch',
                label=self.utext_overlay_scrollbar,
                key='org.gnome.desktop.interface.ubuntu-overlay-scrollbars',
                backend='gsettings')
        else:
            overlay_label, overlay_widget = WidgetFactory.create(
                'ComboBox',
                label=self.utext_overlay_scrollbar,
                key='com.canonical.desktop.interface.scrollbar-mode',
                texts=[
                    _('Normal'),
                    _('Auto'),
                    _('Show Overlay'),
                    _('Never Show Overlay')
                ],
                values=[
                    'normal', 'overlay-auto', 'overlay-pointer',
                    'overlay-touch'
                ],
                backend='gsettings')

        self.theme_box = GridPack(
            WidgetFactory.create(
                'CheckButton',
                label=self.utext_menu_icon,
                key='org.gnome.desktop.interface.menus-have-icons',
                backend='gsettings',
            ),
            WidgetFactory.create(
                'CheckButton',
                label=self.utext_button_icon,
                key='org.gnome.desktop.interface.buttons-have-icons',
                backend='gsettings'),
            WidgetFactory.create(
                'CheckButton',
                label=self.utext_context_menu,
                key='org.gnome.desktop.interface.show-input-method-menu',
                backend='gsettings',
            ),
            WidgetFactory.create(
                'CheckButton',
                label=self.utext_unicode,
                key='org.gnome.desktop.interface.show-unicode-menu',
                backend='gsettings',
            ), Gtk.Separator(),
            WidgetFactory.create(
                "CheckButton",
                label=self.utext_disable_print,
                key="org.gnome.desktop.lockdown.disable-printing",
                backend="gsettings",
                blank_label=True),
            WidgetFactory.create(
                "CheckButton",
                label=self.utext_disable_print_setting,
                key="org.gnome.desktop.lockdown.disable-print-setup",
                backend="gsettings",
                blank_label=True),
            WidgetFactory.create(
                "CheckButton",
                label=self.utext_save,
                key="org.gnome.desktop.lockdown.disable-save-to-disk",
                backend="gsettings",
                blank_label=True),
            WidgetFactory.create(
                "CheckButton",
                label=self.utext_user_switch,
                key="org.gnome.desktop.lockdown.disable-user-switching",
                backend="gsettings",
                blank_label=True), Gtk.Separator(),
            (Gtk.Label(self.utext_natural), self.natural_scrolling_switch),
            notes_label, (overlay_label, overlay_widget),
            WidgetFactory.create(
                'Switch',
                label=self.utext_cursor_blink,
                key='org.gnome.desktop.interface.cursor-blink',
                backend='gsettings',
            ),
            WidgetFactory.create(
                'Scale',
                label=self.utext_cursor_blink_time,
                key='org.gnome.desktop.interface.cursor-blink-time',
                backend='gsettings',
                min=100,
                max=2500,
                step=100,
                type=int,
            ),
            WidgetFactory.create(
                'SpinButton',
                label=self.utext_cursor_blink_timeout,
                key='org.gnome.desktop.interface.cursor-blink-timeout',
                backend='gsettings',
                min=1,
                max=2147483647,
            ))
        self.add_start(self.theme_box, False, False, 0)
Esempio n. 40
0
    def __init__(self):
        TweakModule.__init__(self)
        fb = Gtk.FontButton()
        fb.set_font_name("Monospace 24")
        fb.set_show_size(False)
        fb.set_use_size(13)

        if system.CODENAME == "quantal":
            window_font_label, window_font_button, window_font_reset_button = WidgetFactory.create(
                "FontButton",
                label=self.utext_window_title_font,
                key="org.gnome.desktop.wm.preferences.titlebar-font",
                backend="gsettings",
                enable_reset=True,
            )
        else:
            window_font_label, window_font_button, window_font_reset_button = WidgetFactory.create(
                "FontButton",
                label=self.utext_window_title_font,
                key="/apps/metacity/general/titlebar_font",
                backend="gconf",
                enable_reset=True,
            )

        box = GridPack(
            WidgetFactory.create(
                "Scale",
                label=self.utext_text_scaling,
                key="org.gnome.desktop.interface.text-scaling-factor",
                min=0.5,
                max=3.0,
                step=0.1,
                digits=1,
                backend="gsettings",
                enable_reset=True,
            ),
            WidgetFactory.create(
                "FontButton",
                label=self.utext_default_font,
                key="org.gnome.desktop.interface.font-name",
                backend="gsettings",
                enable_reset=True,
            ),
            WidgetFactory.create(
                "FontButton",
                label=_("Desktop font:"),
                key="org.gnome.nautilus.desktop.font",
                backend="gsettings",
                default="Ubuntu 11",
                enable_reset=True,
            ),
            WidgetFactory.create(
                "FontButton",
                label=self.utext_monospace_font,
                key="org.gnome.desktop.interface.monospace-font-name",
                backend="gsettings",
                enable_reset=True,
            ),
            WidgetFactory.create(
                "FontButton",
                label=self.utext_document_font,
                key="org.gnome.desktop.interface.document-font-name",
                backend="gsettings",
                enable_reset=True,
            ),
            (window_font_label, window_font_button, window_font_reset_button),
            Gtk.Separator(),
            WidgetFactory.create(
                "ComboBox",
                label=self.utext_hinting,
                key="org.gnome.settings-daemon.plugins.xsettings.hinting",
                values=("none", "slight", "medium", "full"),
                texts=(_("No hinting"), _("Basic"), _("Moderate"), _("Maximum")),
                backend="gsettings",
                enable_reset=True,
            ),
            WidgetFactory.create(
                "ComboBox",
                label=self.utext_antialiasing,
                key="org.gnome.settings-daemon.plugins.xsettings.antialiasing",
                values=("none", "grayscale", "rgba"),
                texts=(
                    _("No antialiasing"),
                    _("Standard grayscale antialiasing"),
                    _("Subpixel antialiasing (LCD screens only)"),
                ),
                backend="gsettings",
                enable_reset=True,
            ),
        )

        self.add_start(box, False, False, 0)
Esempio n. 41
0
    def __init__(self):
        TweakModule.__init__(self, 'metacity.ui')

        swindow = Gtk.ScrolledWindow()
        swindow.set_size_request(-1, 54)
        swindow.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
        self.buttonview = ButtonView()
        swindow.add(self.buttonview)
        self.vbox2.pack_start(swindow, False, False, 0)

        for value, label in ButtonView.get_control_items():
            button = WindowControlButton(label, value, self.buttonview)
            self.control_hbox.pack_start(button, False, False, 0)

        box = ListPack(_('Window Titlebar Button Layout'),
                       [child for child in self.main_vbox.get_children()])
        self.add_start(box, False, False, 0)
        self.init_control_buttons()

        table = TablePack(_('Window Titlebar Actions'), (
                    WidgetFactory.create('ComboBox',
                                         label=_('Titlebar mouse wheel action'),
                                         key='/apps/gwd/mouse_wheel_action',
                                         enable_reset=True,
                                         backend='gconf',
                                         texts=[_('None'), _('Roll up')],
                                         values=['none', 'shade']
                                         ),
                    #TODO the toggle_maximize_horizontally and vertically may not work
                    WidgetFactory.create('ComboBox',
                                         label=_('Titlebar double-click action'),
                                         key='/apps/metacity/general/action_double_click_titlebar',
                                         enable_reset=True,
                                         backend='gconf',
                                         texts=[_('None'), _('Maximize'), \
                                                 _('Maximize Horizontally'), \
                                                 _('Maximize Vertically'), \
                                                 _('Minimize'), _('Roll up'), \
                                                 _('Lower'), _('Menu')],
                                         values=['none', 'toggle_maximize', \
                                                 'toggle_maximize_horizontally', \
                                                 'toggle_maximize_vertically', \
                                                 'minimize', 'toggle_shade', \
                                                 'lower', 'menu']),
                    WidgetFactory.create('ComboBox',
                                         label=_('Titlebar middle-click action'),
                                         key='/apps/metacity/general/action_middle_click_titlebar',
                                         enable_reset=True,
                                         backend="gconf",
                                         texts=[_('None'), _('Maximize'), \
                                                 _('Maximize Horizontally'), \
                                                 _('Maximize Vertically'), \
                                                 _('Minimize'), _('Roll up'), \
                                                 _('Lower'), _('Menu')],
                                         values=['none', 'toggle_maximize', \
                                                 'toggle_maximize_horizontally', \
                                                 'toggle_maximize_vertically', \
                                                 'minimize', 'toggle_shade', \
                                                 'lower', 'menu']),
                    WidgetFactory.create('ComboBox',
                                         label=_('Titlebar right-click action'),
                                         key='/apps/metacity/general/action_right_click_titlebar',
                                         enable_reset=True,
                                         backend="gconf",
                                         texts=[_('None'), _('Maximize'), \
                                                 _('Maximize Horizontally'), \
                                                 _('Maximize Vertically'), \
                                                 _('Minimize'), _('Roll up'), \
                                                 _('Lower'), _('Menu')],
                                         values=['none', 'toggle_maximize', \
                                                 'toggle_maximize_horizontally', \
                                                 'toggle_maximize_vertically', \
                                                 'minimize', 'toggle_shade', \
                                                 'lower', 'menu']),
                ))

        self.add_start(table, False, False, 0)

        box = TablePack(_('Window Decoration Effects'), (
                    WidgetFactory.create('CheckButton',
                                          label=_('Use Metacity window theme'),
                                          enable_reset=True,
                                          backend="gconf",
                                          key='/apps/gwd/use_metacity_theme'),
                    WidgetFactory.create('CheckButton',
                                          label=_('Enable active window transparency'),
                                          backend="gconf",
                                          enable_reset=True,
                                          key='/apps/gwd/metacity_theme_active_shade_opacity'),
                    WidgetFactory.create('Scale',
                                          label=_('Active window transparency level'),
                                          key='/apps/gwd/metacity_theme_active_opacity',
                                          backend="gconf",
                                          enable_reset=True,
                                          min=0, max=1, digits=2),
                    WidgetFactory.create('CheckButton',
                                          label=_('Enable inactive window transparency'),
                                          enable_reset=True,
                                          backend="gconf",
                                          key='/apps/gwd/metacity_theme_shade_opacity'),
                    WidgetFactory.create('Scale',
                                          label=_('Inactive window shade transparency level'),
                                          backend="gconf",
                                          key='/apps/gwd/metacity_theme_opacity',
                                          enable_reset=True,
                                          min=0, max=1, digits=2),
            ))
        self.add_start(box, False, False, 0)
Esempio n. 42
0
    def __init__(self):
        TweakModule.__init__(self)

        show_permission_button, show_permission_reset = WidgetFactory.create(
            "CheckButton",
            label=self.utext_advanced_properties,
            enable_reset=True,
            key="org.gnome.nautilus.preferences.show-advanced-permissions",
            backend="gsettings")

        box = GridPack(
            (Gtk.Label(_("File browser:")), show_permission_button,
             show_permission_reset),
            WidgetFactory.create(
                "CheckButton",
                label=self.utext_pathbar,
                enable_reset=True,
                blank_label=True,
                key="org.gnome.nautilus.preferences.always-use-location-entry",
                backend="gsettings"),
            Gtk.Separator(),
            WidgetFactory.create(
                'Switch',
                key='org.gnome.desktop.media-handling.automount',
                enable_reset=True,
                label=self.utext_automount,
                backend="gsettings"),
            WidgetFactory.create(
                'Switch',
                key='org.gnome.desktop.media-handling.automount-open',
                enable_reset=True,
                label=self.utext_open,
                backend="gsettings"),
            WidgetFactory.create(
                'Switch',
                key='org.gnome.desktop.media-handling.autorun-never',
                enable_reset=True,
                reverse=True,
                label=self.utext_prompt,
                backend="gsettings"),
            Gtk.Separator(),
            WidgetFactory.create(
                'Scale',
                key='org.gnome.nautilus.icon-view.thumbnail-size',
                enable_reset=True,
                min=16,
                max=512,
                step=16,
                label=self.utext_thumbnail_icon_size,
                backend="gsettings"),
            WidgetFactory.create(
                'Scale',
                key='org.gnome.desktop.thumbnail-cache.maximum-age',
                enable_reset=True,
                min=-1,
                max=180,
                step=1,
                label=self.utext_thumbnail_cache_age,
                backend="gsettings"),
            WidgetFactory.create(
                'Scale',
                key='org.gnome.desktop.thumbnail-cache.maximum-size',
                enable_reset=True,
                min=-1,
                max=512,
                step=1,
                label=self.utext_thumbnail_cache_size,
                backend="gsettings"),
        )
        self.add_start(box, False, False, 0)
Esempio n. 43
0
    def __init__(self):
        TweakModule.__init__(self)

        version_pattern = re.compile('\d.\d+.\d')

        if system.DESKTOP == 'ubuntu':
            hide_texts = (_('Never'), _('Auto Hide'))
            hide_values = (0, 1)

            grid_pack = GridPack(
                        WidgetFactory.create("Switch",
                            label=self.utext_hud,
                            key="unityshell.show_hud",
                            on='<Alt>',
                            off='Disabled',
                            backend="compiz",
                            enable_reset=True),
                        WidgetFactory.create("Switch",
                            label=self.utext_overlay,
                            key="unityshell.shortcut_overlay",
                            backend="compiz",
                            enable_reset=True),
                        WidgetFactory.create("Switch",
                            label=self.utext_web_apps_integration,
                            key="com.canonical.unity.webapps.integration-allowed",
                            backend="gsettings",
                            enable_reset=True),
                        Gtk.Separator(),
                        WidgetFactory.create("Switch",
                            label=self.utext_show_desktop_icon,
                            key="unityshell.show_desktop_icon",
                            backend="compiz",
                            enable_reset=True),
                        WidgetFactory.create("Switch",
                            label=self.utext_disable_show_desktop_switcher,
                            key="unityshell.disable_show_desktop",
                            backend="compiz",
                            enable_reset=True),
                        WidgetFactory.create("Switch",
                            label=self.utext_launcher_minimize_window,
                            key="unityshell.launcher_minimize_window",
                            backend="compiz",
                            enable_reset=True),
                        WidgetFactory.create("Scale",
                            label=self.utext_launcher_size,
                            key="unityshell.icon_size",
                            min=32,
                            max=64,
                            step=16,
                            backend="compiz",
                            enable_reset=True),
                        WidgetFactory.create("Scale",
                            label=self.utext_launcher_opacity,
                            key="unityshell.launcher_opacity",
                            min=0,
                            max=1,
                            step=0.1,
                            digits=2,
                            backend="compiz",
                            enable_reset=True),
                        WidgetFactory.create("ComboBox",
                            label=self.utext_launcher_hide,
                            key="unityshell.launcher_hide_mode",
                            texts=hide_texts,
                            values=hide_values,
                            type=int,
                            backend="compiz",
                            enable_reset=True),
                        WidgetFactory.create("ComboBox",
                            label=self.utext_launcher_backlight,
                            key="unityshell.backlight_mode",
                            texts=(_('Backlight Always On'),
                                 _('Backlight Toggles'),
                                 _('Backlight Always Off'),
                                 _('Edge Illumination Toggles'),
                                 _('Backlight and Edge Illumination Toggles')),
                            values=(0, 1, 2, 3, 4),
                            type=int,
                            backend="compiz",
                            enable_reset=True),
                        WidgetFactory.create("ComboBox",
                            label=self.utext_device,
                            key="unityshell.devices_option",
                            texts=(_('Never'),
                                   _('Only Mounted'),
                                   _('Always')),
                             values=(0, 1, 2),
                             type=int,
                             backend="compiz",
                             enable_reset=True),
                        Gtk.Separator(),
                        WidgetFactory.create("ComboBox",
                             label=self.utext_dash_size,
                             key="com.canonical.Unity.form-factor",
                             texts=(_('Automatic'), _('Desktop'), _('Netbook')),
                             values=('Automatic', 'Desktop', 'Netbook'),
                             backend="gsettings",
                             enable_reset=True),
                        WidgetFactory.create("ComboBox",
                             label=self.utext_blur_type,
                             key="unityshell.dash_blur_experimental",
                             texts=(_('No blur'),
                                    _('Static blur'),
                                    _('Active blur')),
                             values=(0, 1, 2),
                             type=int,
                             backend="compiz",
                             enable_reset=True),
                        WidgetFactory.create("Scale",
                             label=self.utext_panel_opacity,
                             key="unityshell.panel_opacity",
                             min=0, max=1, step=0.1, digits=2,
                             backend="compiz",
                             enable_reset=True),
                        WidgetFactory.create("Switch",
                             label=self.utext_panel_toggle_max,
                             key="unityshell.panel_opacity_maximized_toggle",
                             backend="compiz",
                             reverse=True,
                             enable_reset=True),
                )

            self.add_start(grid_pack, False, False, 0)
        else:
            notes_label = Gtk.Label()
            notes_label.set_property('halign', Gtk.Align.START)
            notes_label.set_markup('<span size="smaller">%s</span>' % \
                    _('Note: you may need to log out to take effect'))
            notes_label._ut_left = 1

            box = GridPack(
                        WidgetFactory.create("Switch",
                            label=self.utext_hud,
                            key="unityshell.show_hud",
                            on='<Alt>',
                            off='Disabled',
                            backend="compiz",
                            enable_reset=True),
                        WidgetFactory.create("Switch",
                                             label=self.utext_fullscreen,
                                             key="com.canonical.Unity2d.Dash.full-screen",
                                             backend="gsettings",
                                             enable_reset=True),
                        WidgetFactory.create("Switch",
                                             label=self.utext_super_key,
                                             key="com.canonical.Unity2d.Launcher.super-key-enable",
                                             backend="gsettings",
                                             enable_reset=True),
                        WidgetFactory.create("ComboBox",
                                             label=self.utext_launcher_hide,
                                             key="com.canonical.Unity2d.Launcher.hide-mode",
                                             texts=(_('Never'), _('Auto Hide'),
                                                    _('Intellihide')),
                                             values=(0, 1, 2),
                                             type=int,
                                             backend="gsettings",
                                             enable_reset=True),
                        Gtk.Separator(),
                        WidgetFactory.create("Switch",
                                             label=self.utext_compositing_manager,
                                             key="/apps/metacity/general/compositing_manager",
                                             backend="gconf",
                                             signal_dict={'notify::active': self.on_compositing_enabled},
                                             enable_reset=True),
                        notes_label,
                        WidgetFactory.create("Scale",
                                             label=self.utext_num_workspaces,
                                             key="/apps/metacity/general/num_workspaces",
                                             backend="gconf",
                                             min=1,
                                             max=36,
                                             step=1,
                                             type=int,
                                             enable_reset=True),
                )

            self.add_start(box, False, False, 0)