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


Python TweakSettings.get_check_update方法代码示例

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


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

示例1: __init__

# 需要导入模块: from ubuntutweak.common.config import TweakSettings [as 别名]
# 或者: from ubuntutweak.common.config.TweakSettings import get_check_update [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

示例2: __init__

# 需要导入模块: from ubuntutweak.common.config import TweakSettings [as 别名]
# 或者: from ubuntutweak.common.config.TweakSettings import get_check_update [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_check_update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。