From 42ac757c981c2ff78ab58a88e06bfa48d2d8cc47 Mon Sep 17 00:00:00 2001 From: Damiano Lombardi Date: Thu, 10 Aug 2023 13:03:46 +0200 Subject: [PATCH 1/2] Remove old unused files --- QgisModelBaker/gui/export.py | 655 ------------ QgisModelBaker/gui/generate_project.py | 1355 ------------------------ QgisModelBaker/gui/import_data.py | 600 ----------- QgisModelBaker/gui/multiple_models.py | 67 -- QgisModelBaker/qgismodelbaker.py | 100 -- QgisModelBaker/ui/export.ui | 233 ---- QgisModelBaker/ui/generate_project.ui | 328 ------ QgisModelBaker/ui/import_data.ui | 276 ----- QgisModelBaker/ui/multiple_models.ui | 181 ---- 9 files changed, 3795 deletions(-) delete mode 100644 QgisModelBaker/gui/export.py delete mode 100644 QgisModelBaker/gui/generate_project.py delete mode 100644 QgisModelBaker/gui/import_data.py delete mode 100644 QgisModelBaker/gui/multiple_models.py delete mode 100644 QgisModelBaker/ui/export.ui delete mode 100644 QgisModelBaker/ui/generate_project.ui delete mode 100644 QgisModelBaker/ui/import_data.ui delete mode 100644 QgisModelBaker/ui/multiple_models.ui diff --git a/QgisModelBaker/gui/export.py b/QgisModelBaker/gui/export.py deleted file mode 100644 index 2de3ceaf8..000000000 --- a/QgisModelBaker/gui/export.py +++ /dev/null @@ -1,655 +0,0 @@ -""" -/*************************************************************************** - ------------------- - begin : 30/05/17 - git sha : :%H$ - copyright : (C) 2017 by Germán Carrillo (BSF-Swissphoto) - email : gcarrillo@linuxmail.org - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ -""" - -import os -import os.path -import re -import webbrowser - -from qgis.core import Qgis -from qgis.gui import QgsGui, QgsMessageBar -from qgis.PyQt.QtCore import ( - QCoreApplication, - QLocale, - QSettings, - QStringListModel, - Qt, - QTimer, -) -from qgis.PyQt.QtGui import QColor, QDesktopServices, QValidator -from qgis.PyQt.QtWidgets import ( - QAction, - QDialog, - QDialogButtonBox, - QGridLayout, - QMessageBox, - QSizePolicy, -) - -from QgisModelBaker.gui.edit_command import EditCommandDialog -from QgisModelBaker.gui.options import OptionsDialog -from QgisModelBaker.gui.panel import db_panel_utils -from QgisModelBaker.libs.modelbaker.db_factory.db_simple_factory import DbSimpleFactory -from QgisModelBaker.libs.modelbaker.dbconnector.db_connector import DBConnectorError -from QgisModelBaker.libs.modelbaker.iliwrapper import ili2dbconfig, iliexporter -from QgisModelBaker.libs.modelbaker.iliwrapper.globals import DbIliMode -from QgisModelBaker.libs.modelbaker.iliwrapper.ili2dbutils import ( - JavaNotFoundError, - color_log_text, -) -from QgisModelBaker.libs.modelbaker.utils.globals import DbActionType -from QgisModelBaker.libs.modelbaker.utils.qt_utils import ( - FileValidator, - OverrideCursor, - Validators, - make_save_file_selector, -) -from QgisModelBaker.utils import gui_utils -from QgisModelBaker.utils.globals import displayDbIliMode -from QgisModelBaker.utils.gui_utils import LogColor - -DIALOG_UI = gui_utils.get_ui_class("export.ui") - - -class ExportModels(QStringListModel): - - blacklist = [ - "CHBaseEx_MapCatalogue_V1", - "CHBaseEx_WaterNet_V1", - "CHBaseEx_Sewage_V1", - "CHAdminCodes_V1", - "AdministrativeUnits_V1", - "AdministrativeUnitsCH_V1", - "WithOneState_V1", - "WithLatestModification_V1", - "WithModificationObjects_V1", - "GraphicCHLV03_V1", - "GraphicCHLV95_V1", - "NonVector_Base_V2", - "NonVector_Base_V3", - "NonVector_Base_LV03_V3_1", - "NonVector_Base_LV95_V3_1", - "GeometryCHLV03_V1", - "GeometryCHLV95_V1", - "InternationalCodes_V1", - "Localisation_V1", - "LocalisationCH_V1", - "Dictionaries_V1", - "DictionariesCH_V1", - "CatalogueObjects_V1", - "CatalogueObjectTrees_V1", - "AbstractSymbology", - "CodeISO", - "CoordSys", - "GM03_2_1Comprehensive", - "GM03_2_1Core", - "GM03_2Comprehensive", - "GM03_2Core", - "GM03Comprehensive", - "GM03Core", - "IliRepository09", - "IliSite09", - "IlisMeta07", - "IliVErrors", - "INTERLIS_ext", - "RoadsExdm2ben", - "RoadsExdm2ben_10", - "RoadsExgm2ien", - "RoadsExgm2ien_10", - "StandardSymbology", - "StandardSymbology", - "Time", - "Units", - ] - - def __init__(self): - super().__init__() - self._checked_models = None - - def refresh_models(self, db_connector=None): - modelnames = list() - - if db_connector: - if db_connector.db_or_schema_exists() and db_connector.metadata_exists(): - db_models = db_connector.get_models() - regex = re.compile(r"(?:\{[^\}]*\}|\s)") - for db_model in db_models: - for modelname in regex.split(db_model["modelname"]): - if modelname and modelname not in ExportModels.blacklist: - modelnames.append(modelname.strip()) - - self.setStringList(modelnames) - - self._checked_models = {modelname: Qt.Checked for modelname in modelnames} - - def flags(self, index): - return Qt.ItemIsSelectable | Qt.ItemIsEnabled - - def data(self, index, role): - if role == Qt.CheckStateRole: - return self._checked_models[self.data(index, Qt.DisplayRole)] - else: - return QStringListModel.data(self, index, role) - - def setData(self, index, role, data): - if role == Qt.CheckStateRole: - self._checked_models[self.data(index, Qt.DisplayRole)] = data - else: - QStringListModel.setData(self, index, role, data) - - def check(self, index): - if self.data(index, Qt.CheckStateRole) == Qt.Checked: - self.setData(index, Qt.CheckStateRole, Qt.Unchecked) - else: - self.setData(index, Qt.CheckStateRole, Qt.Checked) - - def checked_models(self): - return [ - modelname - for modelname in self.stringList() - if self._checked_models[modelname] == Qt.Checked - ] - - -class ExportDialog(QDialog, DIALOG_UI): - ValidExtensions = ["xtf", "XTF", "itf", "ITF", "gml", "GML", "xml", "XML"] - - def __init__(self, base_config, parent=None): - QDialog.__init__(self, parent) - self.setupUi(self) - self.db_simple_factory = DbSimpleFactory() - QgsGui.instance().enableAutoGeometryRestore(self) - self.buttonBox.accepted.disconnect() - self.buttonBox.clear() - self.buttonBox.addButton(QDialogButtonBox.Cancel) - self.buttonBox.addButton(QDialogButtonBox.Help) - self.buttonBox.helpRequested.connect(self.help_requested) - - self.export_text = self.tr("Export") - self.set_button_to_export_action = QAction(self.export_text, None) - self.set_button_to_export_action.triggered.connect(self.set_button_to_export) - - self.export_without_validation_text = self.tr("Export without validation") - self.set_button_to_export_without_validation_action = QAction( - self.export_without_validation_text, None - ) - self.set_button_to_export_without_validation_action.triggered.connect( - self.set_button_to_export_without_validation - ) - - self.edit_command_action = QAction(self.tr("Edit ili2db command"), None) - self.edit_command_action.triggered.connect(self.edit_command) - - self.export_tool_button.addAction( - self.set_button_to_export_without_validation_action - ) - self.export_tool_button.addAction(self.edit_command_action) - self.export_tool_button.setText(self.export_text) - self.export_tool_button.clicked.connect(self.accepted) - - self.xtf_file_browse_button.clicked.connect( - make_save_file_selector( - self.xtf_file_line_edit, - title=self.tr("Save in XTF Transfer File"), - file_filter=self.tr( - "XTF Transfer File (*.xtf *XTF);;Interlis 1 Transfer File (*.itf *ITF);;XML (*.xml *XML);;GML (*.gml *GML)" - ), - extension=".xtf", - extensions=["." + ext for ext in self.ValidExtensions], - ) - ) - self.xtf_file_browse_button.clicked.connect(self.xtf_browser_opened_to_true) - self.xtf_browser_was_opened = False - - self.type_combo_box.clear() - self._lst_panel = dict() - - for db_id in self.db_simple_factory.get_db_list(False): - self.type_combo_box.addItem(displayDbIliMode[db_id], db_id) - item_panel = db_panel_utils.get_config_panel( - db_id, self, DbActionType.EXPORT - ) - self._lst_panel[db_id] = item_panel - self.db_layout.addWidget(item_panel) - - self.validators = Validators() - - fileValidator = FileValidator( - pattern=["*." + ext for ext in self.ValidExtensions], - allow_non_existing=True, - ) - - self.xtf_file_line_edit.setValidator(fileValidator) - self.xtf_file_line_edit.textChanged.connect(self.validators.validate_line_edits) - self.xtf_file_line_edit.textChanged.connect(self.xtf_browser_opened_to_false) - self.xtf_file_line_edit.textChanged.emit(self.xtf_file_line_edit.text()) - - # Reset to export as default text - self.xtf_file_line_edit.textChanged.connect(self.set_button_to_export) - - # refresh the models on changing values but avoid massive db connects by timer - self.refreshTimer = QTimer() - self.refreshTimer.setSingleShot(True) - self.refreshTimer.timeout.connect(self.refresh_models) - - for key, value in self._lst_panel.items(): - value.notify_fields_modified.connect(self.request_for_refresh_models) - - self.validate_data = True # validates exported data by default, We use --disableValidation when is False - self.base_configuration = base_config - self.restore_configuration() - - self.export_models_model = ExportModels() - self.export_models_view.setModel(self.export_models_model) - self.export_models_view.clicked.connect(self.export_models_model.check) - self.export_models_view.space_pressed.connect(self.export_models_model.check) - self.request_for_refresh_models() - - self.type_combo_box.currentIndexChanged.connect(self.type_changed) - - self.bar = QgsMessageBar() - self.bar.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed) - self.txtStdout.setLayout(QGridLayout()) - self.txtStdout.layout().setContentsMargins(0, 0, 0, 0) - self.txtStdout.layout().addWidget(self.bar, 0, 0, Qt.AlignTop) - - def request_for_refresh_models(self): - # hold refresh back - self.refreshTimer.start(500) - - def refresh_models(self): - self.refreshed_export_models_model() - - def refreshed_export_models_model(self): - tool = self.type_combo_box.currentData() & ~DbIliMode.ili - - configuration = self.updated_configuration() - schema = configuration.dbschema - - db_factory = self.db_simple_factory.create_factory(tool) - config_manager = db_factory.get_db_command_config_manager(configuration) - uri_string = config_manager.get_uri(configuration.db_use_super_login) - - db_connector = None - - try: - db_connector = db_factory.get_db_connector(uri_string, schema) - except (DBConnectorError, FileNotFoundError): - # when wrong connection parameters entered, there should just be returned an empty model - so let it pass - pass - - self.export_models_model.refresh_models(db_connector) - - def db_ili_version(self, configuration): - """ - Returns the ili2db version the database has been created with or None if the database - could not be detected as a ili2db database - """ - schema = configuration.dbschema - - db_factory = self.db_simple_factory.create_factory(configuration.tool) - config_manager = db_factory.get_db_command_config_manager(configuration) - uri_string = config_manager.get_uri(configuration.db_use_super_login) - - db_connector = None - - try: - db_connector = db_factory.get_db_connector(uri_string, schema) - return db_connector.ili_version() - except (DBConnectorError, FileNotFoundError): - return None - - def set_button_to_export(self): - """ - Changes the text of the button to export (with validation) and sets the validate_data to true. - So on clicking the button the export will start with validation. - The buttons actions are changed to be able to switch the without-validation mode. - """ - self.validate_data = True - self.export_tool_button.removeAction(self.set_button_to_export_action) - self.export_tool_button.removeAction(self.edit_command_action) - self.export_tool_button.addAction( - self.set_button_to_export_without_validation_action - ) - self.export_tool_button.addAction(self.edit_command_action) - self.export_tool_button.setText(self.export_text) - - def set_button_to_export_without_validation(self): - """ - Changes the text of the button to export without validation and sets the validate_data to false. - So on clicking the button the export will start without validation. - The buttons actions are changed to be able to switch the with-validation mode. - """ - self.validate_data = False - self.export_tool_button.removeAction( - self.set_button_to_export_without_validation_action - ) - self.export_tool_button.removeAction(self.edit_command_action) - self.export_tool_button.addAction(self.set_button_to_export_action) - self.export_tool_button.addAction(self.edit_command_action) - self.export_tool_button.setText(self.export_without_validation_text) - - def edit_command(self): - """ - A dialog opens giving the user the possibility to edit the ili2db command used for the export - """ - exporter = iliexporter.Exporter() - exporter.tool = self.type_combo_box.currentData() - exporter.configuration = self.updated_configuration() - command = exporter.command(True) - edit_command_dialog = EditCommandDialog(self) - edit_command_dialog.command_edit.setPlainText(command) - if edit_command_dialog.exec_(): - edited_command = edit_command_dialog.command_edit.toPlainText() - self.accepted(edited_command) - - def accepted(self, edited_command=None): - db_id = self.type_combo_box.currentData() - - res, message = self._lst_panel[db_id].is_valid() - - if not res: - self.txtStdout.setText(message) - return - - configuration = self.updated_configuration() - - if not edited_command: - if ( - not self.xtf_file_line_edit.validator().validate( - configuration.xtffile, 0 - )[0] - == QValidator.Acceptable - ): - self.txtStdout.setText( - self.tr( - "Please set a valid INTERLIS XTF file before exporting data." - ) - ) - self.xtf_file_line_edit.setFocus() - return - if not configuration.ilimodels: - self.txtStdout.setText( - self.tr("Please set a model before exporting data.") - ) - self.export_models_view.setFocus() - return - - # If xtf browser was opened and the file exists, the user already chose - # to overwrite the file - if ( - os.path.isfile(self.xtf_file_line_edit.text().strip()) - and not self.xtf_browser_was_opened - ): - self.msg = QMessageBox() - self.msg.setIcon(QMessageBox.Warning) - self.msg.setText( - self.tr( - "{filename} already exists.\nDo you want to replace it?" - ).format( - filename=os.path.basename(self.xtf_file_line_edit.text().strip()) - ) - ) - self.msg.setWindowTitle(self.tr("Save in XTF Transfer File")) - self.msg.setStandardButtons(QMessageBox.Yes | QMessageBox.No) - msg_box = self.msg.exec_() - if msg_box == QMessageBox.No: - return - - with OverrideCursor(Qt.WaitCursor): - self.progress_bar.show() - self.progress_bar.setValue(0) - - self.disable() - self.txtStdout.setTextColor(QColor(LogColor.COLOR_INFO)) - self.txtStdout.clear() - - exporter = iliexporter.Exporter() - exporter.tool = self.type_combo_box.currentData() - exporter.configuration = configuration - - self.save_configuration(configuration) - - exporter.stdout.connect(self.print_info) - exporter.stderr.connect(self.on_stderr) - exporter.process_started.connect(self.on_process_started) - exporter.process_finished.connect(self.on_process_finished) - - self.progress_bar.setValue(25) - - try: - if exporter.run(edited_command) != iliexporter.Exporter.SUCCESS: - if configuration.db_ili_version == 3: - # failed with a db created by ili2db version 3 - if not edited_command: - # fallback because of issues with --export3 argument - self.show_message( - Qgis.Warning, - self.tr( - "Tried export with ili2db version 3.x.x (fallback)" - ), - ) - - exporter.version = 3 - # ... and enforce the Exporter to use ili2db version 3.x.x - if exporter.run() != iliexporter.Exporter.SUCCESS: - self.enable() - self.progress_bar.hide() - return - else: - self.show_message( - Qgis.Warning, - self.tr( - "Tried export with ili2db version 3.x.x (no fallback with editted command)" - ), - ) - return - else: - self.enable() - self.progress_bar.hide() - return - except JavaNotFoundError as e: - self.txtStdout.setTextColor(QColor(LogColor.COLOR_INFO)) - self.txtStdout.clear() - self.txtStdout.setText(e.error_string) - self.enable() - self.progress_bar.hide() - - QApplication.restoreOverrideCursor() - QMessageBox.critical( - self, self.tr("Java not found error"), e.error_string - ) - - return - - self.buttonBox.clear() - self.buttonBox.setEnabled(True) - self.buttonBox.addButton(QDialogButtonBox.Close) - self.progress_bar.setValue(100) - - def print_info(self, text): - self.txtStdout.setTextColor(QColor(LogColor.COLOR_INFO)) - self.txtStdout.append(text) - QCoreApplication.processEvents() - - def on_stderr(self, text): - color_log_text(text, self.txtStdout) - self.advance_progress_bar_by_text(text) - QCoreApplication.processEvents() - - def show_message(self, level, message): - if level == Qgis.Warning: - self.bar.pushMessage(message, Qgis.Info, 10) - elif level == Qgis.Critical: - self.bar.pushMessage(message, Qgis.Warning, 10) - - def on_process_started(self, command): - self.disable() - self.txtStdout.setTextColor(QColor(LogColor.COLOR_INFO)) - self.txtStdout.clear() - self.txtStdout.setText(command) - QCoreApplication.processEvents() - - def on_process_finished(self, exit_code, result): - color = "#004905" if exit_code == 0 else "#aa2222" - self.txtStdout.setTextColor(QColor(color)) - self.txtStdout.append(self.tr("Finished ({})".format(exit_code))) - if result == iliexporter.Exporter.SUCCESS: - self.buttonBox.clear() - self.buttonBox.setEnabled(True) - self.buttonBox.addButton(QDialogButtonBox.Close) - else: - if self.export_without_validate(): - self.set_button_to_export_without_validation() - self.enable() - - def export_without_validate(self): - """ - Valid if an error occurred that prevents executing the export without validations - :return: True if you can execute the export without validations, False in other case - """ - log = self.txtStdout.toPlainText().lower() - if "permission denied" in log or "access is denied" in log: - return False - return True - - def updated_configuration(self): - """ - Get the configuration that is updated with the user configuration changes on the dialog. - :return: Configuration - """ - configuration = ili2dbconfig.ExportConfiguration() - - mode = self.type_combo_box.currentData() - self._lst_panel[mode].get_fields(configuration) - - configuration.tool = mode - configuration.xtffile = self.xtf_file_line_edit.text().strip() - configuration.ilimodels = ";".join(self.export_models_model.checked_models()) - configuration.base_configuration = self.base_configuration - configuration.db_ili_version = self.db_ili_version(configuration) - - if not self.validate_data: - configuration.disable_validation = True - return configuration - - def save_configuration(self, configuration): - settings = QSettings() - settings.setValue("QgisModelBaker/ili2pg/xtffile_export", configuration.xtffile) - settings.setValue( - "QgisModelBaker/importtype", self.type_combo_box.currentData().name - ) - - mode = self.type_combo_box.currentData() - db_factory = self.db_simple_factory.create_factory(mode) - config_manager = db_factory.get_db_command_config_manager(configuration) - config_manager.save_config_in_qsettings() - - def restore_configuration(self): - settings = QSettings() - - for db_id in self.db_simple_factory.get_db_list(False): - configuration = iliexporter.ExportConfiguration() - db_factory = self.db_simple_factory.create_factory(db_id) - config_manager = db_factory.get_db_command_config_manager(configuration) - config_manager.load_config_from_qsettings() - self._lst_panel[db_id].set_fields(configuration) - - mode = settings.value("QgisModelBaker/importtype") - mode = DbIliMode[mode] if mode else self.db_simple_factory.default_database - mode = mode & ~DbIliMode.ili - - self.type_combo_box.setCurrentIndex(self.type_combo_box.findData(mode)) - self.refresh_db_panel() - - def disable(self): - self.type_combo_box.setEnabled(False) - for key, value in self._lst_panel.items(): - value.setEnabled(False) - self.ili_config.setEnabled(False) - self.buttonBox.setEnabled(False) - - def enable(self): - self.type_combo_box.setEnabled(True) - for key, value in self._lst_panel.items(): - value.setEnabled(True) - self.ili_config.setEnabled(True) - self.buttonBox.setEnabled(True) - - def type_changed(self): - self.txtStdout.clear() - self.set_button_to_export() - self.refresh_db_panel() - self.refresh_models() - self.txtStdout.clear() - - def refresh_db_panel(self): - self.progress_bar.hide() - - db_id = self.type_combo_box.currentData() - self.db_wrapper_group_box.setTitle(displayDbIliMode[db_id]) - - # Refresh panels - for key, value in self._lst_panel.items(): - value.interlis_mode = False - is_current_panel_selected = db_id == key - value.setVisible(is_current_panel_selected) - if is_current_panel_selected: - value._show_panel() - - def link_activated(self, link): - if link.url() == "#configure": - cfg = OptionsDialog(self.base_configuration) - if cfg.exec_(): - settings = QSettings() - settings.beginGroup("QgisModelBaker/ili2db") - self.base_configuration.save(settings) - else: - QDesktopServices.openUrl(link) - - def help_requested(self): - os_language = QLocale(QSettings().value("locale/userLocale")).name()[:2] - if os_language in ["es", "de"]: - webbrowser.open( - "https://opengisch.github.io/QgisModelBaker/docs/{}/user-guide.html#export-an-interlis-transfer-file-xtf".format( - os_language - ) - ) - else: - webbrowser.open( - "https://opengisch.github.io/QgisModelBaker/docs/user-guide.html#export-an-interlis-transfer-file-xtf" - ) - - def xtf_browser_opened_to_true(self): - """ - Slot. Sets a flag to true to eventually avoid asking a user whether to overwrite a file. - """ - self.xtf_browser_was_opened = True - - def xtf_browser_opened_to_false(self): - """ - Slot. Sets a flag to false to eventually ask a user whether to overwrite a file. - """ - self.xtf_browser_was_opened = False - - def advance_progress_bar_by_text(self, text): - if text.strip() == "Info: compile models…": - self.progress_bar.setValue(50) - elif text.strip() == "Info: create table structure…": - self.progress_bar.setValue(75) diff --git a/QgisModelBaker/gui/generate_project.py b/QgisModelBaker/gui/generate_project.py deleted file mode 100644 index c45960f66..000000000 --- a/QgisModelBaker/gui/generate_project.py +++ /dev/null @@ -1,1355 +0,0 @@ -""" -/*************************************************************************** - ------------------- - begin : 29/03/17 - git sha : :%H$ - copyright : (C) 2017 by OPENGIS.ch - email : info@opengis.ch - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ -""" -import configparser -import os -import re -import webbrowser - -import yaml -from qgis.core import Qgis, QgsCoordinateReferenceSystem, QgsProject -from qgis.gui import QgsGui, QgsMessageBar -from qgis.PyQt.QtCore import ( - QCoreApplication, - QEventLoop, - QLocale, - QSettings, - Qt, - QTimer, -) -from qgis.PyQt.QtGui import QColor, QDesktopServices, QValidator -from qgis.PyQt.QtWidgets import ( - QAction, - QCompleter, - QDialog, - QDialogButtonBox, - QGridLayout, - QMessageBox, - QSizePolicy, -) - -from QgisModelBaker.gui.edit_command import EditCommandDialog -from QgisModelBaker.gui.ili2db_options import Ili2dbOptionsDialog -from QgisModelBaker.gui.multiple_models import MultipleModelsDialog -from QgisModelBaker.gui.options import OptionsDialog -from QgisModelBaker.gui.panel import db_panel_utils -from QgisModelBaker.libs.modelbaker.dataobjects.project import Project -from QgisModelBaker.libs.modelbaker.db_factory.db_simple_factory import DbSimpleFactory -from QgisModelBaker.libs.modelbaker.dbconnector.db_connector import DBConnectorError -from QgisModelBaker.libs.modelbaker.generator.generator import Generator -from QgisModelBaker.libs.modelbaker.iliwrapper import iliimporter -from QgisModelBaker.libs.modelbaker.iliwrapper.globals import DbIliMode -from QgisModelBaker.libs.modelbaker.iliwrapper.ili2dbconfig import ( - ImportDataConfiguration, - SchemaImportConfiguration, -) -from QgisModelBaker.libs.modelbaker.iliwrapper.ili2dbutils import ( - JavaNotFoundError, - color_log_text, -) -from QgisModelBaker.libs.modelbaker.iliwrapper.ilicache import ( - IliCache, - IliDataCache, - IliDataItemModel, - IliToppingFileCache, - IliToppingFileItemModel, - MetaConfigCompleterDelegate, - ModelCompleterDelegate, -) -from QgisModelBaker.libs.modelbaker.utils.globals import DbActionType -from QgisModelBaker.libs.modelbaker.utils.qt_utils import ( - FileValidator, - NonEmptyStringValidator, - OverrideCursor, - Validators, - make_file_selector, -) -from QgisModelBaker.utils import gui_utils -from QgisModelBaker.utils.globals import ( - CATALOGUE_DATASETNAME, - CRS_PATTERNS, - displayDbIliMode, -) -from QgisModelBaker.utils.gui_utils import LogColor - -DIALOG_UI = gui_utils.get_ui_class("generate_project.ui") - - -class GenerateProjectDialog(QDialog, DIALOG_UI): - - ValidExtensions = ["ili"] - - def __init__(self, iface, base_config, parent=None): - QDialog.__init__(self, parent) - self.setupUi(self) - self.iface = iface - self.db_simple_factory = DbSimpleFactory() - QgsGui.instance().enableAutoGeometryRestore(self) - - self.create_text = self.tr("Create") - self.set_button_to_create_action = QAction(self.create_text, None) - self.set_button_to_create_action.triggered.connect(self.set_button_to_create) - - self.create_without_constraints_text = self.tr("Create without constraints") - self.set_button_to_create_without_constraints_action = QAction( - self.create_without_constraints_text, None - ) - self.set_button_to_create_without_constraints_action.triggered.connect( - self.set_button_to_create_without_constraints - ) - - self.edit_command_action = QAction(self.tr("Edit ili2db command"), None) - self.edit_command_action.triggered.connect(self.edit_command) - - self.create_tool_button.addAction( - self.set_button_to_create_without_constraints_action - ) - self.create_tool_button.addAction(self.edit_command_action) - self.create_tool_button.setText(self.create_text) - self.create_tool_button.clicked.connect(self.accepted) - - self.buttonBox.accepted.disconnect() - self.buttonBox.clear() - self.buttonBox.addButton(QDialogButtonBox.Cancel) - - self.create_constraints = True - - self.create_button.setText(self.tr("Create")) - self.create_button.clicked.connect(self.accepted) - self.ili_file_browse_button.clicked.connect( - make_file_selector( - self.ili_file_line_edit, - title=self.tr("Open Interlis Model"), - file_filter=self.tr("Interlis Model File (*.ili *.ILI)"), - ) - ) - self.buttonBox.addButton(QDialogButtonBox.Help) - self.buttonBox.helpRequested.connect(self.help_requested) - self.crs = QgsCoordinateReferenceSystem() - self.ili2db_options = Ili2dbOptionsDialog(self) - self.ili2db_options_button.clicked.connect(self.ili2db_options.open) - self.ili2db_options.finished.connect(self.fill_toml_file_info_label) - self.multiple_models_dialog = MultipleModelsDialog(self) - self.multiple_models_button.clicked.connect(self.multiple_models_dialog.open) - self.multiple_models_dialog.accepted.connect(self.fill_models_line_edit) - - self.type_combo_box.clear() - self._lst_panel = dict() - - for db_id in self.db_simple_factory.get_db_list(True): - self.type_combo_box.addItem(displayDbIliMode[db_id], db_id) - - for db_id in self.db_simple_factory.get_db_list(False): - item_panel = db_panel_utils.get_config_panel( - db_id, self, DbActionType.GENERATE - ) - self._lst_panel[db_id] = item_panel - self.db_layout.addWidget(item_panel) - - self.type_combo_box.currentIndexChanged.connect(self.type_changed) - self.txtStdout.anchorClicked.connect(self.link_activated) - self.crsSelector.crsChanged.connect(self.crs_changed) - self.base_configuration = base_config - - self.bar = QgsMessageBar() - self.bar.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed) - self.txtStdout.setLayout(QGridLayout()) - self.txtStdout.layout().setContentsMargins(0, 0, 0, 0) - self.txtStdout.layout().addWidget(self.bar, 0, 0, Qt.AlignTop) - - self.validators = Validators() - nonEmptyValidator = NonEmptyStringValidator() - fileValidator = FileValidator( - pattern=["*." + ext for ext in self.ValidExtensions], allow_empty=True - ) - - self.restore_configuration() - - self.ilimetaconfigcache = IliDataCache(self.base_configuration) - self.metaconfig_delegate = MetaConfigCompleterDelegate() - self.metaconfig = configparser.ConfigParser() - self.current_models = None - self.current_metaconfig_id = None - self.ili_metaconfig_line_edit.setPlaceholderText( - self.tr("[Search metaconfig / topping from UsabILIty Hub]") - ) - self.ili_metaconfig_line_edit.setEnabled(False) - completer = QCompleter( - self.ilimetaconfigcache.model, self.ili_metaconfig_line_edit - ) - completer.setCaseSensitivity(Qt.CaseInsensitive) - completer.setFilterMode(Qt.MatchContains) - completer.popup().setItemDelegate(self.metaconfig_delegate) - self.ili_metaconfig_line_edit.setCompleter(completer) - self.ili_metaconfig_line_edit.textChanged.emit( - self.ili_metaconfig_line_edit.text() - ) - self.ili_metaconfig_line_edit.textChanged.connect( - self.complete_metaconfig_completer - ) - self.ili_metaconfig_line_edit.punched.connect( - self.complete_metaconfig_completer - ) - self.ili_metaconfig_line_edit.textChanged.connect( - self.on_metaconfig_completer_activated - ) - - self.ili_models_line_edit.setValidator(nonEmptyValidator) - self.ili_file_line_edit.setValidator(fileValidator) - - self.ili_models_line_edit.textChanged.connect( - self.validators.validate_line_edits - ) - self.ili_models_line_edit.textChanged.emit(self.ili_models_line_edit.text()) - self.ili_models_line_edit.textChanged.connect(self.on_model_changed) - self.ili_models_line_edit.textChanged.connect(self.complete_models_completer) - self.ili_models_line_edit.punched.connect(self.complete_models_completer) - - self.ilicache = IliCache(self.base_configuration) - self.model_delegate = ModelCompleterDelegate() - self.refresh_ili_models_cache() - self.ili_models_line_edit.setPlaceholderText( - self.tr("[Search model from repository]") - ) - - self.ili_file_line_edit.textChanged.connect(self.validators.validate_line_edits) - self.ili_file_line_edit.textChanged.connect(self.ili_file_changed) - self.ili_file_line_edit.textChanged.emit(self.ili_file_line_edit.text()) - - def set_button_to_create(self): - """ - Changes the text of the button to create (with validation) and sets the validate_data to true. - So on clicking the button the creation will start with validation. - The buttons actions are changed to be able to switch the with-validation mode. - """ - self.create_constraints = True - self.create_tool_button.removeAction(self.set_button_to_create_action) - self.create_tool_button.removeAction(self.edit_command_action) - self.create_tool_button.addAction( - self.set_button_to_create_without_constraints_action - ) - self.create_tool_button.addAction(self.edit_command_action) - self.create_tool_button.setText(self.create_text) - - def set_button_to_create_without_constraints(self): - """ - Changes the text of the button to create without validation and sets the validate_data to false. - So on clicking the button the creation will start without validation. - The buttons actions are changed to be able to switch the with-validation mode. - """ - self.create_constraints = False - self.create_tool_button.removeAction( - self.set_button_to_create_without_constraints_action - ) - self.create_tool_button.removeAction(self.edit_command_action) - self.create_tool_button.addAction(self.set_button_to_create_action) - self.create_tool_button.addAction(self.edit_command_action) - self.create_tool_button.setText(self.create_without_constraints_text) - - def edit_command(self): - """ - A dialog opens giving the user the possibility to edit the ili2db command used for the creation - """ - importer = iliimporter.Importer() - importer.tool = self.type_combo_box.currentData() - importer.configuration = self.updated_configuration() - command = importer.command(True) - edit_command_dialog = EditCommandDialog(self) - edit_command_dialog.command_edit.setPlainText(command) - if edit_command_dialog.exec_(): - edited_command = edit_command_dialog.command_edit.toPlainText() - self.accepted(edited_command) - - def accepted(self, edited_command=None): - ili_mode = self.type_combo_box.currentData() - db_id = ili_mode & ~DbIliMode.ili - interlis_mode = ili_mode & DbIliMode.ili - - res, message = self._lst_panel[db_id].is_valid() - - if not res: - self.txtStdout.setText(message) - return - - configuration = self.updated_configuration() - - if not edited_command: - if interlis_mode: - if not self.ili_file_line_edit.text().strip(): - if not self.ili_models_line_edit.text().strip(): - self.txtStdout.setText( - self.tr( - "Please set a valid INTERLIS model before creating the project." - ) - ) - self.ili_models_line_edit.setFocus() - return - - if ( - self.ili_file_line_edit.text().strip() - and self.ili_file_line_edit.validator().validate( - configuration.ilifile, 0 - )[0] - != QValidator.Acceptable - ): - - self.txtStdout.setText( - self.tr( - "Please set a valid INTERLIS file before creating the project. {}" - ).format(self.ili_file_line_edit.validator().error) - ) - self.ili_file_line_edit.setFocus() - return - - configuration.dbschema = configuration.dbschema or configuration.database - self.save_configuration(configuration) - - db_factory = self.db_simple_factory.create_factory(db_id) - - try: - # raise warning when the schema or the database file already exists - config_manager = db_factory.get_db_command_config_manager(configuration) - db_connector = db_factory.get_db_connector( - config_manager.get_uri(configuration.db_use_super_login) - or config_manager.get_uri(), - configuration.dbschema, - ) - - if db_connector.db_or_schema_exists(): - if interlis_mode: - warning_box = QMessageBox(self) - warning_box.setIcon(QMessageBox.Information) - warning_title = ( - self.tr("{} already exists") - .format(db_factory.get_specific_messages()["db_or_schema"]) - .capitalize() - ) - warning_box.setWindowTitle(warning_title) - warning_box.setText( - self.tr( - "{warning_title}:\n{db_or_schema_name}\n\nDo you want to " - "import into the existing {db_or_schema}?" - ).format( - warning_title=warning_title, - db_or_schema=db_factory.get_specific_messages()[ - "db_or_schema" - ].capitalize(), - db_or_schema_name=configuration.dbschema - or config_manager.get_uri(), - ) - ) - warning_box.setStandardButtons(QMessageBox.Yes | QMessageBox.No) - warning_box_result = warning_box.exec_() - if warning_box_result == QMessageBox.No: - return - except (DBConnectorError, FileNotFoundError): - # we don't mind when the database file is not yet created - pass - - # create schema with superuser - res, message = db_factory.pre_generate_project(configuration) - if not res: - self.txtStdout.setText(message) - return - - with OverrideCursor(Qt.WaitCursor): - self.progress_bar.show() - self.progress_bar.setValue(0) - - self.disable() - self.txtStdout.setTextColor(QColor(LogColor.COLOR_INFO)) - - if interlis_mode: - importer = iliimporter.Importer() - importer.tool = self.type_combo_box.currentData() - importer.configuration = configuration - importer.stdout.connect(self.print_info) - importer.stderr.connect(self.on_stderr) - importer.process_started.connect(self.on_process_started) - importer.process_finished.connect(self.on_process_finished) - try: - if importer.run(edited_command) != iliimporter.Importer.SUCCESS: - self.enable() - self.progress_bar.hide() - return - except JavaNotFoundError as e: - self.txtStdout.setTextColor(QColor(LogColor.COLOR_INFO)) - self.txtStdout.clear() - self.txtStdout.setText(e.error_string) - self.enable() - self.progress_bar.hide() - - QApplication.restoreOverrideCursor() - QMessageBox.critical( - self, self.tr("Java not found error"), e.error_string - ) - - return - - try: - config_manager = db_factory.get_db_command_config_manager(configuration) - uri = config_manager.get_uri(qgis=True) - mgmt_uri = config_manager.get_uri(configuration.db_use_super_login) - generator = Generator( - configuration.tool, - uri, - configuration.inheritance, - configuration.dbschema, - mgmt_uri=mgmt_uri, - consider_basket_handling=True, - ) - generator.stdout.connect(self.print_info) - generator.new_message.connect(self.show_message) - self.progress_bar.setValue(30) - except DBConnectorError as db_connector_error: - self.txtStdout.setText( - self.tr( - "There was an error connecting to the database. Check connection parameters. Error details: {}".format( - db_connector_error - ) - ) - ) - self.progress_bar.setValue(0) - return - except FileNotFoundError as file_not_found_error: - self.txtStdout.setText( - self.tr( - "There was an error connecting to the database. Check connection parameters. Error details: {}".format( - file_not_found_error - ) - ) - ) - self.progress_bar.setValue(0) - return - - if not interlis_mode: - if not generator.db_or_schema_exists(): - self.txtStdout.setText( - self.tr( - "Source {} does not exist. Check connection parameters." - ).format(db_factory.get_specific_messages()["db_or_schema"]) - ) - self.enable() - self.progress_bar.hide() - return - - res, message = db_factory.post_generate_project_validations(configuration) - - if not res: - self.txtStdout.setText(message) - self.enable() - self.progress_bar.hide() - return - - self.print_info( - f'\n{self.tr("Obtaining available layers from the database…")}' - ) - - available_layers = generator.layers() - - if not available_layers: - text = self.tr("The {} has no layers to load into QGIS.").format( - db_factory.get_specific_messages()["layers_source"] - ) - - self.txtStdout.setText(text) - self.enable() - self.progress_bar.hide() - return - - self.progress_bar.setValue(40) - self.print_info(self.tr("Obtaining relations from the database…")) - relations, bags_of_enum = generator.relations(available_layers) - self.progress_bar.setValue(45) - - self.print_info(self.tr("Arranging layers into groups…")) - legend = generator.legend(available_layers) - - custom_layer_order_structure = list() - - # Project topping file for legend and layers: collect and download - projecttopping_file_path_list = [] - if "CONFIGURATION" in self.metaconfig.sections(): - configuration_section = self.metaconfig["CONFIGURATION"] - # get topping referenced in qgis.modelbaker.projecttopping - key = "qgis.modelbaker.projecttopping" - if key not in configuration_section: - key = "qgis.modelbaker.layertree" - self.print_info( - self.tr( - 'Keyword "qgis.modelbaker.layertree" is deprecated (but still working).. Use "qgis.modelbaker.projecttopping" instead.' - ), - LogColor.COLOR_TOPPING, - ) - if key in configuration_section: - self.print_info( - self.tr("Metaconfig contains a project topping."), - LogColor.COLOR_TOPPING, - ) - projecttopping_data_list = configuration_section[key].split(";") - projecttopping_file_path_list = self.get_topping_file_list( - projecttopping_data_list - ) - - if len(projecttopping_file_path_list) > 1: - self.print_info( - self.tr( - "Multiple project toppings can lead to unexpected behavior, when the sections are not clearly separated." - ), - LogColor.COLOR_TOPPING, - ) - - for projecttopping_file_path in projecttopping_file_path_list: - self.print_info( - self.tr("Parse project topping file {}…").format( - projecttopping_file_path - ), - LogColor.COLOR_TOPPING, - ) - with open(projecttopping_file_path) as stream: - try: - projecttopping_data = yaml.safe_load(stream) - layertree_key = "layertree" - if layertree_key not in projecttopping_data: - layertree_key = "legend" - self.print_info( - self.tr( - 'Keyword "legend" is deprecated (but still working).. Use "layertree" instead.' - ), - LogColor.COLOR_TOPPING, - ) - if layertree_key in projecttopping_data: - legend = generator.legend( - available_layers, - layertree_structure=projecttopping_data[layertree_key], - path_resolver=lambda path: self.ilidata_path_resolver( - os.path.dirname(projecttopping_file_path), path - ) - if path - else None, - ) - if "layer-order" in projecttopping_data: - custom_layer_order_structure = projecttopping_data[ - "layer-order" - ] - except yaml.YAMLError as exc: - self.print_info( - self.tr("Unable to parse project topping: {}").format(exc), - LogColor.COLOR_TOPPING, - ) - - self.progress_bar.setValue(55) - - # on geopackages we don't use the transaction mode on default, since this leaded to troubles - auto_transaction = not bool(configuration.tool & DbIliMode.gpkg) - project = Project( - auto_transaction, - context={"catalogue_datasetname": CATALOGUE_DATASETNAME}, - ) - project.layers = available_layers - project.relations = relations - project.bags_of_enum = bags_of_enum - project.legend = legend - project.custom_layer_order_structure = custom_layer_order_structure - - self.print_info(self.tr("Configure forms and widgets…")) - project.post_generate() - - qgis_project = QgsProject.instance() - - self.print_info(self.tr("Generate QGIS project…")) - project.create(None, qgis_project) - - # Set the extent of the mapCanvas from the first layer extent found - for layer in project.layers: - if layer.extent is not None: - self.iface.mapCanvas().setExtent(layer.extent) - self.iface.mapCanvas().refresh() - break - - self.progress_bar.setValue(60) - - # QML Toppings in the metadata: collect, download and apply - # This configuration is legacy (should be in project topping instead), but it's still supported - if "qgis.modelbaker.qml" in self.metaconfig.sections(): - self.print_info( - self.tr( - "Metaconfig contains QML toppings. Better practice would be to define QML toppings in the project topping file." - ), - LogColor.COLOR_TOPPING, - ) - qml_section = dict(self.metaconfig["qgis.modelbaker.qml"]) - qml_file_model = self.get_topping_file_model(list(qml_section.values())) - for layer in project.layers: - if layer.alias: - if any(layer.alias.lower() == s for s in qml_section): - layer_qml = layer.alias.lower() - elif any(f'"{layer.alias.lower()}"' == s for s in qml_section): - layer_qml = f'"{layer.alias.lower()}"' - else: - continue - matches = qml_file_model.match( - qml_file_model.index(0, 0), - Qt.DisplayRole, - qml_section[layer_qml], - 1, - ) - if matches: - style_file_path = matches[0].data( - int(IliToppingFileItemModel.Roles.LOCALFILEPATH) - ) - self.print_info( - self.tr("Apply QML topping on layer {}:{}…").format( - layer.alias, style_file_path - ), - LogColor.COLOR_TOPPING, - ) - layer.layer.loadNamedStyle(style_file_path) - - self.progress_bar.setValue(80) - - # Cataloges and Transferfiles: collect, download and import - if "CONFIGURATION" in self.metaconfig.sections(): - configuration_section = self.metaconfig["CONFIGURATION"] - if "ch.interlis.referenceData" in configuration_section: - self.print_info( - self.tr( - "Metaconfig contains transfer or catalogue toppings (reference data)." - ), - LogColor.COLOR_TOPPING, - ) - reference_data_list = configuration_section[ - "ch.interlis.referenceData" - ].split(";") - referencedata_file_path_list = self.get_topping_file_list( - reference_data_list - ) - for referencedata_file_path in referencedata_file_path_list: - self.print_info( - self.tr("Import reference data file {}…").format( - referencedata_file_path - ) - ) - - configuration = self.updated_referencedata_import_configuration( - referencedata_file_path - ) - - # create schema with superuser - db_factory = self.db_simple_factory.create_factory(db_id) - res, message = db_factory.pre_generate_project(configuration) - - if not res: - self.txtStdout.setText(message) - return - - with OverrideCursor(Qt.WaitCursor): - - dataImporter = iliimporter.Importer(dataImport=True) - - dataImporter.tool = self.type_combo_box.currentData() - dataImporter.configuration = configuration - - dataImporter.stdout.connect(self.print_info) - dataImporter.stderr.connect(self.on_stderr) - dataImporter.process_started.connect( - self.on_process_started - ) - dataImporter.process_finished.connect( - self.on_process_finished - ) - - try: - if ( - dataImporter.run(edited_command) - != iliimporter.Importer.SUCCESS - ): - self.enable() - self.progress_bar.hide() - return - except JavaNotFoundError as e: - self.txtStdout.setTextColor(QColor(LogColor.COLOR_INFO)) - self.txtStdout.clear() - self.txtStdout.setText(e.error_string) - self.enable() - self.progress_bar.hide() - - QApplication.restoreOverrideCursor() - QMessageBox.critical( - self, - self.tr("Java not found error"), - e.error_string, - ) - - return - - self.buttonBox.clear() - self.buttonBox.setEnabled(True) - self.buttonBox.addButton(QDialogButtonBox.Close) - self.progress_bar.setValue(100) - self.print_info(self.tr("\nDone!"), "#004905") - - def print_info(self, text, text_color=LogColor.COLOR_INFO): - self.txtStdout.setTextColor(QColor(text_color)) - self.txtStdout.append(text) - QCoreApplication.processEvents() - - def on_stderr(self, text): - color_log_text(text, self.txtStdout) - self.advance_progress_bar_by_text(text) - QCoreApplication.processEvents() - - def on_process_started(self, command): - self.print_info(self.tr("\n--- Process ---")) - self.print_info(command) - QCoreApplication.processEvents() - - def on_process_finished(self, exit_code, result): - if exit_code == 0: - color = LogColor.COLOR_SUCCESS - message = self.tr( - "Interlis model(s) successfully imported into the database!" - ) - else: - color = LogColor.COLOR_FAIL - message = self.tr("Finished with errors!") - - self.txtStdout.setTextColor(QColor(color)) - self.txtStdout.append(message) - - def db_ili_version(self, configuration): - """ - Returns the ili2db version the database has been created with or None if the database - could not be detected as a ili2db database - """ - schema = configuration.dbschema - - db_factory = self.db_simple_factory.create_factory(configuration.tool) - config_manager = db_factory.get_db_command_config_manager(configuration) - uri_string = config_manager.get_uri(configuration.db_use_super_login) - - try: - db_connector = db_factory.get_db_connector(uri_string, schema) - db_connector.new_message.connect(self.show_message) - return db_connector.ili_version() - except (DBConnectorError, FileNotFoundError): - return None - - def updated_configuration(self): - """ - Get the configuration that is updated with the user configuration changes on the dialog. - :return: Configuration - """ - configuration = SchemaImportConfiguration() - configuration.create_basket_col = True - - mode = self.type_combo_box.currentData() - db_id = mode & ~DbIliMode.ili - - self._lst_panel[db_id].get_fields(configuration) - - configuration.tool = mode - configuration.srs_auth = self.srs_auth - configuration.srs_code = self.srs_code - configuration.inheritance = self.ili2db_options.inheritance_type() - configuration.tomlfile = self.ili2db_options.toml_file() - configuration.create_basket_col = self.ili2db_options.create_basket_col() - configuration.create_import_tid = self.ili2db_options.create_import_tid() - configuration.stroke_arcs = self.ili2db_options.stroke_arcs() - configuration.pre_script = self.ili2db_options.pre_script() - configuration.post_script = self.ili2db_options.post_script() - configuration.db_ili_version = self.db_ili_version(configuration) - configuration.metaconfig = self.metaconfig - configuration.metaconfig_id = self.current_metaconfig_id - - configuration.base_configuration = self.base_configuration - if self.ili_file_line_edit.text().strip(): - configuration.ilifile = self.ili_file_line_edit.text().strip() - - if self.ili_models_line_edit.text().strip(): - configuration.ilimodels = self.ili_models_line_edit.text().strip() - - if not self.create_constraints: - configuration.disable_validation = True - - return configuration - - def updated_referencedata_import_configuration(self, file): - """ - Get the configuration that is updated with the user configuration changes on the dialog. - :return: Configuration - """ - configuration = ImportDataConfiguration() - - mode = self.type_combo_box.currentData() - - db_id = mode & ~DbIliMode.ili - self._lst_panel[db_id].get_fields(configuration) - - configuration.tool = mode - configuration.xtffile = file - configuration.delete_data = False - configuration.base_configuration = self.base_configuration - configuration.with_schemaimport = False - # if not self.validate_data: - # configuration.disable_validation = True - return configuration - - def save_configuration(self, configuration): - settings = QSettings() - settings.setValue("QgisModelBaker/ili2db/ilifile", configuration.ilifile) - settings.setValue("QgisModelBaker/ili2db/srs_auth", self.srs_auth) - settings.setValue("QgisModelBaker/ili2db/srs_code", self.srs_code) - settings.setValue( - "QgisModelBaker/importtype", self.type_combo_box.currentData().name - ) - - mode = self.type_combo_box.currentData() - db_factory = self.db_simple_factory.create_factory(mode) - config_manager = db_factory.get_db_command_config_manager(configuration) - config_manager.save_config_in_qsettings() - - def restore_configuration(self): - settings = QSettings() - - self.ili_file_line_edit.setText(settings.value("QgisModelBaker/ili2db/ilifile")) - srs_auth = settings.value("QgisModelBaker/ili2db/srs_auth", "EPSG") - srs_code = settings.value("QgisModelBaker/ili2db/srs_code", 2056, int) - crs = QgsCoordinateReferenceSystem("{}:{}".format(srs_auth, srs_code)) - if not crs.isValid(): - crs = QgsCoordinateReferenceSystem(srs_code) # Fallback - self.crs = crs - self.fill_toml_file_info_label() - self.update_crs_info() - - for db_id in self.db_simple_factory.get_db_list(False): - configuration = SchemaImportConfiguration() - configuration.create_basket_col = True - db_factory = self.db_simple_factory.create_factory(db_id) - config_manager = db_factory.get_db_command_config_manager(configuration) - config_manager.load_config_from_qsettings() - self._lst_panel[db_id].set_fields(configuration) - - mode = settings.value("QgisModelBaker/importtype") - mode = DbIliMode[mode] if mode else self.db_simple_factory.default_database - - self.type_combo_box.setCurrentIndex(self.type_combo_box.findData(mode)) - self.type_changed() - self.crs_changed() - - def disable(self): - self.type_combo_box.setEnabled(False) - for key, value in self._lst_panel.items(): - value.setEnabled(False) - self.ili_config.setEnabled(False) - self.buttonBox.setEnabled(False) - - def enable(self): - self.type_combo_box.setEnabled(True) - for key, value in self._lst_panel.items(): - value.setEnabled(True) - self.ili_config.setEnabled(True) - self.buttonBox.setEnabled(True) - - def type_changed(self): - self.txtStdout.clear() - self.progress_bar.hide() - - ili_mode = self.type_combo_box.currentData() - db_id = ili_mode & ~DbIliMode.ili - interlis_mode = bool(ili_mode & DbIliMode.ili) - - self.ili_config.setVisible(interlis_mode) - self.db_wrapper_group_box.setTitle(displayDbIliMode[db_id]) - - self.create_button.setVisible(not interlis_mode) - self.create_tool_button.setVisible(interlis_mode) - - # Refresh panels - for key, value in self._lst_panel.items(): - value.interlis_mode = interlis_mode - is_current_panel_selected = db_id == key - value.setVisible(is_current_panel_selected) - if is_current_panel_selected: - value._show_panel() - - def on_model_changed(self, text): - if not text: - self.update_metaconfig_completer(0) - return - for pattern, crs in CRS_PATTERNS.items(): - if re.search(pattern, text): - self.crs = QgsCoordinateReferenceSystem.fromEpsgId(int(crs)) - self.update_crs_info() - break - self.ili2db_options.set_toml_file_key(text) - self.fill_toml_file_info_label() - self.ilimetaconfigcache = IliDataCache(self.base_configuration, models=text) - self.ilimetaconfigcache.file_download_succeeded.connect( - lambda dataset_id, path: self.on_metaconfig_received(path) - ) - self.ilimetaconfigcache.file_download_failed.connect(self.on_metaconfig_failed) - self.ilimetaconfigcache.model_refreshed.connect( - self.update_metaconfig_completer - ) - self.refresh_ili_metaconfig_cache() - - def link_activated(self, link): - if link.url() == "#configure": - cfg = OptionsDialog(self.base_configuration) - if cfg.exec_(): - settings = QSettings() - settings.beginGroup("QgisModelBaker/ili2db") - self.base_configuration.save(settings) - else: - QDesktopServices.openUrl(link) - - def update_crs_info(self): - self.crsSelector.setCrs(self.crs) - - def crs_changed(self): - self.srs_auth = "EPSG" # Default - self.srs_code = 2056 # Default - srs_auth, srs_code = self.crsSelector.crs().authid().split(":") - if srs_auth == "USER": - self.crs_label.setStyleSheet("color: orange") - self.crs_label.setToolTip( - self.tr( - "Please select a valid Coordinate Reference System.\nCRSs from USER are valid for a single computer and therefore, a default EPSG:2056 will be used instead." - ) - ) - else: - self.crs_label.setStyleSheet("") - self.crs_label.setToolTip(self.tr("Coordinate Reference System")) - try: - self.srs_code = int(srs_code) - self.srs_auth = srs_auth - except ValueError: - # Preserve defaults if srs_code is not an integer - self.crs_label.setStyleSheet("color: orange") - self.crs_label.setToolTip( - self.tr( - "The srs code ('{}') should be an integer.\nA default EPSG:2056 will be used.".format( - srs_code - ) - ) - ) - - def ili_file_changed(self): - # If ili file is valid, models is optional - if ( - self.ili_file_line_edit.text().strip() - and self.ili_file_line_edit.validator().validate( - self.ili_file_line_edit.text().strip(), 0 - )[0] - == QValidator.Acceptable - ): - self.ili_models_line_edit.setValidator(None) - self.ili_models_line_edit.textChanged.emit(self.ili_models_line_edit.text()) - - # Update completer to add models from given ili file - self.ilicache = IliCache(None, self.ili_file_line_edit.text().strip()) - self.refresh_ili_models_cache() - models = self.ilicache.process_ili_file( - self.ili_file_line_edit.text().strip() - ) - try: - self.ili_models_line_edit.setText(models[-1]["name"]) - self.ili_models_line_edit.setPlaceholderText(models[-1]["name"]) - except IndexError: - self.ili_models_line_edit.setText("") - self.ili_models_line_edit.setPlaceholderText( - self.tr("[No models found in ili file]") - ) - else: - nonEmptyValidator = NonEmptyStringValidator() - self.ili_models_line_edit.setValidator(nonEmptyValidator) - self.ili_models_line_edit.textChanged.emit(self.ili_models_line_edit.text()) - - # Update completer to add models from given ili file - self.ilicache = IliCache(self.base_configuration) - self.refresh_ili_models_cache() - self.ili_models_line_edit.setPlaceholderText( - self.tr("[Search model from repository]") - ) - - def refresh_ili_models_cache(self): - self.ilicache.new_message.connect(self.show_message) - self.ilicache.refresh() - self.update_models_completer() - - def complete_models_completer(self): - if not self.ili_models_line_edit.text(): - self.ili_models_line_edit.completer().setCompletionMode( - QCompleter.UnfilteredPopupCompletion - ) - self.ili_models_line_edit.completer().complete() - else: - match_contains = ( - self.ili_models_line_edit.completer() - .completionModel() - .match( - self.ili_models_line_edit.completer().completionModel().index(0, 0), - Qt.DisplayRole, - self.ili_models_line_edit.text(), - -1, - Qt.MatchContains, - ) - ) - if len(match_contains) > 1: - self.ili_models_line_edit.completer().setCompletionMode( - QCompleter.PopupCompletion - ) - self.ili_models_line_edit.completer().complete() - - def update_models_completer(self): - completer = QCompleter(self.ilicache.model, self.ili_models_line_edit) - completer.setCaseSensitivity(Qt.CaseInsensitive) - completer.setFilterMode(Qt.MatchContains) - completer.popup().setItemDelegate(self.model_delegate) - self.ili_models_line_edit.setCompleter(completer) - self.multiple_models_dialog.models_line_edit.setCompleter(completer) - - def refresh_ili_metaconfig_cache(self): - self.ilimetaconfigcache.new_message.connect(self.show_message) - self.ilimetaconfigcache.refresh() - - def complete_metaconfig_completer(self): - if not self.ili_metaconfig_line_edit.text(): - self.clean_metaconfig() - self.ili_metaconfig_line_edit.completer().setCompletionMode( - QCompleter.UnfilteredPopupCompletion - ) - self.ili_metaconfig_line_edit.completer().complete() - else: - if ";" not in self.ili_metaconfig_line_edit.text(): - match_contains = ( - self.ili_metaconfig_line_edit.completer() - .completionModel() - .match( - self.ili_metaconfig_line_edit.completer() - .completionModel() - .index(0, 0), - Qt.DisplayRole, - self.ili_metaconfig_line_edit.text(), - -1, - Qt.MatchContains, - ) - ) - if len(match_contains) > 1: - self.ili_metaconfig_line_edit.completer().setCompletionMode( - QCompleter.PopupCompletion - ) - self.ili_metaconfig_line_edit.completer().complete() - - def update_metaconfig_completer(self, rows): - self.ili_metaconfig_line_edit.completer().setModel( - self.ilimetaconfigcache.model - ) - self.ili_metaconfig_line_edit.setEnabled(bool(rows)) - if self.ili_models_line_edit.text() != self.current_models: - self.ili_metaconfig_line_edit.clear() - - def on_metaconfig_completer_activated(self, text=None): - matches = self.ilimetaconfigcache.model.match( - self.ilimetaconfigcache.model.index(0, 0), - Qt.DisplayRole, - self.ili_metaconfig_line_edit.text(), - 1, - Qt.MatchExactly, - ) - if matches: - model_index = matches[0] - metaconfig_id = self.ilimetaconfigcache.model.data( - model_index, int(IliDataItemModel.Roles.ID) - ) - - if self.current_metaconfig_id == metaconfig_id: - return - self.current_metaconfig_id = metaconfig_id - self.metaconfig_file_info_label.setText( - self.tr("Current Metaconfig File: {} ({})").format( - self.ilimetaconfigcache.model.data(model_index, Qt.DisplayRole), - metaconfig_id, - ) - ) - self.metaconfig_file_info_label.setStyleSheet("color: #341d5c") - repository = self.ilimetaconfigcache.model.data( - model_index, int(IliDataItemModel.Roles.ILIREPO) - ) - url = self.ilimetaconfigcache.model.data( - model_index, int(IliDataItemModel.Roles.URL) - ) - path = self.ilimetaconfigcache.model.data( - model_index, int(IliDataItemModel.Roles.RELATIVEFILEPATH) - ) - dataset_id = self.ilimetaconfigcache.model.data( - model_index, int(IliDataItemModel.Roles.ID) - ) - # disable the create button while downloading - self.create_tool_button.setEnabled(False) - if path: - self.ilimetaconfigcache.download_file(repository, url, path, dataset_id) - else: - self.print_info( - self.tr("File not specified for metaconfig with id {}.").format( - dataset_id - ), - LogColor.COLOR_TOPPING, - ) - - self.set_metaconfig_line_edit_state(True) - else: - self.set_metaconfig_line_edit_state( - not self.ili_metaconfig_line_edit.text() - ) - self.clean_metaconfig() - - def clean_metaconfig(self): - self.current_metaconfig_id = None - self.metaconfig.clear() - self.metaconfig_file_info_label.setText("") - self.txtStdout.clear() - - def set_metaconfig_line_edit_state(self, valid): - self.ili_metaconfig_line_edit.setStyleSheet( - "QLineEdit {{ background-color: {} }}".format( - "#ffffff" if valid else "#ffd356" - ) - ) - - def on_metaconfig_received(self, path): - self.txtStdout.clear() - self.print_info( - self.tr("Metaconfig file successfully downloaded: {}").format(path), - LogColor.COLOR_TOPPING, - ) - # parse metaconfig - self.metaconfig.clear() - with open(path) as metaconfig_file: - self.metaconfig.read_file(metaconfig_file) - self.load_metaconfig() - # enable the tool button again - self.create_tool_button.setEnabled(True) - self.fill_toml_file_info_label() - self.print_info( - self.tr("Metaconfig successfully loaded."), LogColor.COLOR_TOPPING - ) - - def on_metaconfig_failed(self, dataset_id, error_msg): - self.print_info( - self.tr("Download of metaconfig file failed: {}.").format(error_msg), - LogColor.COLOR_TOPPING, - ) - # enable the tool button again - self.create_tool_button.setEnabled(True) - - def load_crs_from_metaconfig(self, ili2db_metaconfig): - srs_auth = self.srs_auth - srs_code = self.srs_code - if "defaultSrsAuth" in ili2db_metaconfig: - srs_auth = ili2db_metaconfig.get("defaultSrsAuth") - if "defaultSrsCode" in ili2db_metaconfig: - srs_code = ili2db_metaconfig.get("defaultSrsCode") - - crs = QgsCoordinateReferenceSystem("{}:{}".format(srs_auth, srs_code)) - if not crs.isValid(): - crs = QgsCoordinateReferenceSystem(srs_code) # Fallback - self.crs = crs - self.update_crs_info() - self.crs_changed() - - def load_metaconfig(self): - # load ili2db parameters to the GUI and into the configuration - if "ch.ehi.ili2db" in self.metaconfig.sections(): - self.print_info( - self.tr("Load the ili2db configurations from the metaconfig…"), - LogColor.COLOR_TOPPING, - ) - - ili2db_metaconfig = self.metaconfig["ch.ehi.ili2db"] - - if ( - "defaultSrsAuth" in ili2db_metaconfig - or "defaultSrsCode" in ili2db_metaconfig - ): - self.load_crs_from_metaconfig(ili2db_metaconfig) - self.print_info(self.tr("- Loaded CRS"), LogColor.COLOR_TOPPING) - - if "models" in ili2db_metaconfig: - model_list = self.ili_models_line_edit.text().strip().split( - ";" - ) + ili2db_metaconfig.get("models").strip().split(";") - self.current_models = ";".join(set(model_list)) - self.ili_models_line_edit.setText(self.current_models) - self.print_info(self.tr("- Loaded models"), LogColor.COLOR_TOPPING) - - self.ili2db_options.load_metaconfig(ili2db_metaconfig) - self.print_info(self.tr("- Loaded ili2db options"), LogColor.COLOR_TOPPING) - - # get iliMetaAttrs (toml) - if "iliMetaAttrs" in ili2db_metaconfig: - self.print_info( - self.tr("- Seek for iliMetaAttrs (toml) files:"), - LogColor.COLOR_TOPPING, - ) - ili_meta_attrs_list = ili2db_metaconfig.get("iliMetaAttrs").split(";") - ili_meta_attrs_file_path_list = self.get_topping_file_list( - ili_meta_attrs_list - ) - self.ili2db_options.load_toml_file_path( - self.ili_models_line_edit.text(), - ";".join(ili_meta_attrs_file_path_list), - ) - self.print_info( - self.tr("- Loaded iliMetaAttrs (toml) files"), - LogColor.COLOR_TOPPING, - ) - - # get prescript (sql) - if "prescript" in ili2db_metaconfig: - self.print_info( - self.tr("- Seek for prescript (sql) files:"), LogColor.COLOR_TOPPING - ) - prescript_list = ili2db_metaconfig.get("prescript").split(";") - prescript_file_path_list = self.get_topping_file_list(prescript_list) - self.ili2db_options.load_pre_script_path( - ";".join(prescript_file_path_list) - ) - self.print_info( - self.tr("- Loaded prescript (sql) files"), LogColor.COLOR_TOPPING - ) - - # get postscript (sql) - if "postscript" in ili2db_metaconfig: - self.print_info( - self.tr("- Seek for postscript (sql) files:"), - LogColor.COLOR_TOPPING, - ) - postscript_list = ili2db_metaconfig.get("postscript").split(";") - postscript_file_path_list = self.get_topping_file_list(postscript_list) - self.ili2db_options.load_post_script_path( - ";".join(postscript_file_path_list) - ) - self.print_info( - self.tr("- Loaded postscript (sql) files"), LogColor.COLOR_TOPPING - ) - - def show_message(self, level, message): - if level == Qgis.Warning: - self.bar.pushMessage(message, Qgis.Info, 10) - elif level == Qgis.Critical: - self.bar.pushMessage(message, Qgis.Warning, 10) - - def fill_models_line_edit(self): - self.ili_models_line_edit.setText( - self.multiple_models_dialog.get_models_string() - ) - - def fill_toml_file_info_label(self): - text = None - if self.ili2db_options.toml_file(): - text = self.tr("Extra Meta Attribute File: {}").format( - ( - "…" - + self.ili2db_options.toml_file()[ - len(self.ili2db_options.toml_file()) - 40 : - ] - ) - if len(self.ili2db_options.toml_file()) > 40 - else self.ili2db_options.toml_file() - ) - self.toml_file_info_label.setText(text) - self.toml_file_info_label.setToolTip(self.ili2db_options.toml_file()) - - def help_requested(self): - os_language = QLocale(QSettings().value("locale/userLocale")).name()[:2] - if os_language in ["es", "de"]: - webbrowser.open( - "https://opengisch.github.io/QgisModelBaker/docs/{}/user-guide.html#generate-project".format( - os_language - ) - ) - else: - webbrowser.open( - "https://opengisch.github.io/QgisModelBaker/docs/user-guide.html#generate-project" - ) - - def advance_progress_bar_by_text(self, text): - if text.strip() == "Info: compile models…": - self.progress_bar.setValue(20) - elif text.strip() == "Info: create table structure…": - self.progress_bar.setValue(30) - - def get_topping_file_list(self, id_list): - topping_file_model = self.get_topping_file_model(id_list) - file_path_list = [] - - for file_id in id_list: - matches = topping_file_model.match( - topping_file_model.index(0, 0), Qt.DisplayRole, file_id, 1 - ) - if matches: - file_path = matches[0].data(int(topping_file_model.Roles.LOCALFILEPATH)) - self.print_info( - self.tr("- - Got file {}").format(file_path), LogColor.COLOR_TOPPING - ) - file_path_list.append(file_path) - return file_path_list - - def get_topping_file_model(self, id_list): - topping_file_cache = IliToppingFileCache(self.base_configuration, id_list) - - # we wait for the download or we timeout after 30 seconds and we apply what we have - loop = QEventLoop() - topping_file_cache.download_finished.connect(lambda: loop.quit()) - timer = QTimer() - timer.setSingleShot(True) - timer.timeout.connect(lambda: loop.quit()) - timer.start(30000) - - topping_file_cache.refresh() - self.print_info(self.tr("- - Downloading…"), LogColor.COLOR_TOPPING) - - if len(topping_file_cache.downloaded_files) != len(id_list): - loop.exec() - - if len(topping_file_cache.downloaded_files) == len(id_list): - self.print_info( - self.tr("- - All topping files successfully downloaded"), - LogColor.COLOR_TOPPING, - ) - else: - missing_file_ids = id_list - for downloaded_file_id in topping_file_cache.downloaded_files: - if downloaded_file_id in missing_file_ids: - missing_file_ids.remove(downloaded_file_id) - self.print_info( - self.tr( - "- - Some topping files where not successfully downloaded: {}" - ).format(" ".join(missing_file_ids)), - LogColor.COLOR_TOPPING, - ) - - return topping_file_cache.model - - def ilidata_path_resolver(self, base_path, path): - if "ilidata:" in path or "file:" in path: - data_file_path_list = self.get_topping_file_list([path]) - return data_file_path_list[0] if data_file_path_list else None - return os.path.join(base_path, path) diff --git a/QgisModelBaker/gui/import_data.py b/QgisModelBaker/gui/import_data.py deleted file mode 100644 index 4559d3f7c..000000000 --- a/QgisModelBaker/gui/import_data.py +++ /dev/null @@ -1,600 +0,0 @@ -""" -/*************************************************************************** - ------------------- - begin : 30/05/17 - git sha : :%H$ - copyright : (C) 2017 by Germán Carrillo (BSF-Swissphoto) - email : gcarrillo@linuxmail.org - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ -""" - -import re -import webbrowser - -from qgis.core import Qgis -from qgis.gui import QgsGui, QgsMessageBar -from qgis.PyQt.QtCore import QCoreApplication, QLocale, QSettings, Qt -from qgis.PyQt.QtGui import QColor, QDesktopServices, QValidator -from qgis.PyQt.QtWidgets import ( - QAction, - QCompleter, - QDialog, - QDialogButtonBox, - QGridLayout, - QMessageBox, - QSizePolicy, -) - -from QgisModelBaker.gui.edit_command import EditCommandDialog -from QgisModelBaker.gui.ili2db_options import Ili2dbOptionsDialog -from QgisModelBaker.gui.multiple_models import MultipleModelsDialog -from QgisModelBaker.gui.options import OptionsDialog -from QgisModelBaker.gui.panel import db_panel_utils -from QgisModelBaker.libs.modelbaker.db_factory.db_simple_factory import DbSimpleFactory -from QgisModelBaker.libs.modelbaker.dbconnector.db_connector import DBConnectorError -from QgisModelBaker.libs.modelbaker.iliwrapper import ili2dbconfig, iliimporter -from QgisModelBaker.libs.modelbaker.iliwrapper.globals import DbIliMode -from QgisModelBaker.libs.modelbaker.iliwrapper.ili2dbutils import ( - JavaNotFoundError, - color_log_text, -) -from QgisModelBaker.libs.modelbaker.iliwrapper.ilicache import ( - IliCache, - ModelCompleterDelegate, -) -from QgisModelBaker.libs.modelbaker.utils.globals import DbActionType -from QgisModelBaker.libs.modelbaker.utils.qt_utils import ( - FileValidator, - OverrideCursor, - Validators, - make_file_selector, -) -from QgisModelBaker.utils import gui_utils -from QgisModelBaker.utils.globals import displayDbIliMode -from QgisModelBaker.utils.gui_utils import LogColor - -DIALOG_UI = gui_utils.get_ui_class("import_data.ui") - - -class ImportDataDialog(QDialog, DIALOG_UI): - - ValidExtensions = [ - "xtf", - "XTF", - "itf", - "ITF", - "pdf", - "PDF", - "xml", - "XML", - "xls", - "XLS", - "xlsx", - "XLSX", - ] - - ModelMissingRegExp = re.compile(r"Error: failed to query .*\.t_ili2db_seq") - - def __init__(self, iface, base_config, parent=None): - - QDialog.__init__(self, parent) - self.iface = iface - self.setupUi(self) - QgsGui.instance().enableAutoGeometryRestore(self) - self.db_simple_factory = DbSimpleFactory() - self.buttonBox.accepted.disconnect() - self.buttonBox.clear() - self.buttonBox.addButton(QDialogButtonBox.Cancel) - self.buttonBox.addButton(QDialogButtonBox.Help) - self.buttonBox.helpRequested.connect(self.help_requested) - - self.import_text = self.tr("Import Data") - self.set_button_to_import_action = QAction(self.import_text, None) - self.set_button_to_import_action.triggered.connect(self.set_button_to_import) - - self.import_without_validation_text = self.tr("Import without validation") - self.set_button_to_import_without_validation_action = QAction( - self.import_without_validation_text, None - ) - self.set_button_to_import_without_validation_action.triggered.connect( - self.set_button_to_import_without_validation - ) - - self.edit_command_action = QAction(self.tr("Edit ili2db command"), None) - self.edit_command_action.triggered.connect(self.edit_command) - - self.import_tool_button.addAction( - self.set_button_to_import_without_validation_action - ) - self.import_tool_button.addAction(self.edit_command_action) - self.import_tool_button.setText(self.import_text) - self.import_tool_button.clicked.connect(self.accepted) - - self.xtf_file_browse_button.clicked.connect( - make_file_selector( - self.xtf_file_line_edit, - title=self.tr("Open Transfer or Catalog File"), - file_filter=self.tr( - "Transfer File (*.xtf *.itf *.XTF *.ITF);;Catalogue File (*.xml *.XML *.xls *.XLS *.xlsx *.XLSX)" - ), - ) - ) - - self.type_combo_box.clear() - self._lst_panel = dict() - - for db_id in self.db_simple_factory.get_db_list(False): - self.type_combo_box.addItem(displayDbIliMode[db_id], db_id) - item_panel = db_panel_utils.get_config_panel( - db_id, self, DbActionType.IMPORT_DATA - ) - self._lst_panel[db_id] = item_panel - self.db_layout.addWidget(item_panel) - - self.type_combo_box.currentIndexChanged.connect(self.type_changed) - self.ili2db_options = Ili2dbOptionsDialog(self, False) - self.ili2db_options_button.clicked.connect(self.ili2db_options.open) - self.ili2db_options.finished.connect(self.fill_toml_file_info_label) - - self.multiple_models_dialog = MultipleModelsDialog(self) - self.multiple_models_button.clicked.connect(self.multiple_models_dialog.open) - self.multiple_models_dialog.accepted.connect(self.fill_models_line_edit) - - self.validate_data = True # validates imported data by default, We use --disableValidation when is False - self.base_configuration = base_config - self.restore_configuration() - - self.validators = Validators() - fileValidator = FileValidator( - pattern=["*." + ext for ext in self.ValidExtensions] - ) - - self.xtf_file_line_edit.setValidator(fileValidator) - - self.ili_models_line_edit.setPlaceholderText( - self.tr("[Search model in repository]") - ) - self.ili_models_line_edit.textChanged.connect(self.complete_models_completer) - self.ili_models_line_edit.punched.connect(self.complete_models_completer) - - self.xtf_file_line_edit.textChanged.connect(self.validators.validate_line_edits) - self.xtf_file_line_edit.textChanged.emit(self.xtf_file_line_edit.text()) - - # Reset to import as default text - self.xtf_file_line_edit.textChanged.connect(self.set_button_to_import) - - settings = QSettings() - ilifile = settings.value("QgisModelBaker/ili2db/ilifile") - self.ilicache = IliCache(base_config, ilifile or None) - self.update_models_completer() - self.ilicache.refresh() - - self.bar = QgsMessageBar() - self.bar.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed) - self.txtStdout.setLayout(QGridLayout()) - self.txtStdout.layout().setContentsMargins(0, 0, 0, 0) - self.txtStdout.layout().addWidget(self.bar, 0, 0, Qt.AlignTop) - - def set_button_to_import(self): - """ - Changes the text of the button to import (with validation) and sets the validate_data to true. - So on clicking the button the import will start with validation. - The buttons actions are changed to be able to switch the without-validation mode. - """ - self.validate_data = True - self.import_tool_button.removeAction(self.set_button_to_import_action) - self.import_tool_button.removeAction(self.edit_command_action) - self.import_tool_button.addAction( - self.set_button_to_import_without_validation_action - ) - self.import_tool_button.addAction(self.edit_command_action) - self.import_tool_button.setText(self.import_text) - - def set_button_to_import_without_validation(self): - """ - Changes the text of the button to import without validation and sets the validate_data to false. - So on clicking the button the import will start without validation. - The buttons actions are changed to be able to switch the with-validation mode. - """ - self.validate_data = False - self.import_tool_button.removeAction( - self.set_button_to_import_without_validation_action - ) - self.import_tool_button.removeAction(self.edit_command_action) - self.import_tool_button.addAction(self.set_button_to_import_action) - self.import_tool_button.addAction(self.edit_command_action) - self.import_tool_button.setText(self.import_without_validation_text) - - def edit_command(self): - """ - A dialog opens giving the user the possibility to edit the ili2db command used for the import - """ - importer = iliimporter.Importer() - importer.tool = self.type_combo_box.currentData() - importer.configuration = self.updated_configuration() - command = importer.command(True) - edit_command_dialog = EditCommandDialog(self) - edit_command_dialog.command_edit.setPlainText(command) - if edit_command_dialog.exec_(): - edited_command = edit_command_dialog.command_edit.toPlainText() - self.accepted(edited_command) - - def accepted(self, edited_command=None): - db_id = self.type_combo_box.currentData() - res, message = self._lst_panel[db_id].is_valid() - - if not res: - self.txtStdout.setText(message) - return - - configuration = self.updated_configuration() - - if not edited_command: - if ( - not self.xtf_file_line_edit.validator().validate( - configuration.xtffile, 0 - )[0] - == QValidator.Acceptable - ): - self.txtStdout.setText( - self.tr( - "Please set a valid INTERLIS transfer or catalogue file before importing data." - ) - ) - self.xtf_file_line_edit.setFocus() - return - - # create schema with superuser - db_factory = self.db_simple_factory.create_factory(db_id) - res, message = db_factory.pre_generate_project(configuration) - - if not res: - self.txtStdout.setText(message) - return - - with OverrideCursor(Qt.WaitCursor): - self.progress_bar.show() - self.progress_bar.setValue(0) - - self.disable() - self.txtStdout.setTextColor(QColor(LogColor.COLOR_INFO)) - self.txtStdout.clear() - - dataImporter = iliimporter.Importer(dataImport=True) - - dataImporter.tool = self.type_combo_box.currentData() - dataImporter.configuration = configuration - - self.save_configuration(configuration) - - dataImporter.stdout.connect(self.print_info) - dataImporter.stderr.connect(self.on_stderr) - dataImporter.process_started.connect(self.on_process_started) - dataImporter.process_finished.connect(self.on_process_finished) - - self.progress_bar.setValue(25) - - try: - if dataImporter.run(edited_command) != iliimporter.Importer.SUCCESS: - self.enable() - self.progress_bar.hide() - return - except JavaNotFoundError as e: - self.txtStdout.setTextColor(QColor(LogColor.COLOR_INFO)) - self.txtStdout.clear() - self.txtStdout.setText(e.error_string) - self.enable() - self.progress_bar.hide() - - QApplication.restoreOverrideCursor() - QMessageBox.critical( - self, self.tr("Java not found error"), e.error_string - ) - - return - - self.buttonBox.clear() - self.buttonBox.setEnabled(True) - self.buttonBox.addButton(QDialogButtonBox.Close) - self.progress_bar.setValue(100) - - self.refresh_layers() - - def refresh_layers(self): - # refresh layers - try: - for layer in self.iface.mapCanvas().layers(): - layer.dataProvider().reloadData() - self.iface.layerTreeView().layerTreeModel().recursivelyEmitDataChanged() - except AttributeError: - pass - - def print_info(self, text, text_color=LogColor.COLOR_INFO): - self.txtStdout.setTextColor(QColor(text_color)) - self.txtStdout.append(text) - QCoreApplication.processEvents() - - def on_stderr(self, text): - color_log_text(text, self.txtStdout) - match = re.match(ImportDataDialog.ModelMissingRegExp, text) - if match: - color_log_text( - "=======================================================================", - self.txtStdout, - ) - color_log_text( - self.tr( - "It looks like the required schema for the imported data has not been generated." - ), - self.txtStdout, - ) - color_log_text( - self.tr("Did you generate the model in the database?"), self.txtStdout - ) - color_log_text( - self.tr( - "Note: the model for a catalogue may be different from the data model itself." - ), - self.txtStdout, - ) - color_log_text( - "=======================================================================", - self.txtStdout, - ) - self.advance_progress_bar_by_text(text) - - def show_message(self, level, message): - if level == Qgis.Warning: - self.bar.pushMessage(message, Qgis.Info, 10) - elif level == Qgis.Critical: - self.bar.pushMessage(message, Qgis.Warning, 10) - - def on_process_started(self, command): - self.disable() - self.txtStdout.setTextColor(QColor(LogColor.COLOR_INFO)) - self.txtStdout.clear() - self.txtStdout.setText(command) - QCoreApplication.processEvents() - - def on_process_finished(self, exit_code, result): - color = "#004905" if exit_code == 0 else "#aa2222" - self.txtStdout.setTextColor(QColor(color)) - self.txtStdout.append("Finished ({})".format(exit_code)) - if result == iliimporter.Importer.SUCCESS: - self.buttonBox.clear() - self.buttonBox.setEnabled(True) - self.buttonBox.addButton(QDialogButtonBox.Close) - else: - if self.import_without_validate(): - self.set_button_to_import_without_validation() - self.enable() - - def import_without_validate(self): - """ - Valid if an error occurred that prevents executing the import without validations - :return: True if you can execute the import without validations, False in other case - """ - log = self.txtStdout.toPlainText().lower() - if "no models given" in log: - return False - if "attribute bid missing in basket" in log: - return False - return True - - def db_ili_version(self, configuration): - """ - Returns the ili2db version the database has been created with or None if the database - could not be detected as a ili2db database - """ - db_connector = self.__db_connector(configuration) - - if db_connector: - return db_connector.ili_version() - - return None - - def updated_configuration(self): - """ - Get the configuration that is updated with the user configuration changes on the dialog. - :return: Configuration - """ - configuration = ili2dbconfig.ImportDataConfiguration() - - mode = self.type_combo_box.currentData() - self._lst_panel[mode].get_fields(configuration) - - configuration.tool = mode - configuration.xtffile = self.xtf_file_line_edit.text().strip() - configuration.delete_data = self.chk_delete_data.isChecked() - configuration.ilimodels = self.ili_models_line_edit.text().strip() - configuration.inheritance = self.ili2db_options.inheritance_type() - configuration.create_basket_col = self.ili2db_options.create_basket_col() - configuration.create_import_tid = self.ili2db_options.create_import_tid() - configuration.stroke_arcs = self.ili2db_options.stroke_arcs() - configuration.pre_script = self.ili2db_options.pre_script() - configuration.post_script = self.ili2db_options.post_script() - configuration.base_configuration = self.base_configuration - configuration.db_ili_version = self.db_ili_version(configuration) - - configuration.with_schemaimport = True - db_connector = self.__db_connector(configuration) - if db_connector and db_connector.db_or_schema_exists(): - configuration.with_schemaimport = False - - if not self.validate_data: - configuration.disable_validation = True - return configuration - - def save_configuration(self, configuration): - settings = QSettings() - settings.setValue("QgisModelBaker/ili2pg/xtffile_import", configuration.xtffile) - settings.setValue("QgisModelBaker/ili2pg/deleteData", configuration.delete_data) - settings.setValue( - "QgisModelBaker/importtype", self.type_combo_box.currentData().name - ) - - mode = self.type_combo_box.currentData() - db_factory = self.db_simple_factory.create_factory(mode) - config_manager = db_factory.get_db_command_config_manager(configuration) - config_manager.save_config_in_qsettings() - - def restore_configuration(self): - settings = QSettings() - self.fill_toml_file_info_label() - self.xtf_file_line_edit.setText( - settings.value("QgisModelBaker/ili2pg/xtffile_import") - ) - # set chk_delete_data always to unchecked because otherwise the user could delete the data accidentally - self.chk_delete_data.setChecked(False) - - for db_id in self.db_simple_factory.get_db_list(False): - configuration = iliimporter.ImportDataConfiguration() - db_factory = self.db_simple_factory.create_factory(db_id) - config_manager = db_factory.get_db_command_config_manager(configuration) - config_manager.load_config_from_qsettings() - self._lst_panel[db_id].set_fields(configuration) - - mode = settings.value("QgisModelBaker/importtype") - mode = DbIliMode[mode] if mode else self.db_simple_factory.default_database - mode = mode & ~DbIliMode.ili - - self.type_combo_box.setCurrentIndex(self.type_combo_box.findData(mode)) - self.type_changed() - - def disable(self): - self.type_combo_box.setEnabled(False) - for key, value in self._lst_panel.items(): - value.setEnabled(False) - self.ili_config.setEnabled(False) - self.buttonBox.setEnabled(False) - - def enable(self): - self.type_combo_box.setEnabled(True) - for key, value in self._lst_panel.items(): - value.setEnabled(True) - self.ili_config.setEnabled(True) - self.buttonBox.setEnabled(True) - - def type_changed(self): - self.txtStdout.clear() - self.set_button_to_import() - self.progress_bar.hide() - - db_id = self.type_combo_box.currentData() - self.db_wrapper_group_box.setTitle(displayDbIliMode[db_id]) - - # Refresh panels - for key, value in self._lst_panel.items(): - value.interlis_mode = False - is_current_panel_selected = db_id == key - value.setVisible(is_current_panel_selected) - if is_current_panel_selected: - value._show_panel() - - def link_activated(self, link): - if link.url() == "#configure": - cfg = OptionsDialog(self.base_configuration) - if cfg.exec_(): - settings = QSettings() - settings.beginGroup("QgisModelBaker/ili2db") - self.base_configuration.save(settings) - else: - QDesktopServices.openUrl(link) - - def complete_models_completer(self): - if not self.ili_models_line_edit.text(): - self.ili_models_line_edit.completer().setCompletionMode( - QCompleter.UnfilteredPopupCompletion - ) - self.ili_models_line_edit.completer().complete() - else: - match_contains = ( - self.ili_models_line_edit.completer() - .completionModel() - .match( - self.ili_models_line_edit.completer().completionModel().index(0, 0), - Qt.DisplayRole, - self.ili_models_line_edit.text(), - -1, - Qt.MatchContains, - ) - ) - if len(match_contains) > 1: - self.ili_models_line_edit.completer().setCompletionMode( - QCompleter.PopupCompletion - ) - self.ili_models_line_edit.completer().complete() - - def update_models_completer(self): - completer = QCompleter(self.ilicache.model, self.ili_models_line_edit) - completer.setCaseSensitivity(Qt.CaseInsensitive) - completer.setFilterMode(Qt.MatchContains) - self.delegate = ModelCompleterDelegate() - completer.popup().setItemDelegate(self.delegate) - self.ili_models_line_edit.setCompleter(completer) - self.multiple_models_dialog.models_line_edit.setCompleter(completer) - - def fill_models_line_edit(self): - self.ili_models_line_edit.setText( - self.multiple_models_dialog.get_models_string() - ) - - def fill_toml_file_info_label(self): - text = None - if self.ili2db_options.toml_file(): - text = self.tr("Extra Meta Attribute File: {}").format( - ( - "…" - + self.ili2db_options.toml_file()[ - len(self.ili2db_options.toml_file()) - 40 : - ] - ) - if len(self.ili2db_options.toml_file()) > 40 - else self.ili2db_options.toml_file() - ) - self.toml_file_info_label.setText(text) - self.toml_file_info_label.setToolTip(self.ili2db_options.toml_file()) - - def help_requested(self): - os_language = QLocale(QSettings().value("locale/userLocale")).name()[:2] - if os_language in ["es", "de"]: - webbrowser.open( - "https://opengisch.github.io/QgisModelBaker/docs/{}/user-guide.html#import-an-interlis-transfer-file-xtf".format( - os_language - ) - ) - else: - webbrowser.open( - "https://opengisch.github.io/QgisModelBaker/docs/user-guide.html#import-an-interlis-transfer-file-xtf" - ) - - def advance_progress_bar_by_text(self, text): - if text.strip() == "Info: compile models...": - self.progress_bar.setValue(50) - QCoreApplication.processEvents() - elif text.strip() == "Info: create table structure...": - self.progress_bar.setValue(75) - QCoreApplication.processEvents() - - def __db_connector(self, configuration): - db_factory = self.db_simple_factory.create_factory(configuration.tool) - config_manager = db_factory.get_db_command_config_manager(configuration) - try: - db_connector = db_factory.get_db_connector( - config_manager.get_uri(configuration.db_use_super_login) - or config_manager.get_uri(), - configuration.dbschema, - ) - db_connector.new_message.connect(self.show_message) - return db_connector - except (DBConnectorError, FileNotFoundError): - return None diff --git a/QgisModelBaker/gui/multiple_models.py b/QgisModelBaker/gui/multiple_models.py deleted file mode 100644 index b16c9cdf0..000000000 --- a/QgisModelBaker/gui/multiple_models.py +++ /dev/null @@ -1,67 +0,0 @@ -""" -/*************************************************************************** - ------------------- - begin : 25.11.2017 - git sha : :%H$ - copyright : (C) 2017 by Germán Carrillo (BSF-Swissphoto) - email : gcarrillo@linuxmail.org - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ -""" -from qgis.gui import QgsGui -from qgis.PyQt.QtCore import Qt -from qgis.PyQt.QtWidgets import QDialog, QDialogButtonBox, QListWidgetItem - -from QgisModelBaker.utils.gui_utils import get_ui_class - -DIALOG_UI = get_ui_class("multiple_models.ui") - - -class MultipleModelsDialog(QDialog, DIALOG_UI): - def __init__(self, parent=None): - QDialog.__init__(self, parent) - self.setupUi(self) - QgsGui.instance().enableAutoGeometryRestore(self) - self.parent = parent - - self.model_list.itemSelectionChanged.connect(self.on_selection_changed) - self.on_selection_changed() - - self.add_button.clicked.connect(self.add_model) - self.remove_button.clicked.connect(self.remove_model) - self.buttonBox.accepted.connect(self.accepted) - - self.models_line_edit.textChanged.connect(self.update_add_button_state) - self.models_line_edit.textChanged.emit(self.models_line_edit.text()) - - def add_model(self): - model_name = self.models_line_edit.text().strip() - if not self.model_list.findItems(model_name, Qt.MatchExactly): - self.model_list.addItem(QListWidgetItem(model_name)) - self.models_line_edit.setText("") - - def remove_model(self): - for item in self.model_list.selectedItems(): - self.model_list.takeItem(self.model_list.row(item)) - - def get_models_string(self): - items = [self.model_list.item(x) for x in range(self.model_list.count())] - models = ";".join([i.text().strip() for i in items if i.text().strip()]) - return models - - def on_selection_changed(self): - enable = len(self.model_list.selectedItems()) == 1 - self.remove_button.setEnabled(enable) - - def update_add_button_state(self, text): - self.add_button.setEnabled(bool(text.strip())) - self.add_button.setDefault(bool(text.strip())) - self.buttonBox.button(QDialogButtonBox.Ok).setDefault(not bool(text.strip())) diff --git a/QgisModelBaker/qgismodelbaker.py b/QgisModelBaker/qgismodelbaker.py index 27061fae9..54106e1d3 100644 --- a/QgisModelBaker/qgismodelbaker.py +++ b/QgisModelBaker/qgismodelbaker.py @@ -41,9 +41,6 @@ from QgisModelBaker.gui.dataset_manager import DatasetManagerDialog from QgisModelBaker.gui.drop_message import DropMessageDialog -from QgisModelBaker.gui.export import ExportDialog -from QgisModelBaker.gui.generate_project import GenerateProjectDialog -from QgisModelBaker.gui.import_data import ImportDataDialog from QgisModelBaker.gui.options import OptionsDialog from QgisModelBaker.gui.panel.dataset_selector import DatasetSelector from QgisModelBaker.gui.topping_wizard.topping_wizard import ToppingWizardDialog @@ -61,16 +58,10 @@ def __init__(self, iface): self.iface = iface self.plugin_dir = os.path.dirname(__file__) - self.generate_dlg = None - self.export_dlg = None - self.importdata_dlg = None self.workflow_wizard_dlg = None self.datasetmanager_dlg = None self.topping_wizard_dlg = None - self.__generate_action = None - self.__export_action = None - self.__importdata_action = None self.__workflow_wizard_action = None self.__datasetmanager_action = None self.__validate_action = None @@ -121,35 +112,6 @@ def initGui(self): pyplugin_installer.instance().uninstallPlugin( "projectgenerator", quiet=True ) - self.__generate_action = QAction( - QIcon( - os.path.join( - os.path.dirname(__file__), "images/QgisModelBaker-generate-icon.svg" - ) - ), - self.tr("Generate"), - None, - ) - self.__export_action = QAction( - QIcon( - os.path.join( - os.path.dirname(__file__), - "images/QgisModelBaker-xtf-export-icon.svg", - ) - ), - self.tr("Export Interlis Transfer File (.xtf)"), - None, - ) - self.__importdata_action = QAction( - QIcon( - os.path.join( - os.path.dirname(__file__), - "images/QgisModelBaker-xtf-import-icon.svg", - ) - ), - self.tr("Import Interlis Transfer File (.xtf)"), - None, - ) self.__datasetmanager_action = QAction( QIcon( os.path.join( @@ -198,20 +160,14 @@ def initGui(self): self.__about_action = QAction(self.tr("About"), None) # set these actions checkable to visualize that the dialog is open - self.__generate_action.setCheckable(True) - self.__export_action.setCheckable(True) - self.__importdata_action.setCheckable(True) self.__workflow_wizard_action.setCheckable(True) self.__datasetmanager_action.setCheckable(True) self.__validate_action.setCheckable(True) self.__topping_wizard_action.setCheckable(True) - self.__generate_action.triggered.connect(self.show_generate_dialog) self.__configure_action.triggered.connect(self.show_options_dialog) - self.__importdata_action.triggered.connect(self.show_importdata_dialog) self.__datasetmanager_action.triggered.connect(self.show_datasetmanager_dialog) self.__validate_action.triggered.connect(self.show_validate_dock) - self.__export_action.triggered.connect(self.show_export_dialog) self.__workflow_wizard_action.triggered.connect( self.show_workflow_wizard_dialog ) @@ -273,9 +229,6 @@ def unload(self): self.iface.layerTreeView().currentLayerChanged.disconnect( self.__dataset_selector.set_current_layer ) - del self.__generate_action - del self.__export_action - del self.__importdata_action del self.__workflow_wizard_action del self.__datasetmanager_action del self.__validate_action @@ -290,40 +243,6 @@ def unload(self): self.remove_validate_dock() - def show_generate_dialog(self): - if self.generate_dlg: - self.generate_dlg.reject() - else: - self.generate_dlg = GenerateProjectDialog( - self.iface, self.ili2db_configuration, self.iface.mainWindow() - ) - self.generate_dlg.setAttribute(Qt.WA_DeleteOnClose) - self.generate_dlg.setWindowFlags(self.generate_dlg.windowFlags() | Qt.Tool) - self.generate_dlg.show() - self.generate_dlg.finished.connect(self.generate_dialog_finished) - self.__generate_action.setChecked(True) - - def generate_dialog_finished(self): - self.__generate_action.setChecked(False) - self.generate_dlg = None - - def show_export_dialog(self): - if self.export_dlg: - self.export_dlg.reject() - else: - self.export_dlg = ExportDialog( - self.ili2db_configuration, self.iface.mainWindow() - ) - self.export_dlg.setAttribute(Qt.WA_DeleteOnClose) - self.export_dlg.setWindowFlags(self.export_dlg.windowFlags() | Qt.Tool) - self.export_dlg.show() - self.export_dlg.finished.connect(self.export_dialog_finished) - self.__export_action.setChecked(True) - - def export_dialog_finished(self): - self.__export_action.setChecked(False) - self.export_dlg = None - def show_workflow_wizard_dialog(self): if self.workflow_wizard_dlg: self.workflow_wizard_dlg.reject() @@ -366,25 +285,6 @@ def topping_wizard_dialog_finished(self): self.__topping_wizard_action.setChecked(False) self.topping_wizard_dlg = None - def show_importdata_dialog(self): - if self.importdata_dlg: - self.importdata_dlg.reject() - else: - self.importdata_dlg = ImportDataDialog( - self.iface, self.ili2db_configuration, self.iface.mainWindow() - ) - self.importdata_dlg.setAttribute(Qt.WA_DeleteOnClose) - self.importdata_dlg.setWindowFlags( - self.importdata_dlg.windowFlags() | Qt.Tool - ) - self.importdata_dlg.show() - self.importdata_dlg.finished.connect(self.importdata_dialog_finished) - self.__importdata_action.setChecked(True) - - def importdata_dialog_finished(self): - self.__importdata_action.setChecked(False) - self.importdata_dlg = None - def show_datasetmanager_dialog(self): if self.datasetmanager_dlg: self.datasetmanager_dlg.reject() diff --git a/QgisModelBaker/ui/export.ui b/QgisModelBaker/ui/export.ui deleted file mode 100644 index 07997d68e..000000000 --- a/QgisModelBaker/ui/export.ui +++ /dev/null @@ -1,233 +0,0 @@ - - - InterlisExport - - - - 0 - 0 - 718 - 771 - - - - Export Interlis Data - - - - - - - - - 0 - 0 - - - - - 88 - 16777215 - - - - Source - - - - - - - - PostGIS - - - - - GeoPackage - - - - - - - - - - 0 - - - - - - - - - 0 - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Help - - - - - - - ... - - - QToolButton::MenuButtonPopup - - - - - - - - - - - - - - - - - false - - - - - - - Interlis - - - - - - - - - Models - - - - - - - Qt::Horizontal - - - - 40 - 3 - - - - - - - - Browse XTF files - - - - - - - - - - XTF File - - - - - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - - - - - - SpaceCheckListView - -
QgisModelBaker.utils.gui_utils
- 1 -
-
- - type_combo_box - xtf_file_line_edit - xtf_file_browse_button - txtStdout - - - - - buttonBox - accepted() - InterlisExport - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - InterlisExport - reject() - - - 316 - 260 - - - 286 - 274 - - - - -
diff --git a/QgisModelBaker/ui/generate_project.ui b/QgisModelBaker/ui/generate_project.ui deleted file mode 100644 index 7d5687fed..000000000 --- a/QgisModelBaker/ui/generate_project.ui +++ /dev/null @@ -1,328 +0,0 @@ - - - InterlisImport - - - - 0 - 0 - 641 - 803 - - - - Generate Project - - - - - - - 0 - 0 - - - - - 88 - 16777215 - - - - Source - - - - - - - - Interlis (PostGIS) - - - - - Interlis (GeoPackage) - - - - - PostGIS - - - - - GeoPackage - - - - - - - - 0 - - - - - - - - - - false - - - - - - - Interlis - - - - - - - 580 - 16777215 - - - - - - - - - - - Qt::StrongFocus - - - - - - - [Optional] - - - - - - - Coordinate Reference System - - - CRS - - - - - - - Models - - - - - - - Advanced Options - - - - - - - Select multiple Interlis models - - - - - - - - - - - - - - - - Metaconfiguration / Topping - - - - - - - Interlis File - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Browse Interlis files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - - 0 - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Help - - - - - - - ... - - - QToolButton::MenuButtonPopup - - - - - - - Create - - - - - - - - - - - - - - - QgsProjectionSelectionWidget - QWidget -
qgis.gui
- 1 -
- - CompletionLineEdit - -
QgisModelBaker.utils.gui_utils
- 1 -
-
- - type_combo_box - ili_file_line_edit - ili_file_browse_button - ili_models_line_edit - multiple_models_button - crsSelector - ili2db_options_button - txtStdout - buttonBox - - - - - buttonBox - accepted() - InterlisImport - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - InterlisImport - reject() - - - 316 - 260 - - - 286 - 274 - - - - -
diff --git a/QgisModelBaker/ui/import_data.ui b/QgisModelBaker/ui/import_data.ui deleted file mode 100644 index ad0626191..000000000 --- a/QgisModelBaker/ui/import_data.ui +++ /dev/null @@ -1,276 +0,0 @@ - - - InterlisImportData - - - - 0 - 0 - 718 - 791 - - - - Import Interlis Data - - - - - - - - - 0 - 0 - - - - - 88 - 16777215 - - - - Target - - - - - - - - PostGIS - - - - - GeoPackage - - - - - - - - - - 0 - - - - - - - Interlis - - - - - - Browse XTF files - - - - - - - - - - Models - - - - - - - Select multiple Interlis models - - - - - - - - - - Advanced Options - - - - - - - - - - - - - XTF File - - - - - - - Qt::Horizontal - - - - 40 - 3 - - - - - - - - Delete existing data including dependencies like catalogues etc. - - - Delete existing data in affected tables - - - - - - - - 580 - 16777215 - - - - - - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - - - - - - - - false - - - - - - - - - - - - - - 0 - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Help - - - - - - - ... - - - QToolButton::MenuButtonPopup - - - - - - - - - - CompletionLineEdit - -
QgisModelBaker.utils.gui_utils
- 1 -
-
- - type_combo_box - xtf_file_line_edit - xtf_file_browse_button - ili_models_line_edit - multiple_models_button - chk_delete_data - txtStdout - - - - - buttonBox - accepted() - InterlisImportData - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - InterlisImportData - reject() - - - 316 - 260 - - - 286 - 274 - - - - -
diff --git a/QgisModelBaker/ui/multiple_models.ui b/QgisModelBaker/ui/multiple_models.ui deleted file mode 100644 index 8b9b9243a..000000000 --- a/QgisModelBaker/ui/multiple_models.ui +++ /dev/null @@ -1,181 +0,0 @@ - - - MultipleModelsDialog - - - - 0 - 0 - 413 - 266 - - - - Select multiple Interlis models - - - - - - - - Start typing a model name - - - - - - - - false - - - - QListWidget::item { border-bottom: 1px #A4A4A4; border-style: dotted;} -QListWidget::item:selected { color: white; background: #6699ff;} - - - QFrame::StyledPanel - - - QFrame::Sunken - - - 0 - - - QAbstractItemView::NoEditTriggers - - - true - - - true - - - QAbstractItemView::SingleSelection - - - false - - - QListView::ListMode - - - false - - - false - - - - - - - - - - - - 101 - 0 - - - - Add - - - false - - - - - - - - 50 - false - false - - - - Remove - - - false - - - false - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - models_line_edit - add_button - model_list - remove_button - buttonBox - - - - - buttonBox - accepted() - MultipleModelsDialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - MultipleModelsDialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - - From ca97dd356a21823e404cb5e8c583eeb076bf79d6 Mon Sep 17 00:00:00 2001 From: Damiano Lombardi Date: Thu, 10 Aug 2023 15:09:53 +0200 Subject: [PATCH 2/2] Remove unused icons --- .../images/QgisModelBaker-generate-icon.svg | 366 ----------------- QgisModelBaker/images/QgisModelBaker-icon.png | Bin 14939 -> 0 bytes .../images/QgisModelBaker-xtf-export-icon.svg | 368 ------------------ .../images/QgisModelBaker-xtf-import-icon.svg | 367 ----------------- 4 files changed, 1101 deletions(-) delete mode 100644 QgisModelBaker/images/QgisModelBaker-generate-icon.svg delete mode 100644 QgisModelBaker/images/QgisModelBaker-icon.png delete mode 100644 QgisModelBaker/images/QgisModelBaker-xtf-export-icon.svg delete mode 100644 QgisModelBaker/images/QgisModelBaker-xtf-import-icon.svg diff --git a/QgisModelBaker/images/QgisModelBaker-generate-icon.svg b/QgisModelBaker/images/QgisModelBaker-generate-icon.svg deleted file mode 100644 index b81dcd63d..000000000 --- a/QgisModelBaker/images/QgisModelBaker-generate-icon.svg +++ /dev/null @@ -1,366 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/QgisModelBaker/images/QgisModelBaker-icon.png b/QgisModelBaker/images/QgisModelBaker-icon.png deleted file mode 100644 index bec58a69115bad3def6a4b74f9df42bea293d5ac..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14939 zcmaibby!r<*Y262L%KVpTaacLx}-a#5fG5>?hZvl=@bM6qy)(!1tgVjM7q20@%KI7 zbH984xObj2GiT=6`<%7cUh%GX?-Q$`rtk!l0uum$CrXO4S^xk6Payz0D)?pMR`v?~ zLUxx{(m@Ab0qE8-;BO2UMMHP6{q(;#M4C0r2mF)VL(afM+xeA;w}qPx;O*_rZU4r> z-O9qnhTGZAHtRr~0s!a$C0QvQpX~h{?*Pj4`$seHx$bl)-}zW8Tb{2Ul<1ta1xw)F z*o+p$m<8{pNtY+m4fTSZ*dpNcmG9q@VA`ZT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+;f=#4KTP5~EpA{GxA0rvoU-smXqkHV^w>=_R~H diff --git a/QgisModelBaker/images/QgisModelBaker-xtf-export-icon.svg b/QgisModelBaker/images/QgisModelBaker-xtf-export-icon.svg deleted file mode 100644 index 63ebb5fa6..000000000 --- a/QgisModelBaker/images/QgisModelBaker-xtf-export-icon.svg +++ /dev/null @@ -1,368 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/QgisModelBaker/images/QgisModelBaker-xtf-import-icon.svg b/QgisModelBaker/images/QgisModelBaker-xtf-import-icon.svg deleted file mode 100644 index 52f13be50..000000000 --- a/QgisModelBaker/images/QgisModelBaker-xtf-import-icon.svg +++ /dev/null @@ -1,367 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - -