Beispiel #1
0
    def __init__(self):
        TweakModule.__init__(self, 'sourceeditor.ui')

        self.auto_backup_setting = GSetting('com.ubuntu-tweak.tweak.auto-backup')

        self.textview = SourceView(SOURCES_LIST)
        self.textview.set_sensitive(False)
        self.sw1.add(self.textview)
        self.textview.get_buffer().connect('changed', self.on_buffer_changed)

        un_lock = PolkitButton(PK_ACTION_SOURCE)
        un_lock.connect('authenticated', self.on_polkit_action)
        self._authenticated = False
        self.hbuttonbox2.pack_end(un_lock, False, False, 0)

        self.list_selection = self.list_view.get_selection()
        self.list_selection.connect("changed", self.on_selection_changed)

        self.infobar = Gtk.InfoBar()
        self.info_label = Gtk.Label('Current view the list')
        self.info_label.set_alignment(0, 0.5)
        self.infobar.get_content_area().add(self.info_label)
        self.infobar.connect("response", self.on_infobar_response)
        self.infobar.add_button(Gtk.STOCK_CLOSE, Gtk.ResponseType.CLOSE)
        self.infobar.hide()
        self.text_vbox.pack_start(self.infobar, False, False, 0)

        self.connect('realize', self.on_ui_realize)
        self.add_start(self.hbox1)
Beispiel #2
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)
    def __init__(self):
        TweakModule.__init__(self, 'loginsettings.ui')

        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)
Beispiel #4
0
    def __init__(self):
        TweakModule.__init__(self)

        self.fix_theme_button = Gtk.CheckButton(_('Fix the appearance of themes when granted root privileges'))
        if proxy.is_exists(self.ROOT_THEMES) and proxy.is_exists(self.ROOT_ICONS):
            self.fix_theme_button.set_active(True)

        self.fix_theme_button.connect('toggled', self.on_fix_theme_btn_taggled)
        self.fix_theme_button.set_sensitive(False)
        box = ListPack(_('Miscellaneous Options'), (self.fix_theme_button,))
        self.add_start(box, False, False, 0)

        hbox = Gtk.HBox(spacing=12)
        self.add_end(hbox, False ,False, 0)

        un_lock = PolkitButton(PK_ACTION_TWEAK)
        un_lock.connect('authenticated', self.on_polkit_action)
        hbox.pack_end(un_lock, False, False, 0)
    def __init__(self):
        TweakModule.__init__(self, 'sourcecenter.ui')

        self.url = SOURCE_VERSION_URL
        set_label_for_stock_button(self.sync_button, _('_Sync'))

        self.sourceview = SourcesView()

        self.sourceview.set_status_active(True)
        self.sourceview.update_model()
        self.sourceview.connect('sourcechanged', self.on_source_changed)
        self.sourceview.selection.connect('changed', self.on_selection_changed)
        self.sourceview.set_sensitive(False)
        self.sourceview.set_rules_hint(True)
        self.source_selection = self.sourceview.get_selection()
        self.source_selection.connect('changed', self.on_source_selection)
        self.right_sw.add(self.sourceview)

        self.cateview = CategoryView(os.path.join(SOURCE_ROOT, 'cates.json'))
        self.cateview.set_status_from_view(self.sourceview)
        self.cateview.update_model()
        self.cate_selection = self.cateview.get_selection()
        self.cate_selection.connect('changed', self.on_category_changed)
        self.left_sw.add(self.cateview)

        un_lock = PolkitButton(PK_ACTION_SOURCE)
        un_lock.connect('authenticated', self.on_polkit_action)
        self.hbuttonbox1.pack_end(un_lock, False, False, 0)

        self.update_timestamp()
        UPDATE_SETTING.set_value(False)
        UPDATE_SETTING.connect_notify(self.on_have_update, data=None)

        log.debug('Start check update')
        thread.start_new_thread(self.check_update, ())
        GObject.timeout_add(60000, self.update_timestamp)

        if self.check_source_upgradable() and UPGRADE_DICT:
            GObject.idle_add(self.upgrade_sources)

        self.reparent(self.main_vbox)