Beispiel #1
0
"""Dialog for atlas edition."""

from qgis.core import QgsMapLayerProxyModel, QgsProject

from lizmap.definitions.atlas import AtlasDefinitions
from lizmap.forms.base_edition_dialog import BaseEditionDialog
from lizmap.qgis_plugin_tools.tools.i18n import tr
from lizmap.qgis_plugin_tools.tools.resources import load_ui

__copyright__ = 'Copyright 2020, 3Liz'
__license__ = 'GPL version 3'
__email__ = '*****@*****.**'

CLASS = load_ui('ui_form_atlas.ui')


class AtlasEditionDialog(BaseEditionDialog, CLASS):
    def __init__(self, parent=None, unicity=None):
        super().__init__(parent, unicity)
        self.setupUi(self)
        self.config = AtlasDefinitions()
        self.config.add_layer_widget('layer', self.layer)
        self.config.add_layer_widget('primaryKey', self.primary_key)
        self.config.add_layer_widget('displayLayerDescription',
                                     self.display_layer_description)
        self.config.add_layer_widget('featureLabel', self.feature_label)
        self.config.add_layer_widget('sortField', self.sort_field)
        self.config.add_layer_widget('highlightGeometry',
                                     self.highlight_geometry)
        self.config.add_layer_widget('zoom', self.zoom)
        self.config.add_layer_widget('displayPopup', self.display_popup)
    QgsMapLayerProxyModel,
    QgsProject,
)

from lizmap.definitions.time_manager import TimeManagerDefinitions
from lizmap.forms.base_edition_dialog import BaseEditionDialog
from lizmap.qgis_plugin_tools.tools.i18n import tr
from lizmap.qgis_plugin_tools.tools.resources import load_ui
from lizmap.tools import is_database_layer

__copyright__ = 'Copyright 2020, 3Liz'
__license__ = 'GPL version 3'
__email__ = '*****@*****.**'


CLASS = load_ui('ui_form_time_manager.ui')


class TimeManagerEditionDialog(BaseEditionDialog, CLASS):

    def __init__(self, parent=None, unicity=None):
        super().__init__(parent, unicity)
        self.setupUi(self)
        self.config = TimeManagerDefinitions()
        self.config.add_layer_widget('layerId', self.layer)
        self.config.add_layer_widget('startAttribute', self.start_field)
        self.config.add_layer_widget('endAttribute', self.end_field)
        self.config.add_layer_widget('attributeResolution', self.resolution)
        self.config.add_layer_widget('min_timestamp', self.edit_min_value)
        self.config.add_layer_widget('max_timestamp', self.edit_max_value)
"""Dialog for filter by form."""

from qgis.core import QgsMapLayerProxyModel, QgsProject

from lizmap.definitions.filter_by_form import FilterByFormDefinitions
from lizmap.forms.base_edition_dialog import BaseEditionDialog
from lizmap.qgis_plugin_tools.tools.i18n import tr
from lizmap.qgis_plugin_tools.tools.resources import load_ui

__copyright__ = 'Copyright 2020, 3Liz'
__license__ = 'GPL version 3'
__email__ = '*****@*****.**'

CLASS = load_ui('ui_form_filter_by_form.ui')


class FilterByFormEditionDialog(BaseEditionDialog, CLASS):
    def __init__(self, parent=None, unicity=None):
        super().__init__(parent, unicity)
        self.setupUi(self)
        self.config = FilterByFormDefinitions()
        self.config.add_layer_widget('layerId', self.layer)
        self.config.add_layer_widget('title', self.title)
        self.config.add_layer_widget('type', self.type)
        self.config.add_layer_widget('field', self.field)
        self.config.add_layer_widget('min_date', self.min_date)
        self.config.add_layer_widget('max_date', self.max_date)
        self.config.add_layer_widget('format', self.filter_format)
        self.config.add_layer_widget('splitter', self.splitter)

        self.config.add_layer_label('layerId', self.label_layer)
