示例#1
0
    def makeSettings(self, settingsSizer):
        settingsSizerHelper = guiHelper.BoxSizerHelper(self,
                                                       sizer=settingsSizer)
        # Translators: A label for the engines on the engine panel.
        engineLabel = self.title + _("&Engines")
        engineBox = wx.StaticBox(self, label=engineLabel)
        engineGroup = guiHelper.BoxSizerHelper(self,
                                               sizer=wx.StaticBoxSizer(
                                                   engineBox, wx.HORIZONTAL))
        settingsSizerHelper.addItem(engineGroup)

        # Use a ExpandoTextCtrl because even when readonly it accepts focus from keyboard, which
        # standard readonly TextCtrl does not. ExpandoTextCtrl is a TE_MULTILINE control, however
        # by default it renders as a single line. Standard TextCtrl with TE_MULTILINE has two lines,
        # and a vertical scroll bar. This is not necessary for the single line of text we wish to
        # display here.
        engineDesc = self.handler.getCurrentEngine().description
        self.descEngineNameCtrl = ExpandoTextCtrl(self,
                                                  size=(self.scaleSize(250),
                                                        -1),
                                                  value=engineDesc,
                                                  style=wx.TE_READONLY)
        self.descEngineNameCtrl.Bind(wx.EVT_CHAR_HOOK,
                                     self._enterTriggersOnChangeEngine)

        # Translators: This is the label for the button used to change engines,
        # it appears in the context of a engine group on the Online OCR settings panel.
        changeEngineBtn = wx.Button(self, label=_("C&hange..."))
        engineGroup.addItem(
            guiHelper.associateElements(self.descEngineNameCtrl,
                                        changeEngineBtn))
        changeEngineBtn.Bind(wx.EVT_BUTTON, self.onChangeEngine)
        self.engineSettingPanel = SpecificEnginePanel(self, self.handler)
        settingsSizerHelper.addItem(self.engineSettingPanel)
        self.makeGeneralSettings(settingsSizerHelper)
示例#2
0
	def makeSettings(self, settingsSizer):
		sHelper = guiHelper.BoxSizerHelper(self, sizer=settingsSizer)
		languageLabel = _("&Language:")
		self.languageChoices = list(available_languages_dict.values())
		self.language = os.environ['LANGUAGE']
		self.languageList = sHelper.addLabeledControl(languageLabel, wx.Choice, choices=self.languageChoices)
		try:
			index = list(available_languages_dict.keys()).index(self.language)
		except:
			configure.initialize_config()
			index = list(available_languages_dict.keys()).index(self.language)
		self.languageList.Selection = index

		sHelper = guiHelper.BoxSizerHelper(self, sizer=settingsSizer)
		item_interval_timeLabel = _("&Item interval time:")
		self.item_interval_timeChoices = [unicode(i) for i in range(1, 101)]
		self.item_interval_timeList = sHelper.addLabeledControl(item_interval_timeLabel, wx.Choice, choices=self.item_interval_timeChoices)
		try:
			index = self.item_interval_timeChoices.index(os.environ['item_interval_time'])
		except:
			configure.initialize_config()
			index = self.item_interval_timeChoices.index(os.environ['item_interval_time'])
		self.item_interval_timeList.Selection = index

		for k,v in self.CheckBox_settings.items():
			setattr(self, k +"CheckBox", sHelper.addItem(wx.CheckBox(self, label=v)))
			value = convert_bool(os.environ[k])
			getattr(self, k +"CheckBox").SetValue(value)
示例#3
0
	def makeSettings(self, settingsSizer):
		sHelper = guiHelper.BoxSizerHelper(self, sizer=settingsSizer)
		self.language = self.Access8MathConfig["settings"]["language"]
		languageLabel = _("&Language:")
		self.languageChoices = list(available_languages_dict.values())
		self.languageList = sHelper.addLabeledControl(languageLabel, wx.Choice, choices=self.languageChoices)
		try:
			index = list(available_languages_dict.keys()).index(self.language)
		except:
			index = 0
			tones.beep(100, 100)
		self.languageList.Selection = index

		sHelper = guiHelper.BoxSizerHelper(self, sizer=settingsSizer)
		item_interval_timeLabel = _("&Item interval time:")
		self.item_interval_timeChoices = [str(i) for i in range(1, 101)]
		self.item_interval_timeList = sHelper.addLabeledControl(item_interval_timeLabel, wx.Choice, choices=self.item_interval_timeChoices)
		try:
			index = self.item_interval_timeChoices.index(str(self.Access8MathConfig["settings"]["item_interval_time"]))
		except:
			index = 0
			tones.beep(100, 100)
		self.item_interval_timeList.Selection = index

		for k,v in self.CheckBox_settings.items():
			setattr(self, k +"CheckBox", sHelper.addItem(wx.CheckBox(self, label=v)))
			value = self.Access8MathConfig["settings"][k]
			getattr(self, k +"CheckBox").SetValue(value)
示例#4
0
 def __init__(self, parent, globalPluginClass):
     super(wx.Dialog, self).__init__(parent,
                                     title=_("Configure Timezone Ring..."))
     self.gPlugin = globalPluginClass
     sHelper = guiHelper.BoxSizerHelper(self, orientation=wx.VERTICAL)
     self.filterElement = sHelper.addLabeledControl(_("Filter:"),
                                                    wx.TextCtrl)
     # The label and text box will be next to each other.
     # Below this we will find the label and listbox.
     listBoxesHelper = guiHelper.BoxSizerHelper(self,
                                                orientation=wx.HORIZONTAL)
     sHelper.addItem(listBoxesHelper)
     # For translators: Name of time zones list
     self.timezonesList = listBoxesHelper.addLabeledControl(
         _("Timezones (select to add, deselect to remove)"),
         wx.ListBox,
         choices=common_timezones,
         style=wx.LB_MULTIPLE)
     self.timezonesList.Bind(wx.EVT_LISTBOX, self.onTimezoneSelected)
     # For translators: Name of time zones ring list
     self.selectedTimezonesList = listBoxesHelper.addLabeledControl(
         _("Timezone Ring"), wx.ListBox, choices=[])
     self.selectedTimezonesList.AppendItems(self.gPlugin.destTimezones)
     self.setTimezonesListSelections()
     # The label and listbox will be below each other
     self.filterElement.Bind(wx.EVT_TEXT, self.onFilterTextChange)
     buttonsHelper = guiHelper.BoxSizerHelper(self,
                                              orientation=wx.HORIZONTAL)
     sHelper.addItem(buttonsHelper)
     # For translators: Name of the button to remove a time zone
     removeButton = buttonsHelper.addItem(wx.Button(self,
                                                    label=_("Remove")))
     removeButton.Bind(wx.EVT_BUTTON, self.onRemoveClick)
     # For translators: Name of the button to move up a time zone
     moveUpButton = buttonsHelper.addItem(
         wx.Button(self, label=_("Move Up")))
     moveUpButton.Bind(wx.EVT_BUTTON, self.onMoveUp)
     # For translators: Name of the button to move down a time zone
     moveDownButton = buttonsHelper.addItem(
         wx.Button(self, label=_("Move Down")))
     moveDownButton.Bind(wx.EVT_BUTTON, self.onMoveDown)
     # For translators: The label for the checkbox to announce timezones in abbreviated form.
     self.announceAbbriv = sHelper.addItem(
         wx.CheckBox(self, label=_("Announce abbreviated timezones")))
     # Check the box by default if we're announcing abbreviations.
     self.announceAbbriv.SetValue(self.gPlugin.announceAbbriv)
     saveAndCancelHelper = guiHelper.BoxSizerHelper(
         self, orientation=wx.HORIZONTAL)
     sHelper.addItem(saveAndCancelHelper)
     # For translators: Name of the button to save the selections of time zones
     setButton = saveAndCancelHelper.addItem(
         wx.Button(self, label=_("Save")))
     setButton.Bind(wx.EVT_BUTTON, self.onSetTZClick)
     # For translators: Name of the button to exit without saving the selections of time zones
     cancelButton = saveAndCancelHelper.addDialogDismissButtons(
         wx.Button(self, id=wx.ID_CLOSE, label=_("Cancel")))
     cancelButton.Bind(wx.EVT_BUTTON, self.onCancelClick)
     self.SetEscapeId(wx.ID_CLOSE)
