Added keyboard shortcuts for account and global settings dialogs

This commit is contained in:
Mohamed
2024-05-24 18:24:33 -04:00
parent 438115d8e8
commit c06c6beff4
2 changed files with 52 additions and 52 deletions

View File

@@ -12,43 +12,43 @@ class general(wx.Panel, baseDialog.BaseWXDialog):
def __init__(self, parent, languages,keymaps):
super(general, self).__init__(parent)
sizer = wx.BoxSizer(wx.VERTICAL)
language = wx.StaticText(self, -1, _(u"Language"))
language = wx.StaticText(self, -1, _(u"&Language"))
self.language = wx.ListBox(self, -1, choices=languages)
self.language.SetSize(self.language.GetBestSize())
langBox = wx.BoxSizer(wx.HORIZONTAL)
langBox.Add(language, 0, wx.ALL, 5)
langBox.Add(self.language, 0, wx.ALL, 5)
sizer.Add(langBox, 0, wx.ALL, 5)
self.ask_at_exit = wx.CheckBox(self, -1, _(U"ask before exiting {0}").format(application.name,))
self.ask_at_exit = wx.CheckBox(self, -1, _(U"&Ask before exiting {0}").format(application.name,))
sizer.Add(self.ask_at_exit, 0, wx.ALL, 5)
self.no_streaming = wx.CheckBox(self, -1, _(U"Disable Streaming functions"))
self.no_streaming = wx.CheckBox(self, -1, _(U"&Disable Streaming functions"))
sizer.Add(self.no_streaming, 0, wx.ALL, 5)
updatePeriodBox = wx.BoxSizer(wx.HORIZONTAL)
updatePeriodBox.Add(wx.StaticText(self, -1, _(u"Buffer update interval, in minutes")), 0, wx.ALL, 5)
updatePeriodBox.Add(wx.StaticText(self, -1, _(u"&Buffer update interval, in minutes")), 0, wx.ALL, 5)
self.update_period = wx.SpinCtrl(self, wx.ID_ANY)
self.update_period.SetRange(1, 30)
self.update_period.SetSize(self.update_period.GetBestSize())
updatePeriodBox.Add(self.update_period, 0, wx.ALL, 5)
sizer.Add(updatePeriodBox, 0, wx.ALL, 5)
self.play_ready_sound = wx.CheckBox(self, -1, _(U"Play a sound when {0} launches").format(application.name,))
self.play_ready_sound = wx.CheckBox(self, -1, _(U"&Play a sound when {0} launches").format(application.name,))
sizer.Add(self.play_ready_sound, 0, wx.ALL, 5)
self.speak_ready_msg = wx.CheckBox(self, -1, _(U"Speak a message when {0} launches").format(application.name,))
self.speak_ready_msg = wx.CheckBox(self, -1, _(U"&Speak a message when {0} launches").format(application.name,))
sizer.Add(self.speak_ready_msg, 0, wx.ALL, 5)
self.use_invisible_shorcuts = wx.CheckBox(self, -1, _(u"Use invisible interface's keyboard shortcuts while GUI is visible"))
self.use_invisible_shorcuts = wx.CheckBox(self, -1, _(u"&Use invisible interface's keyboard shortcuts while GUI is visible"))
sizer.Add(self.use_invisible_shorcuts, 0, wx.ALL, 5)
self.disable_sapi5 = wx.CheckBox(self, -1, _(u"Activate Sapi5 when any other screen reader is not being run"))
self.disable_sapi5 = wx.CheckBox(self, -1, _(u"&Activate Sapi5 when any other screen reader is not being run"))
sizer.Add(self.disable_sapi5, 0, wx.ALL, 5)
self.hide_gui = wx.CheckBox(self, -1, _(u"Hide GUI on launch"))
self.hide_gui = wx.CheckBox(self, -1, _(u"&Hide GUI on launch"))
sizer.Add(self.hide_gui, 0, wx.ALL, 5)
self.read_long_posts_in_gui = wx.CheckBox(self, wx.ID_ANY, _("Read long posts in GUI"))
self.read_long_posts_in_gui = wx.CheckBox(self, wx.ID_ANY, _("&Read long posts in GUI"))
sizer.Add(self.read_long_posts_in_gui, 0, wx.ALL, 5)
kmbox = wx.BoxSizer(wx.VERTICAL)
km_label = wx.StaticText(self, -1, _(u"Keymap"))
km_label = wx.StaticText(self, -1, _(u"&Keymap"))
self.km = wx.ComboBox(self, -1, choices=keymaps, style=wx.CB_READONLY)
self.km.SetSize(self.km.GetBestSize())
kmbox.Add(km_label, 0, wx.ALL, 5)
kmbox.Add(self.km, 0, wx.ALL, 5)
self.check_for_updates = wx.CheckBox(self, -1, _(U"Check for updates when {0} launches").format(application.name,))
self.check_for_updates = wx.CheckBox(self, -1, _(U"Check for &updates when {0} launches").format(application.name,))
sizer.Add(self.check_for_updates, 0, wx.ALL, 5)
sizer.Add(kmbox, 0, wx.ALL, 5)
self.SetSizer(sizer)
@@ -58,32 +58,32 @@ class proxy(wx.Panel, baseDialog.BaseWXDialog):
def __init__(self, parent, proxyTypes):
super(proxy, self).__init__(parent)
sizer = wx.BoxSizer(wx.VERTICAL)
type=wx.StaticText(self, wx.ID_ANY, _(u"Proxy type: "))
type=wx.StaticText(self, wx.ID_ANY, _(u"Proxy &type: "))
self.type=wx.ComboBox(self, -1, choices=proxyTypes, style=wx.CB_READONLY)
self.type.SetSize(self.type.GetBestSize())
typeBox = wx.BoxSizer(wx.HORIZONTAL)
typeBox.Add(type, 0, wx.ALL, 5)
typeBox.Add(self.type, 0, wx.ALL, 5)
sizer.Add(typeBox, 0, wx.ALL, 5)
lbl = wx.StaticText(self, wx.ID_ANY, _(u"Proxy server: "))
lbl = wx.StaticText(self, wx.ID_ANY, _(u"Proxy &server: "))
self.server = wx.TextCtrl(self, -1)
serverBox = wx.BoxSizer(wx.HORIZONTAL)
serverBox.Add(lbl, 0, wx.ALL, 5)
serverBox.Add(self.server, 0, wx.ALL, 5)
sizer.Add(serverBox, 0, wx.ALL, 5)
lbl = wx.StaticText(self, wx.ID_ANY, _(u"Port: "))
lbl = wx.StaticText(self, wx.ID_ANY, _(u"&Port: "))
self.port = wx.SpinCtrl(self, wx.ID_ANY, min=1, max=65535)
portBox = wx.BoxSizer(wx.HORIZONTAL)
portBox.Add(lbl, 0, wx.ALL, 5)
portBox.Add(self.port, 0, wx.ALL, 5)
sizer.Add(portBox, 0, wx.ALL, 5)
lbl = wx.StaticText(self, wx.ID_ANY, _(u"User: "))
lbl = wx.StaticText(self, wx.ID_ANY, _(u"&User: "))
self.user = wx.TextCtrl(self, wx.ID_ANY)
userBox = wx.BoxSizer(wx.HORIZONTAL)
userBox.Add(lbl, 0, wx.ALL, 5)
userBox.Add(self.user, 0, wx.ALL, 5)
sizer.Add(userBox, 0, wx.ALL, 5)
lbl = wx.StaticText(self, wx.ID_ANY, _(u"Password: "))
lbl = wx.StaticText(self, wx.ID_ANY, _(u"&Password: "))
self.password = wx.TextCtrl(self, wx.ID_ANY, style=wx.TE_PASSWORD)
passwordBox = wx.BoxSizer(wx.HORIZONTAL)
passwordBox.Add(lbl, 0, wx.ALL, 5)
@@ -95,9 +95,9 @@ class reporting(wx.Panel, baseDialog.BaseWXDialog):
def __init__(self, parent):
super(reporting, self).__init__(parent)
sizer = wx.BoxSizer(wx.VERTICAL)
self.speech_reporting = wx.CheckBox(self, wx.ID_ANY, _(U"Enable automatic speech feedback"))
self.speech_reporting = wx.CheckBox(self, wx.ID_ANY, _(U"Enable automatic &speech feedback"))
sizer.Add(self.speech_reporting, 0, wx.ALL, 5)
self.braille_reporting = wx.CheckBox(self, wx.ID_ANY, _(U"Enable automatic Braille feedback"))
self.braille_reporting = wx.CheckBox(self, wx.ID_ANY, _(U"Enable automatic &Braille feedback"))
sizer.Add(self.braille_reporting, 0, wx.ALL, 5)
self.SetSizer(sizer)
@@ -108,9 +108,9 @@ class other_buffers(wx.Panel):
self.buffers = widgets.list(self, _(u"Buffer"), _(u"Name"), _(u"Status"), style=wx.LC_SINGLE_SEL|wx.LC_REPORT)
sizer.Add(self.buffers.list, 0, wx.ALL, 5)
btnSizer = wx.BoxSizer(wx.HORIZONTAL)
self.toggle_state = wx.Button(self, -1, _(u"Show/hide"))
self.up = wx.Button(self, -1, _(u"Move up"))
self.down = wx.Button(self, -1, _(u"Move down"))
self.toggle_state = wx.Button(self, -1, _(u"&Show/hide"))
self.up = wx.Button(self, -1, _(u"Move &up"))
self.down = wx.Button(self, -1, _(u"Move &down"))
btnSizer.Add(self.toggle_state, 0, wx.ALL, 5)
btnSizer.Add(self.up, 0, wx.ALL, 5)
btnSizer.Add(self.down, 0, wx.ALL, 5)
@@ -202,19 +202,19 @@ class TranslatorPanel(wx.Panel, baseDialog.BaseWXDialog):
super(TranslatorPanel, self).__init__(parent)
sizer = wx.BoxSizer(wx.VERTICAL)
lbl_libre_url = wx.StaticText(self, wx.ID_ANY, _(u"LibreTranslate API URL: "))
lbl_libre_url = wx.StaticText(self, wx.ID_ANY, _(u"&LibreTranslate API URL: "))
self.libre_api_url = wx.TextCtrl(self, wx.ID_ANY)
libreUrlBox = wx.BoxSizer(wx.HORIZONTAL)
libreUrlBox.Add(lbl_libre_url, 0, wx.ALL, 5)
libreUrlBox.Add(self.libre_api_url, 1, wx.ALL | wx.EXPAND, 5)
sizer.Add(libreUrlBox, 0, wx.ALL | wx.EXPAND, 5)
lbl_libre_api_key = wx.StaticText(self, wx.ID_ANY, _(u"LibreTranslate API Key (optional): "))
lbl_libre_api_key = wx.StaticText(self, wx.ID_ANY, _(u"LibreTranslate API &Key (optional): "))
self.libre_api_key = wx.TextCtrl(self, wx.ID_ANY)
libreApiKeyBox = wx.BoxSizer(wx.HORIZONTAL)
libreApiKeyBox.Add(lbl_libre_api_key, 0, wx.ALL, 5)
libreApiKeyBox.Add(self.libre_api_key, 1, wx.ALL | wx.EXPAND, 5)
sizer.Add(libreApiKeyBox, 0, wx.ALL | wx.EXPAND, 5)
lbl_deepL_api_key = wx.StaticText(self, wx.ID_ANY, _(u"DeepL API Key: "))
lbl_deepL_api_key = wx.StaticText(self, wx.ID_ANY, _(u"&DeepL API Key: "))
self.deepL_api_key = wx.TextCtrl(self, wx.ID_ANY)
deepLApiKeyBox = wx.BoxSizer(wx.HORIZONTAL)
deepLApiKeyBox.Add(lbl_deepL_api_key, 0, wx.ALL, 5)
@@ -248,9 +248,9 @@ class configurationDialog(baseDialog.BaseWXDialog):
def realize(self):
self.sizer.Add(self.notebook, 0, wx.ALL, 5)
ok_cancel_box = wx.BoxSizer(wx.HORIZONTAL)
ok = wx.Button(self.panel, wx.ID_OK, _(u"Save"))
ok = wx.Button(self.panel, wx.ID_OK, _(u"&Save"))
ok.SetDefault()
cancel = wx.Button(self.panel, wx.ID_CANCEL, _(u"Close"))
cancel = wx.Button(self.panel, wx.ID_CANCEL, _(u"&Close"))
self.SetEscapeId(cancel.GetId())
ok_cancel_box.Add(ok, 0, wx.ALL, 5)
ok_cancel_box.Add(cancel, 0, wx.ALL, 5)