def onOk(self, evt):
# #39: Prompt if switching from stable to development channel.
currentUpdateChannel = config.conf["wintenApps"]["updateChannel"]
newUpdateChannel = ("dev", "stable")[self.channels.GetSelection()]
if currentUpdateChannel == "stable" and newUpdateChannel == "dev":
if gui.messageBox(
# Translators: The confirmation prompt displayed when changing to development channel (with risks involved).
_("You are about to switch to development updates channel. Although updates from this channel brings exciting features, it also comes with updates that might be unstable at times and should be used for testing and sending feedback to the add-on developer. If you prefer to use stable releases, please answer no and switch to stable update channel. Are you sure you wish to switch to the development update channel?"),
# Translators: The title of the channel switch confirmation dialog.
_("Switching to unstable channel"),
wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION, self
) == wx.NO:
return
global updateChecker
if updateChecker and updateChecker.IsRunning(): updateChecker.Stop()
config.conf["wintenApps"]["autoUpdateCheck"] = self.autoUpdateCheckbox.Value
config.conf["wintenApps"]["updateCheckTimeInterval"] = self.updateInterval.Value
if not self.updateInterval.Value:
config.conf["wintenApps"]["updateCheckTime"] = 0
updateChecker = None
else:
updateChecker = wx.PyTimer(autoUpdateCheck)
currentTime = time.time()
whenToCheck = currentTime+(self.updateInterval.Value * addonUpdateCheckInterval)
updateChecker.Start(whenToCheck-currentTime, True)
config.conf["wintenApps"]["updateChannel"] = ("dev", "stable")[self.channels.GetSelection()]
self.Destroy()
评论列表
文章目录