示例#5
0
 def _buildGui(self):
     mainSizer = wx.BoxSizer(wx.VERTICAL)
     mainHelper = guiHelper.BoxSizerHelper(self, orientation=wx.VERTICAL)
     timerHelper = guiHelper.BoxSizerHelper(self, orientation=wx.HORIZONTAL)
     feedbackHelper = guiHelper.BoxSizerHelper(self,
                                               orientation=wx.HORIZONTAL)
     self._timerValueCtrl = timerHelper.addLabeledControl("", wx.TextCtrl)
     # Translators: time unit radio group label
     self._timeUnitCTRL = timerHelper.addItem(
         wx.RadioBox(self,
                     label=_("Time unit"),
                     choices=getTimeUnits(),
                     majorDimension=1,
                     style=wx.RA_SPECIFY_ROWS))
     mainHelper.addItem(timerHelper)
     # Translators: type of watch combobox label
     self._operationModeCTRL = mainHelper.addLabeledControl(
         _("Type of watch"),
         wx.Choice,
         id=wx.ID_ANY,
         choices=getOperationModes())
     timerActions = guiHelper.ButtonHelper(wx.HORIZONTAL)
     # Translators: start button
     self._startButton = timerActions.addButton(self, label=_("start"))
     self._pauseButton = timerActions.addButton(self, label=PAUSE)
     # Translators: stop button
     self._stopButton = timerActions.addButton(self, label=_("stop"))
     mainHelper.addItem(timerActions)
     # Translators: report progress with sound checkbox label
     self._reportWithSoundCheckbox = feedbackHelper.addItem(
         wx.CheckBox(self,
                     id=wx.ID_ANY,
                     label=_("Report progress with sound")))
     # Translators: report progress with speech checkbox label
     self._reportWithSpeechCheckbox = feedbackHelper.addItem(
         wx.CheckBox(self,
                     id=wx.ID_ANY,
                     label=_("Report progress with speech")))
     mainHelper.addItem(feedbackHelper)
     dialogActions = guiHelper.ButtonHelper(wx.HORIZONTAL)
     # Translators: close button
     self._closeButton = dialogActions.addButton(self,
                                                 label=_("Close"),
                                                 id=wx.ID_CANCEL)
     mainHelper.addItem(dialogActions)
     self._statusBar = wx.StatusBar(self, id=wx.ID_ANY)
     self._statusBar.SetStatusText(getStatus())
     mainHelper.addItem(self._statusBar, flag=wx.EXPAND)
     self._setInitialValues()
     self._refreshUI()
     mainSizer.Add(mainHelper.sizer, border=10, flag=wx.ALL)
     mainSizer.Fit(self)
     self.SetSizer(mainSizer)
     self.CentreOnScreen()
示例#6
0
	def __init__(self, parent):
		if InsertEmoticonDialog._instance is not None:
			return
		InsertEmoticonDialog._instance = self
		WIDTH = 500
		HEIGHT = 600
		pos = self._calculatePosition(WIDTH, HEIGHT)
		# Translators: Title of the dialog.
		super(InsertEmoticonDialog, self).__init__(parent, title= _("Insert emoticon"), pos = pos, size = (WIDTH, HEIGHT))
		self._filteredEmoticons = emoticons
		self._filter = EmoticonFilter()
		self.sizerLayout = guiHelper.BoxSizerHelper(self, wx.VERTICAL)
		# Filter panel.
		# Translators: A text field to filter emoticons.
		self.txtFilter = self.sizerLayout.addLabeledControl(_("&Filter:"), wx.TextCtrl)
		self.Bind(wx.EVT_TEXT, self.onFilterChange, self.txtFilter)
		# Radio buttons to choose the emoticon set.
		self.sizerRadio = guiHelper.BoxSizerHelper(self, wx.HORIZONTAL)
		# Translators: A radio button to choose all types of emoticons.
		self.rdAll = self.sizerRadio.addItem(wx.RadioButton(self, label= _("&All"), style= wx.RB_GROUP))
		self.Bind(wx.EVT_RADIOBUTTON, self.onAllEmoticons, self.rdAll)
		# Translators: A radio button to choose only standard emoticons.
		self.rdStandard = self.sizerRadio.addItem(wx.RadioButton(self, label= _("&Standard")))
		self.Bind(wx.EVT_RADIOBUTTON, self.onStandardEmoticons, self.rdStandard)
		# Translators: A radio button to choose only emojis.
		self.rdEmojis = self.sizerRadio.addItem(wx.RadioButton(self, label= _("Emoj&is")))
		self.Bind(wx.EVT_RADIOBUTTON, self.onEmojis, self.rdEmojis)
		# List of emoticons.
		# Translators: Label for the smileys list.
		self.smileysList = self.sizerLayout.addLabeledControl(_("&List of smilies"), wx.ListCtrl, size= (490, 400), style= wx.LC_REPORT | wx.BORDER_SUNKEN)
		# Translators: Column which specifies the name  of emoticon.
		self.smileysList.InsertColumn(0, _("Name"), width=350)
		# Translators: Column which specifies the type of emoticon (standard or emoji).
		self.smileysList.InsertColumn(1, _("Type"), width=100)
		# Translators: The column which contains the characters of the emoticon.
		self.smileysList.InsertColumn(2, _("Characters"), width=40)
		self.smileysList.Bind(wx.EVT_KEY_DOWN, self.onEnterOnList)
		self._loadEmoticons()
		# Buttons.
		self.sizerButtons = self.CreateButtonSizer(wx.OK | wx.CANCEL)
		btnOk = self.FindWindowById(self.GetAffirmativeId())
		self.Bind(wx.EVT_BUTTON, self.onOk, btnOk)
		# Vertical layout
		self.sizerLayout.addItem(self.sizerRadio.sizer, flag=wx.ALL)
		self.sizerLayout.addDialogDismissButtons(self.sizerButtons)

		self.mainSizer = wx.BoxSizer(wx.VERTICAL)
		self.mainSizer.Add(self.sizerLayout.sizer, border=10, flag=wx.ALL)
		self.SetSizer(self.mainSizer)
		self.mainSizer.Fit(self)
		self.txtFilter.SetFocus()
