From 173f4bbf1296b3453a720bfeb4fc6e7ba0b67e2a Mon Sep 17 00:00:00 2001 From: James Teh Date: Wed, 4 Apr 2012 21:44:51 +1000 Subject: [PATCH] Move donate URL into a constant in gui to avoid duplication. --- source/gui/__init__.py | 3 ++- source/updateCheck.py | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/gui/__init__.py b/source/gui/__init__.py index f47f27481..946844d33 100644 --- a/source/gui/__init__.py +++ b/source/gui/__init__.py @@ -31,6 +31,7 @@ except RuntimeError: ### Constants NVDA_PATH = os.getcwdu() ICON_PATH=os.path.join(NVDA_PATH, "images", "nvda.ico") +DONATE_URL = "http://www.nvaccess.org/wiki/Donate" ### Globals mainFrame = None @@ -345,7 +346,7 @@ class SysTrayIcon(wx.TaskBarIcon): if not globalVars.appArgs.secure: self.menu.AppendSeparator() item = self.menu.Append(wx.ID_ANY, _("Donate")) - self.Bind(wx.EVT_MENU, lambda evt: os.startfile("http://www.nvaccess.org/wiki/Donate"), item) + self.Bind(wx.EVT_MENU, lambda evt: os.startfile(DONATE_URL), item) self.menu.AppendSeparator() item = self.menu.Append(wx.ID_EXIT, _("E&xit"),_("Exit NVDA")) self.Bind(wx.EVT_MENU, frame.onExitCommand, item) diff --git a/source/updateCheck.py b/source/updateCheck.py index dedc1f018..71ec6f3da 100644 --- a/source/updateCheck.py +++ b/source/updateCheck.py @@ -298,7 +298,6 @@ class DonateRequestDialog(wx.Dialog): "All donations are received by NV Access, the non-profit organisation which develops NVDA.\n" "Thank you for your support." ) - DONATE_URL = "http://www.nvaccess.org/wiki/Donate" def __init__(self, parent, continueFunc): # Translators: The title of the dialog requesting donations from users. @@ -311,7 +310,7 @@ class DonateRequestDialog(wx.Dialog): sizer = wx.BoxSizer(wx.HORIZONTAL) # Translators: The label of the button to donate. item = wx.Button(self, label=_("&Donate")) - item.Bind(wx.EVT_BUTTON, lambda evt: os.startfile(self.DONATE_URL)) + item.Bind(wx.EVT_BUTTON, lambda evt: os.startfile(gui.DONATE_URL)) sizer.Add(item) item = wx.Button(self, wx.ID_CLOSE, label=_("&Close")) item.Bind(wx.EVT_BUTTON, lambda evt: self.Close()) -- 2.11.0