diff --git a/doc/changelog.md b/doc/changelog.md index 93d28da7..ebb67885 100644 --- a/doc/changelog.md +++ b/doc/changelog.md @@ -2,6 +2,7 @@ ## changes in this version +* When adding or removing an user from a list, it is possible to press enter in the focused list instead of having to search for the "add" or "delete" button. * Quoted and long tweets are displayed properly in the sent tweets buffer after being send. ([#253](https://github.com/manuelcortez/TWBlue/issues/253)) * Fixed an issue that was making the list manager keystroke unable to be shown in the keystroke editor. Now the keystroke is listed properly. ([#260](https://github.com/manuelcortez/TWBlue/issues/260)) * The volume slider, located in the account settings of TWBlue, now should decrease and increase value properly when up and down arrows are pressed. Before it was doing it in inverted order. ([#261](https://github.com/manuelcortez/TWBlue/issues/261)) diff --git a/src/wxUI/dialogs/lists.py b/src/wxUI/dialogs/lists.py index a5914211..5fb7d57f 100644 --- a/src/wxUI/dialogs/lists.py +++ b/src/wxUI/dialogs/lists.py @@ -113,6 +113,13 @@ class addUserListDialog(listViewer): # self.subscriptors.Disable() # self.members.Disable() self.deleteBtn.Disable() + widgetUtils.connect_event(self.lista.list, widgetUtils.KEYPRESS, self.on_keypress) + + def on_keypress(self, event): + """Catch return and execute ok()""" + if event.GetKeyCode() == wx.WXK_RETURN: + return self.ok() + event.Skip() def ok(self, *args, **kwargs): self.EndModal(wx.ID_OK) @@ -129,6 +136,13 @@ class removeUserListDialog(listViewer): # self.subscriptors.Disable() # self.members.Disable() self.deleteBtn.Disable() + widgetUtils.connect_event(self.lista.list, widgetUtils.KEYPRESS, self.on_keypress) + + def on_keypress(self, event): + """Catch return and execute EndModal()""" + if event.GetKeyCode() == wx.WXK_RETURN: + return self.EndModal(wx.ID_OK) + event.Skip() def remove_list(): return wx.MessageDialog(None, _("Do you really want to delete this list?"), _("Delete"), wx.YES_NO).ShowModal()