示例#7
0
	def makeSettings(self, settingsSizer):
		sHelper = guiHelper.BoxSizerHelper(self, sizer=settingsSizer)
		# Translators: label of a dialog.
		setSeparatorLabel = _("Type the string to be used as a &separator between contents added to the clipboard.")
		setSeparatorLabeledCtrl = gui.guiHelper.LabeledControlHelper(self, setSeparatorLabel, wx.TextCtrl)
		self.setSeparatorEdit = setSeparatorLabeledCtrl.control
		try:
			self.setSeparatorEdit.SetValue(config.conf["clipContentsDesigner"]["separator"])
		except KeyError:
			pass
		# Translators: label of a dialog.
		self.addTextBeforeCheckBox = sHelper.addItem(wx.CheckBox(self, label= _("&Add text before clip data")))
		self.addTextBeforeCheckBox.SetValue(config.conf["clipContentsDesigner"]["addTextBefore"])
		# Translators: label of a dialog.
		self.confirmAddCheckBox = sHelper.addItem(wx.CheckBox(self, label= _("Confirm to a&dd text")))
		self.confirmAddCheckBox.SetValue(config.conf["clipContentsDesigner"]["confirmToAdd"])
		# Translators: label of a dialog.
		self.confirmClearCheckBox = sHelper.addItem(wx.CheckBox(self, label= _("Confirm to c&lear clipboard")))
		self.confirmClearCheckBox.SetValue(config.conf["clipContentsDesigner"]["confirmToClear"])
		# Translators: label of a dialog.
		self.confirmCopyCheckBox = sHelper.addItem(wx.CheckBox(self, label= _("&Confirm to emulate copy")))
		self.confirmCopyCheckBox.SetValue(config.conf["clipContentsDesigner"]["confirmToCopy"])
		# Translators: label of a dialog.
		self.confirmCutCheckBox = sHelper.addItem(wx.CheckBox(self, label= _("&Confirm to emulate cut")))
		self.confirmCutCheckBox.SetValue(config.conf["clipContentsDesigner"]["confirmToCut"])
		# Translators: label of a dialog.
		self.requireTextCheckBox = sHelper.addItem(wx.CheckBox(self, label= _("&Text in clipboard to confirm")))
		self.requireTextCheckBox.SetValue(config.conf["clipContentsDesigner"]["requireTextForConfirmation"])
示例#8
0
    def makeSettings(self, sizer):
        settingsSizerHelper = guiHelper.BoxSizerHelper(self, sizer=sizer)

        # Translators: Type of windows to display translation result.
        windowTypes = [
            _("Default full browser"),
            _("Browser window only"),
            _("NVDA browseable message box(choose it after testing)")
        ]
        self.resultWindowComboBox = settingsSizerHelper.addLabeledControl(
            # Translators: label of cumbo box to choose type of window to display result.
            _("Choose type of window To Display Result:"),
            wx.Choice,
            choices=windowTypes)
        self.resultWindowComboBox.SetSelection(
            config.conf["dictionariesAlmaany"]["windowType"])

        # Translators: label of the check box
        self.closeDialogCheckBox = wx.CheckBox(
            self,
            label=_(
                "&Close Dictionaries Almaany Dialog after requiring translation"
            ))
        self.closeDialogCheckBox.SetValue(
            config.conf["dictionariesAlmaany"]
            ["closeDialogAfterRequiringTranslation"])
        settingsSizerHelper.addItem(self.closeDialogCheckBox)
示例#9
0
    def makeSettings(self, settingsSizer):
        settingsSizerHelper = guiHelper.BoxSizerHelper(self,
                                                       sizer=settingsSizer)
        # Translators: The label of the checkbox to enable or disable the spacebar announcements.
        self.reportSpaceCheckBox = wx.CheckBox(
            parent=self, label=_("Enable announcements of the space key"))
        self.reportSpaceCheckBox.SetValue(config.conf['mp3DCReport']['space'])
        if globalVars.appArgs.secure:
            self.reportSpaceCheckBox.Disable()
        settingsSizerHelper.addItem(self.reportSpaceCheckBox)

        # Translators: The label of the checkbox to enable or disable the announcements of the selection markers.
        self.reportMarkerCheckBox = wx.CheckBox(
            parent=self,
            label=_("Announce the placement of the selection markers"))
        self.reportMarkerCheckBox.SetValue(
            config.conf['mp3DCReport']['marker'])
        if globalVars.appArgs.secure:
            self.reportMarkerCheckBox.Disable()
        settingsSizerHelper.addItem(self.reportMarkerCheckBox)

        # Translators: The label of the checkbox to enable or disable the other announcements.
        self.reportOtherCheckBox = wx.CheckBox(
            parent=self, label=_("Enable the other announces"))
        self.reportOtherCheckBox.SetValue(config.conf['mp3DCReport']['other'])
        if globalVars.appArgs.secure:
            self.reportOtherCheckBox.Disable()
        settingsSizerHelper.addItem(self.reportOtherCheckBox)
示例#10
0
 def doGui(self):
     mainSizer = wx.BoxSizer(wx.VERTICAL)
     sHelper = guiHelper.BoxSizerHelper(self, orientation=wx.VERTICAL)
     # the text control
     sHelper.addItem(wx.StaticText(self, label=self.waitMessage))
     # the buttons
     bHelper = sHelper.addDialogDismissButtons(
         guiHelper.ButtonHelper(wx.HORIZONTAL))
     interruptButton = bHelper.addButton(
         self,
         id=wx.ID_ANY,
         # Translators: label of interrupt to clipboard button.
         label=_("&interrupt"))
     cancelButton = bHelper.addButton(self,
                                      id=wx.ID_CANCEL,
                                      label=_("&Cancel"))
     mainSizer.Add(sHelper.sizer,
                   border=guiHelper.BORDER_FOR_DIALOGS,
                   flag=wx.ALL)
     mainSizer.Fit(self)
     self.SetSizer(mainSizer)
     cancelButton.SetFocus()
     # the events
     cancelButton.Bind(wx.EVT_BUTTON, self.onCancelButton)
     interruptButton.Bind(wx.EVT_BUTTON, self.onInterruptButton)
     self.Bind(wx.EVT_CLOSE, self.onClose)
     self.SetEscapeId(wx.ID_CANCEL)
     self.Bind(wx.EVT_ACTIVATE, self.onActivate)
示例#11
0
 def makeSettings(self, settingsSizer):
     sHelper = guiHelper.BoxSizerHelper(self, sizer=settingsSizer)
     # Translators: label of a dialog.
     self.reportPasswordsCheckBox = sHelper.addItem(
         wx.CheckBox(self, label=_("&Report passwords")))
     self.reportPasswordsCheckBox.SetValue(
         config.conf["reportPasswords"]["unprotectControls"])
 def __init__(self, parent, cursorManager, text, caseSensitivity):
     # Translators: Title of a dialog to find text.
     super(FindDialog, self).__init__(parent, wx.ID_ANY, _("Find"))
     # Have a copy of the active cursor manager, as this is needed later for finding text.
     self.activeCursorManager = cursorManager
     mainSizer = wx.BoxSizer(wx.VERTICAL)
     sHelper = guiHelper.BoxSizerHelper(self, orientation=wx.VERTICAL)
     # Translators: Dialog text for NvDA's find command.
     findLabelText = _("Type the text you wish to find")
     self.findTextField = sHelper.addLabeledControl(findLabelText,
                                                    wx.TextCtrl,
                                                    value=text)
     # Translators: An option in find dialog to perform case-sensitive search.
     self.caseSensitiveCheckBox = wx.CheckBox(self,
                                              wx.ID_ANY,
                                              label=_("Case &sensitive"))
     self.caseSensitiveCheckBox.SetValue(caseSensitivity)
     sHelper.addItem(self.caseSensitiveCheckBox)
     sHelper.addDialogDismissButtons(
         self.CreateButtonSizer(wx.OK | wx.CANCEL))
     mainSizer.Add(sHelper.sizer,
                   border=guiHelper.BORDER_FOR_DIALOGS,
                   flag=wx.ALL)
     self.Bind(wx.EVT_BUTTON, self.onOk, id=wx.ID_OK)
     self.Bind(wx.EVT_BUTTON, self.onCancel, id=wx.ID_CANCEL)
     mainSizer.Fit(self)
     self.SetSizer(mainSizer)
     self.CentreOnScreen()
     self.findTextField.SetFocus()
示例#13
0
    def makeSettings(self, settingsSizer):
        self.filteredSymbols = self.symbols = [
            copy.copy(symbol)
            for symbol in self.symbolProcessor.computedSymbols.values()
        ]
        sHelper = guiHelper.BoxSizerHelper(self, sizer=settingsSizer)
        # Translators: The label of a text field to search for symbols in the Insert Symbol dialog.
        filterText = _("&Filter:")
        self.filterEdit = sHelper.addLabeledControl(
            labelText=filterText,
            wxCtrlClass=wx.TextCtrl,
            size=(self.scaleSize(310), -1),
        )

        # Translators: The label for symbols list in Insert Symbol dialog.
        symbolsText = translate("&Symbols")
        self.symbolsList = sHelper.addLabeledControl(
            symbolsText,
            nvdaControls.AutoWidthColumnListCtrl,
            autoSizeColumn=
            2,  # The replacement column is likely to need the most space
            itemTextCallable=self.getItemTextForList,
            style=wx.LC_REPORT | wx.LC_SINGLE_SEL | wx.LC_VIRTUAL)

        # Translators: The label for a column in symbols list used to identify a symbol.
        self.symbolsList.InsertColumn(0,
                                      translate("Symbol"),
                                      width=self.scaleSize(150))
        # Translators: The label for a column in symbols list used to identify a replacement.
        self.symbolsList.InsertColumn(1, translate("Replacement"))

        self.filterEdit.Bind(wx.EVT_TEXT, self.onFilterEditTextChange)
        self.filter()
示例#14
0
	def doGui(self):
		mainSizer = wx.BoxSizer(wx.VERTICAL)
		sHelper = guiHelper.BoxSizerHelper(self, orientation=wx.VERTICAL)
		# the list box
		# Translators: This is the label of the list  appearing on List of Words dialog.
		wordsListDialog = _("Words and its occurrences")
		self.wordsListBox = sHelper.addLabeledControl(wordsListDialog, wx.ListBox, id = wx.ID_ANY, choices=self.wdsList, style = wx.LB_SINGLE, size = (700,580))
		if self.wordsListBox.GetCount():
			self.wordsListBox.SetSelection(0)

		# Buttons
		if len(wordList)is not 0:
			bHelper= guiHelper.ButtonHelper(wx.HORIZONTAL)
			# Translators: This is a label of a button appearing on List of Words dialog.
			showButton =  bHelper.addButton(self, id = wx.ID_ANY, label=_("&Show occurrences"))
			showButton.SetDefault()
			sHelper.addItem(bHelper)
		bHelper = sHelper.addDialogDismissButtons(guiHelper.ButtonHelper(wx.HORIZONTAL))
		closeButton = bHelper.addButton(self, id = wx.ID_CLOSE, label = _("&Close"))
		if len(wordList)is 0:
			closeButton.SetDefault()
			mainSizer.Add(sHelper.sizer, border=guiHelper.BORDER_FOR_DIALOGS, flag=wx.ALL)
			mainSizer.Fit(self)
			self.SetSizer(mainSizer)
			# Events
			closeButton.Bind(wx.EVT_BUTTON, lambda evt: self.Destroy())
			self.SetEscapeId(wx.ID_CLOSE)
		else:
			mainSizer.Add(sHelper.sizer, border=guiHelper.BORDER_FOR_DIALOGS, flag=wx.ALL)
			mainSizer.Fit(self)
			self.SetSizer(mainSizer)
			# Events
			showButton.Bind(wx.EVT_BUTTON, self.onOkButton)
			closeButton.Bind(wx.EVT_BUTTON, lambda evt: self.Destroy())
			self.SetEscapeId(wx.ID_CLOSE)
示例#15
0
    def makeSettings(self, settingsSizer):
        sHelper = guiHelper.BoxSizerHelper(self, sizer=settingsSizer)

        global min
        minLabel = _("&Minute:")
        self.minChoices = [unicode(i) for i in range(60)]
        self.minList = sHelper.addLabeledControl(minLabel,
                                                 wx.Choice,
                                                 choices=self.minChoices)
        try:
            index = self.minChoices.index(min)
        except:
            index = 59
        self.minList.Selection = index

        global sec
        secLabel = _("&Second:")
        self.secChoices = [unicode(i) for i in range(60)]
        self.secList = sHelper.addLabeledControl(secLabel,
                                                 wx.Choice,
                                                 choices=self.secChoices)
        try:
            index = self.secChoices.index(sec)
        except:
            index = 59
        self.secList.Selection = index