Beispiel #4
0
from qgis.core import QgsMapLayerProxyModel, QgsProject, QgsWkbTypes

from lizmap.forms.base_edition_dialog import BaseEditionDialog
from lizmap.definitions.edition import EditionDefinitions
from lizmap.qgis_plugin_tools.tools.i18n import tr
from lizmap.qgis_plugin_tools.tools.resources import load_ui
from lizmap.tools import excluded_providers


__copyright__ = 'Copyright 2020, 3Liz'
__license__ = 'GPL version 3'
__email__ = '*****@*****.**'
__revision__ = '$Format:%H$'


CLASS = load_ui('ui_form_edition.ui')


class EditionLayerDialog(BaseEditionDialog, CLASS):

    def __init__(self, parent=None, unicity=None):
        super().__init__(parent, unicity)
        self.setupUi(self)
        self.config = EditionDefinitions()
        self.config.add_layer_widget('layerId', self.layer)
        self.config.add_layer_widget('createFeature', self.create_feature)
        self.config.add_layer_widget('modifyAttribute', self.edit_attributes)
        self.config.add_layer_widget('modifyGeometry', self.edit_geometry)
        self.config.add_layer_widget('deleteFeature', self.delete_feature)
        self.config.add_layer_widget('acl', self.allowed_groups)
from lizmap import DEFAULT_LWC_VERSION
from lizmap.definitions.base import InputType
from lizmap.definitions.dataviz import DatavizDefinitions, GraphType
from lizmap.definitions.definitions import LwcVersions
from lizmap.forms.base_edition_dialog import BaseEditionDialog
from lizmap.forms.trace_dataviz_edition import TraceDatavizEditionDialog
from lizmap.qgis_plugin_tools.tools.i18n import tr
from lizmap.qgis_plugin_tools.tools.resources import load_ui
from lizmap.qt_style_sheets import NEW_FEATURE

__copyright__ = 'Copyright 2020, 3Liz'
__license__ = 'GPL version 3'
__email__ = '*****@*****.**'

CLASS = load_ui('ui_form_dataviz.ui')


class DatavizEditionDialog(BaseEditionDialog, CLASS):
    def __init__(self, parent=None, unicity=None):
        super().__init__(parent, unicity)
        self.setupUi(self)
        self.parent = parent
        self.config = DatavizDefinitions()
        self.config.add_layer_widget('title', self.title)
        self.config.add_layer_widget('type', self.type_graph)
        self.config.add_layer_widget('description', self.text_description)
        self.config.add_layer_widget('layerId', self.layer)
        self.config.add_layer_widget('x_field', self.x_field)
        self.config.add_layer_widget('aggregation', self.aggregation)
        self.config.add_layer_widget('traces', self.traces)
Beispiel #6
0
"""Dialog for editing a trace in the dataviz window."""
from collections import OrderedDict

from qgis.PyQt.QtGui import QColor
from qgis.PyQt.QtWidgets import QDialog, QDialogButtonBox

from lizmap.definitions.base import InputType
from lizmap.definitions.dataviz import DatavizDefinitions, GraphType
from lizmap.qgis_plugin_tools.tools.i18n import tr
from lizmap.qgis_plugin_tools.tools.resources import load_ui

__copyright__ = 'Copyright 2020, 3Liz'
__license__ = 'GPL version 3'
__email__ = '*****@*****.**'

CLASS = load_ui('ui_trace.ui')


class TraceDatavizEditionDialog(QDialog, CLASS):
    def __init__(self, parent, layer, graph, uniques):
        super().__init__(parent)
        self.config = DatavizDefinitions()
        self._graph = graph
        self._layer = layer
        self.uniques = uniques
        self.setupUi(self)
        self.setWindowTitle(tr('Dataviz Trace'))

        self.y_field.setLayer(self._layer)
        self.color_field.setLayer(self._layer)
        self.z_field.setLayer(self._layer)
from qgis.core import QgsMapLayerProxyModel, QgsProject

