Skip to content

Commit

Permalink
Merge pull request #858 from opengisch/projecttopping
Browse files Browse the repository at this point in the history
Topping on create Project
  • Loading branch information
signedav authored Dec 6, 2023
2 parents 0b554db + 3589cf9 commit 737579b
Show file tree
Hide file tree
Showing 6 changed files with 573 additions and 172 deletions.
10 changes: 9 additions & 1 deletion QgisModelBaker/gui/panel/log_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import logging

from PyQt5.QtWidgets import QGridLayout
from PyQt5.QtWidgets import QGridLayout, QProgressBar
from qgis.core import Qgis
from qgis.gui import QgsMessageBar
from qgis.PyQt.QtCore import QSize, Qt
Expand All @@ -40,9 +40,17 @@ def __init__(self, parent=None):
self.txtStdout.setLayout(QGridLayout())
self.txtStdout.layout().setContentsMargins(0, 0, 0, 0)
self.txtStdout.layout().addWidget(self.bar, 0, 0, Qt.AlignTop)
self.scrollbar = self.txtStdout.verticalScrollBar()

self.busy_bar = QProgressBar()
self.busy_bar.setRange(0, 0)
self.busy_bar.setTextVisible(True)
self.busy_bar.setVisible(False)

layout = QGridLayout()
layout.addWidget(self.txtStdout)
layout.addWidget(self.busy_bar)

self.setLayout(layout)

def sizeHint(self):
Expand Down
9 changes: 6 additions & 3 deletions QgisModelBaker/gui/workflow_wizard/default_baskets_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ def isComplete(self):

def setComplete(self, complete):
self.is_complete = complete
self.create_default_baskets_button.setDisabled(complete)
self.skip_button.setDisabled(complete)
self.baskets_panel.setDisabled(complete)
self.completeChanged.emit()

def nextId(self):
Expand Down Expand Up @@ -88,6 +85,9 @@ def _create_default_baskets(self):
self.progress_bar.setFormat(self.tr("Default baskets created!"))
self.progress_bar.setValue(100)
self.setStyleSheet(gui_utils.SUCCESS_STYLE)
self.create_default_baskets_button.setDisabled(True)
self.skip_button.setDisabled(True)
self.baskets_panel.setDisabled(True)
self.setComplete(True)
else:
self.workflow_wizard.log_panel.print_info(message)
Expand All @@ -103,4 +103,7 @@ def _skip(self):
self.progress_bar.setFormat(self.tr("SKIPPED"))
self.progress_bar.setTextVisible(True)
self.setStyleSheet(gui_utils.INACTIVE_STYLE)
self.create_default_baskets_button.setDisabled(True)
self.skip_button.setDisabled(True)
self.baskets_panel.setDisabled(True)
self.setComplete(True)
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ def _update_ilimetaconfigcache(self):
self.ilimetaconfigcache.model_refreshed.connect(
self._update_metaconfig_completer
)
self.workflow_wizard.busy(self, True, self.tr("Refresh repository data..."))
self._refresh_ili_metaconfig_cache()

def _update_ilireferencedatacache(self):
Expand Down Expand Up @@ -289,6 +290,7 @@ def _update_metaconfig_completer(self, rows):
completer.popup().setItemDelegate(self.metaconfig_delegate)
self.ili_metaconfig_line_edit.setCompleter(completer)
self.ili_metaconfig_line_edit.setEnabled(bool(rows))
self.workflow_wizard.busy(self, False)

def _on_metaconfig_completer_activated(self, text=None):
self._clean_metaconfig()
Expand All @@ -315,8 +317,9 @@ def _on_metaconfig_completer_activated(self, text=None):
self.ilimetaconfigcache.model.data(model_index, Qt.DisplayRole),
metaconfig_id,
self.ilimetaconfigcache.model.data(
model_index, int(IliDataItemModel.Roles.SHORT_DESCRIPTION) or ""
),
model_index, int(IliDataItemModel.Roles.SHORT_DESCRIPTION)
)
or "",
)
)
self.metaconfig_file_info_label.setStyleSheet("color: #341d5c")
Expand Down Expand Up @@ -433,6 +436,7 @@ def _load_crs_from_metaconfig(self, ili2db_metaconfig):
self._crs_changed()

def _load_metaconfig(self):
self.workflow_wizard.busy(self, True, "Load metaconfiguration...")
# load ili2db parameters to the GUI
if "ch.ehi.ili2db" in self.metaconfig.sections():
self.workflow_wizard.log_panel.print_info(
Expand Down Expand Up @@ -570,3 +574,5 @@ def _load_metaconfig(self):
LogColor.COLOR_TOPPING,
)
self.workflow_wizard.refresh_import_models()

self.workflow_wizard.busy(self, False)
Loading

0 comments on commit 737579b

Please sign in to comment.