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


Python TweakSettings.get_default_launch方法代码示例

本文整理汇总了Python中ubuntutweak.common.config.TweakSettings.get_default_launch方法的典型用法代码示例。如果您正苦于以下问题:Python TweakSettings.get_default_launch方法的具体用法?Python TweakSettings.get_default_launch怎么用?Python TweakSettings.get_default_launch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ubuntutweak.common.config.TweakSettings的用法示例。


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

示例1: setup_launch_function

# 需要导入模块: from ubuntutweak.common.config import TweakSettings [as 别名]
# 或者: from ubuntutweak.common.config.TweakSettings import get_default_launch [as 别名]
    def setup_launch_function(self):
        from mainwindow import module_loader
        from mainwindow import ID_COLUMN, LOGO_COLUMN, TITLE_COLUMN
        function_box = self.worker.get_object('function_box')

        model = gtk.ListStore(
                gobject.TYPE_STRING,
                gtk.gdk.Pixbuf,
                gobject.TYPE_STRING)

        iter = model.append(None)
        model.set(iter,
                ID_COLUMN, 0,
                LOGO_COLUMN, None,
                TITLE_COLUMN, _('None')
        )
        for module in module_loader.get_all_module():
            iter = model.append(None)
            pixbuf = module_loader.get_pixbuf(module.__name__)

            model.set(iter,
                    ID_COLUMN, module.__name__,
                    LOGO_COLUMN, pixbuf,
                    TITLE_COLUMN, module.__title__,
            )

        function_box.set_model(model)
        textcell = gtk.CellRendererText()
        pixbufcell = gtk.CellRendererPixbuf()
        function_box.pack_start(pixbufcell, False)
        function_box.pack_start(textcell, True)
        function_box.add_attribute(textcell, 'text', TITLE_COLUMN)
        function_box.add_attribute(pixbufcell, 'pixbuf', LOGO_COLUMN)
        id = TweakSettings.get_default_launch()
        for i, row in enumerate(model):
            _id = model.get_value(row.iter, ID_COLUMN)
            if id == _id:
                function_box.set_active(i)
        function_box.connect('changed', self.on_launch_changed)
开发者ID:DigGe,项目名称:ubuntu-tweak,代码行数:41,代码来源:preferences.py

示例2: setup_launch_function

# 需要导入模块: from ubuntutweak.common.config import TweakSettings [as 别名]
# 或者: from ubuntutweak.common.config.TweakSettings import get_default_launch [as 别名]
    def setup_launch_function(self):
        from ubuntutweak.mainwindow import MLOADER
        from ubuntutweak.mainwindow import MainWindow as MW
        function_box = self.worker.get_object('function_box')

        model = gtk.ListStore(
                gobject.TYPE_STRING,
                gtk.gdk.Pixbuf,
                gobject.TYPE_STRING)

        iter = model.append(None)
        model.set(iter,
                MW.ID_COLUMN, '',
                MW.LOGO_COLUMN, None,
                MW.TITLE_COLUMN, _('None')
        )
        for module in MLOADER.get_all_module():
            iter = model.append(None)

            model.set(iter,
                    MW.ID_COLUMN, module.get_name(),
                    MW.LOGO_COLUMN, module.get_pixbuf(),
                    MW.TITLE_COLUMN, module.get_title(),
            )

        function_box.set_model(model)
        textcell = gtk.CellRendererText()
        pixbufcell = gtk.CellRendererPixbuf()
        function_box.pack_start(pixbufcell, False)
        function_box.pack_start(textcell, True)
        function_box.add_attribute(textcell, 'text', MW.TITLE_COLUMN)
        function_box.add_attribute(pixbufcell, 'pixbuf', MW.LOGO_COLUMN)
        id = TweakSettings.get_default_launch()
        for i, row in enumerate(model):
            _id = model.get_value(row.iter, MW.ID_COLUMN)
            if id == _id:
                function_box.set_active(i)
        function_box.connect('changed', self.on_launch_changed)
开发者ID:Adriarson,项目名称:ubuntu-tweak,代码行数:40,代码来源:preferences.py

示例3: __init__

