commit/readFeeds: josephsl: Merged master, L10N updates

  • From: commits-noreply@xxxxxxxxxxxxx
  • To: nvda-addons-commits@xxxxxxxxxxxxx
  • Date: Mon, 18 Apr 2016 07:57:52 -0000

1 new commit in readFeeds:

https://bitbucket.org/nvdaaddonteam/readfeeds/commits/f618c77a3e52/
Changeset:   f618c77a3e52
Branch:      stable
User:        josephsl
Date:        2016-04-18 07:56:38+00:00
Summary:     Merged master, L10N updates

Signed-off-by: Joseph Lee <joseph.lee22590@xxxxxxxxx>

Affected #:  4 files

diff --git a/addon/globalPlugins/readFeeds.py b/addon/globalPlugins/readFeeds.py
index 437ed08..da7e23b 100644
--- a/addon/globalPlugins/readFeeds.py
+++ b/addon/globalPlugins/readFeeds.py
@@ -168,18 +168,12 @@ class GlobalPlugin(globalPluginHandler.GlobalPlugin):
                # Translators: the tooltip for a menu item.
                _("Checks for new articles for the current feed"))
                gui.mainFrame.sysTrayIcon.Bind(wx.EVT_MENU, 
self.onReadFirstFeed, self.readFirstItem)
-               self.copyFeedsItem = self.readFeedsMenu.Append(wx.ID_ANY,
-               # Translators: the name of a menu item, which will backup the 
users feeds.
-               _("&Backup personal feeds folder..."),
-               # Translators: the tooltip for a menu item.
-               _("Backs up your personal feeds folder"))
-               gui.mainFrame.sysTrayIcon.Bind(wx.EVT_MENU, self.onCopyFeeds, 
self.copyFeedsItem)
-               self.restoreFeedsItem = self.readFeedsMenu.Append(wx.ID_ANY,
+               self.ReadFeedsFileManagerItem = 
self.readFeedsMenu.Append(wx.ID_ANY,
                # Translators: the name of a menu item.
-               _("R&estore personal feeds..."),
+               _("&ReadFeeds file manager..."),
                # Translators: the tooltip for a menu item.
-               _("Restore previously saved feeds"))
-               gui.mainFrame.sysTrayIcon.Bind(wx.EVT_MENU, 
self.onRestoreFeeds, self.restoreFeedsItem)
+               _("Opens the ReadFeedsFileManager dialog"))
+               gui.mainFrame.sysTrayIcon.Bind(wx.EVT_MENU, 
self.onReadFeedsFileManager, self.ReadFeedsFileManagerItem)
                self._feed = None
 
        def terminate(self):
@@ -230,47 +224,8 @@ class GlobalPlugin(globalPluginHandler.GlobalPlugin):
                        return
                ui.message(self._feed.getArticleTitle())
 
-       def onCopyFeeds(self, evt):
-               dlg = wx.DirDialog(gui.mainFrame,
-               # Translators: the label of a dialog to select a folder.
-               _("Select the folder where your personal feeds will be backed 
up."),
-               configPath, wx.DD_DEFAULT_STYLE)
-               gui.mainFrame.prePopup()
-               result = dlg.ShowModal()
-               gui.mainFrame.postPopup()
-               if result == wx.ID_OK:
-                       copyPath = os.path.join(dlg.GetPath(), "personalFeeds")
-                       try:
-                               shutil.rmtree(copyPath, ignore_errors=True)
-                               shutil.copytree(_savePath, copyPath)
-                       except WindowsError:
-                               wx.CallAfter(gui.messageBox,
-                               # Translators: the label of an error dialog.
-                               _("Unable to backup folder"),
-                               # Translators: the title of an error dialog.
-                               _("Backup Error"),
-                               wx.OK|wx.ICON_ERROR)
-
-       def onRestoreFeeds(self, evt):
-               feedsPath = os.path.join(configPath, "personalFeeds")
-               dlg = wx.DirDialog(gui.mainFrame,
-               # Translators: the label of a dialog to select a folder.
-               _("Restore personal feeds from backup folder"), feedsPath, 
wx.DD_DIR_MUST_EXIST | wx.DD_DEFAULT_STYLE)
-               gui.mainFrame.prePopup()
-               result = dlg.ShowModal()
-               gui.mainFrame.postPopup()
-               if result == wx.ID_OK:
-                       feedsPath = dlg.GetPath()
-                       try:
-                               shutil.rmtree(_savePath, ignore_errors=True)
-                               shutil.copytree(feedsPath, _savePath)
-                       except WindowsError:
-                               wx.CallAfter(gui.messageBox,
-                               # Translators: the label of an error dialog.
-                               _("Folder not restored"),
-                               # Translators: the title of an error dialog.
-                               _("Restore Error"),
-                               wx.OK|wx.ICON_ERROR)
+       def onReadFeedsFileManager(self, evt):
+               gui.mainFrame._popupSettingsDialog(ReadFeedsManagerDialog)
 
        def script_readFirstFeed(self, gesture):
                self.onReadFirstFeed(None)
@@ -418,3 +373,62 @@ class GlobalPlugin(globalPluginHandler.GlobalPlugin):
                "kb:control+NVDA+enter": "setAddressFile",
                "kb:shift+NVDA+enter": "saveAddress",
        }
