Skip to content

Free Motion Capture for Everyone πŸ’€βœ¨

TypeScript

Add help and support menus (#359)

philipqueen89db91623858
diff --git a/freemocap/gui/qt/actions_and_menus/actions.py b/freemocap/gui/qt/actions_and_menus/actions.py
index fdad2781..f4b62f38 100644
--- a/freemocap/gui/qt/actions_and_menus/actions.py
+++ b/freemocap/gui/qt/actions_and_menus/actions.py
@@ -1,4 +1,5 @@
-from PyQt6.QtGui import QAction
+from PyQt6.QtGui import QAction, QDesktopServices
+from PyQt6.QtCore import QUrl
CREATE_NEW_RECORDING_ACTION_NAME = "New Recording"
@@ -9,6 +10,11 @@ KILL_THREADS_AND_PROCESSES_ACTION_NAME = "Kill Threads and Processes"
REBOOT_GUI_ACTION_NAME = "Reboot GUI"
EXIT_ACTION_NAME = "Exit"
+OPEN_DOCS_ACTION_NAME = "Open Documentation"
+FREEMOCAP_FOUNDATION_ACTION_NAME = "Freemocap Foundation"
+
+DONATE_ACTION_NAME = "Donate to Freemocap"
+
class Actions:
def __init__(self, freemocap_main_window):
@@ -49,10 +55,13 @@ class Actions:
self.exit_action.setShortcut("Ctrl+Q")
self.exit_action.triggered.connect(freemocap_main_window.close)
- # # Help
- # open_docs_action = QAction("Open &Documentation", parent=main_window)
- # about_us_action = QAction("&About Us", parent=main_window)
- #
+ # Help
+ self.open_docs_action = QAction(OPEN_DOCS_ACTION_NAME, parent=freemocap_main_window)
+ self.open_docs_action.triggered.connect(lambda: QDesktopServices.openUrl(QUrl("https://freemocap.readthedocs.io/en/latest/")))
+
+ self.freemocap_foundation_action = QAction(FREEMOCAP_FOUNDATION_ACTION_NAME, parent=freemocap_main_window)
+ self.freemocap_foundation_action.triggered.connect(lambda: QDesktopServices.openUrl(QUrl("https://freemocap.org/about-us.html")))
+
# # Navigation
# show_camera_control_panel_action = QAction("&1 - Show Camera Control Panel", parent=main_window)
# show_camera_control_panel_action.setShortcut("Ctrl+1")
@@ -65,7 +74,8 @@ class Actions:
# show_motion_capture_videos_panel_action = QAction("&3 - Show Motion Capture Videos Panel", parent=main_window)
# show_motion_capture_videos_panel_action.setShortcut("Ctrl+3")
#
- # # Support
- # donate_action = QAction("&Donate", parent=main_window)
- # send_usage_statistics_action = QAction("Send &User Statistics", parent=main_window)
- # user_survey_action = QAction("&User Survey", parent=main_window)
+ # Support
+ self.donate_action = QAction(DONATE_ACTION_NAME, parent=freemocap_main_window)
+ self.donate_action.triggered.connect(lambda: QDesktopServices.openUrl(QUrl("https://freemocap.org/about-us.html#donate")))
+ # self.send_usage_statistics_action = QAction("Send &User Statistics", parent=freemocap_main_window)
+ # self.user_survey_action = QAction("&User Survey", parent=freemocap_main_window)
diff --git a/freemocap/gui/qt/actions_and_menus/menu_bar.py b/freemocap/gui/qt/actions_and_menus/menu_bar.py
index d3499568..03427d2f 100644
--- a/freemocap/gui/qt/actions_and_menus/menu_bar.py
+++ b/freemocap/gui/qt/actions_and_menus/menu_bar.py
@@ -1,5 +1,4 @@
from PyQt6.QtWidgets import QMainWindow, QMenuBar
-
from freemocap.gui.qt.actions_and_menus.actions import Actions
@@ -33,24 +32,18 @@ class MenuBar(QMenuBar):
# navigation_menu.addAction(self._show_calibrate_capture_volume_panel_action)
# navigation_menu.addAction(self._show_motion_capture_videos_panel_action)
#
- # # help menu
- # help_menu = QMenu("&Help", parent=self)
- # self.addMenu(help_menu)
- # help_menu.setEnabled(False)
- #
- # help_menu.addAction(self._open_docs_action)
- # help_menu.addAction(self._about_us_action)
- #
- # # support menu
- # support_menu = QMenu(
- # "\U00002665 &Support the FreeMoCap Project", parent=self
- # )
- # support_menu.setEnabled(False)
- # self.addMenu(support_menu)
+ # help menu
+ help_menu = self.addMenu("&Help")
+
+ help_menu.addAction(actions.open_docs_action)
+ help_menu.addAction(actions.freemocap_foundation_action)
#
- # support_menu.addAction(self._donate_action)
- # support_menu.addAction(self._send_usage_statistics_action)
- # support_menu.addAction(self._user_survey_action)
+ # support menu
+ support_menu = self.addMenu("&Support the Freemocap Project")
+
+ support_menu.addAction(actions.donate_action)
+ # support_menu.addAction(actions.send_usage_statistics_action)
+ # support_menu.addAction(actions.user_survey_action)
if __name__ == "__main__":