Example #1
0
    def __init__(self):
        TweakModule.__init__(self, 'desktoprecovery.ui')

        self.setup_backup_model()

        hbox = Gtk.HBox(spacing=12)
        self.add_start(hbox)

        self.cateview = CateView()
        sw = Gtk.ScrolledWindow(shadow_type=Gtk.ShadowType.IN)
        sw.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
        sw.add(self.cateview)

        #FIXME it will cause two callback for cateview changed
        self.cateview.connect('button_press_event',
                              self.on_cateview_button_press_event)
        self.cate_selection = self.cateview.get_selection()
        self.cate_selection.connect('changed', self.on_cateview_changed)
        hbox.pack_start(sw, False, False, 0)

        vpaned = Gtk.VPaned()
        hbox.pack_start(vpaned, True, True, 0)

        self.settingview = SettingView()
        self.setting_selection = self.settingview.get_selection()
        self.setting_selection.connect('changed', self.on_settingview_changed)
        sw = Gtk.ScrolledWindow(shadow_type=Gtk.ShadowType.IN)
        sw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
        sw.add(self.settingview)
        vpaned.pack1(sw, True, False)

        vpaned.pack2(self.recover_box, False, False)

        self.on_cateview_changed(self.cate_selection)
        self.show_all()
Example #2
0
    def __init__(self):
        TweakModule.__init__(self, "templates.ui")

        if not is_right_path():
            label = Gtk.Label(
                label=_(
                    'The templates path is incorrect! The current path points to "%s".\nPlease reset it to a location within your Home Folder.'
                )
                % USER_DIR
            )

            hbox = Gtk.HBox()
            self.add_start(hbox, False, False, 0)

            hbox.pack_start(label, False, False, 0)

            button = Gtk.Button(stock=Gtk.STOCK_GO_FORWARD)
            button.connect("clicked", self.on_go_button_clicked)
            set_label_for_stock_button(button, _("Go And Set"))
            hbox.pack_end(button, False, False, 0)

            button = Gtk.Button(stock=Gtk.STOCK_EXECUTE)
            button.connect("clicked", self.on_restart_button_clicked)
            set_label_for_stock_button(button, _("Restart This Module"))
            hbox.pack_end(button, False, False, 0)
        else:
            self.create_interface()
Example #3
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)
Example #4
0
    def __init__(self):
        TweakModule.__init__(self)

        hbox = gtk.HBox(False, 5)
        self.add_start(hbox)

        self.cateview = CateView()
        self.cate_selection = self.cateview.get_selection()
        self.cate_selection.connect("changed", self.on_cateview_changed)
        hbox.pack_start(self.cateview, False, False, 0)

        self.typeview = TypeView()
        self.typeview.connect("row-activated", self.on_row_activated)
        self.type_selection = self.typeview.get_selection()
        self.type_selection.set_mode(gtk.SELECTION_MULTIPLE)
        self.type_selection.connect("changed", self.on_typeview_changed)
        sw = gtk.ScrolledWindow()
        sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        sw.add(self.typeview)
        hbox.pack_start(sw)

        hbox = gtk.HBox(False, 5)
        self.add_start(hbox, False, False, 0)

        self.edit_button = gtk.Button(stock=gtk.STOCK_EDIT)
        self.edit_button.connect("clicked", self.on_edit_clicked)
        self.edit_button.set_sensitive(False)
        hbox.pack_end(self.edit_button, False, False, 0)

        self.show_have_app = gtk.CheckButton(_("Only show filetypes with associated applications"))
        self.show_have_app.set_active(True)
        self.show_have_app.connect("toggled", self.on_show_all_toggled)
        hbox.pack_start(self.show_have_app, False, False, 5)

        self.show_all()
Example #5
0
    def __init__(self):
        TweakModule.__init__(self)

        self.wallpaper_path = os.path.join(CONFIG_ROOT, 'lovewallpaper.jpg')
        self.jsonman = JsonMan(Gdk.Screen.width(), Gdk.Screen.height())

        self.image_model = Gtk.ListStore(Pixbuf, str)
        self.image_view = Gtk.IconView.new_with_model(self.image_model)
        self.image_view.set_property('halign', Gtk.Align.CENTER)
        self.image_view.set_column_spacing(5)
        self.image_view.set_item_padding(5)
        self.image_view.set_item_width(175)
        self.image_view.set_pixbuf_column(0)
        self.image_view.connect("item-activated", self.set_wallpaper)

        link_label = Gtk.Label()
        link_label.set_markup('Powered by <a href="http://www.lovebizhi.com/linux">%s</a>.' % self.__title__)
        link_label.set_line_wrap(True)

        lucky_button = Gtk.Button(_("I'm Feeling Lucky"))
        lucky_button.set_property('halign', Gtk.Align.CENTER)
        lucky_button.connect('clicked', self.on_luky_button_clicked)

        self.connect('size-allocate', self.on_size_allocate)

        try:
            self.load_imageview()
            self.add_start(self.image_view, False, False, 0)
            self.add_start(lucky_button, False, False, 0)
        except Exception, e:
            link_label.set_markup('Network issue happened when visiting <a href="http://www.lovebizhi.com/linux">%s</a>. Please check if you can access the website.' % self.__title__)
Example #6
0
    def __init__(self):
        TweakModule.__init__(self)

        sw = Gtk.ScrolledWindow()
        sw = Gtk.ScrolledWindow(shadow_type=Gtk.ShadowType.IN)
        sw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
        self.add_start(sw, True, True, 0)

        self.dirview = UserdirView()
        self.dirview.get_selection().connect('changed',
                                             self.on_selection_changed)
        sw.add(self.dirview)

        hbuttonbox = Gtk.HButtonBox()
        hbuttonbox.set_spacing(12)
        hbuttonbox.set_layout(Gtk.ButtonBoxStyle.END)
        self.add_start(hbuttonbox, False, False, 0)

        self.restore_button = Gtk.Button(_('_Restore'))
        self.restore_button.set_use_underline(True)
        self.restore_button.set_sensitive(False)
        self.restore_button.connect('clicked', self.on_restore_button_clicked)
        hbuttonbox.pack_end(self.restore_button, False, False, 0)

        self.change_button = Gtk.Button(_('_Change'))
        self.change_button.set_use_underline(True)
        self.change_button.set_sensitive(False)
        self.change_button.connect('clicked', self.on_change_button_clicked)
        hbuttonbox.pack_end(self.change_button, False, False, 0)
