Skip to content

Commit

Permalink
Application: Add "Help Spyder" entry to the Help menu
Browse files Browse the repository at this point in the history
This will help users to find where to donate in our interface in case
they miss the heart hint we show in the status bar.
  • Loading branch information
ccordoba12 committed Oct 20, 2024
1 parent 2fe945e commit 581ce15
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
8 changes: 8 additions & 0 deletions spyder/plugins/application/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class ApplicationActions:
SpyderTroubleshootingAction = "spyder_troubleshooting_action"
SpyderDependenciesAction = "spyder_dependencies_action"
SpyderSupportAction = "spyder_support_action"
HelpSpyderAction = "help_spyder_action"
SpyderAbout = "spyder_about_action"

# Tools
Expand Down Expand Up @@ -137,6 +138,13 @@ def setup(self):
_("Spyder support..."),
triggered=lambda: start_file(__forum_url__))

self.create_action(
ApplicationActions.HelpSpyderAction,
_("Help Spyder..."),
icon=self.create_icon("inapp_appeal"),
triggered=self.inapp_appeal_status.show_appeal
)

# About action
self.about_action = self.create_action(
ApplicationActions.SpyderAbout,
Expand Down
11 changes: 8 additions & 3 deletions spyder/plugins/application/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,18 @@ def _populate_help_menu_support_section(self):
"""Add Spyder base support actions to the Help main menu."""
mainmenu = self.get_plugin(Plugins.MainMenu)
for support_action in [
self.trouble_action, self.report_action,
self.dependencies_action, self.support_group_action]:
self.trouble_action,
self.report_action,
self.dependencies_action,
self.support_group_action,
self.get_action(ApplicationActions.HelpSpyderAction),
]:
mainmenu.add_item_to_application_menu(
support_action,
menu_id=ApplicationMenus.Help,
section=HelpMenuSections.Support,
before_section=HelpMenuSections.ExternalDocumentation)
before_section=HelpMenuSections.ExternalDocumentation
)

def _populate_help_menu_about_section(self):
"""Create Spyder base about actions."""
Expand Down
2 changes: 2 additions & 0 deletions spyder/plugins/application/widgets/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ def _on_click(self):
def show_appeal(self):
if self._appeal_dialog is None:
self._appeal_dialog = InAppAppealDialog(self)

if not self._appeal_dialog.isVisible():
self._appeal_dialog.show()

# ---- StatusBarWidget API
Expand Down

0 comments on commit 581ce15

Please sign in to comment.