Skip to content

Commit

Permalink
setting to export config variable as topping
Browse files Browse the repository at this point in the history
  • Loading branch information
signedav committed Dec 3, 2024
1 parent e5b6232 commit 0f863c3
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 35 deletions.
9 changes: 9 additions & 0 deletions QgisModelBaker/gui/topping_wizard/additives_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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)
Expand Down
77 changes: 42 additions & 35 deletions QgisModelBaker/ui/topping_wizard/additives.ui
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,40 @@
<string>Select Files</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="3" column="0" colspan="2">
<widget class="QLabel" name="variables_label">
<property name="text">
<string>Custom Project Variables</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="SpaceCheckListView" name="variables_view" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="7" column="0" colspan="2">
<widget class="SpaceCheckListView" name="layouts_view" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="layouts_label">
<property name="text">
<string>Print Layouts (exported as templates)</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="description">
<property name="minimumSize">
Expand All @@ -39,35 +73,15 @@
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="SpaceCheckListView" name="mapthemes_view" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QLabel" name="variables_label">
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="mapthemes_label">
<property name="text">
<string>Custom Project Variables</string>
</property>
</widget>
</item>
<item row="6" column="0" colspan="2">
<widget class="SpaceCheckListView" name="layouts_view" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<string>Map Themes</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="SpaceCheckListView" name="variables_view" native="true">
<item row="2" column="0" colspan="2">
<widget class="SpaceCheckListView" name="mapthemes_view" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
Expand All @@ -76,17 +90,10 @@
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="layouts_label">
<item row="5" column="0" colspan="2">
<widget class="QCheckBox" name="validatortopping_checkbox">
<property name="text">
<string>Print Layouts (exported as templates)</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="mapthemes_label">
<property name="text">
<string>Map Themes</string>
<string>Convert validation configuration file to topping file</string>
</property>
</widget>
</item>
Expand Down

0 comments on commit 0f863c3

Please sign in to comment.