From 62c4d416692bf1f83a4bdef721c3d12029d262dd Mon Sep 17 00:00:00 2001 From: Ilya Zhuravlev Date: Sun, 4 Jul 2021 22:54:10 -0400 Subject: [PATCH] main_window: add "about vial" menu --- src/build/settings/base.json | 2 +- src/main/python/main_window.py | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/build/settings/base.json b/src/build/settings/base.json index 6c3140d..cc69792 100644 --- a/src/build/settings/base.json +++ b/src/build/settings/base.json @@ -2,5 +2,5 @@ "app_name": "Vial", "author": "xyz", "main_module": "src/main/python/main.py", - "version": "0.0.0" + "version": "0.4" } \ No newline at end of file diff --git a/src/main/python/main_window.py b/src/main/python/main_window.py index 678bcc4..64da576 100644 --- a/src/main/python/main_window.py +++ b/src/main/python/main_window.py @@ -194,6 +194,11 @@ class MainWindow(QMainWindow): if theme_group.checkedAction() is None: theme_group.actions()[0].setChecked(True) + about_vial_act = QAction(tr("MenuAbout", "About Vial..."), self) + about_vial_act.triggered.connect(self.about_vial) + self.about_menu = self.menuBar().addMenu(tr("Menu", "About")) + self.about_menu.addAction(about_vial_act) + def on_layout_load(self): dialog = QFileDialog() dialog.setDefaultSuffix("vil") @@ -362,3 +367,13 @@ class MainWindow(QMainWindow): new_tab.editor.activate() self.current_tab = new_tab + + def about_vial(self): + QMessageBox.about( + self, + "About Vial", + 'Vial {}

' + 'Licensed under the terms of the
GNU General Public License (version 2 or later)

' + 'https://get.vial.today/' + .format(self.appctx.build_settings["version"]) + )