from lizmap.definitions.attribute_table import (
    AttributeTableDefinitions,
    layer_has_custom_attribute_table,
)
from lizmap.forms.base_edition_dialog import BaseEditionDialog
from lizmap.qgis_plugin_tools.tools.i18n import tr
from lizmap.qgis_plugin_tools.tools.resources import load_ui

__copyright__ = 'Copyright 2020, 3Liz'
__license__ = 'GPL version 3'
__email__ = '*****@*****.**'

CLASS = load_ui('ui_form_attribute_table.ui')


class AttributeTableEditionDialog(BaseEditionDialog, CLASS):
    def __init__(self, parent=None, unicity=None):
        super().__init__(parent, unicity)
        self.setupUi(self)
        self.config = AttributeTableDefinitions()
        self.config.add_layer_widget('layerId', self.layer)
        self.config.add_layer_widget('primaryKey', self.field_primary_key)
        self.config.add_layer_widget('hiddenFields', self.fields_to_hide)
        self.config.add_layer_widget('pivot', self.pivot_table)
        self.config.add_layer_widget('hideAsChild', self.hide_subpanels)
        self.config.add_layer_widget('hideLayer', self.hide_layer)
        self.config.add_layer_widget('custom_config', self.has_custom_config)
Beispiel #8
0
"""Dialog for filter by login."""

from qgis.core import QgsMapLayerProxyModel

from lizmap.forms.base_edition_dialog import BaseEditionDialog
from lizmap.definitions.filter_by_login import FilterByLoginDefinitions
from lizmap.qgis_plugin_tools.tools.i18n import tr
from lizmap.qgis_plugin_tools.tools.resources import load_ui

__copyright__ = 'Copyright 2020, 3Liz'
__license__ = 'GPL version 3'
__email__ = '*****@*****.**'
__revision__ = '$Format:%H$'

CLASS = load_ui('ui_form_filter_by_login.ui')


class FilterByLoginEditionDialog(BaseEditionDialog, CLASS):
    def __init__(self, parent=None, unicity=None):
        super().__init__(parent, unicity)
        self.setupUi(self)
        self.config = FilterByLoginDefinitions()
        self.config.add_layer_widget('layerId', self.layer)
        self.config.add_layer_widget('filterAttribute', self.field)
        self.config.add_layer_widget('filterPrivate', self.filter_by_user)

        self.config.add_layer_label('layerId', self.label_layer)
        self.config.add_layer_label('filterAttribute', self.label_field)
        self.config.add_layer_label('filterPrivate', self.label_filter_user)

        self.layer.setFilters(QgsMapLayerProxyModel.VectorLayer)
"""Dialog for tooltip edition."""

from qgis.core import QgsMapLayerProxyModel, QgsProject
from qgis.PyQt.QtGui import QColor

from lizmap.definitions.tooltip import ToolTipDefinitions
from lizmap.forms.base_edition_dialog import BaseEditionDialog
from lizmap.qgis_plugin_tools.tools.i18n import tr
from lizmap.qgis_plugin_tools.tools.resources import load_ui

__copyright__ = 'Copyright 2020, 3Liz'
__license__ = 'GPL version 3'
__email__ = '*****@*****.**'


CLASS = load_ui('ui_form_tooltip.ui')


class ToolTipEditionDialog(BaseEditionDialog, CLASS):

    def __init__(self, parent=None, unicity=None):
        super().__init__(parent, unicity)
        self.setupUi(self)
        self.config = ToolTipDefinitions()
        self.config.add_layer_widget('layerId', self.layer)
        self.config.add_layer_widget('fields', self.fields)
        self.config.add_layer_widget('displayGeom', self.display_geometry)
        self.config.add_layer_widget('colorGeom', self.color)

        self.config.add_layer_label('layerId', self.label_layer)
        self.config.add_layer_label('fields', self.label_fields)
Beispiel #10
0
"""Dialog for locate by layer edition."""

