commit/StationPlaylist: josephsl: Welcome dialog (8.0-dev/LTS): Present a welcome dialog similar to how NVDA Core does when ran for the first time.

  • From: commits-noreply@xxxxxxxxxxxxx
  • To: nvda-addons-commits@xxxxxxxxxxxxx
  • Date: Mon, 28 Mar 2016 18:48:38 -0000

1 new commit in StationPlaylist:

https://bitbucket.org/nvdaaddonteam/stationplaylist/commits/4138ec187e4a/
Changeset:   4138ec187e4a
Branch:      8.0/welcomeDialog
User:        josephsl
Date:        2016-03-28 18:47:52+00:00
Summary:     Welcome dialog (8.0-dev/LTS): Present a welcome dialog similar to 
how NVDA Core does when ran for the first time.

To introduce new users to the operation of the Studio add-on, a welcome dialog 
has been added that presents add-on highlights, layer commands and more. So 
far, it is a work in progress (it'll not be complete without adding buttons to 
read add-on readme and such). Also added a command (Alt+NVDA+F1) to open this 
dialog in case it was dismissed.
Due to work involved and to receive feedback from people, this is destined for 
add-on 8 and 7.x LTS.

Affected #:  2 files

diff --git a/addon/appModules/splstudio/__init__.py 
b/addon/appModules/splstudio/__init__.py
index c11ff07..4ab6969 100755
--- a/addon/appModules/splstudio/__init__.py
+++ b/addon/appModules/splstudio/__init__.py
@@ -874,13 +874,20 @@ class AppModule(appModuleHandler.AppModule):
        # Translators: Input help mode message for a command in Station 
Playlist Studio.
        script_setMicAlarm.__doc__=_("Sets microphone alarm (default is 5 
seconds).")
 
-       # SPL Config management.
+       # SPL Config management among others.
 
        def script_openConfigDialog(self, gesture):
                wx.CallAfter(splconfui.onConfigDialog, None)
        # Translators: Input help mode message for a command in Station 
Playlist Studio.
        script_openConfigDialog.__doc__=_("Opens SPL Studio add-on 
configuration dialog.")
 
+       def script_openWelcomeDialog(self, gesture):
+               gui.mainFrame.prePopup()
+               splconfig.WelcomeDialog(gui.mainFrame).Show()
+               gui.mainFrame.postPopup()
+       # Translators: Input help mode message for a command in Station 
Playlist Studio.
+       script_openWelcomeDialog.__doc__=_("Opens SPL Studio add-on welcome 
dialog.")
+
        # Other commands (track finder and others)
 
        # Toggle whether beeps should be heard instead of toggle announcements.
@@ -1816,6 +1823,7 @@ class AppModule(appModuleHandler.AppModule):
                "kb:control+shift+r":"startScanFromInsertTracks",
                "kb:control+shift+x":"setBrailleTimer",
                "kb:control+NVDA+0":"openConfigDialog",
+               "kb:alt+NVDA+f1":"openWelcomeDialog",
                "kb:Shift+delete":"deleteTrack",
                "kb:Shift+numpadDelete":"deleteTrack",
                "kb:escape":"escape",

diff --git a/addon/appModules/splstudio/splconfig.py 
b/addon/appModules/splstudio/splconfig.py
index 5ec02a0..f8624bc 100755
--- a/addon/appModules/splstudio/splconfig.py
+++ b/addon/appModules/splstudio/splconfig.py
@@ -63,6 +63,7 @@ ProfileTriggerThreshold = integer(min=5, max=60, default=15)
 AutoUpdateCheck = boolean(default=true)
 [Startup]
 AudioDuckingReminder = boolean(default=true)
+WelcomeDialog = boolean(default=true)
 """), encoding="UTF-8", list_values=False)
 confspec7.newlines = "\r\n"
 SPLConfig = None
@@ -895,8 +896,65 @@ class AudioDuckingReminder(wx.Dialog):
                        SPLConfig["Startup"]["AudioDuckingReminder"] = not 
self.audioDuckingReminder.Value
                self.Destroy()
 
+# Welcome dialog (emulating NvDA Core)
+class WelcomeDialog(wx.Dialog):
+
+       # Translators: A message giving basic information about the add-on.
+       welcomeMessage=_("""Welcome to StationPlaylist Studio add-on for NVDA,
+your companion to broadcasting with SPL Studio using NVDA screen reader.
+
+Highlights of StationPlaylist Studio add-on include:
+* Layer commands for obtaining status information.
+* Various ways to examine track columns.
+* Various ways to find tracks.
+* Cart Explorer to learn cart assignments.
+* Comprehensive settings and documentation.
+* Check for add-on updates automatically or manually.
+* Completely free, open-source and community-driven.
+* And much more.
+
+Visit www.stationplaylist.com for details on StationPlaylist Studio.
+Visit StationPlaylist entry on NVDA Community Add-ons page 
(addons.nvda-project.org) for more information on the add-on and to read the 
documentation.
+Want to see this dialog again? Just press Alt+NVDA+F1 while using Studio to 
return to this dialog.
+Have something to say about the add-on? Press Control+NVDA+hyphen (-) to send 
a feedback to the developer of this add-on using your default email program.
+
+Thank you.""")
+
+       def __init__(self, parent):
+               # Translators: Title of a dialog displayed when the add-on 
starts presenting basic information, similar to NVDA's own welcome dialog.
+               super(WelcomeDialog, self).__init__(parent, title=_("Welcome to 
StationPlaylist Studio add-on"))
+
+               mainSizer = wx.BoxSizer(wx.VERTICAL)
+
+               label = wx.StaticText(self, wx.ID_ANY, 
label=self.welcomeMessage)
+               mainSizer.Add(label,border=20,flag=wx.LEFT|wx.RIGHT|wx.TOP)
+
+               sizer = wx.BoxSizer(wx.HORIZONTAL)
+               # Translators: A checkbox to turn off welcome dialog.
+               self.showWelcomeDialog=wx.CheckBox(self,wx.NewId(),label=_("Do 
not show welcome dialog when I start Studio"))
+               self.showWelcomeDialog.SetValue(not 
SPLConfig["Startup"]["WelcomeDialog"])
+               sizer.Add(self.showWelcomeDialog, border=10,flag=wx.TOP)
+               mainSizer.Add(sizer, border=10, flag=wx.BOTTOM)
+
+               mainSizer.Add(self.CreateButtonSizer(wx.OK))
+               self.Bind(wx.EVT_BUTTON, self.onOk, id=wx.ID_OK)
+               mainSizer.Fit(self)
+               self.Sizer = mainSizer
+               self.showWelcomeDialog.SetFocus()
+               self.Center(wx.BOTH | wx.CENTER_ON_SCREEN)
+
+       def onOk(self, evt):
+               global SPLConfig
+               if self.showWelcomeDialog.Value:
+                       SPLConfig["Startup"]["WelcomeDialog"] = not 
self.showWelcomeDialog.Value
+               self.Destroy()
+
 # And to open the above dialog and any other dialogs.
 def showStartupDialogs():
+       if SPLConfig["Startup"]["WelcomeDialog"]:
+               gui.mainFrame.prePopup()
+               WelcomeDialog(gui.mainFrame).Show()
+               gui.mainFrame.postPopup()
        try:
                import audioDucking
                if SPLConfig["Startup"]["AudioDuckingReminder"] and 
audioDucking.isAudioDuckingSupported():

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

--

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/StationPlaylist: josephsl: Welcome dialog (8.0-dev/LTS): Present a welcome dialog similar to how NVDA Core does when ran for the first time. - commits-noreply