|
35 | 35 | QDialog, |
36 | 36 | QFileDialog, |
37 | 37 | QMenu, |
| 38 | + QMenuBar, |
38 | 39 | QMessageBox, |
39 | 40 | QStyle, |
40 | 41 | QTreeWidgetItem, |
|
44 | 45 | from ..core.module_version import ModuleVersion |
45 | 46 | from ..core.package_prepare_task import PackagePrepareTask |
46 | 47 | from ..libs import pgserviceparser |
47 | | -from ..libs.pum.config import PumConfig |
| 48 | +from ..libs.pum.pum_config import PumConfig |
48 | 49 | from ..libs.pum.schema_migrations import SchemaMigrations |
49 | 50 | from ..libs.pum.upgrader import Upgrader |
50 | 51 | from ..utils.plugin_utils import LoggingBridge, PluginUtils, logger |
51 | 52 | from ..utils.qt_utils import CriticalMessageBox, OverrideCursor, QtUtils |
| 53 | +from .about_dialog import AboutDialog |
52 | 54 | from .database_create_dialog import DatabaseCreateDialog |
53 | 55 | from .database_duplicate_dialog import DatabaseDuplicateDialog |
| 56 | +from .settings_dialog import SettingsDialog |
54 | 57 |
|
55 | 58 | DIALOG_UI = PluginUtils.get_ui_class("main_dialog.ui") |
56 | 59 |
|
@@ -105,6 +108,22 @@ def __init__(self, modules_config, parent=None): |
105 | 108 | self.__packagePrepareTaskProgress |
106 | 109 | ) |
107 | 110 |
|
| 111 | + # Add menubar |
| 112 | + self.menubar = QMenuBar(self) |
| 113 | + self.layout().setMenuBar(self.menubar) |
| 114 | + |
| 115 | + # Settings action |
| 116 | + settings_action = QAction(self.tr("Settings"), self) |
| 117 | + settings_action.triggered.connect(self.__open_settings_dialog) |
| 118 | + |
| 119 | + # About action |
| 120 | + about_action = QAction(self.tr("About"), self) |
| 121 | + about_action.triggered.connect(self.__show_about_dialog) |
| 122 | + |
| 123 | + # Add actions to menubar |
| 124 | + self.menubar.addAction(settings_action) |
| 125 | + self.menubar.addAction(about_action) |
| 126 | + |
108 | 127 | logger.info("Ready.") |
109 | 128 |
|
110 | 129 | def __initGuiModules(self): |
@@ -299,7 +318,7 @@ def __moduleVersionChanged(self, index): |
299 | 318 | QtUtils.resetForegroundColor(self.module_information_label) |
300 | 319 | logger.info(loading_text) |
301 | 320 |
|
302 | | - self.module_informationDemodatal_label.setText("-") |
| 321 | + self.module_informationDatamodel_label.setText("-") |
303 | 322 | self.module_informationProject_label.setText("-") |
304 | 323 | self.module_informationPlugin_label.setText("-") |
305 | 324 |
|
@@ -379,9 +398,9 @@ def __packagePrepareTaskFinished(self): |
379 | 398 |
|
380 | 399 | asset_datamodel = self.module_version_comboBox.currentData().asset_datamodel |
381 | 400 | if asset_datamodel: |
382 | | - self.module_informationDemodata_label.setText(asset_datamodel.package_dir) |
| 401 | + self.module_informationDatamodel_label.setText(asset_datamodel.package_dir) |
383 | 402 | else: |
384 | | - self.module_informationDemodata_label.setText("No asset available") |
| 403 | + self.module_informationDatamodel_label.setText("No asset available") |
385 | 404 |
|
386 | 405 | asset_project = self.module_version_comboBox.currentData().asset_project |
387 | 406 | if asset_project: |
@@ -414,7 +433,7 @@ def __packagePrepareGetPUMConfig(self): |
414 | 433 | return |
415 | 434 |
|
416 | 435 | try: |
417 | | - self.__pum_config = PumConfig.from_yaml(pumConfigFilename) |
| 436 | + self.__pum_config = PumConfig.from_yaml(pumConfigFilename, install_dependencies=True) |
418 | 437 | except Exception as exception: |
419 | 438 | CriticalMessageBox( |
420 | 439 | self.tr("Error"), |
@@ -802,3 +821,11 @@ def __logsOpenFolderClicked(self): |
802 | 821 |
|
803 | 822 | def __logsClearClicked(self): |
804 | 823 | self.logs_treeWidget.clear() |
| 824 | + |
| 825 | + def __open_settings_dialog(self): |
| 826 | + dlg = SettingsDialog(self) |
| 827 | + dlg.exec_() |
| 828 | + |
| 829 | + def __show_about_dialog(self): |
| 830 | + dialog = AboutDialog(self) |
| 831 | + dialog.exec_() |
0 commit comments