|
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 |
|
|
32 | 33 | QWidget, |
33 | 34 | ) |
34 | 35 |
|
| 36 | +from ..C import APP_NAME, REPO_URL |
35 | 37 | from ..models import PEtabModel, SbmlViewerModel |
36 | 38 | from ..settings_manager import SettingsDialog, settings_manager |
37 | 39 | from ..utils import ( |
@@ -164,7 +166,7 @@ def window_title(self): |
164 | 166 | """Return the window title based on the model.""" |
165 | 167 | if isinstance(self.model.sbml, SbmlViewerModel): |
166 | 168 | return self.model.sbml.model_id |
167 | | - return "PEtab Editor" |
| 169 | + return APP_NAME |
168 | 170 |
|
169 | 171 | def setup_context_menu(self): |
170 | 172 | """Sets up context menus for the tables.""" |
@@ -438,6 +440,12 @@ def setup_actions(self): |
438 | 440 | self._whats_this_filter = _WhatsThisClickHelp(actions["whats_this"]) |
439 | 441 | actions["whats_this"].toggled.connect(self._toggle_whats_this_mode) |
440 | 442 |
|
| 443 | + # About action |
| 444 | + actions["about"] = QAction( |
| 445 | + qta.icon("mdi6.information"), "&About", self.view |
| 446 | + ) |
| 447 | + actions["about"].triggered.connect(self.about) |
| 448 | + |
441 | 449 | # connect actions |
442 | 450 | actions["reset_view"] = QAction( |
443 | 451 | qta.icon("mdi6.view-grid-plus"), "Reset View", self.view |
@@ -1158,6 +1166,24 @@ def _show_help_welcome(self): |
1158 | 1166 | if dont.isChecked(): |
1159 | 1167 | settings.setValue("help_mode/welcome_disabled", True) |
1160 | 1168 |
|
| 1169 | + def about(self): |
| 1170 | + """Show an about dialog.""" |
| 1171 | + config_file = settings_manager.settings.fileName() |
| 1172 | + QMessageBox.about( |
| 1173 | + self.view, |
| 1174 | + f"About {APP_NAME}", |
| 1175 | + f"<b>{APP_NAME}</b><br>" |
| 1176 | + f"Version: {version('petab-gui')}<br>" |
| 1177 | + f"PEtab version: {version('petab')}<br><br>" |
| 1178 | + f"{APP_NAME} is a tool for editing and visualizing PEtab " |
| 1179 | + f"problems.<br><br>" |
| 1180 | + f"Visit the GitHub repository at " |
| 1181 | + f"<a href='{REPO_URL}'>{REPO_URL}</a> " |
| 1182 | + "for more information.<br><br>" |
| 1183 | + f"<small>Settings are stored in " |
| 1184 | + f"<a href='file://{config_file}'>{config_file}</a></small>", |
| 1185 | + ) |
| 1186 | + |
1161 | 1187 | def get_current_problem(self): |
1162 | 1188 | """Get the current PEtab problem from the model.""" |
1163 | 1189 | return self.model.current_petab_problem |
0 commit comments