diff --git a/QgisModelBaker/gui/topping_wizard/additives_page.py b/QgisModelBaker/gui/topping_wizard/additives_page.py index 1707f9e4..c21bfcc5 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,11 +73,28 @@ 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) 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: @@ -88,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() diff --git a/QgisModelBaker/ui/topping_wizard/additives.ui b/QgisModelBaker/ui/topping_wizard/additives.ui index 2ff00358..42bc8588 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 diff --git a/scripts/package_pip_packages.sh b/scripts/package_pip_packages.sh index 99306d78..e899d827 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=(