From e5b6232e85ef3f5866ab9dc7d4cbd448b40f2c9e Mon Sep 17 00:00:00 2001 From: signedav Date: Tue, 3 Dec 2024 14:55:57 +0100 Subject: [PATCH 1/4] jump to next page if no additive settings in current project --- QgisModelBaker/gui/topping_wizard/additives_page.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/QgisModelBaker/gui/topping_wizard/additives_page.py b/QgisModelBaker/gui/topping_wizard/additives_page.py index 1707f9e48..26d291f46 100644 --- a/QgisModelBaker/gui/topping_wizard/additives_page.py +++ b/QgisModelBaker/gui/topping_wizard/additives_page.py @@ -76,6 +76,16 @@ def initializePage(self) -> None: self.layouts_model.refresh_stringlist(layout_names) self.layouts_view.setVisible(self.layouts_model.rowCount()) self.layouts_label.setVisible(self.layouts_model.rowCount()) + + if not ( + self.mapthemes_model.rowCount() + or self.variables_model.rowCount() + or self.layouts_model.rowCount() + ): + self.topping_wizard.log_panel.print_info( + self.tr("No additive settings - go on...") + ) + self.topping_wizard.next() return super().initializePage() def validatePage(self) -> bool: From 0f863c367a4f2db93775f148cc052f086cf311d0 Mon Sep 17 00:00:00 2001 From: signedav Date: Tue, 3 Dec 2024 15:57:40 +0100 Subject: [PATCH 2/4] setting to export config variable as topping --- .../gui/topping_wizard/additives_page.py | 9 +++ QgisModelBaker/ui/topping_wizard/additives.ui | 77 ++++++++++--------- 2 files changed, 51 insertions(+), 35 deletions(-) diff --git a/QgisModelBaker/gui/topping_wizard/additives_page.py b/QgisModelBaker/gui/topping_wizard/additives_page.py index 26d291f46..c693ec3dd 100644 --- a/QgisModelBaker/gui/topping_wizard/additives_page.py +++ b/QgisModelBaker/gui/topping_wizard/additives_page.py @@ -27,6 +27,8 @@ VARIABLE_PREFIX_BLACKLIST = ["default_basket", "optimize_strategy"] +VALIDATION_VARIABLE = "validator_config" + class AdditivesPage(QWizardPage, PAGE_UI): def __init__(self, parent, title): @@ -71,6 +73,13 @@ def initializePage(self) -> None: self.variables_view.setVisible(self.variables_model.rowCount()) self.variables_label.setVisible(self.variables_model.rowCount()) + if VALIDATION_VARIABLE in self.variables_model.stringList(): + self.validatortopping_checkbox.setVisible(True) + self.validatortopping_checkbox.setChecked(True) + else: + self.validatortopping_checkbox.setVisible(False) + self.validatortopping_checkbox.setChecked(False) + layout_manager = QgsProject.instance().layoutManager() layout_names = [layout.name() for layout in layout_manager.printLayouts()] self.layouts_model.refresh_stringlist(layout_names) diff --git a/QgisModelBaker/ui/topping_wizard/additives.ui b/QgisModelBaker/ui/topping_wizard/additives.ui index 2ff003586..42bc85889 100644 --- a/QgisModelBaker/ui/topping_wizard/additives.ui +++ b/QgisModelBaker/ui/topping_wizard/additives.ui @@ -14,6 +14,40 @@ Select Files + + + + Custom Project Variables + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + + + + + Print Layouts (exported as templates) + + + @@ -39,35 +73,15 @@ - - - - - 0 - 0 - - - - - - + + - Custom Project Variables - - - - - - - - 0 - 0 - + Map Themes - - + + 0 @@ -76,17 +90,10 @@ - - + + - Print Layouts (exported as templates) - - - - - - - Map Themes + Convert validation configuration file to topping file From 5f9d2ec5c45ff1acc82dbcc6f6c3ef065c0cc9ec Mon Sep 17 00:00:00 2001 From: signedav Date: Thu, 5 Dec 2024 17:36:43 +0100 Subject: [PATCH 3/4] pass path variables if required --- QgisModelBaker/gui/topping_wizard/additives_page.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/QgisModelBaker/gui/topping_wizard/additives_page.py b/QgisModelBaker/gui/topping_wizard/additives_page.py index c693ec3dd..c21bfcc5a 100644 --- a/QgisModelBaker/gui/topping_wizard/additives_page.py +++ b/QgisModelBaker/gui/topping_wizard/additives_page.py @@ -107,4 +107,8 @@ def validatePage(self) -> bool: self.topping_wizard.topping.export_settings.layouts = ( self.layouts_model.checked_entries() ) + if self.validatortopping_checkbox.isChecked(): + self.topping_wizard.topping.export_settings.path_variables = [ + VALIDATION_VARIABLE + ] return super().validatePage() From b063c7f1901d6776b7e4ca80c7eb23062f259976 Mon Sep 17 00:00:00 2001 From: signedav Date: Tue, 10 Dec 2024 09:29:15 +0100 Subject: [PATCH 4/4] bump modelbaker to 1.9.6 to get toppingmaker 1.6.0 --- scripts/package_pip_packages.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/package_pip_packages.sh b/scripts/package_pip_packages.sh index 99306d782..e899d8273 100755 --- a/scripts/package_pip_packages.sh +++ b/scripts/package_pip_packages.sh @@ -1,7 +1,7 @@ #!/bin/bash LIBS_DIR="QgisModelBaker/libs" -MODELBAKER_LIBRARY=("modelbaker" "1.9.5") +MODELBAKER_LIBRARY=("modelbaker" "1.9.6") PACKAGING=("packaging" "21.3") PACKAGES=(