本文整理汇总了Python中syncthing_gtk.editordialog.EditorDialog.display_value方法的典型用法代码示例。如果您正苦于以下问题:Python EditorDialog.display_value方法的具体用法?Python EditorDialog.display_value怎么用?Python EditorDialog.display_value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类syncthing_gtk.editordialog.EditorDialog
的用法示例。
在下文中一共展示了EditorDialog.display_value方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: display_value
# 需要导入模块: from syncthing_gtk.editordialog import EditorDialog [as 别名]
# 或者: from syncthing_gtk.editordialog.EditorDialog import display_value [as 别名]
def display_value(self, key, w):
if key == "vdevices":
# Very special case
nids = [ n["deviceID"] for n in self.get_value("devices") ]
for device in self.app.devices.values():
if device["id"] != self.app.daemon.get_my_id():
b = Gtk.CheckButton(device.get_title(), False)
b.set_tooltip_text(device["id"])
self["vdevices"].pack_end(b, False, False, 0)
b.set_active(device["id"] in nids)
self["vdevices"].show_all()
else:
EditorDialog.display_value(self, key, w)
示例2: display_value
# 需要导入模块: from syncthing_gtk.editordialog import EditorDialog [as 别名]
# 或者: from syncthing_gtk.editordialog.EditorDialog import display_value [as 别名]
def display_value(self, key, w):
if key == "vfolders":
# Even more special case
rids = [ ]
# Get list of folders that share this device
for r in self.config["folders"]:
for n in r["devices"]:
if n["deviceID"] == self.id:
rids.append(r["id"])
# Create CheckButtons
for folder in reversed(sorted(self.app.folders.values(), key=lambda x : x["id"])):
b = Gtk.CheckButton(folder["path"], False)
b.set_tooltip_text(folder["id"])
self["vfolders"].pack_start(b, False, False, 0)
b.set_active(folder["id"] in rids)
self["vfolders"].show_all()
else:
EditorDialog.display_value(self, key, w)
示例3: display_value
# 需要导入模块: from syncthing_gtk.editordialog import EditorDialog [as 别名]
# 或者: from syncthing_gtk.editordialog.EditorDialog import display_value [as 别名]
def display_value(self, key, w):
if key == "vautostart_daemon":
value = self.get_value(key[1:])
if value == 0: self["rbOnStartWait"].set_active(True)
elif value == 1: self["rbOnStartRun"].set_active(True)
else: self["rbOnStartAsk"].set_active(True)
elif key == "vautokill_daemon":
value = self.get_value(key[1:])
if value == 1: self["rbOnExitTerminate"].set_active(True)
elif value == 0: self["rbOnExitLeave"].set_active(True)
else: self["rbOnExitAsk"].set_active(True)
else:
return EditorDialog.display_value(self, key, w)