本文整理汇总了Python中ubuntutweak.common.config.TweakSettings.get_sync_notify方法的典型用法代码示例。如果您正苦于以下问题:Python TweakSettings.get_sync_notify方法的具体用法?Python TweakSettings.get_sync_notify怎么用?Python TweakSettings.get_sync_notify使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ubuntutweak.common.config.TweakSettings
的用法示例。
在下文中一共展示了TweakSettings.get_sync_notify方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from ubuntutweak.common.config import TweakSettings [as 别名]
# 或者: from ubuntutweak.common.config.TweakSettings import get_sync_notify [as 别名]
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)
示例2: __init__
# 需要导入模块: from ubuntutweak.common.config import TweakSettings [as 别名]
# 或者: from ubuntutweak.common.config.TweakSettings import get_sync_notify [as 别名]
def __init__(self):
TweakModule.__init__(self, 'sourcecenter.ui')
self.url = SOURCE_VERSION_URL
set_label_for_stock_button(self.sync_button, _('_Sync'))
self.cateview = CategoryView(os.path.join(SOURCE_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.sourceview = SourcesView()
self.sourceview.connect('sourcechanged', self.on_source_changed)
self.sourceview.selection.connect('changed', self.on_selection_changed)
self.sourceview.set_sensitive(False)
self.sourceview.set_rules_hint(True)
self.right_sw.add(self.sourceview)
self.expander = gtk.Expander(_('Details'))
self.vbox1.pack_start(self.expander, False, False, 0)
self.sourcedetail = SourceDetail()
self.expander.set_sensitive(False)
self.expander.add(self.sourcedetail)
un_lock = PolkitButton()
un_lock.connect('changed', self.on_polkit_action)
self.hbox2.pack_end(un_lock, False, False, 0)
self.hbox2.reorder_child(un_lock, 0)
#TODO when server is ready, work on it again
# try:
# if os.getenv('LANG').startswith('zh_CN'):
# if TweakSettings.get_use_mirror_ppa():
# gobject.idle_add(self.start_check_cn_ppa)
# else:
# self.sourceview.unconver_ubuntu_cn_mirror()
# except AttributeError:
# pass
# CONFIG.get_client().notify_add('/apps/ubuntu-tweak/use_mirror_ppa',
# self.value_changed)
self.update_timestamp()
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)