From c79e659b74d48ff529768be1feffdfdaaa7b104b Mon Sep 17 00:00:00 2001 From: Blake Oliver Date: Sun, 20 Mar 2016 10:26:05 -0400 Subject: [PATCH] Add hotkeys for some dialogs, making navigation much faster --- contributors.txt | 3 ++- src/wxUI/dialogs/message.py | 18 +++++++++--------- src/wxUI/dialogs/search.py | 10 +++++----- src/wxUI/dialogs/show_user.py | 4 ++-- src/wxUI/dialogs/trends.py | 6 +++--- src/wxUI/dialogs/update_profile.py | 14 +++++++------- src/wxUI/dialogs/userActions.py | 22 +++++++++++----------- src/wxUI/dialogs/userSelection.py | 12 ++++++------ 8 files changed, 45 insertions(+), 44 deletions(-) diff --git a/contributors.txt b/contributors.txt index efc25883..6bfcfaf8 100644 --- a/contributors.txt +++ b/contributors.txt @@ -35,4 +35,5 @@ Anibal Hernández Sussan Leiva Brian Hartgen PEDRO REINA COLOBON -Moora-Moora Arrilla \ No newline at end of file +Moora-Moora Arrilla +Blake Oliver \ No newline at end of file diff --git a/src/wxUI/dialogs/message.py b/src/wxUI/dialogs/message.py index 3c39cfc8..f5fd8768 100644 --- a/src/wxUI/dialogs/message.py +++ b/src/wxUI/dialogs/message.py @@ -68,20 +68,20 @@ class tweet(textLimited): self.mainBox = wx.BoxSizer(wx.VERTICAL) self.createTextArea(message, text) self.mainBox.Add(self.textBox, 0, wx.ALL, 5) - self.long_tweet = wx.CheckBox(self.panel, -1, _(u"Long tweet")) + self.long_tweet = wx.CheckBox(self.panel, -1, _(u"&Long tweet")) self.long_tweet.SetValue(True) - self.upload_image = wx.Button(self.panel, -1, _(u"Upload image..."), size=wx.DefaultSize) - self.spellcheck = wx.Button(self.panel, -1, _("Check spelling..."), size=wx.DefaultSize) - self.attach = wx.Button(self.panel, -1, _(u"Attach audio..."), size=wx.DefaultSize) - self.shortenButton = wx.Button(self.panel, -1, _(u"Shorten URL"), size=wx.DefaultSize) - self.unshortenButton = wx.Button(self.panel, -1, _(u"Expand URL"), size=wx.DefaultSize) + self.upload_image = wx.Button(self.panel, -1, _(u"&Upload image..."), size=wx.DefaultSize) + self.spellcheck = wx.Button(self.panel, -1, _("Check &spelling..."), size=wx.DefaultSize) + self.attach = wx.Button(self.panel, -1, _(u"&Attach audio..."), size=wx.DefaultSize) + self.shortenButton = wx.Button(self.panel, -1, _(u"Sh&orten URL"), size=wx.DefaultSize) + self.unshortenButton = wx.Button(self.panel, -1, _(u"&Expand URL"), size=wx.DefaultSize) self.shortenButton.Disable() self.unshortenButton.Disable() - self.translateButton = wx.Button(self.panel, -1, _(u"Translate..."), size=wx.DefaultSize) + self.translateButton = wx.Button(self.panel, -1, _(u"&Translate..."), size=wx.DefaultSize) self.autocompletionButton = wx.Button(self.panel, -1, _(u"&Autocomplete users")) - self.okButton = wx.Button(self.panel, wx.ID_OK, _(u"Send"), size=wx.DefaultSize) + self.okButton = wx.Button(self.panel, wx.ID_OK, _(u"&Send"), size=wx.DefaultSize) self.okButton.SetDefault() - cancelButton = wx.Button(self.panel, wx.ID_CANCEL, _(u"Close"), size=wx.DefaultSize) + cancelButton = wx.Button(self.panel, wx.ID_CANCEL, _(u"&Close"), size=wx.DefaultSize) self.buttonsBox1 = wx.BoxSizer(wx.HORIZONTAL) self.buttonsBox1.Add(self.upload_image, 0, wx.ALL, 10) self.buttonsBox1.Add(self.spellcheck, 0, wx.ALL, 10) diff --git a/src/wxUI/dialogs/search.py b/src/wxUI/dialogs/search.py index f8324430..e04f07c6 100644 --- a/src/wxUI/dialogs/search.py +++ b/src/wxUI/dialogs/search.py @@ -10,7 +10,7 @@ class searchDialog(baseDialog.BaseWXDialog): panel = wx.Panel(self) sizer = wx.BoxSizer(wx.VERTICAL) self.SetTitle(_(u"Search on Twitter")) - label = wx.StaticText(panel, -1, _(u"Search")) + label = wx.StaticText(panel, -1, _(u"&Search")) self.term = wx.TextCtrl(panel, -1, value) dc = wx.WindowDC(self.term) dc.SetFont(self.term.GetFont()) @@ -25,7 +25,7 @@ class searchDialog(baseDialog.BaseWXDialog): radioSizer.Add(self.tweets, 0, wx.ALL, 5) radioSizer.Add(self.users, 0, wx.ALL, 5) sizer.Add(radioSizer, 0, wx.ALL, 5) - lang = wx.StaticText(panel, -1, _(u"Language for results: ")) + lang = wx.StaticText(panel, -1, _(u"&Language for results: ")) langs = [x[1] for x in translator.translator.available_languages()] langs[:] = langs[1:] langs.insert(0, _(u"any")) @@ -34,15 +34,15 @@ class searchDialog(baseDialog.BaseWXDialog): langBox.Add(lang, 0, wx.ALL, 5) langBox.Add(self.lang, 0, wx.ALL, 5) sizer.Add(langBox, 0, wx.ALL, 5) - resulttype = wx.StaticText(panel, -1, _(U"Results type: ")) + resulttype = wx.StaticText(panel, -1, _(U"Results &type: ")) self.resultstype = wx.ComboBox(panel, -1, choices=[_(u"Mixed"), _(u"Recent"), _(u"Popular")], value=_(u"Mixed"), style=wx.CB_READONLY) rBox = wx.BoxSizer(wx.HORIZONTAL) rBox.Add(resulttype, 0, wx.ALL, 5) rBox.Add(self.resultstype, 0, wx.ALL, 5) sizer.Add(rBox, 0, wx.ALL, 5) - ok = wx.Button(panel, wx.ID_OK, _(u"OK")) + ok = wx.Button(panel, wx.ID_OK, _(u"&OK")) ok.SetDefault() - cancel = wx.Button(panel, wx.ID_CANCEL, _(u"Close")) + cancel = wx.Button(panel, wx.ID_CANCEL, _(u"&Close")) btnsizer = wx.BoxSizer() btnsizer.Add(ok, 0, wx.ALL, 5) btnsizer.Add(cancel, 0, wx.ALL, 5) diff --git a/src/wxUI/dialogs/show_user.py b/src/wxUI/dialogs/show_user.py index ecc601a2..a3850a7b 100644 --- a/src/wxUI/dialogs/show_user.py +++ b/src/wxUI/dialogs/show_user.py @@ -12,9 +12,9 @@ class showUserProfile(baseDialog.BaseWXDialog): self.text = wx.TextCtrl(panel, -1, style=wx.TE_MULTILINE|wx.TE_READONLY, size=(350, 250)) self.text.SetFocus() sizer.Add(self.text, 0, wx.ALL|wx.EXPAND, 5) - self.url = wx.Button(panel, -1, _(u"Go to URL"), size=wx.DefaultSize) + self.url = wx.Button(panel, -1, _(u"&Go to URL"), size=wx.DefaultSize) self.url.Disable() - close = wx.Button(panel, wx.ID_CANCEL, _(u"Close")) + close = wx.Button(panel, wx.ID_CANCEL, _(u"&Close")) btnSizer = wx.BoxSizer(wx.HORIZONTAL) btnSizer.Add(self.url, 0, wx.ALL, 5) btnSizer.Add(close, 0, wx.ALL, 5) diff --git a/src/wxUI/dialogs/trends.py b/src/wxUI/dialogs/trends.py index 76275ec9..6cf973f6 100644 --- a/src/wxUI/dialogs/trends.py +++ b/src/wxUI/dialogs/trends.py @@ -17,15 +17,15 @@ class trendingTopicsDialog(baseDialog.BaseWXDialog): radioSizer.Add(self.country, 0, wx.ALL, 5) radioSizer.Add(self.city, 0, wx.ALL, 5) sizer.Add(radioSizer, 0, wx.ALL, 5) - label = wx.StaticText(panel, -1, _(u"Location")) + label = wx.StaticText(panel, -1, _(u"&Location")) self.location = wx.ListBox(panel, -1, choices=[], style=wx.CB_READONLY) locationBox = wx.BoxSizer(wx.HORIZONTAL) locationBox.Add(label, 0, wx.ALL, 5) locationBox.Add(self.location, 0, wx.ALL, 5) sizer.Add(locationBox, 0, wx.ALL, 5) - ok = wx.Button(panel, wx.ID_OK, _(u"OK")) + ok = wx.Button(panel, wx.ID_OK, _(u"&OK")) ok.SetDefault() - cancel = wx.Button(panel, wx.ID_CANCEL, _(u"Close")) + cancel = wx.Button(panel, wx.ID_CANCEL, _(u"&Close")) btnsizer = wx.BoxSizer() btnsizer.Add(ok, 0, wx.ALL, 5) btnsizer.Add(cancel, 0, wx.ALL, 5) diff --git a/src/wxUI/dialogs/update_profile.py b/src/wxUI/dialogs/update_profile.py index 027a2e74..594f7f3b 100644 --- a/src/wxUI/dialogs/update_profile.py +++ b/src/wxUI/dialogs/update_profile.py @@ -7,32 +7,32 @@ class updateProfileDialog(baseDialog.BaseWXDialog): super(updateProfileDialog, self).__init__(parent=None, id=-1) self.SetTitle(_(u"Update your profile")) panel = wx.Panel(self) - labelName = wx.StaticText(panel, -1, _(u"Name (20 characters maximum)")) + labelName = wx.StaticText(panel, -1, _(u"&Name (20 characters maximum)")) self.name = wx.TextCtrl(panel, -1) self.name.SetFocus() dc = wx.WindowDC(self.name) dc.SetFont(self.name.GetFont()) self.name.SetSize(dc.GetTextExtent("0"*20)) - labelLocation = wx.StaticText(panel, -1, _(u"Location")) + labelLocation = wx.StaticText(panel, -1, _(u"&Location")) self.location = wx.TextCtrl(panel, -1) dc = wx.WindowDC(self.location) dc.SetFont(self.location.GetFont()) self.location.SetSize(dc.GetTextExtent("0"*35)) - labelUrl = wx.StaticText(panel, -1, _(u"Website")) + labelUrl = wx.StaticText(panel, -1, _(u"&Website")) self.url = wx.TextCtrl(panel, -1) dc = wx.WindowDC(self.url) dc.SetFont(self.url.GetFont()) self.url.SetSize(dc.GetTextExtent("0"*22)) - labelDescription = wx.StaticText(panel, -1, _(u"Bio (160 characters maximum)")) + labelDescription = wx.StaticText(panel, -1, _(u"&Bio (160 characters maximum)")) self.description = wx.TextCtrl(panel, -1, size=(400, 400)) dc = wx.WindowDC(self.description) dc.SetFont(self.description.GetFont()) self.description.SetSize(dc.GetTextExtent("0"*160)) self.image = None - self.upload_image = wx.Button(panel, -1, _(u"Upload a picture")) - self.ok = wx.Button(panel, wx.ID_OK, _(u"Update profile")) + self.upload_image = wx.Button(panel, -1, _(u"Upload a &picture")) + self.ok = wx.Button(panel, wx.ID_OK, _(u"&Update profile")) self.ok.SetDefault() - close = wx.Button(panel, wx.ID_CANCEL, _("Close")) + close = wx.Button(panel, wx.ID_CANCEL, _("&Close")) sizer = wx.BoxSizer(wx.VERTICAL) nameBox = wx.BoxSizer(wx.HORIZONTAL) nameBox.Add(labelName, 0, wx.ALL, 5) diff --git a/src/wxUI/dialogs/userActions.py b/src/wxUI/dialogs/userActions.py index 97369db6..34f493ea 100644 --- a/src/wxUI/dialogs/userActions.py +++ b/src/wxUI/dialogs/userActions.py @@ -7,7 +7,7 @@ class UserActionsDialog(wx.Dialog): panel = wx.Panel(self) userSizer = wx.BoxSizer() self.SetTitle(_(u"Action")) - userLabel = wx.StaticText(panel, -1, _(u"User")) + userLabel = wx.StaticText(panel, -1, _(u"&User")) self.cb = wx.ComboBox(panel, -1, choices=users, value=users[0]) self.cb.SetFocus() self.autocompletion = wx.Button(panel, -1, _(u"&Autocomplete users")) @@ -16,14 +16,14 @@ class UserActionsDialog(wx.Dialog): userSizer.Add(self.autocompletion, 0, wx.ALL, 5) actionSizer = wx.BoxSizer(wx.VERTICAL) label2 = wx.StaticText(panel, -1, _(u"Action")) - self.follow = wx.RadioButton(panel, -1, _(u"Follow"), style=wx.RB_GROUP) - self.unfollow = wx.RadioButton(panel, -1, _(u"Unfollow")) - self.mute = wx.RadioButton(panel, -1, _(u"Mute")) - self.unmute = wx.RadioButton(panel, -1, _(u"Unmute")) - self.block = wx.RadioButton(panel, -1, _(u"Block")) - self.unblock = wx.RadioButton(panel, -1, _(u"Unblock")) - self.reportSpam = wx.RadioButton(panel, -1, _(u"Report as spam")) - self.ignore_client = wx.RadioButton(panel, -1, _(u"Ignore tweets from this client")) + self.follow = wx.RadioButton(panel, -1, _(u"&Follow"), style=wx.RB_GROUP) + self.unfollow = wx.RadioButton(panel, -1, _(u"U&nfollow")) + self.mute = wx.RadioButton(panel, -1, _(u"&Mute")) + self.unmute = wx.RadioButton(panel, -1, _(u"Unmu&te")) + self.block = wx.RadioButton(panel, -1, _(u"&Block")) + self.unblock = wx.RadioButton(panel, -1, _(u"Unbl&ock")) + self.reportSpam = wx.RadioButton(panel, -1, _(u"&Report as spam")) + self.ignore_client = wx.RadioButton(panel, -1, _(u"&Ignore tweets from this client")) self.setup_default(default) hSizer = wx.BoxSizer(wx.HORIZONTAL) hSizer.Add(label2, 0, wx.ALL, 5) @@ -37,9 +37,9 @@ class UserActionsDialog(wx.Dialog): actionSizer.Add(self.ignore_client, 0, wx.ALL, 5) hSizer.Add(actionSizer, 0, wx.ALL, 5) sizer = wx.BoxSizer(wx.VERTICAL) - ok = wx.Button(panel, wx.ID_OK, _(u"OK")) + ok = wx.Button(panel, wx.ID_OK, _(u"&OK")) ok.SetDefault() - cancel = wx.Button(panel, wx.ID_CANCEL, _(u"Close")) + cancel = wx.Button(panel, wx.ID_CANCEL, _(u"&Close")) btnsizer = wx.BoxSizer() btnsizer.Add(ok) btnsizer.Add(cancel) diff --git a/src/wxUI/dialogs/userSelection.py b/src/wxUI/dialogs/userSelection.py index 59867f26..76924cb5 100644 --- a/src/wxUI/dialogs/userSelection.py +++ b/src/wxUI/dialogs/userSelection.py @@ -16,10 +16,10 @@ class selectUserDialog(wx.Dialog): userSizer.Add(self.autocompletion, 0, wx.ALL, 5) actionSizer = wx.BoxSizer(wx.VERTICAL) label2 = wx.StaticText(panel, -1, _(u"Buffer type")) - self.tweets = wx.RadioButton(panel, -1, _(u"Tweets"), style=wx.RB_GROUP) - self.favourites = wx.RadioButton(panel, -1, _(u"Likes")) - self.followers = wx.RadioButton(panel, -1, _(u"Followers")) - self.friends = wx.RadioButton(panel, -1, _(u"Friends")) + self.tweets = wx.RadioButton(panel, -1, _(u"&Tweets"), style=wx.RB_GROUP) + self.favourites = wx.RadioButton(panel, -1, _(u"&Likes")) + self.followers = wx.RadioButton(panel, -1, _(u"&Followers")) + self.friends = wx.RadioButton(panel, -1, _(u"F&riends")) self.setup_default(default) hSizer = wx.BoxSizer(wx.HORIZONTAL) hSizer.Add(label2, 0, wx.ALL, 5) @@ -29,9 +29,9 @@ class selectUserDialog(wx.Dialog): actionSizer.Add(self.friends, 0, wx.ALL, 5) hSizer.Add(actionSizer, 0, wx.ALL, 5) sizer = wx.BoxSizer(wx.VERTICAL) - ok = wx.Button(panel, wx.ID_OK, _(u"OK")) + ok = wx.Button(panel, wx.ID_OK, _(u"&OK")) ok.SetDefault() - cancel = wx.Button(panel, wx.ID_CANCEL, _(u"Close")) + cancel = wx.Button(panel, wx.ID_CANCEL, _(u"&Close")) btnsizer = wx.BoxSizer() btnsizer.Add(ok) btnsizer.Add(cancel)