Skip to content

Commit

Permalink
Enhancements for the articles list dialog
Browse files Browse the repository at this point in the history
* Added a button to copy info about the selected article.
* Updated readme.
  • Loading branch information
nvdaes committed Aug 11, 2018
1 parent 66d4f16 commit f2a4519
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
29 changes: 22 additions & 7 deletions addon/globalPlugins/readFeeds/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,13 +288,18 @@ def __init__(self, parent):
self.articlesList.Bind(wx.EVT_CHOICE, self.onArticlesListChoice)

buttonHelper = guiHelper.ButtonHelper(wx.VERTICAL)
# Translators: The label of a button to open the list of articles of a feed.
self.articlesButton = wx.Button(self, label=_("Open &web page of selected article."))
self.articlesButton.Bind(wx.EVT_BUTTON, self.onArticlesListChoice)
self.AffirmativeId = self.articlesButton.Id
self.articlesButton.SetDefault()
buttonHelper.addButton(self.articlesButton)

# Translators: The label of a button to open the selected article of a feed.
self.articleButton = wx.Button(self, label=_("Open &web page of selected article."))
self.articleButton.Bind(wx.EVT_BUTTON, self.onArticlesListChoice)
self.AffirmativeId = self.articleButton.Id
self.articleButton.SetDefault()
buttonHelper.addButton(self.articleButton)

# Translators: The label of a button to show information of a feed article.
self.infoButton = wx.Button(self, label=_("&About article..."))
self.infoButton.Bind(wx.EVT_BUTTON, self.onArticlesListInfo)
buttonHelper.addButton(self.infoButton)

closeButton = sHelper.addDialogDismissButtons(wx.Button(self, wx.ID_CLOSE, label=translate("&Close")))
closeButton.Bind(wx.EVT_BUTTON, lambda evt: self.Close())
self.Bind(wx.EVT_CLOSE, self.onClose)
Expand All @@ -308,6 +313,16 @@ def __init__(self, parent):
def onArticlesListChoice(self, evt):
os.startfile(self.Parent.feed.getArticleLink(self.articlesList.Selection))

def onArticlesListInfo(self, evt):
articleInfo = u"{title}\r\n\r\n{address}".format(title=self.Parent.feed.getArticleTitle(self.articlesList.Selection), address=self.Parent.feed.getArticleLink(self.articlesList.Selection))
if gui.messageBox(
# Translators: the label of a message box dialog.
_("%s\r\n\r\nDo you want to copy article title and link to the clipboard?" % articleInfo),
# Translators: the title of a message box dialog.
_("Article information"),
wx.YES|wx.NO|wx.CANCEL|wx.ICON_QUESTION) == wx.YES:
api.copyToClip(articleInfo)

def onClose(self, evt):
self.Parent.Enable()
self.Destroy()
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Opens a dialog with the following controls:

* Filter by: An edit box to search previously saved feeds.
* A list of the saved feeds.
* List of articles: Opens a dialog which presents the articles list from your current feed. Select the article you want to read and press Enteror Open web page of selected article button to open the corresponding page in your browser.
* List of articles: Opens a dialog which presents the articles list from your current feed. Select the article you want to read and press Enter or Open web page of selected article button to open the corresponding page in your browser. Press About article button to open a dialog showing title and link of the selected article; from this dialog, you'll be able to copy this info to the clipboard.
* Open feed: Opens the selected feed in the default application.
* New: Opens a dialog with an edit box to enter the address of a new feed. If the address is valid and the feed can be saved, its name, based on the feed title, will appear at the bottom of the feeds list.
* Rename: Opens a dialog with an edit box to rename the selected feed.
Expand Down Expand Up @@ -64,7 +64,7 @@ Opens a dialog to select a folder which replaces your feeds in the personalFeeds

## Changes for 5.0 ##

* In the articles list dialog, OK and Cancel buttons have been replaced with a button to open the webpage of the selected article and a Close button, making easier to add new actions.
* The articles list dialog has been enhanced.
* Requires NVDA 2018.3.
* If needed, you can download the [last version compatible with NVDA 2017.3][3].

Expand Down

0 comments on commit f2a4519

Please sign in to comment.