diff --git a/source/gui/addonStoreGui/controls/messageDialogs.py b/source/gui/addonStoreGui/controls/messageDialogs.py index 6a07b853f89..863fa77a215 100644 --- a/source/gui/addonStoreGui/controls/messageDialogs.py +++ b/source/gui/addonStoreGui/controls/messageDialogs.py @@ -378,6 +378,7 @@ def __init__(self, parent: wx.Window, addonsPendingUpdate: list[_AddonGUIModel]) def _setupUI(self): self.Bind(wx.EVT_CLOSE, self.onClose) + self.Bind(wx.EVT_CHAR_HOOK, self.onCharHook) mainSizer = wx.BoxSizer(wx.VERTICAL) sHelper = BoxSizerHelper(self, orientation=wx.VERTICAL) self._setupMessage(sHelper) @@ -388,6 +389,11 @@ def _setupUI(self): mainSizer.Fit(self) self.CentreOnScreen() + def onCharHook(self, evt: wx.KeyEvent): + if evt.KeyCode == wx.WXK_ESCAPE: + self.Close() + evt.Skip() + def _setupMessage(self, sHelper: BoxSizerHelper): _message = pgettext( "addonStore", @@ -426,15 +432,15 @@ def _createAddonsPanel(self, sHelper: BoxSizerHelper): ) # Translators: Label for an extra detail field for an add-on. In the add-on store UX. - nameLabel = pgettext("addonStore", "Name:") + nameLabel = pgettext("addonStore", "Name") # Translators: Label for an extra detail field for an add-on. In the add-on store UX. - installedVersionLabel = pgettext("addonStore", "Installed version:") + installedVersionLabel = pgettext("addonStore", "Installed version") # Translators: Label for an extra detail field for an add-on. In the add-on store UX. - availableVersionLabel = pgettext("addonStore", "Available version:") + availableVersionLabel = pgettext("addonStore", "Available version") # Translators: Label for an extra detail field for an add-on. In the add-on store UX. - channelLabel = pgettext("addonStore", "Channel:") + channelLabel = pgettext("addonStore", "Channel") # Translators: Label for an extra detail field for an add-on. In the add-on store UX. - statusLabel = pgettext("addonStore", "Status:") + statusLabel = pgettext("addonStore", "Status") self.addonsList.AppendColumn(nameLabel, width=300) self.addonsList.AppendColumn(installedVersionLabel, width=200)