Skip to content

Commit

Permalink
Clear ilicache button
Browse files Browse the repository at this point in the history
  • Loading branch information
domi4484 committed Jul 11, 2023
1 parent 6224c4b commit 814212f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

from qgis.core import QgsApplication
from qgis.PyQt.QtCore import Qt
from qgis.PyQt.QtWidgets import QCompleter, QWizardPage
from qgis.PyQt.QtWidgets import QCompleter, QPushButton, QWizardPage

import QgisModelBaker.utils.gui_utils as gui_utils
from QgisModelBaker.libs.modelbaker.iliwrapper.ilicache import (
Expand Down Expand Up @@ -94,6 +94,9 @@ def __init__(self, parent, title):
self.workflow_wizard.append_dropped_files
)

self.clear_ilicache_button = QPushButton(self.tr("Clear ilicache"))
self.clear_ilicache_button.clicked.connect(self._clear_ilicache_button_clicked)

def nextId(self):
self._disconnect_punch_slots()
return self.workflow_wizard.next_id()
Expand Down Expand Up @@ -186,3 +189,6 @@ def _remove_selected_rows(self):
indices = self.source_list_view.selectionModel().selectedIndexes()
self.source_list_view.model().remove_sources(indices)
self.remove_button.setEnabled(self._valid_selection())

def _clear_ilicache_button_clicked(self):
print("_clear_ilicache_button_clicked")
15 changes: 15 additions & 0 deletions QgisModelBaker/gui/workflow_wizard/workflow_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,21 @@ def id_changed(self, new_id):
self.tr(f" > ---------- {self._current_page_title(self.current_id)}")
)

if self.current_id == PageIds.ImportSourceSelection:
# Add extra button Clear ilicache
self.setOption(QWizard.HaveCustomButton1, True)
self.setButton(
QWizard.CustomButton1, self.source_selection_page.clear_ilicache_button
)
else:
# Remove extra button Clear ilicache
if (
self.button(QWizard.CustomButton1)
== self.source_selection_page.clear_ilicache_button
):
self.setOption(QWizard.HaveCustomButton1, False)
self.setButton(QWizard.CustomButton1, None)

if self.current_id == PageIds.ImportDatabaseSelection:
# use schema config to restore
self.import_database_selection_page.restore_configuration(
Expand Down

0 comments on commit 814212f

Please sign in to comment.