w10config.py 文件源码

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

项目:wintenApps 作者: josephsl 项目源码 文件源码
def __init__(self, parent):
        # Translators: The title of a dialog to configure advanced WinTenApps add-on options such as update checking.
        super(WinTenAppsConfigDialog, self).__init__(parent, title=_("Windows 10 App Essentials settings"))

        mainSizer = wx.BoxSizer(wx.VERTICAL)
        w10Helper = gui.guiHelper.BoxSizerHelper(self, orientation=wx.VERTICAL)

        # Translators: A checkbox to toggle automatic add-on updates.
        self.autoUpdateCheckbox=w10Helper.addItem(wx.CheckBox(self,label=_("Automatically check for add-on &updates")))
        self.autoUpdateCheckbox.SetValue(config.conf["wintenApps"]["autoUpdateCheck"])
        # Translators: The label for a setting in WinTenApps add-on settings to select automatic update interval in days.
        self.updateInterval=w10Helper.addLabeledControl(_("Update &interval in days"), gui.nvdaControls.SelectOnFocusSpinCtrl, min=0, max=30, initial=config.conf["wintenApps"]["updateCheckTimeInterval"])
        # Translators: The label for a combo box to select update channel.
        labelText = _("&Add-on update channel:")
        self.channels=w10Helper.addLabeledControl(labelText, wx.Choice, choices=["development", "stable"])
        self.updateChannels = ("dev", "stable")
        self.channels.SetSelection(self.updateChannels.index(config.conf["wintenApps"]["updateChannel"]))
        if canUpdate:
            # Translators: The label of a button to check for add-on updates.
            updateCheckButton = w10Helper.addItem(wx.Button(self, label=_("Check for add-on &update")))
            updateCheckButton.Bind(wx.EVT_BUTTON, self.onUpdateCheck)

        w10Helper.addDialogDismissButtons(self.CreateButtonSizer(wx.OK | wx.CANCEL))
        self.Bind(wx.EVT_BUTTON, self.onOk, id=wx.ID_OK)
        self.Bind(wx.EVT_BUTTON, self.onCancel, id=wx.ID_CANCEL)
        mainSizer.Add(w10Helper.sizer, border=gui.guiHelper.BORDER_FOR_DIALOGS, flag=wx.ALL)
        mainSizer.Fit(self)
        self.Sizer = mainSizer
        self.autoUpdateCheckbox.SetFocus()
        self.Center(wx.BOTH | (wx.CENTER_ON_SCREEN if hasattr(wx, "CENTER_ON_SCREEN") else 2))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号