OSDN Git Service

Move donate URL into a constant in gui to avoid duplication.
authorJames Teh <jamie@jantrid.net>
Wed, 4 Apr 2012 11:44:51 +0000 (21:44 +1000)
committerJames Teh <jamie@jantrid.net>
Wed, 4 Apr 2012 11:44:51 +0000 (21:44 +1000)
source/gui/__init__.py
source/updateCheck.py

index f47f274..946844d 100644 (file)
@@ -31,6 +31,7 @@ except RuntimeError:
 ### Constants\r
 NVDA_PATH = os.getcwdu()\r
 ICON_PATH=os.path.join(NVDA_PATH, "images", "nvda.ico")\r
+DONATE_URL = "http://www.nvaccess.org/wiki/Donate"\r
 \r
 ### Globals\r
 mainFrame = None\r
@@ -345,7 +346,7 @@ class SysTrayIcon(wx.TaskBarIcon):
                if not globalVars.appArgs.secure:\r
                        self.menu.AppendSeparator()\r
                        item = self.menu.Append(wx.ID_ANY, _("Donate"))\r
-                       self.Bind(wx.EVT_MENU, lambda evt: os.startfile("http://www.nvaccess.org/wiki/Donate"), item)\r
+                       self.Bind(wx.EVT_MENU, lambda evt: os.startfile(DONATE_URL), item)\r
                self.menu.AppendSeparator()\r
                item = self.menu.Append(wx.ID_EXIT, _("E&xit"),_("Exit NVDA"))\r
                self.Bind(wx.EVT_MENU, frame.onExitCommand, item)\r
index dedc1f0..71ec6f3 100644 (file)
@@ -298,7 +298,6 @@ class DonateRequestDialog(wx.Dialog):
                "All donations are received by NV Access, the non-profit organisation which develops NVDA.\n"\r
                "Thank you for your support."\r
        )\r
-       DONATE_URL = "http://www.nvaccess.org/wiki/Donate"\r
 \r
        def __init__(self, parent, continueFunc):\r
                # Translators: The title of the dialog requesting donations from users.\r
@@ -311,7 +310,7 @@ class DonateRequestDialog(wx.Dialog):
                sizer = wx.BoxSizer(wx.HORIZONTAL)\r
                # Translators: The label of the button to donate.\r
                item = wx.Button(self, label=_("&Donate"))\r
-               item.Bind(wx.EVT_BUTTON, lambda evt: os.startfile(self.DONATE_URL))\r
+               item.Bind(wx.EVT_BUTTON, lambda evt: os.startfile(gui.DONATE_URL))\r
                sizer.Add(item)\r
                item = wx.Button(self, wx.ID_CLOSE, label=_("&Close"))\r
                item.Bind(wx.EVT_BUTTON, lambda evt: self.Close())\r