本文整理汇总了Python中ubuntutweak.common.config.TweakSettings.get_enable_new_item方法的典型用法代码示例。如果您正苦于以下问题:Python TweakSettings.get_enable_new_item方法的具体用法?Python TweakSettings.get_enable_new_item怎么用?Python TweakSettings.get_enable_new_item使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ubuntutweak.common.config.TweakSettings
的用法示例。
在下文中一共展示了TweakSettings.get_enable_new_item方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from ubuntutweak.common.config import TweakSettings [as 别名]
# 或者: from ubuntutweak.common.config.TweakSettings import get_enable_new_item [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.appview = AppView()
self.appview.set_status_active(TweakSettings.get_enable_new_item())
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 = CategoryView(os.path.join(APPCENTER_ROOT, 'cates.json'))
self.cateview.set_status_from_view(self.appview)
self.cateview.update_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)
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_enable_new_item [as 别名]
def __init__(self):
TweakModule.__init__(self, 'sourcecenter.ui')
self.url = SOURCE_VERSION_URL
set_label_for_stock_button(self.sync_button, _('_Sync'))
self.sourceview = SourcesView()
self.sourceview.set_status_active(TweakSettings.get_enable_new_item())
self.sourceview.update_model()
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.source_selection = self.sourceview.get_selection()
self.source_selection.connect('changed', self.on_source_selection)
self.right_sw.add(self.sourceview)
self.cateview = CategoryView(os.path.join(SOURCE_ROOT, 'cates.json'))
self.cateview.set_status_from_view(self.sourceview)
self.cateview.update_model()
self.cate_selection = self.cateview.get_selection()
self.cate_selection.connect('changed', self.on_category_changed)
self.left_sw.add(self.cateview)
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():
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.reparent(self.main_vbox)