示例#16
0
    def __init__(self, parent, addonUpdateInfo, auto=True):
        # Translators: The title of the add-on updates dialog.
        super(AddonUpdatesDialog,
              self).__init__(parent, title=_("NVDA Add-on Updates"))
        mainSizer = wx.BoxSizer(wx.VERTICAL)
        addonsSizerHelper = guiHelper.BoxSizerHelper(self,
                                                     orientation=wx.VERTICAL)
        self.addonUpdateInfo = addonUpdateInfo
        self.auto = auto

        if addonUpdateInfo:
            entriesSizer = wx.BoxSizer(wx.VERTICAL)
            self.addonsList = AutoWidthColumnCheckListCtrl(self,
                                                           -1,
                                                           style=wx.LC_REPORT
                                                           | wx.LC_SINGLE_SEL,
                                                           size=(550, 350))
            self.addonsList.Bind(wx.EVT_CHECKLISTBOX, self.onAddonsChecked)
            self.addonsList.InsertColumn(0, translate("Package"), width=150)
            # Translators: The label for a column in add-ons list used to identify add-on's running status (example: status is running).
            self.addonsList.InsertColumn(1, _("Current version"), width=50)
            # Translators: The label for a column in add-ons list used to identify add-on's version (example: version is 0.3).
            self.addonsList.InsertColumn(2, _("New version"), width=50)
            entriesSizer.Add(self.addonsList, proportion=8)
            for entry in sorted(addonUpdateInfo.keys()):
                addon = addonUpdateInfo[entry]
                self.addonsList.Append(
                    (addon['summary'], addon['curVersion'], addon['version']))
                self.addonsList.CheckItem(self.addonsList.GetItemCount() - 1)
            self.addonsList.Select(0)
            self.addonsList.SetItemState(0, wx.LIST_STATE_FOCUSED,
                                         wx.LIST_STATE_FOCUSED)
            addonsSizerHelper.addItem(entriesSizer)
        else:
            # Translators: Message displayed when no add-on updates are available.
            addonsSizerHelper.addItem(
                wx.StaticText(self, label=_("No add-on update available.")))

        bHelper = addonsSizerHelper.addDialogDismissButtons(
            guiHelper.ButtonHelper(wx.HORIZONTAL))
        if addonUpdateInfo:
            # Translators: The label of a button to update add-ons.
            label = _("&Update add-ons")
            self.updateButton = bHelper.addButton(self, label=label)
            self.updateButton.Bind(wx.EVT_BUTTON, self.onUpdate)

        closeButton = bHelper.addButton(self,
                                        wx.ID_CLOSE,
                                        label=translate("&Close"))
        closeButton.Bind(wx.EVT_BUTTON, self.onClose)
        self.Bind(wx.EVT_CLOSE, lambda evt: self.onClose)
        self.EscapeId = wx.ID_CLOSE

        mainSizer.Add(addonsSizerHelper.sizer,
                      border=guiHelper.BORDER_FOR_DIALOGS,
                      flag=wx.ALL)
        self.Sizer = mainSizer
        mainSizer.Fit(self)
        self.Center(wx.BOTH | wx.CENTER_ON_SCREEN)
        wx.CallAfter(self.Show)
示例#17
0
	def makeSettings(self, sizer):
		helper = guiHelper.BoxSizerHelper(self, sizer=sizer)
		# TRANSLATORS: label for available update channels in a combo box
		self.channels = helper.addLabeledControl(_("Update channel"), wx.Choice, choices=channelDescriptions)
		try:
			# Use normal profile only if possible
			self.channels.Selection = int(config.conf.profiles[0]['updateChannel']['channel'])
		except:
			# When using for the first time, read from general configuration
			self.channels.Selection = config.conf['updateChannel']['channel']
		# If updateCheck was not imported correctly next part is skipped.
		if updateCheck:
			# Add an edit box where information about the selected channel (such as the version to be downloaded) is displayed.
			self.channels.Bind(wx.EVT_CHOICE, self.onChoice)
			self.channelInfo = helper.addItem(wx.TextCtrl(self, style=wx.TE_RICH|wx.TE_NO_VSCROLL|wx.TE_WORDWRAP|wx.TE_MULTILINE|wx.TE_READONLY, value = "", size=(300,20)))
			self.channelInfo.Bind(wx.EVT_TEXT, self.onText)
			self.channelInfo.Disable()
			# Also, create hyperlinks to download and view changelog.
			self.download = helper.addItem(wx.adv.HyperlinkCtrl(self, style=wx.adv.HL_CONTEXTMENU))
			self.download.Hide()
			# TRANSLATORS: label of the View changelog hyperlink in the add-on settings panel
			self.changelog = helper.addItem(wx.adv.HyperlinkCtrl(self, style=wx.adv.HL_CONTEXTMENU, label=_("View changelog")))
			self.changelog.Hide()
			self.availableUpdates = {}
			self.status = 0
			self.event = Event()
			# It is done in a separate thread so as not to slow down the execution.
			self.thGetAvailableUpdates = Thread(target=self.getAvailableUpdates, args=(versionInfo.updateVersionType,))
			self.thGetAvailableUpdates.setDaemon(True)
			self.thGetAvailableUpdates.start()
			self.onChoice(None)
示例#18
0
 def makeSettings(self, settingsSizer):
     sHelper = guiHelper.BoxSizerHelper(self, sizer=settingsSizer)
     # Translators: label of a dialog.
     outputModesLabel = _("Sele&ct output modes for automatic messages")
     outputModesChoices = [
         # Translators: label of a dialog.
         _("Speech"),
         # Translators: label of a dialog.
         _("Braille"),
     ]
     self.outputModesList = sHelper.addLabeledControl(
         outputModesLabel,
         gui.nvdaControls.CustomCheckListBox,
         choices=outputModesChoices)
     checkedItems = []
     if config.conf["controlUsageAssistant"]["speech"]:
         checkedItems.append(0)
     if config.conf["controlUsageAssistant"]["braille"]:
         checkedItems.append(1)
     self.outputModesList.CheckedItems = checkedItems
     self.outputModesList.Select(0)
     # Translators: label of a dialog.
     pitchLabel = _("&Pitch change for automatic messages")
     self.pitchEdit = sHelper.addLabeledControl(
         pitchLabel,
         gui.nvdaControls.SelectOnFocusSpinCtrl,
         min=-30,
         max=30,
         initial=config.conf["controlUsageAssistant"]["pitch"])
