Repository: spyder-ide/spyder

Issue:
Add Tutorial Videos item to Spyder Help menu
<!--- **PLEASE READ:** When submitting here, please ensure you've completed the following checklist and checked the boxes to confirm. Issue reports without it may be closed. Thanks! --->


## Problem Description

Now that we have our tutorial video series, we should consider adding a link to the playlist as an item in the Help menu, like we have the Spyder website, docs, Troubleshooting Guide, Google Group, and various other doc sites. Maybe not right away, but hopefully for 4.2 when they are more complete.



Discussion:
This is a good point, but perhaps it'd be even better to embed our docs inside the Help pane. And that's what we're planning to do for Spyder 5.

@juanis2112, what do you think about this one?
> This is a good point, but perhaps it'd be even better to embed our docs inside the Help pane. And that's what we're planning to do for Spyder 5.

It would certainly be, without a doubt, and we could actually play the videos within the help pane assuming QWebEngine supports Youtube. However, I don't think we should wait until whenever that happens to expose one of the most useful help resources that we offer, at least in some form, considering that embedding the docs may involve several orders of magnitude more time, complexity and risk than spending a few minutes adding a simple menu item (which I can do for 4.2 or whatever the next version is, if we all agree). After all, the videos are for Spyder 4, not Spyder 5, so we may as well share them with our users now so the community gets the most benefit out of @juanis2112 's hard work.
Agreed.

Resolving patch:
diff --git a/spyder/__init__.py b/spyder/__init__.py
--- a/spyder/__init__.py
+++ b/spyder/__init__.py
@@ -35,7 +35,7 @@
 __license__ = __doc__
 __project_url__ = 'https://github.com/spyder-ide/spyder'
 __forum_url__   = 'https://groups.google.com/group/spyderlib'
-__trouble_url__ = __project_url__ + '/wiki/Troubleshooting-Guide-and-FAQ'
+__trouble_url__ = 'https://docs.spyder-ide.org/current/first-steps.html'
 __trouble_url_short__ = 'https://tinyurl.com/SpyderHelp'
 __website_url__ = 'https://www.spyder-ide.org/'
 
diff --git a/spyder/app/mainwindow.py b/spyder/app/mainwindow.py
--- a/spyder/app/mainwindow.py
+++ b/spyder/app/mainwindow.py
@@ -1049,11 +1049,12 @@ def create_edit_action(text, tr_text, icon):
         self.register_shortcut(doc_action, "_",
                                "spyder documentation")
 
-        if self.help is not None:
-            tut_action = create_action(self, _("Spyder tutorial"),
-                                       triggered=self.help.show_tutorial)
-        else:
-            tut_action = None
+        spyder_vid = ("https://www.youtube.com/playlist"
+                      "?list=PLPonohdiDqg9epClEcXoAPUiK0pN5eRoc")
+        vid_action = create_action(self, _("Tutorial videos"),
+                                   icon=ima.icon('VideoIcon'),
+                                   triggered=lambda:
+                                   programs.start_file(spyder_vid))
 
         shortcuts_action = create_action(self, _("Shortcuts Summary"),
                                          shortcut="Meta+F1",
@@ -1080,7 +1081,7 @@ def trigger(i=i, self=self):  # closure needed!
 
         self.tours_menu.addActions(self.tour_menu_actions)
 
-        self.help_menu_actions = [doc_action, tut_action, shortcuts_action,
+        self.help_menu_actions = [doc_action, vid_action, shortcuts_action,
                                   self.tours_menu,
                                   MENU_SEPARATOR, trouble_action,
                                   report_action, dep_action,
diff --git a/spyder/utils/icon_manager.py b/spyder/utils/icon_manager.py
--- a/spyder/utils/icon_manager.py
+++ b/spyder/utils/icon_manager.py
@@ -240,6 +240,7 @@
     'DialogCloseButton':       [('fa.close',), {'color': MAIN_FG_COLOR}],
     'DirClosedIcon':           [('fa.folder-o',), {'color': MAIN_FG_COLOR}],
     'DialogHelpButton':        [('fa.life-ring',), {'color': 'darkred'}],
+    'VideoIcon':               [('fa5s.video',), {'color': MAIN_FG_COLOR}],
     'MessageBoxInformation':   [('fa.info',), {'color': MAIN_FG_COLOR}],
     'DirOpenIcon':             [('fa.folder-open',), {'color': MAIN_FG_COLOR}],
     'FileIcon':                [('fa.file-o',), {'color': MAIN_FG_COLOR}],


Test patch:
diff --git a/spyder/app/tests/test_mainwindow.py b/spyder/app/tests/test_mainwindow.py
--- a/spyder/app/tests/test_mainwindow.py
+++ b/spyder/app/tests/test_mainwindow.py
@@ -2031,17 +2031,6 @@ def test_troubleshooting_menu_item_and_url(monkeypatch):
     assert MockQDesktopServices.openUrl.call_count == 1
     mockQDesktopServices_instance.openUrl.called_once_with(__trouble_url__)
 
-    # Check that the URL resolves correctly. Ignored if no internet connection.
-    try:
-        urlopen("https://www.github.com", timeout=1)
-    except Exception:
-        pass
-    else:
-        try:
-            urlopen(__trouble_url__, timeout=1)
-        except URLError:
-            raise
-
 
 @flaky(max_runs=3)
 @pytest.mark.slow