Example #7
0
    def __init__(self):
        TweakModule.__init__(self, "desktoprecovery.ui")

        self.setup_backup_model()

        hbox = gtk.HBox(False, 5)
        self.add_start(hbox)

        self.cateview = CateView()
        # FIXME it will cause two callback for cateview changed
        self.cateview.connect("button_press_event", self.on_cateview_button_press_event)
        self.cate_selection = self.cateview.get_selection()
        self.cate_selection.connect("changed", self.on_cateview_changed)
        hbox.pack_start(self.cateview, False, False, 0)

        vpaned = gtk.VPaned()
        hbox.pack_start(vpaned)

        self.keydirview = KeyDirView()
        self.keydir_selection = self.keydirview.get_selection()
        self.keydir_selection.connect("changed", self.on_keydirview_changed)
        sw = gtk.ScrolledWindow()
        sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        sw.add(self.keydirview)
        vpaned.pack1(sw, True, False)

        self.window1.remove(self.recover_box)
        vpaned.pack2(self.recover_box, False, False)

        self.on_cateview_changed(self.cate_selection)
        self.show_all()
    def __init__(self):
        TweakModule.__init__(self, 'desktoprecovery.ui')

        self.setup_backup_model()

        hbox = Gtk.HBox(spacing=12)
        self.add_start(hbox)

        self.cateview = CateView()
        sw = Gtk.ScrolledWindow(shadow_type=Gtk.ShadowType.IN)
        sw.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
        sw.add(self.cateview)

        #FIXME it will cause two callback for cateview changed
        self.cateview.connect('button_press_event',
                              self.on_cateview_button_press_event)
        self.cate_selection = self.cateview.get_selection()
        self.cate_selection.connect('changed', self.on_cateview_changed)
        hbox.pack_start(sw, False, False, 0)

        vpaned = Gtk.VPaned()
        hbox.pack_start(vpaned, True, True, 0)

        self.settingview = SettingView()
        self.setting_selection = self.settingview.get_selection()
        self.setting_selection.connect('changed', self.on_settingview_changed)
        sw = Gtk.ScrolledWindow(shadow_type=Gtk.ShadowType.IN)
        sw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
        sw.add(self.settingview)
        vpaned.pack1(sw, True, False)

        vpaned.pack2(self.recover_box, False, False)

        self.on_cateview_changed(self.cate_selection)
        self.show_all()
Example #9
0
    def __init__(self):
        TweakModule.__init__(self)

        box = TablePack(_('Advanced Power Management Settings'), (
                WidgetFactory.create('GconfCheckButton',
                                      label=_('Enable "Lock screen" when "Blank Screen" activates'),
                                      enable_reset=True,
                                      key='blank_screen'),
                WidgetFactory.create('GconfCheckButton',
                                      label=_('Lock screen on hibernate'),
                                      enable_reset=True,
                                      key='/apps/gnome-power-manager/lock/hibernate'),
                WidgetFactory.create('GconfCheckButton',
                                      label=_('Lock screen on suspend'),
                                      enable_reset=True,
                                      key='/apps/gnome-power-manager/lock/suspend'),
                WidgetFactory.create('GconfScale',
                                      label=_('LCD brightness when using AC power'),
                                      enable_reset=True,
                                      key='/apps/gnome-power-manager/backlight/brightness_ac',
                                      min=0, max=100, digits=0),
                WidgetFactory.create('GconfScale',
                                      label=_('LCD brightness when using battery'),
                                      enable_reset=True,
                                      key='/apps/gnome-power-manager/backlight/brightness_dim_battery',
                                      min=0, max=100, digits=0, reversed=True)
        ))
        self.add_start(box, False, False, 0)
Example #10
0
    def __init__(self):
        TweakModule.__init__(self, 'templates.ui')

        self.default = DefaultScripts()
        self.config_test()

        self.enable_scripts = EnableScripts()
        self.sw1.add(self.enable_scripts)

        self.disable_scripts = DisableScripts()
        self.sw2.add(self.disable_scripts)

        self.enable_scripts.connect('drag_data_received',
                                    self.on_enable_drag_data_received)
        self.enable_scripts.connect('deleted', self.on_enable_deleted)
        self.disable_scripts.connect('drag_data_received',
                                     self.on_disable_drag_data_received)

        self.add_start(self.hbox1)

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

        button = Gtk.Button(_('Rebuild System Scripts'))
        button.connect('clicked', self.on_rebuild_clicked)
        hbox.pack_end(button, False, False, 5)
Example #11
0
    def __init__(self):
        TweakModule.__init__(self)

        self.default = DefaultScripts()
        self.config_test()

        hbox = gtk.HBox(False, 10)
        self.add_start(hbox)

        sw = gtk.ScrolledWindow()
        sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        hbox.pack_start(sw)

        self.enable_scripts = EnableScripts()
        sw.add(self.enable_scripts)

        sw = gtk.ScrolledWindow()
        sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        hbox.pack_start(sw)

        self.disable_scripts = DisableScripts()
        sw.add(self.disable_scripts)

        hbox = gtk.HBox(False, 0)
        self.add_start(hbox, False, False, 0)

        button = gtk.Button(_('Rebuild System Scripts'))
        button.connect('clicked', self.on_rebuild_clicked)
        hbox.pack_end(button, False, False, 5)
        
        self.enable_scripts.connect('drag_data_received', self.on_enable_drag_data_received)
        self.enable_scripts.connect('deleted', self.on_enable_deleted)
        self.disable_scripts.connect('drag_data_received', self.on_disable_drag_data_received)