示例#19
0
	def __init__(self, parent, cursorManager, text, isCaseSensitive, reverse=False):
			# Translators: the title of the find dialog
		super().__init__(parent=parent, title=_("Find"))
		self.currentCursorManager = cursorManager
		self.reverse = reverse

		dialogSizer = wx.BoxSizer(wx.VERTICAL)
		helperSizer = guiHelper.BoxSizerHelper(self, orientation=wx.VERTICAL)
		# Translators: a label for the edit text box where you type your search query
		editTextLabel = _("Type the text you wish to find")
		self.findTextField = helperSizer.addLabeledControl(editTextLabel, wx.TextCtrl, value=text)
		self.caseSensitiveCheckBox = wx.CheckBox(self, wx.ID_ANY, label=_("Case &sensitive"))
		self.caseSensitiveCheckBox.SetValue(isCaseSensitive)
		# Translators: An option in the find dialog to allow wrapping on search.
		self.wrapAroundCheckBox = wx.CheckBox(self, wx.ID_ANY, label=_("&Wrap around"))
		self.wrapAroundCheckBox.SetValue(self.currentCursorManager._wrapFind)
		helperSizer.addItem(self.caseSensitiveCheckBox)
		helperSizer.addItem(self.wrapAroundCheckBox)
		helperSizer.addDialogDismissButtons(self.CreateButtonSizer(wx.OK|wx.CANCEL))
		dialogSizer.Add(helperSizer.sizer, border=guiHelper.BORDER_FOR_DIALOGS, flag=wx.ALL)
		dialogSizer.Fit(self)

		self.SetSizer(dialogSizer)
		self.CentreOnScreen()
		self.SetFocus()
		self.findTextField.SetFocus()

		self.Bind(wx.EVT_BUTTON, self.onOk, id=wx.ID_OK)
		self.Bind(wx.EVT_BUTTON, self.onCancel, id=wx.ID_CANCEL)
示例#20
0
 def makeSettings(self, settingsSizer):
     sHelper = guiHelper.BoxSizerHelper(self, sizer=settingsSizer)
     for k, v in self.CheckBox_settings.items():
         setattr(self, k + "CheckBox",
                 sHelper.addItem(wx.CheckBox(self, label=v)))
         value = self.Access8MathConfig["rules"][k]
         getattr(self, k + "CheckBox").SetValue(value)
示例#21
0
    def makeSettings(self, settingsSizer):
        sHelper = guiHelper.BoxSizerHelper(self, sizer=settingsSizer)
        presentationChoices = [f[1] for f in LOCAL_CONSTANTS_DESCRIPTIONS]
        self.languagePresentationChoice = sHelper.addLabeledControl(
            _("Input language &presentation:"),
            wx.Choice,
            choices=presentationChoices)
        curPresentation = config.conf["LangReporter"]["languagePresentation"]
        try:
            index = [f[0] for f in LOCAL_CONSTANTS_DESCRIPTIONS
                     ].index(curPresentation)
            self.languagePresentationChoice.SetSelection(index)
        except Exception:
            log.error(f"invalid language presentation: {curPresentation}")

        self.reportLayoutCheckBox = sHelper.addItem(
            wx.CheckBox(self,
                        label=_("Report &layout when language switching")))
        self.reportLayoutCheckBox.SetValue(
            config.conf["LangReporter"]["reportLayout"])

        self.reportLanguageSwitchingBarCheckBox = sHelper.addItem(
            wx.CheckBox(self, label=_("Report language &switching bar")))
        self.reportLanguageSwitchingBarCheckBox.SetValue(
            config.conf["LangReporter"]["reportLanguageSwitchingBar"])
示例#22
0
 def makeSettings(self, settingsSizer):
     settingsSizer = guiHelper.BoxSizerHelper(self, sizer=settingsSizer)
     self.sayAllCheckBox = settingsSizer.addItem(
         wx.CheckBox(self, label="&Disable in say all"))
     self.sayAllCheckBox.SetValue(config.conf["unspoken"]["sayAll"])
     self.speakRolesCheckBox = settingsSizer.addItem(
         wx.CheckBox(self, label="&Speak object roles"))
     self.speakRolesCheckBox.SetValue(config.conf["unspoken"]["speakRoles"])
     self.HRTFCheckBox = settingsSizer.addItem(
         wx.CheckBox(self, label="Enable &HRTF"))
     self.HRTFCheckBox.SetValue(config.conf["unspoken"]["HRTF"])
     self.ReverbCheckBox = settingsSizer.addItem(
         wx.CheckBox(self, label="Enable &Reverb (Requires NVDA Restart)"))
     self.ReverbCheckBox.SetValue(config.conf["unspoken"]["Reverb"])
     self.ReverbLevelSliderLabel = settingsSizer.addItem(
         wx.StaticText(self, label="Reverb Level"))
     self.ReverbLevelSlider = settingsSizer.addItem(wx.Slider(self))
     self.ReverbLevelSlider.SetValue(
         config.conf["unspoken"]["ReverbLevel"] * 100)
     self.ReverbTimeSliderLabel = settingsSizer.addItem(
         wx.StaticText(self, label="Reverb Time"))
     self.ReverbTimeSlider = settingsSizer.addItem(wx.Slider(self))
     self.ReverbTimeSlider.SetValue(config.conf["unspoken"]["ReverbTime"] *
                                    100)
     self.noSoundsCheckBox = settingsSizer.addItem(
         wx.CheckBox(self, label="Don't &play sounds for roles"))
     self.noSoundsCheckBox.SetValue(config.conf["unspoken"]["noSounds"])
     self.volumeCheckBox = settingsSizer.addItem(
         wx.CheckBox(
             self, label="Automatically adjust sounds with speech &volume"))
     self.volumeCheckBox.SetValue(config.conf["unspoken"]["volumeAdjust"])
示例#23
0
 def makeSettings(self, settingsSizer):
     sHelper = guiHelper.BoxSizerHelper(self, sizer=settingsSizer)
     # Translators: This is the static text of the Quick Profile Wizard dialog.
     msgIntro = _(
         "Choose which options you want to reset to the default value for the Lambdas profile"
     )
     self.introStxt = sHelper.addItem(wx.StaticText(self, label=msgIntro))
     # Translators: This is the label for a checkbox in the
     # Quick Profile Wizard dialog.
     self.defaultTranslationTableCheckBox = sHelper.addItem(
         wx.CheckBox(
             self,
             label=
             _("Keep the LAMBDA braille table for the current language (%s)"
               ) % TABLE_NAME))
     self.defaultTranslationTableCheckBox.SetValue(True)
     # Translators: This is the label for a checkbox in the
     # Quick Profile Wizard dialog.
     self.brailleTetherToFocusCheckBox = sHelper.addItem(
         wx.CheckBox(self,
                     label=_("Set the braille cursor to tether the focus")))
     self.brailleTetherToFocusCheckBox.SetValue(True)
     # Translators: This is the label for a checkbox in the
     # Quick Profile Wizard dialog.
     self.disableReadByParagraphCheckBox = sHelper.addItem(
         wx.CheckBox(self,
                     label=_("Disable the Braille reading by paragraph")))
     self.disableReadByParagraphCheckBox.SetValue(True)
     # Translators: This is the label for a checkbox in the
     # Quick Profile Wizard dialog.
     self.disableBrailleWordWrapCheckBox = sHelper.addItem(
         wx.CheckBox(self,
                     label=_("Disable word wrappping of the braille line")))
     self.disableBrailleWordWrapCheckBox.SetValue(True)
