Ejemplo n.º 1
0
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/
"""

from QgisModelBaker.utils import get_ui_class
from QgisModelBaker.utils.qt_utils import selectFolder

from qgis.PyQt.QtCore import QCoreApplication, Qt
from qgis.PyQt.QtWidgets import QDialog, QListWidgetItem

from qgis.gui import QgsGui


DIALOG_UI = get_ui_class('custom_model_dir.ui')


class CustomModelDirDialog(QDialog, DIALOG_UI):

    def __init__(self, current_paths, parent=None):
        QDialog.__init__(self, parent)
        self.setupUi(self)
        QgsGui.instance().enableAutoGeometryRestore(self);
        self.parent = parent

        paths = current_paths.split(";")
        self.model_dir_list.addItems(
            [path for path in paths if path.strip()] or [''])
        for i in range(self.model_dir_list.count()):
            self.set_flags(self.model_dir_list.item(i))
Ejemplo n.º 2
0
 ***************************************************************************/
"""
import webbrowser

from QgisModelBaker.libili2db.globals import DbIliMode, displayDbIliMode
from QgisModelBaker.libqgsprojectgen.db_factory.db_simple_factory import DbSimpleFactory
from QgisModelBaker.libili2db.ili2dbconfig import SchemaImportConfiguration, ImportDataConfiguration, \
    ExportConfiguration
from QgisModelBaker.utils import get_ui_class
from QgisModelBaker.utils import qt_utils
from QgisModelBaker.gui.custom_model_dir import CustomModelDirDialog
from qgis.PyQt.QtWidgets import QDialog, QLineEdit, QListView
from qgis.PyQt.QtCore import QLocale, QSettings, pyqtSignal, pyqtSlot, Qt, QModelIndex
from QgisModelBaker.utils.qt_utils import FileValidator, Validators

DIALOG_UI = get_ui_class('options.ui')


class OptionsDialog(QDialog, DIALOG_UI):
    def __init__(self, configuration, parent=None):
        QDialog.__init__(self, parent)
        self.setupUi(self)
        self.configuration = configuration
        self.db_simple_factory = DbSimpleFactory()

        self.pg_user_line_edit.setText(configuration.super_pg_user)
        self.pg_password_line_edit.setText(configuration.super_pg_password)

        self.custom_model_directories_line_edit.setText(
            configuration.custom_model_directories)
        self.custom_model_directories_box.setChecked(
Ejemplo n.º 3
0
 *   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.PyQt.QtCore import (QSettings, Qt)
from qgis.PyQt.QtGui import QValidator
from qgis.PyQt.QtWidgets import (QDialog, QSizePolicy)
from qgis.gui import (QgsGui, QgsMessageBar)

from QgisModelBaker.utils import get_ui_class
from QgisModelBaker.utils.qt_utils import (make_file_selector, Validators,
                                           FileValidator)

DIALOG_UI = get_ui_class('ili2db_options.ui')


class Ili2dbOptionsDialog(QDialog, DIALOG_UI):

    ValidExtensions = ['toml', 'TOML']
    SQLValidExtensions = ['sql', 'SQL']

    def __init__(self, parent=None):
        QDialog.__init__(self, parent)
        self.setupUi(self)
        QgsGui.instance().enableAutoGeometryRestore(self)
        self.toml_file_key = None

        self.buttonBox.accepted.disconnect()
        self.buttonBox.accepted.connect(self.accepted)
Ejemplo n.º 4
0
 *   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 QgisModelBaker.utils import get_ui_class
from QgisModelBaker.libili2db.globals import DropMode

from qgis.PyQt.QtWidgets import QDialog, QDialogButtonBox
from qgis.PyQt.QtCore import QSettings
from qgis.gui import QgsGui

DIALOG_UI = get_ui_class('drop_message.ui')


class DropMessageDialog(QDialog, DIALOG_UI):
    def __init__(self, file_name, parent=None):
        QDialog.__init__(self, parent)
        self.setupUi(self)
        QgsGui.instance().enableAutoGeometryRestore(self)
        self.info_label.setText(
            self.tr(
                'Do you want to use the Model Baker plugin to handle file {}?'
            ).format(file_name))
        self.accepted.connect(
            lambda: self.handle_dropped_file_configuration(True))
        self.rejected.connect(
            lambda: self.handle_dropped_file_configuration(False))
Ejemplo n.º 5
0
/***************************************************************************
 *                                                                         *
 *   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 QgisModelBaker.utils import get_ui_class

from qgis.PyQt.QtCore import Qt
from qgis.PyQt.QtWidgets import QDialog, QListWidgetItem, QDialogButtonBox
from qgis.gui import QgsGui

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)
Ejemplo n.º 6
0
        begin                : 27.08.2020
        git sha              : :%H$
        copyright            : (C) 2020 by Dave Signer
        email                : david at 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.                                   *
 *                                                                         *
 ***************************************************************************/
"""
from QgisModelBaker.utils import get_ui_class

from qgis.PyQt.QtCore import Qt
from qgis.PyQt.QtWidgets import QDialog, QListWidgetItem, QDialogButtonBox
from qgis.gui import QgsGui

DIALOG_UI = get_ui_class('edit_command.ui')


class EditCommandDialog(QDialog, DIALOG_UI):
    def __init__(self, parent=None):
        QDialog.__init__(self, parent)
        self.setupUi(self)
        QgsGui.instance().enableAutoGeometryRestore(self)
        self.button_box.button(QDialogButtonBox.Ok).setText(self.tr('Run'))