from qgis.core import QgsMapLayerProxyModel, QgsProject

from lizmap.definitions.locate_by_layer import LocateByLayerDefinitions
from lizmap.forms.base_edition_dialog import BaseEditionDialog
from lizmap.qgis_plugin_tools.tools.i18n import tr
from lizmap.qgis_plugin_tools.tools.resources import load_ui

__copyright__ = 'Copyright 2020, 3Liz'
__license__ = 'GPL version 3'
__email__ = '*****@*****.**'

CLASS = load_ui('ui_form_locate_layer.ui')


class LocateLayerEditionDialog(BaseEditionDialog, CLASS):
    def __init__(self, parent=None, unicity=None):
        super().__init__(parent, unicity)
        self.setupUi(self)
        self.config = LocateByLayerDefinitions()
        self.config.add_layer_widget('layerId', self.layer)
        self.config.add_layer_widget('fieldName', self.display_field)
        self.config.add_layer_widget('filterFieldName', self.field_group_by)
        self.config.add_layer_widget('displayGeom', self.display_geometry)
        self.config.add_layer_widget('minLength', self.autocomplete)
        self.config.add_layer_widget('filterOnLocate', self.filter_layer)

        self.config.add_layer_label('layerId', self.label_layer)
        self.config.add_layer_label('fieldName', self.label_display_field)
        self.config.add_layer_label('filterFieldName', self.label_group_by)
Beispiel #11
0
 Portions created by the Initial Developer are Copyright (C) 2011
 the Initial Developer. All Rights Reserved.

 Alternatively, the contents of this file may be used under the terms of
 either of the GNU General Public License Version 2 or later (the "GPL"),
 or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 in which case the provisions of the GPL or the LGPL are applicable instead
 of those above. If you wish to allow use of your version of this file only
 under the terms of either the GPL or the LGPL, and not to allow others to
 use your version of this file under the terms of the MPL, indicate your
 decision by deleting the provisions above and replace them with the notice
 and other provisions required by the GPL or the LGPL. If you do not delete
 the provisions above, a recipient may use your version of this file under
 the terms of any one of the MPL, the GPL or the LGPL.

 ***** END LICENSE BLOCK ***** */
"""

from qgis.PyQt.QtWidgets import QDialog

from lizmap.qgis_plugin_tools.tools.resources import load_ui

FORM_CLASS = load_ui('ui_lizmap.ui')


class LizmapDialog(QDialog, FORM_CLASS):
    def __init__(self, parent=None):
        """Constructor."""
        super(LizmapDialog, self).__init__(parent)
        self.setupUi(self)
Beispiel #12
0
 of those above. If you wish to allow use of your version of this file only
 under the terms of either the GPL or the LGPL, and not to allow others to
 use your version of this file under the terms of the MPL, indicate your
 decision by deleting the provisions above and replace them with the notice
 and other provisions required by the GPL or the LGPL. If you do not delete
 the provisions above, a recipient may use your version of this file under
 the terms of any one of the MPL, the GPL or the LGPL.

 ***** END LICENSE BLOCK ***** */
"""

from qgis.PyQt.QtWidgets import QDialog, QDialogButtonBox

from lizmap.qgis_plugin_tools.tools.resources import load_ui

FORM_CLASS = load_ui('ui_lizmap_popup.ui')


class LizmapPopupDialog(QDialog, FORM_CLASS):
    def __init__(self, style_sheet, content):
        QDialog.__init__(self)
        self.setupUi(self)

        accept_button = self.bbConfigurePopup.button(QDialogButtonBox.Ok)
        accept_button.clicked.connect(self.accept)
        cancel_button = self.bbConfigurePopup.button(QDialogButtonBox.Cancel)
        cancel_button.clicked.connect(self.reject)

        self.groupBox.setStyleSheet(style_sheet)
        self.groupBox_2.setStyleSheet(style_sheet)
        self.txtPopup.textChanged.connect(self.update_html)