示例#24
0
def createSettings(obj, sizer):
	helper=guiHelper.BoxSizerHelper(obj, sizer=sizer)
	#TRANSLATORS: report banners checkbox
	obj.bannerenabled=helper.addItem(wx.CheckBox(obj, wx.ID_ANY, label=_("Report banners")))
	obj.bannerenabled.SetValue(config.conf['aria']['reportBanner'])
	#TRANSLATORS: report main content checkbox
	obj.mainenabled=helper.addItem(wx.CheckBox(obj, wx.ID_ANY, label=_("Report main content")))
	obj.mainenabled.SetValue(config.conf['aria']['reportMain'])
	#TRANSLATORS: report search forms checkbox
	obj.searchenabled=helper.addItem(wx.CheckBox(obj, wx.ID_ANY, label=_("Report search forms")))
	obj.searchenabled.SetValue(config.conf['aria']['reportSearch'])
	#TRANSLATORS: report forms with form role checkbox
	obj.formenabled=helper.addItem(wx.CheckBox(obj, wx.ID_ANY, label=_("Report forms with form role")))
	obj.formenabled.SetValue(config.conf['aria']['reportForm'])
	#TRANSLATORS: report navigation areas checkbox
	obj.navigationenabled=helper.addItem(wx.CheckBox(obj, wx.ID_ANY, label=_("Report navigation areas")))
	obj.navigationenabled.SetValue(config.conf['aria']['reportNavigation'])
	#TRANSLATORS: report complementary content checkbox
	obj.complementaryenabled=helper.addItem(wx.CheckBox(obj, wx.ID_ANY, label=_("Report complementary content")))
	obj.complementaryenabled.SetValue(config.conf['aria']['reportComplementary'])
	#TRANSLATORS: report content info checkbox
	obj.contentinfoenabled=helper.addItem(wx.CheckBox(obj, wx.ID_ANY, label=_("Report content info areas")))
	obj.contentinfoenabled.SetValue(config.conf['aria']['reportContentinfo'])
	#TRANSLATORS: report articles checkbox
	obj.articleenabled=helper.addItem(wx.CheckBox(obj, wx.ID_ANY, label=_("Report articles")))
	obj.articleenabled.SetValue(config.conf['aria']['reportArticle'])
	#TRANSLATORS: report other labelled regions checkbox
	obj.regionenabled=helper.addItem(wx.CheckBox(obj, wx.ID_ANY, label=_("Report other labelled regions")))
	obj.regionenabled.SetValue(config.conf['aria']['reportRegion'])
示例#25
0
	def __init__(self, parent: wx.Window) -> None:
		"""Layout of dialog box elements to show.
		@param parent: parent top level window
		@type parent: wx.Window
		"""
		# Translators: The title of the dialog which appears when the user enables or disables the default gestures
		super(AddonsReloadDialog, self).__init__(parent, title=_("Gestures Configuration Change"))
		mainSizer = wx.BoxSizer(wx.VERTICAL)
		sHelper = guiHelper.BoxSizerHelper(self, orientation=wx.VERTICAL)
		# Translators: The message displayed when addon gestures has been changed.
		sHelper.addItem(wx.StaticText(self, label=_("NVDA add-ons must be reloaded for the new gestures to take effect.")))
		if not config.conf[addonName]['gestures']:
			# Translators: The warning is displayed before switching on default addon gestures
			sHelper.addItem(wx.StaticText(self, label=_("Warning! Using the feature to set the maximum volume level may damage your hearing.")))

		bHelper = sHelper.addDialogDismissButtons(guiHelper.ButtonHelper(wx.HORIZONTAL))
		# Translators: The label for a button  in the dialog which appears when the user changed addon's default gestures
		reloadNowButton = bHelper.addButton(self, label=_("Reload &now"))
		reloadNowButton.Bind(wx.EVT_BUTTON, self.onReloadNowButton)
		reloadNowButton.SetFocus()

		# Translators: The label for a button  in the dialog which appears when the user changed addon's default gestures
		reloadLaterButton = bHelper.addButton(self, wx.ID_CLOSE, label=_("Reload &later"))
		reloadLaterButton.Bind(wx.EVT_BUTTON, lambda evt: self.Close())
		self.Bind(wx.EVT_CLOSE, lambda evt: self.Destroy())
		self.EscapeId = wx.ID_CLOSE

		mainSizer.Add(sHelper.sizer, border=guiHelper.BORDER_FOR_DIALOGS, flag=wx.ALL)
		self.Sizer = mainSizer
		mainSizer.Fit(self)
		self.CentreOnScreen()
    def __init__(self, parent):

        CHANGES = self.changesLog()

        # Translators: The title of the check  updates dialog.
        super(checkUpdatesDialog,
              self).__init__(parent, title=_("New Version Notification"))
        mainSizer = wx.BoxSizer(wx.VERTICAL)
        sizerHelper = guiHelper.BoxSizerHelper(self, orientation=wx.VERTICAL)
        # Translators: Message displayed when updates are available.
        sizerHelper.addItem(wx.StaticText(self, label=CHANGES))
        bHelper = sizerHelper.addDialogDismissButtons(
            guiHelper.ButtonHelper(wx.HORIZONTAL))
        # Translators: The label of a button.
        label = _("Proceed to &download page")
        self.upgradeButton = bHelper.addButton(self, label=label)
        self.upgradeButton.Bind(wx.EVT_BUTTON, self.onUpgrade)

        closeButton = bHelper.addButton(self,
                                        wx.ID_CLOSE,
                                        label=translate("&Close"))
        closeButton.Bind(wx.EVT_BUTTON, self.onClose)
        self.Bind(wx.EVT_CLOSE, lambda evt: self.onClose)
        self.EscapeId = wx.ID_CLOSE

        mainSizer.Add(sizerHelper.sizer,
                      border=guiHelper.BORDER_FOR_DIALOGS,
                      flag=wx.ALL)
        self.Sizer = mainSizer
        mainSizer.Fit(self)
        self.CentreOnScreen()
        wx.CallAfter(self.Show)
示例#27
0
	def __init__(self, parent, destPath, version):
		self.destPath=destPath
		self.version = version
		storeUpdatesDirWritable=os.path.isdir(storeUpdatesDir) and os.access(storeUpdatesDir, os.W_OK)
		# Translators: The title of the dialog asking the user to Install an NVDA update.
		super(UpdateAskInstallDialog, self).__init__(parent, title=_("NVDA Update"))
		mainSizer = wx.BoxSizer(wx.VERTICAL)
		sHelper = guiHelper.BoxSizerHelper(self, orientation=wx.VERTICAL)
		
		# Translators: A message indicating that an updated version of NVDA is ready to be installed.
		sHelper.addItem(wx.StaticText(self, label=_("NVDA version {version} is ready to be installed.\n").format(version=version)))

		bHelper = sHelper.addDialogDismissButtons(guiHelper.ButtonHelper(wx.HORIZONTAL))
		# Translators: The label of a button to install an NVDA update.
		installButton = bHelper.addButton(self, wx.ID_OK, label=_("&Install update"))
		installButton.Bind(wx.EVT_BUTTON, self.onInstallButton)
		installButton.SetFocus()
		if storeUpdatesDirWritable:
			# Translators: The label of a button to postpone an NVDA update.
			postponeButton = bHelper.addButton(self, wx.ID_CLOSE, label=_("&Postpone update"))
			postponeButton.Bind(wx.EVT_BUTTON, self.onPostponeButton)

			self.EscapeId = wx.ID_CLOSE
		else:
			self.EscapeId = wx.ID_OK

		mainSizer.Add(sHelper.sizer, border=guiHelper.BORDER_FOR_DIALOGS, flag=wx.ALL)
		self.Sizer = mainSizer
		mainSizer.Fit(self)
		self.CentreOnScreen()
