OSDN Git Service

Initial work on dialog to alert users about the new laptop layout. The dialog is...
authorJames Teh <jamie@jantrid.net>
Mon, 4 Feb 2013 02:11:30 +0000 (12:11 +1000)
committerJames Teh <jamie@jantrid.net>
Mon, 4 Feb 2013 02:11:30 +0000 (12:11 +1000)
source/gui/upgradeAlerts.py [new file with mode: 0644]

diff --git a/source/gui/upgradeAlerts.py b/source/gui/upgradeAlerts.py
new file mode 100644 (file)
index 0000000..b2f9c0d
--- /dev/null
@@ -0,0 +1,52 @@
+#upgradeAlerts.py\r
+#A part of NonVisual Desktop Access (NVDA)\r
+#Copyright (C) 2013 NV Access Limited\r
+#This file is covered by the GNU General Public License.\r
+#See the file COPYING for more details.\r
+\r
+"""Dialogs displayed when NVDA starts containing important information about changes to NVDA.\r
+"""\r
+\r
+import os\r
+import wx\r
+import gui\r
+\r
+class NewLaptopLayout(wx.Dialog):\r
+       MESSAGE = _(\r
+               # Translators: Information about NVDA's new laptop keyboard layout.\r
+               "In NVDA 2013.1, the laptop keyboard layout has been completely redesigned in order to make it more intuitive and consistent.\n"\r
+               "If you use the laptop layout, please see the What's New document for more information."\r
+       )\r
+\r
+       def __init__(self, parent):\r
+               # Translators: The title of a dialog providing information about NVDA's new laptop keyboard layout.\r
+               super(NewLaptopLayout, self).__init__(parent, title=_("New Laptop Keyboard layout"))\r
+               mainSizer = wx.BoxSizer(wx.VERTICAL)\r
+               item = wx.StaticText(self, label=self.MESSAGE)\r
+               mainSizer.Add(item, border=20, flag=wx.LEFT | wx.RIGHT | wx.TOP)\r
+               # Translators: The label of a button in the New Laptop Keyboard Layout dialog\r
+               # to open the What's New document.\r
+               whatsNewButton = wx.Button(self, label=_("Read What's New"))\r
+               whatsNewButton.Bind(wx.EVT_BUTTON, self.onWhatsNew)\r
+               mainSizer.Add(whatsNewButton)\r
+\r
+               mainSizer.Add(self.CreateButtonSizer(wx.OK),flag=wx.TOP|wx.BOTTOM|wx.ALIGN_CENTER_HORIZONTAL,border=20)\r
+\r
+               whatsNewButton.SetFocus()\r
+               self.Sizer = mainSizer\r
+               mainSizer.Fit(self)\r
+\r
+       def onWhatsNew(self, evt):\r
+               os.startfile(gui.getDocFilePath("changes.html"))\r
+               self.Close()\r
+\r
+       @classmethod\r
+       def run(cls):\r
+               """Prepare and display an instance of this dialog.\r
+               This does not require the dialog to be instantiated.\r
+               """\r
+               gui.mainFrame.prePopup()\r
+               d = cls(gui.mainFrame)\r
+               d.ShowModal()\r
+               d.Destroy()\r
+               gui.mainFrame.postPopup()\r