def onOk(self, evt): if self.skipEmptyParagraphBox.IsChecked( ) != _addonConfigManager.toggleSkipEmptyParagraphsOption(False): _addonConfigManager.toggleSkipEmptyParagraphsOption() if self.playSoundOnSkippedParagraphBox.IsChecked( ) != _addonConfigManager.togglePlaySoundOnSkippedParagraphOption( False): _addonConfigManager.togglePlaySoundOnSkippedParagraphOption() super(WordAddonSettingsDialog, self).onOk(evt)
def saveSettingChanges(self): if self.skipEmptyParagraphBox.IsChecked( ) != _addonConfigManager.toggleSkipEmptyParagraphsOption(False): _addonConfigManager.toggleSkipEmptyParagraphsOption() if self.playSoundOnSkippedParagraphBox.IsChecked( ) != _addonConfigManager.togglePlaySoundOnSkippedParagraphOption( False): _addonConfigManager.togglePlaySoundOnSkippedParagraphOption() if self.autoCheckForUpdatesCheckBox.IsChecked( ) != _addonConfigManager.toggleAutoUpdateCheck(False): _addonConfigManager.toggleAutoUpdateCheck(True) if self.updateReleaseVersionsToDevVersionsCheckBox.IsChecked( ) != _addonConfigManager.toggleUpdateReleaseVersionsToDevVersions( False): _addonConfigManager.toggleUpdateReleaseVersionsToDevVersions(True)
def saveSettingChanges(self): if self.skipEmptyParagraphBox.IsChecked( ) != _addonConfigManager.toggleSkipEmptyParagraphsOption( False): # noqa:E501 _addonConfigManager.toggleSkipEmptyParagraphsOption() if self.playSoundOnSkippedParagraphBox.IsChecked( ) != _addonConfigManager.togglePlaySoundOnSkippedParagraphOption( False): # noqa:E501 _addonConfigManager.togglePlaySoundOnSkippedParagraphOption() if self.automaticReadingCheckBox.IsChecked( ) != _addonConfigManager.toggleAutomaticReadingOption( False): # noqa:E501 _addonConfigManager.toggleAutomaticReadingOption() if self.objectsToReadCheckListBox.IsChecked( self.objectsToRead.index("comment") ) != _addonConfigManager.toggleAutoCommentReadingOption( False): # noqa:E501 _addonConfigManager.toggleAutoCommentReadingOption() if self.objectsToReadCheckListBox.IsChecked( self.objectsToRead.index("footnote") ) != _addonConfigManager.toggleAutoFootnoteReadingOption( False): # noqa:E501 _addonConfigManager.toggleAutoFootnoteReadingOption() if self.objectsToReadCheckListBox.IsChecked( self.objectsToRead.index("endnote") ) != _addonConfigManager.toggleAutoEndnoteReadingOption( False): # noqa:E501 _addonConfigManager.toggleAutoEndnoteReadingOption() _addonConfigManager.setAutoReadingWithOption( self.autoReadingWithChoiceBox.GetSelection()) elementsSearchMaxTime = int( self.elementsSearchMaxTimeListBox.GetString( self.elementsSearchMaxTimeListBox.GetSelection())) if self.objectsToReadCheckListBox.IsChecked( self.objectsToRead.index("endnote") ) != _addonConfigManager.toggleAutoEndnoteReadingOption( False): # noqa:E501 _addonConfigManager.setElementsSearchMaxTime(elementsSearchMaxTime) if self.loopInNavigationModeOptionBox.IsChecked( ) != _addonConfigManager.toggleLoopInNavigationModeOption(False): _addonConfigManager.toggleLoopInNavigationModeOption()
def makeSettings(self, settingsSizer): sHelper = gui.guiHelper.BoxSizerHelper(self, sizer=settingsSizer) self.skipEmptyParagraphBox = sHelper.addItem( wx.CheckBox(self, wx.ID_ANY, label=_("&Skip empty paragraph"))) self.skipEmptyParagraphBox.SetValue( _addonConfigManager.toggleSkipEmptyParagraphsOption(False)) self.playSoundOnSkippedParagraphBox = sHelper.addItem( wx.CheckBox(self, wx.ID_ANY, label=_("&Play sound when paragraph is skipped"))) self.playSoundOnSkippedParagraphBox.SetValue( _addonConfigManager.togglePlaySoundOnSkippedParagraphOption(False))
def makeSettings(self, settingsSizer): sHelper = gui.guiHelper.BoxSizerHelper(self, sizer=settingsSizer) # Translators: This is the label for a checkbox in the settings panel. self.skipEmptyParagraphBox = sHelper.addItem( wx.CheckBox(self, wx.ID_ANY, label=_("&Skip empty paragraph"))) self.skipEmptyParagraphBox.SetValue( _addonConfigManager.toggleSkipEmptyParagraphsOption(False)) # Translators: This is the label for a checkbox in the settings panel. self.playSoundOnSkippedParagraphBox = sHelper.addItem( wx.CheckBox(self, wx.ID_ANY, label=_("&Play sound when paragraph is skipped"))) self.playSoundOnSkippedParagraphBox.SetValue( _addonConfigManager.togglePlaySoundOnSkippedParagraphOption(False)) # Translators: This is the label for a group of editing options in the settings panel. groupText = _("Update") group = gui.guiHelper.BoxSizerHelper(self, sizer=wx.StaticBoxSizer( wx.StaticBox(self, label=groupText), wx.VERTICAL)) sHelper.addItem(group) # Translators: This is the label for a checkbox in the settings panel. labelText = _("Automatically check for &updates ") self.autoCheckForUpdatesCheckBox = group.addItem( wx.CheckBox(self, wx.ID_ANY, label=labelText)) self.autoCheckForUpdatesCheckBox.SetValue( _addonConfigManager.toggleAutoUpdateCheck(False)) # Translators: This is the label for a checkbox in the settings panel. labelText = _( "Update also release versions to &developpement versions") self.updateReleaseVersionsToDevVersionsCheckBox = group.addItem( wx.CheckBox(self, wx.ID_ANY, label=labelText)) self.updateReleaseVersionsToDevVersionsCheckBox.SetValue( _addonConfigManager.toggleUpdateReleaseVersionsToDevVersions( False)) # Translators: This is the label for a button in the settings panel. labelText = _("&Check for update") checkForUpdateButton = wx.Button(self, label=labelText) group.addItem(checkForUpdateButton) checkForUpdateButton.Bind(wx.EVT_BUTTON, self.onCheckForUpdate)
def playSoundOnSkippedParagraph(self): option = _addonConfigManager.togglePlaySoundOnSkippedParagraphOption( False) if option: tones.beep(400, 12)
def makeSettings(self, settingsSizer): sHelper = gui.guiHelper.BoxSizerHelper(self, sizer=settingsSizer) # Translators: This is the label for a group of editing options # in the settings panel. groupText = _("Paragraph") group = gui.guiHelper.BoxSizerHelper(self, sizer=wx.StaticBoxSizer( wx.StaticBox(self, label=groupText), wx.VERTICAL)) sHelper.addItem(group) # Translators: This is the label for a checkbox in the settings panel. labelText = _("&Skip empty paragraphs") self.skipEmptyParagraphBox = group.addItem( wx.CheckBox(self, wx.ID_ANY, label=labelText)) self.skipEmptyParagraphBox.SetValue( _addonConfigManager.toggleSkipEmptyParagraphsOption(False)) # Translators: This is the label for a checkbox in the settings panel. labelText = _("&Play sound when paragraph is skipped") self.playSoundOnSkippedParagraphBox = group.addItem( wx.CheckBox(self, wx.ID_ANY, label=labelText)) self.playSoundOnSkippedParagraphBox.SetValue( _addonConfigManager.togglePlaySoundOnSkippedParagraphOption(False)) # Translators: This is the label for a group of editing options # in the settings panel. groupText = _("Automatic reading") group = gui.guiHelper.BoxSizerHelper(self, sizer=wx.StaticBoxSizer( wx.StaticBox(self, label=groupText), wx.VERTICAL)) sHelper.addItem(group) # Translators: This is the label for a checkbox in the settings panel. labelText = _("&Activate automatic reading") self.automaticReadingCheckBox = group.addItem( wx.CheckBox(self, wx.ID_ANY, label=labelText)) self.automaticReadingCheckBox.SetValue( _addonConfigManager.toggleAutomaticReadingOption(False)) #Translators: This is the label for a list of checkboxes # controlling which object are automatically reading. labelText = _("Concerned elements:") choice = [self.objectsToReadLabels[x] for x in self.objectsToRead] self.objectsToReadCheckListBox = sHelper.addLabeledControl( labelText, nvdaControls.CustomCheckListBox, choices=choice) checkedItems = [] if _addonConfigManager.toggleAutoCommentReadingOption(False): checkedItems.append(self.objectsToRead.index("comment")) if _addonConfigManager.toggleAutoFootnoteReadingOption(False): checkedItems.append(self.objectsToRead.index("footnote")) if _addonConfigManager.toggleAutoEndnoteReadingOption(False): checkedItems.append(self.objectsToRead.index("endnote")) self.objectsToReadCheckListBox.CheckedItems = checkedItems self.objectsToReadCheckListBox.Select(0) """ # Translators: This is the label for a checkbox in the settings panel. labelText = _("&Comments") self.autoCommentReadingCheckBox = group.addItem( wx.CheckBox(self, wx.ID_ANY, label=labelText)) self.autoCommentReadingCheckBox.SetValue( _addonConfigManager.toggleAutoCommentReadingOption(False)) # Translators: This is the label for a checkbox in the settings panel. labelText = _("&Footnotes") self.automaticNoteReadingCheckBox = group.addItem( wx.CheckBox(self, wx.ID_ANY, label=labelText)) self.automaticNoteReadingCheckBox.SetValue( _addonConfigManager.toggleAutoFootnoteReadingOption(False)) """ # Translators: This is the label for a checkbox in the settings panel. labelText = _("Read &with:") # Translators: choice labelsfor automatic reading. choice = [ _("nothing"), _("a beep at start and end"), _("another voice") ] self.autoReadingWithChoiceBox = group.addLabeledControl(labelText, wx.Choice, choices=choice) self.autoReadingWithChoiceBox.SetSelection( _addonConfigManager.getAutoReadingWithOption()) # translators: label for a button in Options settings panel. labelText = _("&Display voice's recorded setting") voiceInformationsButton = wx.Button(self, label=labelText) group.addItem(voiceInformationsButton) voiceInformationsButton.Bind(wx.EVT_BUTTON, self.onVoiceInformationButton) from versionInfo import version_year, version_major if [version_year, version_major] < [2019, 3]: # automatic reading is not available for nvda version less than nvda 2019.3 for item in range(0, group.sizer.GetItemCount()): group.sizer.Hide(item) choice = [x for x in range(5, 125, 5)] choice = list(reversed(choice)) # translators: label for a list box in Options settings panel. labelText = _("Maximum time of elements's search (in seconds:)") self.elementsSearchMaxTimeListBox = sHelper.addLabeledControl( labelText, wx.Choice, choices=[str(x) for x in choice]) self.elementsSearchMaxTimeListBox.SetSelection( choice.index(_addonConfigManager.getElementsSearchMaxTime())) # Translators: This is the label for a checkbox in the options settings panel. labelText = _("Na&vigate in loop") self.loopInNavigationModeOptionBox = sHelper.addItem( wx.CheckBox(self, wx.ID_ANY, label=labelText)) self.loopInNavigationModeOptionBox.SetValue( _addonConfigManager.toggleLoopInNavigationModeOption(False))