Example #12
0
    def __init__(self):
        TweakModule.__init__(self, 'appcenter.ui')

        set_label_for_stock_button(self.sync_button, _('_Sync'))

        self.to_add = []
        self.to_rm = []

        self.package_worker = PACKAGE_WORKER
        self.url = APP_VERSION_URL

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

        self.appview = AppView()
        self.appview.update_model()
        self.appview.sort_model()
        self.appview.connect('changed', self.on_app_status_changed)
        self.right_sw.add(self.appview)

        self.update_timestamp()
        self.show_all()

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

        if TweakSettings.get_sync_notify():
            thread.start_new_thread(self.check_update, ())
        gobject.timeout_add(60000, self.update_timestamp)

        self.reparent(self.main_vbox)
Example #13
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)
Example #14
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)
Example #15
0
    def __init__(self):
        TweakModule.__init__(self)

        self.default = DefaultScripts()
        self.config_test()

        hbox = gtk.HBox(False, 10)
        self.add_start(hbox)

        sw = gtk.ScrolledWindow()
        sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        hbox.pack_start(sw)

        self.enable_scripts = EnableScripts()
        sw.add(self.enable_scripts)

        sw = gtk.ScrolledWindow()
        sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        hbox.pack_start(sw)

        self.disable_scripts = DisableScripts()
        sw.add(self.disable_scripts)

        hbox = gtk.HBox(False, 0)
        self.add_start(hbox, False, False, 0)

        button = gtk.Button(_('Rebuild System Scripts'))
        button.connect('clicked', self.on_rebuild_clicked)
        hbox.pack_end(button, False, False, 5)

        self.enable_scripts.connect('drag_data_received',
                                    self.on_enable_drag_data_received)
        self.enable_scripts.connect('deleted', self.on_enable_deleted)
        self.disable_scripts.connect('drag_data_received',
                                     self.on_disable_drag_data_received)
Example #16
0
    def __init__(self):
        TweakModule.__init__(self)

        sw = gtk.ScrolledWindow()
        sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        self.add_start(sw, True, True, 0)

        self.dirview = UserdirView()
        self.dirview.get_selection().connect('changed', self.on_selection_changed)
        sw.add(self.dirview)

        hbuttonbox = gtk.HButtonBox()
        hbuttonbox.set_spacing(12)
        hbuttonbox.set_layout(gtk.BUTTONBOX_END)
        self.add_start(hbuttonbox, False, False, 0)

        self.restore_button = gtk.Button(_('_Restore'))
        self.restore_button.set_sensitive(False)
        self.restore_button.connect('clicked', self.on_restore_button_clicked)
        hbuttonbox.pack_end(self.restore_button, False, False, 0)

        self.change_button = gtk.Button(_('_Change'))
        self.change_button.set_sensitive(False)
        self.change_button.connect('clicked', self.on_change_button_clicked)
        hbuttonbox.pack_end(self.change_button, False, False, 0)
Example #17
0
    def __init__(self):
        TweakModule.__init__(self)

        button = WidgetFactory.create("GconfCheckButton", 
                                      label=_('Show advanced permissions in the Nautilus "File Properties" window'),
                                      enable_reset=True,
                                      key="show_advanced_permissions")

        box = ListPack(_("File Browser"), (button, )) 
        self.add_start(box, False, False, 0)

        hbox1 = gtk.HBox(False, 12)
        button = gtk.Button(stock = gtk.STOCK_CLEAR)
        self.set_clean_button_label(button)
        button.connect('clicked', self.on_clean_thumbnails_clicked)
        hbox1.pack_end(button, False, False, 0)

        box = TablePack(_('Thumbnail Settings'), (
                    WidgetFactory.create('GconfSpinButton',
                                                  key='thumbnail_size',
                                                  enable_reset=True,
                                                  min=16, max=512, step=16,
                                                  label=_('Default thumbnail icon size (pixels)')),
                    WidgetFactory.create('GconfSpinButton',
                                                  key='maximum_size',
                                                  enable_reset=True,
                                                  min=-1, max=512, step=1,
                                                  label=_('Maximum thumbnail cache size (megabytes)')),
                    WidgetFactory.create('GconfSpinButton',
                                                  key='maximum_age',
                                                  enable_reset=True,
                                                  min=-1, max=180, step=1,
                                                  label=_('Thumbnail cache time (days)')),
                    hbox1,
            ))
        self.add_start(box, False, False, 0)

        self.PACKAGE_WORKER = PACKAGE_WORKER

        self.nautilus_terminal = AptCheckButton(_('Open folder in terminal'), 'nautilus-open-terminal')
        self.nautilus_terminal.connect('toggled', self.colleague_changed)
        self.nautilus_root = AptCheckButton(_('Open folder with root privileges'), 'nautilus-gksu')
        self.nautilus_root.connect('toggled', self.colleague_changed)
        self.nautilus_wallpaper = AptCheckButton(_('Nautilus with wallpaper'), 'nautilus-wallpaper')
        self.nautilus_wallpaper.connect('toggled', self.colleague_changed)
        box = ListPack(_("Nautilus Extensions"), (
            self.nautilus_terminal,
            self.nautilus_root,
            self.nautilus_wallpaper,
        ))

        self.button = gtk.Button(stock = gtk.STOCK_APPLY)
        self.button.connect("clicked", self.on_apply_clicked, box)
        self.button.set_sensitive(False)
        hbox = gtk.HBox(False, 0)
        hbox.pack_end(self.button, False, False, 0)

        box.vbox.pack_start(hbox, False, False, 0)

        self.add_start(box, False, False, 0)
Example #18
0
    def __init__(self):
        TweakModule.__init__(self)

        self.wallpaper_path = os.path.join(CONFIG_ROOT, 'lovewallpaper.jpg')
        self.jsonman = JsonMan(Gdk.Screen.width(), Gdk.Screen.height())

        self.image_model = Gtk.ListStore(Pixbuf, str)
        self.image_view = Gtk.IconView.new_with_model(self.image_model)
        self.image_view.set_property('halign', Gtk.Align.CENTER)
        self.image_view.set_column_spacing(5)
        self.image_view.set_item_padding(5)
        self.image_view.set_item_width(175)
        self.image_view.set_pixbuf_column(0)
        self.image_view.connect("item-activated", self.set_wallpaper)

        link_label = Gtk.Label()
        link_label.set_markup(
            'Powered by <a href="http://www.lovebizhi.com/linux">%s</a>.' %
            self.__title__)
        link_label.set_line_wrap(True)

        lucky_button = Gtk.Button(_("I'm Feeling Lucky"))
        lucky_button.set_property('halign', Gtk.Align.CENTER)
        lucky_button.connect('clicked', self.on_luky_button_clicked)

        self.add_start(self.image_view, False, False, 0)
        self.add_start(lucky_button, False, False, 0)
        self.add_start(link_label, False, False, 0)

        self.connect('size-allocate', self.on_size_allocate)
        self.load_imageview()
