Skip to content

Commit

Permalink
Merge pull request #767 from opengisch/additives_finetune
Browse files Browse the repository at this point in the history
Finetune on Additives GUI and bump modelbaker
  • Loading branch information
signedav authored Dec 8, 2022
2 parents 713f751 + 7472d66 commit d2b03e8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
18 changes: 15 additions & 3 deletions QgisModelBaker/gui/topping_wizard/additives_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

PAGE_UI = gui_utils.get_ui_class("topping_wizard/additives.ui")

VARIABLE_PREFIX_BLACKLIST = ["default_basket"]


class AdditivesPage(QWizardPage, PAGE_UI):
def __init__(self, parent, title):
Expand Down Expand Up @@ -56,19 +58,29 @@ def initializePage(self) -> None:
maptheme_collection = QgsProject.instance().mapThemeCollection()
self.mapthemes_model.setStringList(maptheme_collection.mapThemes())
self.mapthemes_model.check_all(Qt.Checked)
self.mapthemes_view.setEnabled(self.mapthemes_model.rowCount())
self.mapthemes_view.setVisible(self.mapthemes_model.rowCount())
self.mapthemes_label.setVisible(self.mapthemes_model.rowCount())

variables_keys = []
variables_keys = QgsProject.instance().customVariables().keys()
for blacklisted_prefix in VARIABLE_PREFIX_BLACKLIST:
variables_keys = [
variable_key
for variable_key in variables_keys
if blacklisted_prefix not in variable_key
]

self.variables_model.setStringList(variables_keys)
self.variables_model.check_all(Qt.Checked)
self.mapthemes_view.setEnabled(self.variables_model.rowCount())
self.variables_view.setVisible(self.variables_model.rowCount())
self.variables_label.setVisible(self.variables_model.rowCount())

layout_manager = QgsProject.instance().layoutManager()
layout_names = [layout.name() for layout in layout_manager.printLayouts()]
self.layouts_model.setStringList(layout_names)
self.layouts_model.check_all(Qt.Checked)
self.layouts_view.setEnabled(self.layouts_model.rowCount())
self.layouts_view.setVisible(self.layouts_model.rowCount())
self.layouts_label.setVisible(self.layouts_model.rowCount())
return super().initializePage()

def validatePage(self) -> bool:
Expand Down
4 changes: 2 additions & 2 deletions QgisModelBaker/ui/topping_wizard/additives.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<width>1257</width>
<height>600</height>
</rect>
</property>
Expand All @@ -29,7 +29,7 @@
</font>
</property>
<property name="text">
<string>Select the Map Themes that should be exported, as well as the custom project variables and the print layouts.</string>
<string>Additive project settings, that should be exported (if available). Like Map Themes, Custom Variables and Print Layouts.</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
Expand Down
2 changes: 1 addition & 1 deletion scripts/package_pip_packages.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
LIBS_DIR="QgisModelBaker/libs"

MODELBAKER_LIBRARY=("modelbaker" "1.3.6")
MODELBAKER_LIBRARY=("modelbaker" "1.3.7")
PACKAGING=("packaging" "21.3")

PACKAGES=(
Expand Down

0 comments on commit d2b03e8

Please sign in to comment.