示例#28
0
 def doGui(self):
     mainSizer = wx.BoxSizer(wx.VERTICAL)
     sHelper = guiHelper.BoxSizerHelper(self, orientation=wx.VERTICAL)
     # the text control
     tcLabel = sHelper.addItem(
         wx.StaticText(self, label=self.informationLabel))
     self.tc = sHelper.addItem(
         wx.TextCtrl(self,
                     id=wx.ID_ANY,
                     style=wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_RICH,
                     size=(1000, 600)))
     self.tc.AppendText(self.information)
     self.tc.SetInsertionPoint(0)
     # the buttons
     bHelper = sHelper.addDialogDismissButtons(
         guiHelper.ButtonHelper(wx.HORIZONTAL))
     # Translators: label of copy to clipboard button
     copyToClipboardButton = bHelper.addButton(
         self, id=wx.ID_ANY, label=_("Co&py to Clipboard"))
     closeButton = bHelper.addButton(self,
                                     id=wx.ID_CLOSE,
                                     label=NVDAString("&Close"))
     mainSizer.Add(sHelper.sizer,
                   border=guiHelper.BORDER_FOR_DIALOGS,
                   flag=wx.ALL)
     mainSizer.Fit(self)
     self.SetSizer(mainSizer)
     # events
     copyToClipboardButton.Bind(wx.EVT_BUTTON, self.onCopyToClipboardButton)
     closeButton.Bind(wx.EVT_BUTTON, lambda evt: self.Destroy())
     self.tc.SetFocus()
     self.SetEscapeId(wx.ID_CLOSE)
    def doGui(self):
        mainSizer = wx.BoxSizer(wx.VERTICAL)
        sHelper = guiHelper.BoxSizerHelper(self, orientation=wx.VERTICAL)
        # Translators: This is a label for a edit box in Minute Timer Dialog
        # to show remaining duration.
        remainingDurationLabel = _("Remaining duration:")
        self.remainingDurationEdit = sHelper.addLabeledControl(
            remainingDurationLabel, wx.TextCtrl)
        self.remainingDurationEdit.Value = str(
            _curMinuteTimer.getRemainingTime())
        # the buttons
        bHelper = sHelper.addDialogDismissButtons(
            guiHelper.ButtonHelper(wx.HORIZONTAL))
        # Translators: The label for a button
        # in Minute Timer dialog to stop minute timer.
        stopButton = bHelper.addButton(self, label=_("&Stop"))
        closeButton = bHelper.addButton(self,
                                        id=wx.ID_CLOSE,
                                        label=NVDAString("&Close"))
        closeButton.SetDefault()
        mainSizer.Add(sHelper.sizer,
                      border=gui.guiHelper.BORDER_FOR_DIALOGS,
                      flag=wx.ALL)
        mainSizer.Fit(self)
        self.SetSizer(mainSizer)
        # events
        self.remainingDurationEdit.Bind(wx.EVT_SET_FOCUS, self.onFocus)

        stopButton.Bind(wx.EVT_BUTTON, self.onStopButton)
        closeButton.Bind(wx.EVT_BUTTON, lambda evt: self.Destroy())
        self.SetEscapeId(wx.ID_CLOSE)
        # start monitoring
        self.monitorRemainingTime()
	def doGui(self):
		mainSizer = wx.BoxSizer(wx.VERTICAL)
		sHelper = guiHelper.BoxSizerHelper(self, orientation=wx.VERTICAL)
		self.deviceNames = getDeviceNames()
		from synthDriverHandler import _audioOutputDevice
		self.curOutputDevice = _audioOutputDevice
		# Translators: temporary output device text
		# on Temporary audio output device manager dialog.
		labelText = _(
			"Current temporary audio device: %s") % (_temporaryOutputDevice if _temporaryOutputDevice else _("None"))
		self.currentTemporaryOutputDeviceTextCtrl = sHelper.addItem(wx.StaticText(
			self,
			label=labelText)
		)
		# Translators: This is the label for a listbox
		# on Temporary audio device manager dialog.
		labelText = _("Select a &device:")
		deviceNames = getDeviceNames()
		self.audioDevicesListBox = sHelper.addLabeledControl(
			labelText,
			nvdaControls.CustomCheckListBox,
			choices=deviceNames)
		self.audioDevicesListBox.SetStringSelection(self.curOutputDevice)
		from ..settings import _addonConfigManager
		devicesForCycle = _addonConfigManager.getAudioDevicesForCycle()
		for device in deviceNames:
			index = deviceNames.index(device)
			if device in devicesForCycle:
				self.audioDevicesListBox.Check(index)
		# the buttons
		bHelper = sHelper.addDialogDismissButtons(
			guiHelper.ButtonHelper(wx.HORIZONTAL))
		setButton = bHelper.addButton(
			self,
			# Translators: This is a label of a button appearing
			# on Temporary audio device manager dialog.
			label=_("&Set as temporary audio device"))
		setButton.SetDefault()
		quitTemporaryAudioDeviceButton = bHelper.addButton(
			self,
			# Translators: This is a label of a button appearing
			# on Temporary audio device manager dialog.
			label=_("&leave up the temporary audio device"))
		closeButton = bHelper.addButton(
			self,
			id=wx.ID_CLOSE,
			label=NVDAString("&Close"))
		mainSizer.Add(sHelper.sizer, border=10, flag=wx.ALL)
		mainSizer.Fit(self)
		self.SetSizer(mainSizer)
		# the events
		self.audioDevicesListBox.Bind(wx.EVT_LISTBOX, self.onSelectDevice)
		setButton.Bind(wx.EVT_BUTTON, self.onSetButton)
		quitTemporaryAudioDeviceButton.Bind(wx.EVT_BUTTON, self.onQuitTemporaryAudioDevice)
		closeButton.Bind(wx.EVT_BUTTON, self.onClose)
		self.SetEscapeId(wx.ID_CLOSE)
		self.audioDevicesListBox.SetFocus()
		if not _temporaryOutputDevice:
			quitTemporaryAudioDeviceButton.Disable()