|
4 | 4 | import tempfile |
5 | 5 | import zipfile |
6 | 6 | from functools import partial |
| 7 | +from importlib.metadata import version |
7 | 8 | from io import BytesIO |
8 | 9 | from pathlib import Path |
9 | 10 |
|
@@ -164,7 +165,7 @@ def window_title(self): |
164 | 165 | """Return the window title based on the model.""" |
165 | 166 | if isinstance(self.model.sbml, SbmlViewerModel): |
166 | 167 | return self.model.sbml.model_id |
167 | | - return "PEtab Editor" |
| 168 | + return "PEtabGUI" |
168 | 169 |
|
169 | 170 | def setup_context_menu(self): |
170 | 171 | """Sets up context menus for the tables.""" |
@@ -438,6 +439,12 @@ def setup_actions(self): |
438 | 439 | self._whats_this_filter = _WhatsThisClickHelp(actions["whats_this"]) |
439 | 440 | actions["whats_this"].toggled.connect(self._toggle_whats_this_mode) |
440 | 441 |
|
| 442 | + # About action |
| 443 | + actions["about"] = QAction( |
| 444 | + qta.icon("mdi6.information"), "&About", self.view |
| 445 | + ) |
| 446 | + actions["about"].triggered.connect(self.about) |
| 447 | + |
441 | 448 | # connect actions |
442 | 449 | actions["reset_view"] = QAction( |
443 | 450 | qta.icon("mdi6.view-grid-plus"), "Reset View", self.view |
@@ -1150,3 +1157,22 @@ def _show_help_welcome(self): |
1150 | 1157 | msg.exec() |
1151 | 1158 | if dont.isChecked(): |
1152 | 1159 | 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 | + ) |
0 commit comments