Example #19
0
    def __init__(self):
        TweakModule.__init__(self)

        sw = Gtk.ScrolledWindow()
        sw = Gtk.ScrolledWindow(shadow_type=Gtk.ShadowType.IN)
        sw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
        self.add_start(sw, True, True, 0)

        self.dirview = UserdirView()
        self.dirview.get_selection().connect('changed', self.on_selection_changed)
        sw.add(self.dirview)

        hbuttonbox = Gtk.HButtonBox()
        hbuttonbox.set_spacing(12)
        hbuttonbox.set_layout(Gtk.ButtonBoxStyle.END)
        self.add_start(hbuttonbox, False, False, 0)

        self.restore_button = Gtk.Button(_('_Restore'))
        self.restore_button.set_use_underline(True)
        self.restore_button.set_sensitive(False)
        self.restore_button.connect('clicked', self.on_restore_button_clicked)
        hbuttonbox.pack_end(self.restore_button, False, False, 0)

        self.change_button = Gtk.Button(_('_Change'))
        self.change_button.set_use_underline(True)
        self.change_button.set_sensitive(False)
        self.change_button.connect('clicked', self.on_change_button_clicked)
        hbuttonbox.pack_end(self.change_button, False, False, 0)
Example #20
0
    def __init__(self):
        TweakModule.__init__(self, 'desktoprecovery.ui')

        self.setup_backup_model()

        hbox = gtk.HBox(False, 5)
        self.add_start(hbox)

        self.cateview = CateView()
        #FIXME it will cause two callback for cateview changed
        self.cateview.connect('button_press_event',
                              self.on_cateview_button_press_event)
        self.cate_selection = self.cateview.get_selection()
        self.cate_selection.connect('changed', self.on_cateview_changed)
        hbox.pack_start(self.cateview, False, False, 0)

        vpaned = gtk.VPaned()
        hbox.pack_start(vpaned)

        self.settingview = SettingView()
        self.setting_selection = self.settingview.get_selection()
        self.setting_selection.connect('changed', self.on_settingview_changed)
        sw = gtk.ScrolledWindow()
        sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        sw.add(self.settingview)
        vpaned.pack1(sw, True, False)

        self.window1.remove(self.recover_box)
        vpaned.pack2(self.recover_box, False, False)

        self.on_cateview_changed(self.cate_selection)
        self.show_all()
Example #21
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)

        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(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.hpaned1)
Example #22
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)
Example #23
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)
Example #24
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)
Example #25
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)
Example #26
0
    def __init__(self):
        TweakModule.__init__(self)

        self.__setting = TweakSettings()

        changeicon_hbox = self.create_change_icon_hbox()

        box = ListPack(_("Panel Settings"), (
                    WidgetFactory.create("GconfCheckButton", 
                                    label=_("Display warning when removing a panel"),
                                    enable_reset=True,
                                    key="confirm_panel_remove"),
                    WidgetFactory.create("GconfCheckButton", 
                                    label=_("Complete lockdown of all panels"),
                                    enable_reset=True,
                                    key="locked_down"),
                    WidgetFactory.create("GconfCheckButton", 
                                    label=_("Enable panel animations"),
                                    enable_reset=True,
                                    key="enable_animations"),
            ))
        self.add_start(box, False, False, 0)

        box = ListPack(_("Menu Settings"), (
                    WidgetFactory.create("GconfCheckButton", 
                                    label=_("Show Input Method menu in the context menu"),
                                    enable_reset=True,
                                    key="show_input_method_menu"),
                    WidgetFactory.create("GconfCheckButton",
                                    label=_("Show Unicode Control Character menu in the context menu"),
                                    enable_reset=True,
                                    key="show_unicode_menu"),
                    WidgetFactory.create("GconfCheckButton",
                                    label=_('Show icons in menus'),
                                    enable_reset=True,
                                    key='/desktop/gnome/interface/menus_have_icons'),
                    WidgetFactory.create("GconfCheckButton",
                                    label=_('Show icons on buttons'),
                                    enable_reset=True,
                                    key='/desktop/gnome/interface/buttons_have_icons'),
                    changeicon_hbox,
            ))
        self.add_start(box, False, False, 0)

        box = ListPack(_("Screensaver"), (
                    WidgetFactory.create("GconfCheckButton", 
                                         label=_("Enable user switching whilst screen is locked."),
                                         enable_reset=True,
                                         key="user_switch_enabled"),
            ))
        self.add_start(box, False, False, 0)

        self.recently_used = gtk.CheckButton(_('Enable system-wide "Recent Documents" list'))
        self.recently_used.connect('toggled', self.colleague_changed)
        self.recently_used.set_active(self.get_state())
        box = ListPack(_("History"), (
                    self.recently_used,
            ))
        self.add_start(box, False, False, 0)
