本文整理汇总了Python中btsyncutils.BtBaseDialog.create方法的典型用法代码示例。如果您正苦于以下问题:Python BtBaseDialog.create方法的具体用法?Python BtBaseDialog.create怎么用?Python BtBaseDialog.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类btsyncutils.BtBaseDialog
的用法示例。
在下文中一共展示了BtBaseDialog.create方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create
# 需要导入模块: from btsyncutils import BtBaseDialog [as 别名]
# 或者: from btsyncutils.BtBaseDialog import create [as 别名]
def create(self):
BtBaseDialog.create(self)
self.username = self.agent.get_pref('username',None)
self.password = self.agent.get_pref('password',None)
self.bindui = self.agent.get_pref('bindui',None)
self.portui = self.agent.get_pref('portui',None)
self.username_w = self.builder.get_object('username_value')
self.password_w = self.builder.get_object('password_value')
self.bindportset_w = self.builder.get_object('bindport_set')
self.bindport_w = self.builder.get_object('bindport_value')
self.bindlocal_w = self.builder.get_object('bind_local')
self.bindall_w = self.builder.get_object('bind_all')
self.bindother_w = self.builder.get_object('bind_other')
self.bindportset_w.set_active(self.portui is not None)
self.bindport_w.set_sensitive(self.portui is not None)
self.bindport_w.set_range(8000, 65534)
self.bindport_w.set_increments(1, 100)
self.bindport_w.set_value(self.agent.uid + 8999 if self.portui is None else self.portui)
self.username_w.set_text("" if self.username is None else self.username)
self.password_w.set_text("" if self.password is None else self.password)
self.bindother_w.set_sensitive(False)
if self.bindui is None or self.bindui == '127.0.0.1' or self.bindui == 'localhost':
self.bindlocal_w.set_active(True)
elif self.bindui == '0.0.0.0' or self.bindui == 'auto':
self.bindall_w.set_active(True)
else:
self.bindother_w.set_active(True)
self.changed = False
示例2: create
# 需要导入模块: from btsyncutils import BtBaseDialog [as 别名]
# 或者: from btsyncutils.BtBaseDialog import create [as 别名]
def create(self):
BtBaseDialog.create(self)
self.dlg.add_buttons(
Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
Gtk.STOCK_OK, Gtk.ResponseType.OK
)
self.addr_w = self.builder.get_object('ph_addr')
self.port_w = self.builder.get_object('ph_port')
示例3: create
# 需要导入模块: from btsyncutils import BtBaseDialog [as 别名]
# 或者: from btsyncutils.BtBaseDialog import create [as 别名]
def create(self,folder,secret):
BtBaseDialog.create(self)
# compute secrets
result = self.api.get_secrets(secret)
self.idfolder = folder
self.idsecret = secret
self.rwsecret = result['read_write'] if result.has_key('read_write') else None
self.rosecret = result['read_only']
# initialize OK button
self.fp_button_ok = self.builder.get_object('fp_button_ok')
# secrets page
self.rw_secret = self.builder.get_object('rw_secret')
self.rw_secret_text = self.builder.get_object('rw_secret_text')
self.rw_secret_copy = self.builder.get_object('rw_secret_copy')
self.rw_secret_new = self.builder.get_object('rw_secret_new')
self.ro_secret = self.builder.get_object('ro_secret')
self.ro_secret_text = self.builder.get_object('ro_secret_text')
self.ro_secret_copy = self.builder.get_object('ro_secret_copy')
self.ot_secret = self.builder.get_object('ro_secret')
self.ot_secret_text = self.builder.get_object('ot_secret_text')
self.ot_secret_copy = self.builder.get_object('ot_secret_copy')
self.ot_secret_new = self.builder.get_object('ot_secret_new')
# secrets page - values
if self.rwsecret is None:
self.rw_secret.set_sensitive(False)
self.rw_secret_new.set_sensitive(False)
self.rw_secret_copy.set_sensitive(False)
else:
self.rw_secret_text.set_text(str(self.rwsecret))
self.ro_secret_text.set_text(str(self.rosecret))
# prefs page
self.fp_use_relay = self.builder.get_object('fp_use_relay')
self.fp_use_tracker = self.builder.get_object('fp_use_tracker')
self.fp_search_lan = self.builder.get_object('fp_search_lan')
self.fp_use_dht = self.builder.get_object('fp_use_dht')
self.fp_use_syncarchive = self.builder.get_object('fp_use_syncarchive')
self.fp_use_predefined = self.builder.get_object('fp_use_predefined')
self.fp_predefined_tree = self.builder.get_object('fp_predefined_tree')
self.fp_predefined_add = self.builder.get_object('fp_predefined_add')
self.fp_predefined_remove = self.builder.get_object('fp_predefined_remove')
self.fp_predefined_label = self.builder.get_object('fp_predefined_label')
# prefs page - values
result = self.api.get_folder_prefs(self.idsecret)
self.fp_use_relay.set_active(self.api.get_safe_result(result,'use_relay_server',0) != 0)
self.fp_use_tracker.set_active(self.api.get_safe_result(result,'use_tracker',0) != 0)
self.fp_search_lan.set_active(self.api.get_safe_result(result,'search_lan',0) != 0)
self.fp_use_dht.set_active(self.api.get_safe_result(result,'use_dht',0) != 0)
self.fp_use_syncarchive.set_active(self.api.get_safe_result(result,'use_sync_trash',0) != 0)
self.fp_use_predefined.set_active(self.api.get_safe_result(result,'use_hosts',0) != 0)
self.fp_use_predefined.set_sensitive(False)
self.fp_predefined_tree.set_sensitive(False)
self.fp_predefined_add.set_sensitive(False)
self.fp_predefined_remove.set_sensitive(False)
self.fp_predefined_label.set_sensitive(False)
# nothing is changed now
self.fp_button_ok.set_sensitive(False)
示例4: create
# 需要导入模块: from btsyncutils import BtBaseDialog [as 别名]
# 或者: from btsyncutils.BtBaseDialog import create [as 别名]
def create(self):
BtBaseDialog.create(self)
# get the editing widgets
self.advancedprefs = self.builder.get_object('advancedprefs')
self.ap_tree_prefs = self.builder.get_object('ap_tree_prefs')
self.ap_label_value = self.builder.get_object('ap_label_value')
self.ap_switch_value = self.builder.get_object('ap_switch_value')
self.ap_entry_value = self.builder.get_object('ap_entry_value')
self.ap_reset_value = self.builder.get_object('ap_reset_value')
self.set_treeview_sort_info(
self.ap_tree_prefs,
[0, Gtk.SortType.ASCENDING]
)
# initialize content
self.init_editor()
self.init_values()