+
+class ReadFeedsManagerDialog(gui.SettingsDialog):
+
+       title = _("Feeds manager")
+
+       def makeSettings(self, settingsSizer):
+               foldersSizer = wx.BoxSizer(wx.VERTICAL)
+               # Translators: the name of a dialog button.
+               self.focusedCtrl = wx.Button(self, label = _("&Backup personal 
feeds folder..."))
+               self.focusedCtrl.Bind(wx.EVT_BUTTON, 
self.onBrowseForBackupDirectory)
+               foldersSizer.Add(self.focusedCtrl)
+               # Translators: the name of a dialog button.
+               ctrl = wx.Button(self, label=_("R&estore personal feeds..."))
+               ctrl.Bind(wx.EVT_BUTTON, self.onBrowseForRestoreDirectory)
+               foldersSizer.Add(ctrl)
+               settingsSizer.Add(foldersSizer)
+
+       def postInit(self):
+               self.focusedCtrl.SetFocus()
+       def onBrowseForBackupDirectory(self, evt):
+               with wx.DirDialog(self,
+               # Translators: the label of a dialog to select a folder.
+               _("Select the folder where your personal feeds will be backed 
up."),
+               configPath) as dlg:
+                       gui.mainFrame.prePopup()
+                       if dlg.ShowModal() == wx.ID_OK:
+                               gui.mainFrame.postPopup()
+                               copyPath = os.path.join(dlg.GetPath(), 
"personalFeeds")
+                               try:
+                                       shutil.rmtree(copyPath, 
ignore_errors=True)
+                                       shutil.copytree(_savePath, copyPath)
+                               except WindowsError:
+                                       wx.CallAfter(gui.messageBox,
+                                       ## Translators: the label of an error 
dialog.
+                                       _("Unable to backup folder"),
+                                       # Translators: the title of an error 
dialog.
+                                       _("Backup Error"),
+                                       wx.OK|wx.ICON_ERROR)
+
+       def onBrowseForRestoreDirectory(self, evt):
+               feedsPath = os.path.join(configPath, "personalFeeds")
+               with wx.DirDialog(self,
+               # Translators: the label of a dialog to select a folder.
+               _("Restore personal feeds from backup folder"),
+               feedsPath, wx.DD_DIR_MUST_EXIST  | wx.DD_DEFAULT_STYLE) as dlg:
+                       gui.mainFrame.prePopup()
+                       if dlg.ShowModal() == wx.ID_OK:
+                               gui.mainFrame.postPopup()
+                               feedsPath = dlg.GetPath()
+                               try:
+                                       shutil.rmtree(_savePath, 
ignore_errors=True)
+                                       shutil.copytree(feedsPath, _savePath)
+                               except WindowsError:
+                                       wx.CallAfter(gui.messageBox,
+                                       # Translators: the label of an error 
dialog.
+                                       _("Folder not restored"),
+                                       # Translators: the title of an error 
dialog.
+                                       _("Restore Error"),
+                                       wx.OK|wx.ICON_ERROR)

diff --git a/addon/installTasks.py b/addon/installTasks.py
index 822b9f6..48e6c1b 100644
--- a/addon/installTasks.py
+++ b/addon/installTasks.py
@@ -1,5 +1,3 @@
-# -*- coding: UTF-8 -*-
-
 import addonHandler
 import globalVars
 import os

diff --git a/buildVars.py b/buildVars.py
index 1b95e82..83ad354 100644
--- a/buildVars.py
+++ b/buildVars.py
@@ -19,7 +19,7 @@ addon_info = {
        # Translators: Long description to be shown for this add-on on add-on 
information from add-ons manager
        "addon_description" : _("""Add-on for using NVDA as a feed reader."""),
        # version
-       "addon_version" : "2.6",
+       "addon_version" : "2.7",
        # Author(s)
        "addon_author" : u"Noelia Ruiz Martínez <nrm1977@xxxxxxxxx>, Mesar 
Hameed <mhameed@xxxxxxxxxxxxx>",
        # URL for the add-on documentation support

diff --git a/readme.md b/readme.md
index 0e4d7db..a9b3c12 100644
--- a/readme.md
+++ b/readme.md
@@ -58,6 +58,9 @@ Announces next feed title.
 - NVDA will display an error message if it was not possible to backup the 
personalFeeds folder.
 - The title of the article list dialog displays the selected feed name and 
number of items available.
 
+## Changes for 3.0 ##
+*       Removed ReadFeeds item from NVDA's help menu.
+
 ## Changes for 2.0 ##
 *       Add-on help is available from the Add-ons Manager.

Repository URL: https://bitbucket.org/nvdaaddonteam/readfeeds/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.

Other related posts:

  • » commit/readFeeds: josephsl: Merged master, L10N updates - commits-noreply