Example #27
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)
Example #28
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)
Example #29
0
    def __init__(self):
        TweakModule.__init__(self)

        box = TablePack(_('Window Decorate Effect'), [
                [WidgetFactory.create('GconfCheckButton', 
                                      label = _('Use Metacity window theme'), 
                                      key = 'use_metacity_theme')],
                [WidgetFactory.create('GconfCheckButton', 
                                      label = _('Enable active window transparency'), 
                                      key = 'metacity_theme_active_shade_opacity')],
                [gtk.Label(_('Active window transparency level')), 
                    WidgetFactory.create('GconfScale', 
                                         key = 'metacity_theme_active_opacity',
                                         min = 0, max = 1, digits = 2)],
                [WidgetFactory.create('GconfCheckButton', 
                                      label = _('Enable inactive window transparency'), 
                                      key = 'metacity_theme_shade_opacity')],
                [gtk.Label(_('Inactive window shade transparency level')), 
                    WidgetFactory.create('GconfScale', 
                                         key = 'metacity_theme_opacity',
                                         min = 0, max = 1, digits = 2)],
            ])
        self.add_start(box, False, False, 0)

        table = TablePack(_('Window Titlebar Action'), [
                [gtk.Label(_('Titlebar mouse wheel action')), 
                    WidgetFactory.create('GconfComboBox', 
                                         key = 'mouse_wheel_action', 
                                         texts = [_('None'), _('Roll up')], 
                                         values = ['none', 'shade'])],
                [gtk.Label(_('Titlebar double-click action')), 
                    WidgetFactory.create('GconfComboBox', 
                                         key = 'action_double_click_titlebar', 
                                         texts = [_('None'), _('Maximize'), _('Minimize'), _('Roll up'), _('Lower'), _('Menu')], 
                                         values = ['none', 'toggle_maximize', 'minimize', 'toggle_shade', 'lower', 'menu'])],
                [gtk.Label(_('Titlebar middle-click action')), 
                    WidgetFactory.create('GconfComboBox', 
                                         key = 'action_middle_click_titlebar', 
                                         texts = [_('None'), _('Maximize'), _('Minimize'), _('Roll up'), _('Lower'), _('Menu')], 
                                         values = ['none', 'toggle_maximize', 'minimize', 'toggle_shade', 'lower', 'menu'])],
                [gtk.Label(_('Titlebar right-click action')), 
                    WidgetFactory.create('GconfComboBox', 
                                         key = 'action_right_click_titlebar', 
                                         texts = [_('None'), _('Maximize'), _('Minimize'), _('Roll up'), _('Lower'), _('Menu')], 
                                         values = ['none', 'toggle_maximize', 'minimize', 'toggle_shade', 'lower', 'menu'])],
                ])

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

        button = WidgetFactory.create('GconfCheckButton', 
                                      label = _("Enable Metacity's Compositing feature"), 
                                      key = 'compositing_manager')
        if button:
            box = ListPack(_('Compositing Manager'), (button,))
            button.connect('toggled', self.on_compositing_button_toggled)

            self.add_start(box, False, False, 0)
Example #30
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)
Example #31
0
    def __init__(self):
        TweakModule.__init__(self)

        box = TablePack(_("Advanced Power Management Settings"), [
                [WidgetFactory.create("GconfCheckButton", 
                                      label = _('Enable "Hibernation"'), 
                                      key = "can_hibernate")],
                [WidgetFactory.create("GconfCheckButton", 
                                      label = _('Enable "Suspend"'), 
                                      key = "can_suspend")],
                [WidgetFactory.create("GconfCheckButton", 
                                      label = _('Show "CPU frequency control option" in Power Management Preferences'), 
                                      key = "cpufreq_show")],
                [WidgetFactory.create("GconfCheckButton", 
                                      label = _("Disable Network Manager when asleep"), 
                                      key = "network_sleep")],
                [WidgetFactory.create("GconfCheckButton", 
                                      label = _('Enable "Lock screen" when "Blank Screen" activates'), 
                                      key = "blank_screen")],
                [gtk.Label(_('Display "Power Manager" panel item')), 
                    WidgetFactory.create("GconfComboBox", 
                                         key = "icon_policy", 
                                         texts = [_("Never display"), _("When charging"), _("Always display")], 
                                         values = ["never", "charge", "always"])],
        ]) 
        self.add_start(box, False, False, 0)

        if module_check.get_gnome_version() < 24:
            cpu_policy_text = [_("Normal"), _("On Demand"), _("Power Save"), _("Performance")]
            cpu_policy_value = ["nothing", "ondemand", "powersave", "performance"]
            box = TablePack(_("CPU Policy"), [
                    [gtk.Label(_("The Performance value when on AC power")), 
                        WidgetFactory.create("GconfScale", 
                                             key = "performance_ac", 
                                             min = 0, 
                                             max = 100, 
                                             digits = 0)],
                    [gtk.Label(_("The Performance value when on battery power")), 
                        WidgetFactory.create("GconfScale", 
                                             key = "performance_battery", 
                                             min = 0, 
                                             max = 100, 
                                             digits = 0)],
                    [gtk.Label(_("The CPU frequency policy when on AC power")), 
                        WidgetFactory.create("GconfComboBox", 
                                             key = "policy_ac", 
                                             texts = cpu_policy_text, 
                                             values = cpu_policy_value)],
                    [gtk.Label(_("The CPU frequency policy when on battery power")), 
                        WidgetFactory.create("GconfComboBox", 
                                             key = "policy_battery", 
                                             texts = cpu_policy_text, 
                                             values = cpu_policy_value)],
            ])
                
            self.add_start(box, False, False, 0)
Example #32
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)
Example #33
0
    def __init__(self):
        TweakModule.__init__(self, 'quicklists.ui')

        self.launcher_setting = GSetting('com.canonical.Unity.Launcher.favorites')
        self.launcher_setting.connect_notify(self.update_launch_icon_model)

        self.action_view.get_selection().connect('changed', self.on_action_selection_changed)

        self.update_launch_icon_model()

        self.add_start(self.main_paned)
Example #34
0
    def __init__(self):
        TweakModule.__init__(self)

        if not CompizPlugin.get_plugin_active('commands'):
            CompizPlugin.set_plugin_active('commands', True)

        sw = Gtk.ScrolledWindow(shadow_type=Gtk.ShadowType.IN)
        sw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
        self.add_start(sw)

        treeview = self.create_treeview()
        sw.add(treeview)
Example #35
0
    def __init__(self):
        TweakModule.__init__(self)

        if not CompizPlugin.get_plugin_active("commands"):
            CompizPlugin.set_plugin_active("commands", True)

        sw = Gtk.ScrolledWindow(shadow_type=Gtk.ShadowType.IN)
        sw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
        self.add_start(sw)

        treeview = self.create_treeview()
        sw.add(treeview)
Example #36
0
    def __init__(self):
        TweakModule.__init__(self)

        if not CompizSetting.get_plugin_active("commands"):
            CompizSetting.set_plugin_active("commands", True)

        sw = gtk.ScrolledWindow()
        sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        self.add_start(sw)

        treeview = self.create_treeview()
        sw.add(treeview)
