Skip to content

Commit 9327f3c

Browse files
committed
Add about dialog
Closes #120.
1 parent d484231 commit 9327f3c

2 files changed

Lines changed: 28 additions & 1 deletion

File tree

src/petab_gui/controllers/mother_controller.py

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import tempfile
55
import zipfile
66
from functools import partial
7+
from importlib.metadata import version
78
from io import BytesIO
89
from pathlib import Path
910

@@ -164,7 +165,7 @@ def window_title(self):
164165
"""Return the window title based on the model."""
165166
if isinstance(self.model.sbml, SbmlViewerModel):
166167
return self.model.sbml.model_id
167-
return "PEtab Editor"
168+
return "PEtabGUI"
168169

169170
def setup_context_menu(self):
170171
"""Sets up context menus for the tables."""
@@ -438,6 +439,12 @@ def setup_actions(self):
438439
self._whats_this_filter = _WhatsThisClickHelp(actions["whats_this"])
439440
actions["whats_this"].toggled.connect(self._toggle_whats_this_mode)
440441

442+
# About action
443+
actions["about"] = QAction(
444+
qta.icon("mdi6.information"), "&About", self.view
445+
)
446+
actions["about"].triggered.connect(self.about)
447+
441448
# connect actions
442449
actions["reset_view"] = QAction(
443450
qta.icon("mdi6.view-grid-plus"), "Reset View", self.view
@@ -1150,3 +1157,22 @@ def _show_help_welcome(self):
11501157
msg.exec()
11511158
if dont.isChecked():
11521159
settings.setValue("help_mode/welcome_disabled", True)
1160+
1161+
def about(self):
1162+
"""Show an about dialog."""
1163+
repo_url = "https://github.com/PaulJonasJost/PEtab_GUI"
1164+
config_file = settings_manager.settings.fileName()
1165+
QMessageBox.about(
1166+
self.view,
1167+
"About PEtabGUI",
1168+
f"<b>PEtabGUI</b><br>"
1169+
f"Version: {version('petab-gui')}<br>"
1170+
f"PEtab version: {version('petab')}<br><br>"
1171+
f"PEtabGUI is a tool for editing and visualizing PEtab "
1172+
f"problems.<br><br>"
1173+
f"Visit the GitHub repository at "
1174+
f"<a href='{repo_url}'>{repo_url}</a> "
1175+
"for more information.<br><br>"
1176+
f"<small>Settings are stored in "
1177+
f"<a href='file://{config_file}'>{config_file}</a></small>",
1178+
)

src/petab_gui/views/task_bar.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ def __init__(self, parent, actions):
137137
# Add actions to the menu for re-adding tables
138138
self.menu.addAction(actions["open_documentation"])
139139
self.menu.addAction(actions["whats_this"])
140+
self.menu.addAction(actions["about"])
140141

141142

142143
class TaskBar:

0 commit comments

Comments
 (0)