Skip to content

Commit 1e67a6b

Browse files
Added a help tasbar, currently only pointing to the readthedocs. Mine automatically had a search function, so i did not specifically add this. Is this true for windows as well? (#68)
1 parent f7e75c4 commit 1e67a6b

2 files changed

Lines changed: 28 additions & 2 deletions

File tree

src/petab_gui/controllers/mother_controller.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from PySide6.QtWidgets import QMessageBox, QFileDialog, QLineEdit, QWidget, \
44
QHBoxLayout, QToolButton, QTableView
5-
from PySide6.QtGui import QAction
5+
from PySide6.QtGui import QAction, QDesktopServices
66
import zipfile
77
import tempfile
88
import os
@@ -11,7 +11,7 @@
1111
import yaml
1212
import qtawesome as qta
1313
from ..utils import FindReplaceDialog, CaptureLogHandler, process_file
14-
from PySide6.QtCore import Qt
14+
from PySide6.QtCore import Qt, QUrl
1515
from pathlib import Path
1616
from ..models import PEtabModel
1717
from .sbml_controller import SbmlController
@@ -367,6 +367,18 @@ def setup_actions(self):
367367
)
368368
actions["clear_log"].triggered.connect(self.logger.clear_log)
369369

370+
# Opening the PEtab documentation
371+
actions["open_documentation"] = QAction(
372+
qta.icon("mdi6.web"),
373+
"View PEtab Documentation", self.view
374+
)
375+
actions["open_documentation"].triggered.connect(
376+
lambda: QDesktopServices.openUrl(QUrl(
377+
"https://petab.readthedocs.io/en/latest/v1/"
378+
"documentation_data_format.html"
379+
))
380+
)
381+
370382
return actions
371383

372384
def save_model(self):

src/petab_gui/views/task_bar.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,19 @@ def __init__(self, parent, actions):
109109
self.menu.addAction(actions["clear_log"])
110110

111111

112+
class HelpMenu(BasicMenu):
113+
"""Help Menu of the TaskBar."""
114+
def menu_name(self):
115+
return "&Help"
116+
117+
def __init__(self, parent, actions):
118+
super().__init__(parent, actions)
119+
120+
# Add actions to the menu for re-adding tables
121+
self.menu.addAction(actions["open_documentation"])
122+
123+
124+
112125
class TaskBar:
113126
"""TaskBar of the PEtab Editor."""
114127
def add_menu(self, menu_class, actions):
@@ -123,3 +136,4 @@ def __init__(self, parent, actions):
123136
self.file_menu = self.add_menu(FileMenu, actions)
124137
self.edit_menu = self.add_menu(EditMenu, actions)
125138
self.view_menu = self.add_menu(ViewMenu, actions)
139+
self.help_menu = self.add_menu(HelpMenu, actions)

0 commit comments

Comments
 (0)