Example #37
0
    def __init__(self):
        TweakModule.__init__(self)

        if not CompizPlugin.get_plugin_active('commands'):
            CompizPlugin.set_plugin_active('commands', True)

        sw = gtk.ScrolledWindow()
        sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        self.add_start(sw)

        treeview = self.create_treeview()
        sw.add(treeview)
Example #38
0
    def __init__(self):
        TweakModule.__init__(self)

        data = {
             'changed': self.on_entry_changed,
         }
        label1, entry1 = WidgetFactory.create('GconfEntry',
                                         label=_('File Manager'),
                                         key='/desktop/gnome/session/required_components/filemanager',
                                         signal_dict=data,
                                         )
        label2, entry2 = WidgetFactory.create('GconfEntry',
                                         label=_('Panel'),
                                         signal_dict=data,
                                         key='/desktop/gnome/session/required_components/panel')
        label3, entry3 = WidgetFactory.create('GconfEntry',
                                         label=_('Window Manager'),
                                         signal_dict=data,
                                         key='/desktop/gnome/session/required_components/windowmanager')

        hbox1 = gtk.HBox(False, 12)
        self.apply_button = gtk.Button(stock=gtk.STOCK_APPLY)
        self.apply_button.changed_table = {}
        self.apply_button.set_sensitive(False)
        self.apply_button.connect('clicked', self.on_apply_clicked, (entry1, entry2, entry3))
        hbox1.pack_end(self.apply_button, False, False, 0)

        table = TablePack(_('Session Control'), (
                    (label1, entry1),
                    (label2, entry2),
                    (label3, entry3),
                    hbox1,
                ))

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

        box = ListPack(_("Session Options"), (
                    WidgetFactory.create("GconfCheckButton",
                                         label=_("Automatically save open applications when logging out"),
                                         key="auto_save_session"),
                    WidgetFactory.create("GconfCheckButton",
                                         label=_("Allow TCP Connections (Remote Desktop Connect)"),
                                         key="allow_tcp_connections"),
                    WidgetFactory.create("GconfCheckButton",
                                         label=_("Suppress the dialog to confirm logout, restart and shutdown action"),
                                         key="/apps/indicator-session/suppress_logout_restart_shutdown"),
                    WidgetFactory.create("SystemGconfCheckButton",
                                         label=_("Disable user list in gdm"),
                                         key="/apps/gdm/simple-greeter/disable_user_list"),
                ))

        self.add_start(box, False, False, 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)
Example #40
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, 'updatemanager.ui')

        self.updateview = UpdateView()
        self.updateview.connect('changed', self.on_update_status_changed)
        self.update_list()
        self.sw1.add(self.updateview)

        button = GconfCheckButton(label=_('Enable the auto launch of System Update Manager'), 
                                   key='/apps/update-notifier/auto_launch')
        self.vbox1.pack_start(button, False, False, 0)

        self.reparent(self.main_vbox)
Example #42
0
    def __init__(self):
        TweakModule.__init__(self)

        box = ListPack(_("System Security options"), (
            WidgetFactory.create(
                "GconfCheckButton",
                label=_("Disable \"Run Application\" dialog (Alt+F2)"),
                key="disable_command_line",
                enable_reset=True),
            WidgetFactory.create("GconfCheckButton",
                                 label=_('Disable "Lock Screen"'),
                                 key="disable_lock_screen",
                                 enable_reset=True),
            WidgetFactory.create("GconfCheckButton",
                                 label=_("Disable printing"),
                                 key="disable_printing",
                                 enable_reset=True),
            WidgetFactory.create("GconfCheckButton",
                                 label=_("Disable printer settings"),
                                 key="disable_print_setup",
                                 enable_reset=True),
            WidgetFactory.create("GconfCheckButton",
                                 label=_("Disable save to disk"),
                                 key="disable_save_to_disk",
                                 enable_reset=True),
            WidgetFactory.create("GconfCheckButton",
                                 label=_('Disable "Fast User Switching"'),
                                 key="disable_user_switching",
                                 enable_reset=True),
        ),
                       padding=2)

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

        self.fix_theme_button = gtk.CheckButton(
            _('Fix the appearance of themes when granted root privileges'))
        if proxy.is_exists(ROOT_THEMES) and proxy.is_exists(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)

        # button
        hbox = gtk.HBox(False, 0)
        self.pack_end(hbox, False, False, 5)

        un_lock = PolkitButton()
        un_lock.connect('changed', self.on_polkit_action)
        hbox.pack_end(un_lock, False, False, 5)
Example #43
0
    def __init__(self):
        TweakModule.__init__(self)

        data = {
            'changed': self.on_entry_changed,
        }
        label1, entry1, reset1 = WidgetFactory.create('GconfEntry',
                                         label=_('File Manager'),
                                         key='/desktop/gnome/session/required_components/filemanager',
                                         enable_reset=True,
                                         signal_dict=data)
        label2, entry2, reset2 = WidgetFactory.create('GconfEntry',
                                         label=_('Panel'),
                                         enable_reset=True,
                                         signal_dict=data,
                                         key='/desktop/gnome/session/required_components/panel')
        label3, entry3, reset3 = WidgetFactory.create('GconfEntry',
                                         label=_('Window Manager'),
                                         enable_reset=True,
                                         signal_dict=data,
                                         key='/desktop/gnome/session/required_components/windowmanager')

        hbox1 = gtk.HBox(False, 12)
        self.apply_button = gtk.Button(stock=gtk.STOCK_APPLY)
        self.apply_button.changed_table = {}
        self.apply_button.set_sensitive(False)
        self.apply_button.connect('clicked', self.on_apply_clicked, (entry1, entry2, entry3))
        hbox1.pack_end(self.apply_button, False, False, 0)

        table = TablePack(_('Session Control'), (
                    (label1, entry1, reset1),
                    (label2, entry2, reset2),
                    (label3, entry3, reset3),
                    hbox1,
                ))

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

        box = ListPack(_("Session Options"), (
                    WidgetFactory.create("GconfCheckButton",
                                         label=_("Automatically save open applications when logging out"),
                                         enable_reset=True,
                                         key="auto_save_session"),
                    WidgetFactory.create("GconfCheckButton",
                                         label=_("Suppress the logout, restart and shutdown confirmation dialogue box."),
                                         enable_reset=True,
                                         key="/apps/indicator-session/suppress_logout_restart_shutdown"),
                ))

        self.add_start(box, False, False, 0)