# 需要导入模块: from ubuntutweak.common.config import TweakSettings [as 别名]
# 或者: from ubuntutweak.common.config.TweakSettings import get_default_launch [as 别名]
    def __init__(self):
        gtk.Window.__init__(self)

        self.notify_func = None

        self.connect("destroy", self.destroy)
        self.set_title(APP)
        self.set_default_size(740, 480)
        self.set_position(gtk.WIN_POS_CENTER)
        self.set_border_width(10)

        vbox = gtk.VBox(False, 6)
        self.add(vbox)

        self.hpaned = gtk.HPaned()
        vbox.pack_start(self.hpaned, True, True, 0)

        swindow = gtk.ScrolledWindow()
        swindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        swindow.set_size_request(150, -1)
        self.hpaned.pack1(swindow)

        self.model = self.__create_model()
        self.update_model()
        self.treeview = gtk.TreeView(self.model)
        self.treeview.set_enable_tree_lines(True)

        self.__add_columns(self.treeview)
        selection = self.treeview.get_selection()
        selection.connect("changed", self.selection_cb)
        self.treeview.expand_all()

        swindow.add(self.treeview)

        self.notebook = self.create_notebook()
        self.moduletable = {'0': 0}
        self.modules = {}
        self.hpaned.pack2(self.notebook)

        hbox = gtk.HBox(False, 12)
        vbox.pack_start(hbox, False, False, 0)
        button = gtk.Button(stock=gtk.STOCK_ABOUT)
        button.connect("clicked", self.show_about)
        hbox.pack_start(button, False, False, 0)

        d_button = gtk.Button(stock=gtk.STOCK_YES)
        set_label_for_stock_button(d_button, _('_Donate'))
        d_button.connect("clicked", self.on_d_clicked)
        hbox.pack_start(d_button, False, False, 0)

        button = gtk.Button(stock=gtk.STOCK_QUIT)
        button.connect("clicked", self.destroy)
        hbox.pack_end(button, False, False, 0)

        button = gtk.Button(stock=gtk.STOCK_PREFERENCES)
        button.connect('clicked', self.on_preferences_clicked)
        hbox.pack_end(button, False, False, 0)

        self.get_gui_state()
        self.set_icon(icon.get_from_name('ubuntu-tweak', size=48))
        self.show_all()

        if TweakSettings.get_check_update():
            log.debug("get_check_update will start after 5 seconds")
            gobject.timeout_add(5000, self.on_timeout)

        launch = TweakSettings.get_default_launch()
        try:
            if launch and not launch.isdigit():
                self.__create_newpage(launch)
        except:
            pass

        # Only check if the distribution is supported
        if module_check.get_codename():
            gobject.idle_add(self.notify_stable_source)
开发者ID:jonolumb,项目名称:ubuntu-tweak,代码行数:78,代码来源:mainwindow.py

示例4: __init__

# 需要导入模块: from ubuntutweak.common.config import TweakSettings [as 别名]
# 或者: from ubuntutweak.common.config.TweakSettings import get_default_launch [as 别名]
    def __init__(self):
        gtk.Window.__init__(self)

        self.connect("destroy", self.destroy)
        self.set_title(APP)
        self.set_default_size(740, 480)
        self.set_position(gtk.WIN_POS_CENTER)
        self.set_border_width(10)

        vbox = gtk.VBox(False, 0)
        self.add(vbox)

        self.hpaned = gtk.HPaned()
        vbox.pack_start(self.hpaned, True, True, 0)

        sw = gtk.ScrolledWindow()
        sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        sw.set_size_request(150, -1)
        self.hpaned.pack1(sw)

        self.model = self.__create_model()
        self.update_model()
        self.treeview = gtk.TreeView(self.model)
        self.treeview.set_enable_tree_lines(True)

        self.__add_columns(self.treeview)
        selection = self.treeview.get_selection()
        selection.connect("changed", self.selection_cb)
        self.treeview.expand_all()

        sw.add(self.treeview)

        self.notebook = self.create_notebook()
        self.moduletable = {'0': 0}
        self.modules = {}
        self.hpaned.pack2(self.notebook)

        hbox = gtk.HBox(False, 5)
        vbox.pack_start(hbox, False, False, 5)
        button = gtk.Button(stock = gtk.STOCK_ABOUT)
        button.connect("clicked", self.show_about)
        hbox.pack_start(button, False, False, 0)

        d_button = gtk.Button(stock = gtk.STOCK_YES)
        set_label_for_stock_button(d_button, _('_Donate'))
        d_button.connect("clicked", self.on_d_clicked)
        hbox.pack_start(d_button, False, False, 0)

        button = gtk.Button(stock = gtk.STOCK_QUIT)
        button.connect("clicked", self.destroy);
        hbox.pack_end(button, False, False, 0)

        button = gtk.Button(stock = gtk.STOCK_PREFERENCES)
        button.connect('clicked', self.on_preferences_clicked)
        hbox.pack_end(button, False, False, 0)

        self.get_gui_state()
        self.set_icon(icon.get_with_name('ubuntu-tweak', size=48))
        self.show_all()

        if TweakSettings.get_check_update():
            gobject.timeout_add(5000, self.on_timeout)

        launch = TweakSettings.get_default_launch()
        if launch and launch != '0':
            self.__create_newpage(launch)
开发者ID:DigGe,项目名称:ubuntu-tweak,代码行数:68,代码来源:mainwindow.py


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