当前位置: 首页>>代码示例>>Python>>正文


Python modules.TweakModule类代码示例

本文整理汇总了Python中ubuntutweak.modules.TweakModule的典型用法代码示例。如果您正苦于以下问题:Python TweakModule类的具体用法?Python TweakModule怎么用?Python TweakModule使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了TweakModule类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

    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()
开发者ID:0x0001,项目名称:ubuntu-tweak,代码行数:35,代码来源:desktoprecovery.py

示例2: __init__

    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)
开发者ID:Adriarson,项目名称:ubuntu-tweak,代码行数:28,代码来源:powermanager.py

示例3: __init__

    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)
开发者ID:leeight,项目名称:ubuntu-tweak,代码行数:60,代码来源:nautilus.py

示例4: __init__

    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)
开发者ID:Thongor,项目名称:ubuntu-tweak,代码行数:34,代码来源:powermanager.py

示例5: __init__

    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)
开发者ID:0tli4nitsa,项目名称:ubuntu-tweak,代码行数:28,代码来源:userdir.py

示例6: __init__

    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__)
开发者ID:0xBADCA7,项目名称:ubuntu-tweak,代码行数:31,代码来源:lovewallpaperhd.py

示例7: __init__

    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()
开发者ID:GBeckerRS,项目名称:ubuntu-tweak,代码行数:27,代码来源:templates.py

示例8: __init__

    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)
开发者ID:Thongor,项目名称:ubuntu-tweak,代码行数:29,代码来源:sourceeditor.py

示例9: __init__

    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)
开发者ID:juzerdana,项目名称:ubuntu-tweak,代码行数:32,代码来源:lockdown.py

示例10: __init__

    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()
开发者ID:jonolumb,项目名称:ubuntu-tweak,代码行数:31,代码来源:desktoprecovery.py

示例11: __init__

    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)
开发者ID:Adriarson,项目名称:ubuntu-tweak,代码行数:33,代码来源:scripts.py

示例12: __init__

    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()
开发者ID:priteshdesai,项目名称:ubuntu-tweak,代码行数:35,代码来源:filetype.py

示例13: __init__

    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)
开发者ID:ubuntutweak,项目名称:ubuntu-tweak,代码行数:33,代码来源:appcenter.py

示例14: __init__

    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)
开发者ID:Adriarson,项目名称:ubuntu-tweak,代码行数:25,代码来源:userdir.py

示例15: __init__

    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)
开发者ID:0tli4nitsa,项目名称:ubuntu-tweak,代码行数:27,代码来源:sound.py


注:本文中的ubuntutweak.modules.TweakModule类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。