Skip to content

Commit 5121571

Browse files
committed
appname
1 parent 9327f3c commit 5121571

4 files changed

Lines changed: 15 additions & 7 deletions

File tree

src/petab_gui/C.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
import numpy as np
44

5+
#: Application name
6+
APP_NAME = "PEtabGUI"
7+
#: Base URL of the repository
8+
REPO_URL = "https://github.com/PaulJonasJost/PEtab_GUI"
9+
510
COLUMNS = {
611
"measurement": {
712
"observableId": {"type": np.object_, "optional": False},

src/petab_gui/app.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from PySide6.QtGui import QFileOpenEvent, QIcon
1010
from PySide6.QtWidgets import QApplication
1111

12+
from .C import APP_NAME
1213
from .controllers import MainController
1314
from .models import PEtabModel
1415
from .views import MainWindow
@@ -59,6 +60,7 @@ def __init__(self, file: str | Path = None):
5960
"""
6061
super().__init__(sys.argv)
6162

63+
self.setApplicationName(APP_NAME)
6264
self.setWindowIcon(get_icon())
6365
self.model = PEtabModel()
6466
self.view = MainWindow()
@@ -120,7 +122,7 @@ def main():
120122
except PackageNotFoundError:
121123
pkg_version = "unknown"
122124

123-
parser = argparse.ArgumentParser(description="PEtabGUI: A PEtab editor")
125+
parser = argparse.ArgumentParser(description=f"{APP_NAME}: A PEtab editor")
124126
parser.add_argument(
125127
"--version",
126128
action="version",

src/petab_gui/controllers/mother_controller.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
QWidget,
3434
)
3535

36+
from ..C import APP_NAME, REPO_URL
3637
from ..models import PEtabModel, SbmlViewerModel
3738
from ..settings_manager import SettingsDialog, settings_manager
3839
from ..utils import (
@@ -1160,18 +1161,17 @@ def _show_help_welcome(self):
11601161

11611162
def about(self):
11621163
"""Show an about dialog."""
1163-
repo_url = "https://github.com/PaulJonasJost/PEtab_GUI"
11641164
config_file = settings_manager.settings.fileName()
11651165
QMessageBox.about(
11661166
self.view,
1167-
"About PEtabGUI",
1168-
f"<b>PEtabGUI</b><br>"
1167+
f"About {APP_NAME}",
1168+
f"<b>{APP_NAME}</b><br>"
11691169
f"Version: {version('petab-gui')}<br>"
11701170
f"PEtab version: {version('petab')}<br><br>"
1171-
f"PEtabGUI is a tool for editing and visualizing PEtab "
1171+
f"{APP_NAME} is a tool for editing and visualizing PEtab "
11721172
f"problems.<br><br>"
11731173
f"Visit the GitHub repository at "
1174-
f"<a href='{repo_url}'>{repo_url}</a> "
1174+
f"<a href='{REPO_URL}'>{REPO_URL}</a> "
11751175
"for more information.<br><br>"
11761176
f"<small>Settings are stored in "
11771177
f"<a href='file://{config_file}'>{config_file}</a></small>",

src/petab_gui/views/main_view.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
QWidget,
1313
)
1414

15+
from ..C import APP_NAME
1516
from ..models.tooltips import (
1617
COND_TABLE_TOOLTIP,
1718
DATA_PLOT_TOOLTIP,
@@ -39,7 +40,7 @@ def __init__(self):
3940

4041
self.allow_close = False
4142

42-
self.setWindowTitle("PEtabGUI")
43+
self.setWindowTitle(APP_NAME)
4344
self.setGeometry(100, 100, 1200, 800)
4445

4546
# Logger: used in both tabs

0 commit comments

Comments
 (0)