Example #44
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)
Example #45
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)
Example #46
0
    def __init__(self):
        TweakModule.__init__(self, 'loginsettings.ui')

        log.debug('Start to build "Session Options"')
        self.options_box = ListPack(_("Login Options"), (
            WidgetFactory.create(
                "UserGconfCheckButton",
                user='******',
                label=_("Disable user list in GDM"),
                enable_reset=True,
                key="/apps/gdm/simple-greeter/disable_user_list"),
            WidgetFactory.create("UserGconfCheckButton",
                                 user='******',
                                 label=_("Play sound at login"),
                                 enable_reset=True,
                                 key="/desktop/gnome/sound/event_sounds"),
            WidgetFactory.create(
                "UserGconfCheckButton",
                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(False, 12)
        polkit_button = PolkitButton()
        polkit_button.connect('changed', 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)

        hbox = Gtk.HBox(spacing=12)
        self.add_start(hbox)

        self.cateview = CateView()
        self.cate_selection = self.cateview.get_selection()
        self.cate_selection.connect('changed', self.on_cateview_changed)

        sw = Gtk.ScrolledWindow(shadow_type=Gtk.ShadowType.IN)
        sw.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
        sw.add(self.cateview)
        hbox.pack_start(sw, False, False, 0)

        self.typeview = TypeView()
        self.typeview.connect('row-activated', self.on_row_activated)
        self.type_selection = self.typeview.get_selection()
        self.type_selection.set_mode(Gtk.SelectionMode.MULTIPLE)
        self.type_selection.connect('changed', self.on_typeview_changed)
        sw = Gtk.ScrolledWindow(shadow_type=Gtk.ShadowType.IN)
        sw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
        sw.add(self.typeview)
        hbox.pack_start(sw, True, True, 0)

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

        self.edit_button = Gtk.Button(stock=Gtk.STOCK_EDIT)
        self.edit_button.connect('clicked', self.on_edit_clicked)
        self.edit_button.set_sensitive(False)
        hbox.pack_end(self.edit_button, False, False, 0)

        self.reset_button = Gtk.Button(label=_('_Reset'))
        self.reset_button.set_use_underline(True)
        self.reset_button.connect('clicked', self.on_reset_clicked)
        self.reset_button.set_sensitive(False)
        hbox.pack_end(self.reset_button, False, False, 0)

        self.show_have_app = Gtk.CheckButton(
            _('Only show filetypes with associated applications'))
        self.show_have_app.set_active(True)
        self.show_have_app.connect('toggled', self.on_show_all_toggled)
        hbox.pack_start(self.show_have_app, False, False, 5)

        self.show_all()
Example #48
0
    def __init__(self):
        TweakModule.__init__(self)

        cpumodel = _('Unknown')

        if os.uname()[4][0:3] == "ppc":
            for element in file("/proc/cpuinfo"):
                if element.split(":")[0][0:3] == "cpu":
                    cpumodel = element.split(":")[1]
        else:
            for element in file("/proc/cpuinfo"):
                if element.split(":")[0] == "model name\t":
                    cpumodel = element.split(":")[1]

        for element in file("/proc/meminfo"):
            if element.split(" ")[0] == "MemTotal:":
                raminfo = element.split(" ")[-2]

        hostname_label = gtk.Label(os.uname()[1])
        hostname_button = gtk.Button(_('Change Hostname'))
        hostname_button.connect('clicked', self.on_hostname_button_clicked,
                                hostname_label)

        box = TablePack(_("System information"), (
            (gtk.Label(_("Hostname")), hostname_label, hostname_button),
            (gtk.Label(_("Distribution")), gtk.Label(system.DISTRO)),
            (gtk.Label(
                _("Desktop environment")), gtk.Label(system.DESKTOP_FULLNAME)),
            (gtk.Label(
                _("Kernel")), gtk.Label(os.uname()[0] + " " + os.uname()[2])),
            (gtk.Label(_("Platform")), gtk.Label(os.uname()[-1])),
            (gtk.Label(_("CPU")), gtk.Label(cpumodel.strip())),
            (gtk.Label(_("Memory")),
             gtk.Label(filesizeformat(str(int(raminfo) * 1024)))),
        ))
        self.add_start(box, False, False, 0)

        box = TablePack(_("User information"), (
            (gtk.Label(_("Current user")), gtk.Label(os.getenv("USER"))),
            (gtk.Label(_("Home directory")), gtk.Label(os.getenv("HOME"))),
            (gtk.Label(_("Shell")), gtk.Label(os.getenv("SHELL"))),
            (gtk.Label(_("Language")), gtk.Label(os.getenv("LANG"))),
        ))

        self.add_start(box, False, False, 0)
Example #49
0
    def __init__(self):
        TweakModule.__init__(self)

        hbox = gtk.HBox(False, 10)
        self.add_start(hbox, True, True, 0)

        #create the two checkbutton for extra options of auto run list
        self.show_comment_button = gtk.CheckButton(_("Show comments"))
        self.add_start(self.show_comment_button, False, False, 0)
        self.show_all_button = gtk.CheckButton(_("Show all runnable programs"))
        self.add_start(self.show_all_button, False, False, 0)

        self.show_all_button.connect("toggled", self.on_show_all,
                                     self.show_comment_button)
        self.show_comment_button.connect("toggled", self.on_show_comment,
                                         self.show_all_button)

        sw = gtk.ScrolledWindow()
        sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        hbox.pack_start(sw)

        self.treeview = AutoStartItem()
        self.treeview.connect('row-activated', self.on_row_activated)
        sw.add(self.treeview)

        vbox = gtk.VBox(False, 5)
        hbox.pack_start(vbox, False, False, 0)

        button = gtk.Button(stock=gtk.STOCK_ADD)
        button.connect("clicked", self.on_add_item, self.treeview)
        vbox.pack_start(button, False, False, 0)

        button = gtk.Button(stock=gtk.STOCK_REMOVE)
        button.set_sensitive(False)
        button.connect("clicked", self.on_remove_item, self.treeview)
        vbox.pack_start(button, False, False, 0)
        self.treeview.set_data("remove", button)

        button = gtk.Button(stock=gtk.STOCK_EDIT)
        button.set_sensitive(False)
        button.connect("clicked", self.on_edit_item, self.treeview)
        vbox.pack_start(button, False, False, 0)
        self.treeview.set_data("edit", button)
    def __init__(self):
        TweakModule.__init__(self, 'updatemanager.ui')

        self.updateview = UpdateView()
        self.updateview.connect('changed', self.on_update_status_changed)
        self.updateview.connect('select', self.on_select_action)
        self.update_list()
        self.sw1.add(self.updateview)

        button = GconfCheckButton(label=_('Automatically run System Update Manager'), 
                                  key='/apps/update-notifier/auto_launch')
        self.vbox1.pack_start(button, False, False, 0)

        self.ppa_button = GconfCheckButton(
                            label=_('Temporarily disable third-party PPA sources whilst refreshing'),
                            key='/apps/ubuntu-tweak/disable_ppa')
        self.vbox1.pack_start(self.ppa_button, False, False, 0)

        self.reparent(self.main_vbox)
Example #51
0
    def __init__(self):
        TweakModule.__init__(self)

        self.show_button = WidgetFactory.create("GconfCheckButton",
                                                label=_("Show desktop icons"),
                                                key="show_desktop")
        self.show_button.connect('toggled', self.colleague_changed)
        self.add_start(self.show_button, False, False, 0)

        self.show_button_box = gtk.HBox(False, 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(" ")
        self.show_button_box.pack_start(label, False, False, 0)

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

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

        button = WidgetFactory.create(
            "GconfCheckButton",
            label=_("Show \"Network\" icon on desktop"),
            key="network_icon_visible")
        vbox.pack_start(button, False, False, 0)

        button = WidgetFactory.create(
            "GconfCheckButton",
            label=_("Show mounted volumes on desktop"),
            key="volumes_visible")
        vbox.pack_start(button, False, False, 0)

        button = WidgetFactory.create(
            "GconfCheckButton",
            label=
            _('Show contents of "Home Folder" on desktop (Logout for changes to take effect)'
              ),
            key="desktop_is_home_dir")
        vbox.pack_start(button, False, False, 0)
Example #52
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)
Example #53
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)
Example #54
0
    def __init__(self):
        TweakModule.__init__(self, 'sourcecenter.ui')

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

        self.cateview = SourceCategoryView(
            os.path.join(SOURCE_ROOT, 'cates.json'))
        self.cateview.update_cate_model()
        self.cateview.get_selection().connect('changed',
                                              self.on_category_changed)
        self.left_sw.add(self.cateview)

        self.sourceview = SourcesView()
        self.sourceview.set_status_active(True)
        self.sourceview.update_source_model()
        self.sourceview.connect('sourcechanged', self.on_source_changed)
        self.sourceview.connect('new_purge', self.on_purge_changed)
        self.sourceview.get_selection().connect('changed',
                                                self.on_source_selection)
        self.sourceview.set_rules_hint(True)
        self.right_sw.add(self.sourceview)
        self.cateview.set_status_from_view(self.sourceview)

        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.add_start(self.main_vbox)

        self.connect('realize', self.setup_ui_tasks)

        GObject.idle_add(self.show_warning)
Example #55
0
    def __init__(self):
        TweakModule.__init__(self, 'appcenter.ui')

        set_label_for_stock_button(self.sync_button, _('_Sync'))

        self.to_add = []
        self.to_rm = []

        self.url = APP_VERSION_URL

        self.appview = AppView()
        self.appview.set_status_active(True)
        self.appview.update_model()
        self.appview.sort_model()
        self.appview.connect('changed', self.on_app_status_changed)
        self.app_selection = self.appview.get_selection()
        self.app_selection.connect('changed', self.on_app_selection)
        self.right_sw.add(self.appview)

        self.cateview = AppCategoryView(
            os.path.join(APPCENTER_ROOT, 'cates.json'))
        self.cateview.set_status_from_view(self.appview)
        self.cateview.update_cate_model()
        self.cate_selection = self.cateview.get_selection()
        self.cate_selection.connect('changed', self.on_category_changed)
        self.left_sw.add(self.cateview)

        self.update_timestamp()
        self.show_all()

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

        thread.start_new_thread(self.check_update, ())
        GObject.timeout_add(60000, self.update_timestamp)

        self.add_start(self.main_vbox)

        self.connect('realize', self.setup_ui_tasks)
Example #56
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)
Example #57
0
    def __init__(self):
        TweakModule.__init__(self)

        box = TablePack(
            _('Advanced Power Management Settings'),
            (WidgetFactory.create(
                'GconfCheckButton',
                label=_('Enable "Lock screen" when "Blank Screen" activates'),
                enable_reset=True,
                key='blank_screen'),
             WidgetFactory.create(
                 'GconfCheckButton',
                 label=_('Lock screen on hibernate'),
                 enable_reset=True,
                 key='/apps/gnome-power-manager/lock/hibernate'),
             WidgetFactory.create(
                 'GconfCheckButton',
                 label=_('Lock screen on suspend'),
                 enable_reset=True,
                 key='/apps/gnome-power-manager/lock/suspend'),
             WidgetFactory.create(
                 'GconfScale',
                 label=_('LCD brightness when using AC power'),
                 enable_reset=True,
                 key='/apps/gnome-power-manager/backlight/brightness_ac',
                 min=0,
                 max=100,
                 digits=0),
             WidgetFactory.create(
                 'GconfScale',
                 label=_('LCD brightness when using battery'),
                 enable_reset=True,
                 key=
                 '/apps/gnome-power-manager/backlight/brightness_dim_battery',
                 min=0,
                 max=100,
                 digits=0,
                 reversed=True)))
        self.add_start(box, False, False, 0)