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


Python EditorDialog.store_value方法代码示例

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


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

示例1: store_value

# 需要导入模块: from syncthing_gtk import EditorDialog [as 别名]
# 或者: from syncthing_gtk.EditorDialog import store_value [as 别名]
	def store_value(self, key, w):
		if key == "vFolders":	# And this one is special too
			# Generate dict of { folder_id : bool } where bool is True if
			# folder should be shared with this device
			folders = {}
			for b in self["vFolders"].get_children():
				folders[b.get_tooltip_text()] = b.get_active()
			# Go over all Folders/<folder>/Devices/<device> keys in config
			# and set them as needed
			nid = self.get_value("DeviceID")
			for r in self.config["Folders"]:
				rid = r["ID"]
				found = False
				for n in r["Devices"]:
					if n["DeviceID"] == nid:
						if not rid in folders or not folders[rid]:
							# Remove this /<device> key (unshare folder with device)
							r["Devices"].remove(n)
							break
						found = True
				if (not found) and (rid in folders) and folders[rid]:
					# Add new /<device> key (share folder with device)
					r["Devices"].append({
					   "Addresses" : None,
					   "DeviceID" : nid,
					   "Name" : "",
					   "CertName" : "",
					   "Compression" : False
						})
		else:
			EditorDialog.store_value(self, key, w)
开发者ID:Rongya,项目名称:syncthing-gtk,代码行数:33,代码来源:deviceeditor.py

示例2: store_value

# 需要导入模块: from syncthing_gtk import EditorDialog [as 别名]
# 或者: from syncthing_gtk.EditorDialog import store_value [as 别名]
	def store_value(self, key, w):
		if key == "vDevices":	# Still very special case
			devices = [ {
					   "Addresses" : None,
					   "DeviceID" : b.get_tooltip_text(),
					   "Name" : "",
					   "CertName" : "",
					   "Compression" : False
						}
						for b in self["vDevices"].get_children()
						if b.get_active()
					]
			self.set_value("Devices", devices)
		else:
			EditorDialog.store_value(self, key, w)
开发者ID:LenzGr,项目名称:syncthing-gtk,代码行数:17,代码来源:foldereditor.py

示例3: store_value

# 需要导入模块: from syncthing_gtk import EditorDialog [as 别名]
# 或者: from syncthing_gtk.EditorDialog import store_value [as 别名]
	def store_value(self, key, w):
		if key == "vautostart_daemon":
			if   self["rbOnStartWait"].get_active() : self.set_value(key[1:], 0)
			elif self["rbOnStartRun"].get_active() : self.set_value(key[1:], 1)
			else: return self.set_value(key[1:], 2)	# vOnStartAsk
		elif key == "vautokill_daemon":
			if self["rbOnExitTerminate"].get_active() : return self.set_value(key[1:], 1)
			elif self["rbOnExitLeave"].get_active() : return self.set_value(key[1:], 0)
			else: return self.set_value(key[1:], 2)	# vOnExitAsk
		elif key == "vst_autoupdate":
			# Reset updatecheck timer when autoupdate is turned on
			if self["vst_autoupdate"].get_active():
				self.values["last_updatecheck"] = LONG_AGO
			return EditorDialog.store_value(self, key, w)
		else:
			return EditorDialog.store_value(self, key, w)
开发者ID:Newman101,项目名称:syncthing-gtk,代码行数:18,代码来源:uisettingsdialog.py

示例4: store_value

# 需要导入模块: from syncthing_gtk import EditorDialog [as 别名]
# 或者: from syncthing_gtk.EditorDialog import store_value [as 别名]
	def store_value(self, key, w):
		if key == "vautostart_daemon":
			if   self["rbOnStartWait"].get_active() : self.set_value(key[1:], 0)
			elif self["rbOnStartRun"].get_active() : self.set_value(key[1:], 1)
			else: return self.set_value(key[1:], 2)	# vOnStartAsk
		elif key == "vautokill_daemon":
			if self["rbOnExitTerminate"].get_active() : return self.set_value(key[1:], 1)
			elif self["rbOnExitLeave"].get_active() : return self.set_value(key[1:], 0)
			else: return self.set_value(key[1:], 2)	# vOnExitAsk
		else:
			return EditorDialog.store_value(self, key, w)
开发者ID:bboerner,项目名称:syncthing-gui,代码行数:13,代码来源:uisettings.py


注:本文中的syncthing_gtk.EditorDialog.store_value方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。