w10config.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:wintenApps 作者: josephsl 项目源码 文件源码
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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号