def testGetUiFilePath(self): """ Tests get_ui_file_path svg path """ self.assertTrue(GuiUtils.get_ui_file_path('fetch_by_url_widget.ui')) self.assertIn('fetch_by_url_widget.ui', GuiUtils.get_ui_file_path('fetch_by_url_widget.ui')) self.assertFalse(GuiUtils.get_ui_file_path('not_a_form.ui'))
__revision__ = '$Format:%H$' from typing import List from qgis.PyQt import uic from qgis.PyQt.QtCore import (QModelIndex, Qt) from qgis.PyQt.QtWidgets import QDialog from qgis.core import QgsSettings from qgis.gui import QgsGui from qquake.gui.gui_utils import GuiUtils from qquake.gui.simple_node_model import SimpleNodeModel, ModelNode from qquake.services import SERVICE_MANAGER FORM_CLASS, _ = uic.loadUiType( GuiUtils.get_ui_file_path('output_table_options.ui')) class OutputTableOptionsDialog(QDialog, FORM_CLASS): """ A dialog for configuring output table options """ def __init__( self, # pylint: disable=too-many-locals,too-many-branches,too-many-statements service_type: str, service_id: str, initial_fields: List[str], parent=None): """Constructor.""" super().__init__(parent) self.setupUi(self)
import re from typing import List, Optional, Dict from qgis.PyQt import uic from qgis.PyQt.QtCore import (QDir, QUrl, pyqtSignal) from qgis.PyQt.QtNetwork import QNetworkRequest, QNetworkReply from qgis.PyQt.QtWidgets import QWidget, QFileDialog from qgis.PyQt.QtXml import QDomDocument from qgis.core import (QgsSettings, QgsNetworkAccessManager, QgsUnitTypes) from qquake.gui.base_filter_widget import BaseFilterWidget from qquake.gui.gui_utils import GuiUtils from qquake.services import SERVICE_MANAGER FORM_CLASS, _ = uic.loadUiType( GuiUtils.get_ui_file_path('filter_by_id_widget_base.ui')) class FilterByIdWidget(QWidget, FORM_CLASS, BaseFilterWidget): """ A widget for filtering results by ID """ changed = pyqtSignal() def __init__(self, iface, service_type: str, parent: Optional[QWidget] = None): # pylint: disable=unused-argument """Constructor.""" super().__init__(parent)
from qgis.PyQt import uic from qgis.PyQt.QtWidgets import QWidget from qgis.PyQt.QtCore import pyqtSignal from qgis.core import ( QgsSettings, QgsUnitTypes ) from qquake.gui.gui_utils import GuiUtils from qquake.gui.output_table_options_dialog import OutputTableOptionsDialog from qquake.services import SERVICE_MANAGER from qquake.fetcher import Fetcher FORM_CLASS, _ = uic.loadUiType(GuiUtils.get_ui_file_path('filter_station_by_id_widget_base.ui')) class FilterStationByIdWidget(QWidget, FORM_CLASS): changed = pyqtSignal() def __init__(self, iface, service_type, parent=None): """Constructor.""" super().__init__(parent) self.setupUi(self) self.radio_basic_output.toggled.connect(self._enable_widgets) self.radio_extended_output.toggled.connect(self._enable_widgets) self._enable_widgets()
QUrl ) from qgis.PyQt.QtGui import QFontMetrics from qgis.PyQt.QtWidgets import ( QWidget, QFileDialog ) from qgis.core import ( QgsUnitTypes ) from qquake.gui.base_filter_widget import BaseFilterWidget from qquake.gui.gui_utils import GuiUtils from qquake.services import SERVICE_MANAGER FORM_CLASS, _ = uic.loadUiType(GuiUtils.get_ui_file_path('fetch_by_url_widget.ui')) class FetchByUrlWidget(QWidget, FORM_CLASS, BaseFilterWidget): """ Fetch results by URL widget """ changed = pyqtSignal() def __init__(self, iface, # pylint: disable=unused-argument service_type: str, parent=None): """Constructor.""" QWidget.__init__(self, parent) self.setupUi(self)
QDialogButtonBox, QListWidgetItem ) from qgis.core import ( QgsCoordinateTransform, QgsProject, QgsCoordinateReferenceSystem, QgsCsException ) from qgis.gui import QgsGui, QgsMapToolExtent from qgis.utils import iface from qquake.gui.gui_utils import GuiUtils from qquake.services import SERVICE_MANAGER FORM_CLASS, _ = uic.loadUiType(GuiUtils.get_ui_file_path('predefined_areas_widget_base.ui')) class PredefinedAreasWidget(QDialog, FORM_CLASS): """ A widget for configuring predefined areas """ def __init__(self, parent=None): """Constructor.""" super().__init__(parent) self.setupUi(self) self.blocked = False self.previous_map_tool = None self.extent_tool = None
from qgis.core import (Qgis, QgsProject, QgsSettings, QgsFileUtils) from qgis.gui import (QgsGui, QgsMessageBar, QgsNewNameDialog) from qquake.fetcher import Fetcher from qquake.gui.fetch_by_url_widget import FetchByUrlWidget from qquake.gui.filter_by_id_widget import FilterByIdWidget from qquake.gui.filter_parameter_widget import FilterParameterWidget from qquake.gui.filter_station_by_id_widget import FilterStationByIdWidget from qquake.gui.gui_utils import GuiUtils from qquake.gui.ogc_service_options_widget import OgcServiceWidget from qquake.gui.service_configuration_widget import ServiceConfigurationDialog from qquake.gui.service_information_widget import ServiceInformationWidget from qquake.services import SERVICE_MANAGER FORM_CLASS, _ = uic.loadUiType( GuiUtils.get_ui_file_path('qquake_dialog_base.ui')) class QQuakeDialog(QDialog, FORM_CLASS): """ The main plugin dialog """ def __init__(self, iface, parent=None): # pylint:disable=too-many-statements """Constructor.""" super().__init__(parent) self.setupUi(self) self.setObjectName('QQuakeDialog') QgsGui.enableAutoGeometryRestore(self)
from functools import partial from typing import Dict from qgis.PyQt import uic from qgis.PyQt.QtCore import pyqtSignal from qgis.PyQt.QtWidgets import QWidget from qgis.core import QgsSettings from qquake.fetcher import Fetcher from qquake.gui.gui_utils import GuiUtils from qquake.gui.output_table_options_dialog import OutputTableOptionsDialog from qquake.services import SERVICE_MANAGER FORM_CLASS, _ = uic.loadUiType( GuiUtils.get_ui_file_path('table_options_widget_base.ui')) class OutputTableOptionsWidget(QWidget, FORM_CLASS): """ A widget for configuring output layer options """ changed = pyqtSignal() def __init__(self, parent=None): """Constructor.""" super().__init__(parent) self.setupUi(self)
* * ***************************************************************************/ """ from qgis.PyQt import uic from qgis.PyQt.QtCore import (pyqtSignal, QDir, QUrl) from qgis.PyQt.QtGui import QFontMetrics from qgis.PyQt.QtWidgets import (QWidget, QFileDialog) from qgis.core import (QgsUnitTypes) from qquake.fetcher import Fetcher from qquake.gui.gui_utils import GuiUtils from qquake.gui.output_table_options_dialog import OutputTableOptionsDialog from qquake.services import SERVICE_MANAGER FORM_CLASS, _ = uic.loadUiType( GuiUtils.get_ui_file_path('fetch_by_url_widget.ui')) class FetchByUrlWidget(QWidget, FORM_CLASS): """ Fetch results by URL widget """ changed = pyqtSignal() def __init__( self, iface, # pylint: disable=unused-argument service_type: str, parent=None): """Constructor.""" super().__init__(parent)
# (at your option) any later version. __author__ = 'Original authors: Mario Locati, Roberto Vallone, Matteo Ghetta, Nyall Dawson' __date__ = '29/01/2020' __copyright__ = 'Istituto Nazionale di Geofisica e Vulcanologia (INGV)' # This will get replaced with a git SHA1 when you do a git archive __revision__ = '$Format:%H$' from qgis.PyQt import uic from qgis.PyQt.QtWidgets import QWidget from qgis.core import QgsStringUtils from qquake.gui.gui_utils import GuiUtils from qquake.services import SERVICE_MANAGER FORM_CLASS, _ = uic.loadUiType(GuiUtils.get_ui_file_path('service_information_widget.ui')) class ServiceInformationWidget(QWidget, FORM_CLASS): """ A widget for display of metadata relating to a service """ def __init__(self, iface, parent=None): """Constructor.""" super().__init__(parent) self.iface = iface self.setupUi(self) self.info_browser.viewport().setAutoFillBackground(False) self.layer_model = None
QgsCoordinateTransform, QgsCsException, QgsSettings, QgsUnitTypes, QgsRectangle, QgsPointXY) from qgis.gui import ( QgsMapToolExtent, QgsMapToolEmitPoint, ) from qquake.fetcher import Fetcher from qquake.gui.gui_utils import GuiUtils from qquake.gui.output_table_options_dialog import OutputTableOptionsDialog from qquake.gui.predefined_areas_dialog import PredefinedAreasDialog from qquake.quakeml.common import EVENT_TYPES from qquake.services import SERVICE_MANAGER FORM_CLASS, _ = uic.loadUiType( GuiUtils.get_ui_file_path('filter_parameter_widget_base.ui')) class FilterParameterWidget(QWidget, FORM_CLASS): # pylint: disable=too-many-public-methods """ Service parameter based filtering widget """ changed = pyqtSignal() def __init__( self, # pylint: disable=too-many-statements iface, service_type: str, parent: Optional[QWidget] = None): """Constructor.""" super().__init__(parent)
__author__ = 'Original authors: Mario Locati, Roberto Vallone, Matteo Ghetta, Nyall Dawson' __date__ = '29/01/2020' __copyright__ = 'Istituto Nazionale di Geofisica e Vulcanologia (INGV)' # This will get replaced with a git SHA1 when you do a git archive __revision__ = '$Format:%H$' from copy import deepcopy from qgis.PyQt import uic from qgis.PyQt.QtCore import Qt from qgis.gui import (QgsOptionsPageWidget) from qquake.gui.gui_utils import GuiUtils from qquake.services import SERVICE_MANAGER FORM_CLASS, _ = uic.loadUiType(GuiUtils.get_ui_file_path('qquake_options.ui')) class QQuakeOptionsWidget(FORM_CLASS, QgsOptionsPageWidget): """ A widget for configuring general QQuake options """ def __init__(self, parent=None): """Constructor.""" super().__init__(parent) self.setupUi(self) self.button_add_style.setIcon(GuiUtils.get_icon('add.svg')) self.button_remove_style.setIcon(GuiUtils.get_icon('remove.svg'))
from qgis.PyQt import uic from qgis.PyQt.QtCore import QUrl, Qt from qgis.PyQt.QtNetwork import (QNetworkRequest, QNetworkReply) from qgis.PyQt.QtWidgets import (QWidget, QDialog, QVBoxLayout, QDialogButtonBox, QTreeWidgetItem, QComboBox, QToolButton) from qgis.PyQt.QtGui import QDesktopServices from qgis.core import (QgsNetworkAccessManager) from qgis.gui import ( QgsGui, ) from qquake.gui.gui_utils import GuiUtils FORM_CLASS, _ = uic.loadUiType( GuiUtils.get_ui_file_path('cql_filter_builder.ui')) class CqlBuilderWidget(QWidget, FORM_CLASS): """ CQL builder widget """ def __init__(self, parent: QWidget = None): super().__init__(parent) self.setupUi(self) self.field_list.setHeaderLabels([self.tr('Field'), self.tr('Type')]) self.simple_query_list.setHeaderLabels( [self.tr('Field'), self.tr('Operator'),
* * * 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.PyQt import uic from qgis.PyQt.QtWidgets import QWidget from qgis.core import QgsUnitTypes from qquake.gui.gui_utils import GuiUtils FORM_CLASS, _ = uic.loadUiType(GuiUtils.get_ui_file_path('output_options_base.ui')) class OutputOptionsWidget(QWidget, FORM_CLASS): """ A widget for configuring output layer options """ def __init__(self, parent=None): """Constructor.""" super().__init__(parent) self.setupUi(self) self.depth_unit_combo_box.addItem(self.tr('Meters'), QgsUnitTypes.DistanceMeters) self.depth_unit_combo_box.addItem(self.tr('Kilometers'), QgsUnitTypes.DistanceKilometers)
from typing import Optional, Tuple from qgis.PyQt import uic from qgis.PyQt.QtCore import QDateTime, Qt, pyqtSignal from qgis.PyQt.QtWidgets import (QWidget, QDialog, QVBoxLayout, QDialogButtonBox, QCheckBox, QSpinBox) from qgis.core import ( Qgis, ) from qgis.gui import ( QgsGui, ) from qquake.gui.gui_utils import GuiUtils from qquake.services import SERVICE_MANAGER FORM_CLASS, _ = uic.loadUiType( GuiUtils.get_ui_file_path('service_configuration_widget_base.ui')) class ServiceConfigurationWidget(QWidget, FORM_CLASS): """ A widget for defining a service configuration """ WIDGET_MAP = { 'queryeventid': 'check_filter_by_eventid', 'queryoriginid': 'check_filter_by_originid', 'querymagnitudeid': 'check_filter_by_magnitudeid', 'queryfocalmechanismid': 'check_filter_by_focalmechanismid', 'queryupdatedafter': 'check_filter_data_updated_after', 'querycatalog': 'check_filter_by_catalog', 'querycontributor': 'check_filter_by_contributor',
***************************************************************************/ """ from qgis.PyQt import uic from qgis.PyQt.QtCore import Qt from qgis.PyQt.QtWidgets import (QDialog, QVBoxLayout, QDialogButtonBox, QListWidgetItem) from qgis.utils import iface from qgis.core import (QgsCoordinateTransform, QgsProject, QgsCoordinateReferenceSystem, QgsCsException) from qgis.gui import QgsGui, QgsMapToolExtent from qquake.gui.gui_utils import GuiUtils from qquake.services import SERVICE_MANAGER FORM_CLASS, _ = uic.loadUiType( GuiUtils.get_ui_file_path('predefined_areas_widget_base.ui')) class PredefinedAreasWidget(QDialog, FORM_CLASS): def __init__(self, parent=None): """Constructor.""" super().__init__(parent) self.setupUi(self) self.blocked = False self.previous_map_tool = None self.extent_tool = None for name in SERVICE_MANAGER.available_predefined_bounding_boxes(): extent = SERVICE_MANAGER.predefined_bounding_box(name) item = QListWidgetItem(extent['title'])
""" from copy import deepcopy from qgis.PyQt import uic from qgis.PyQt.QtWidgets import QWidget from qgis.PyQt.QtCore import QModelIndex, Qt from qgis.core import (QgsProject, QgsVectorLayer, QgsRasterLayer) from qquake.services import SERVICE_MANAGER from qquake.style_utils import StyleUtils from qquake.gui.gui_utils import GuiUtils from qquake.gui.simple_node_model import SimpleNodeModel, ModelNode FORM_CLASS, _ = uic.loadUiType( GuiUtils.get_ui_file_path('ogc_service_widget.ui')) class OgcServiceWidget(QWidget, FORM_CLASS): def __init__(self, iface, parent=None): """Constructor.""" super().__init__(parent) self.iface = iface self.setupUi(self) self.layer_model = None self.service_type = None self.service_id = None self.service_config = None self.add_layers_button.clicked.connect(self.add_selected_layers)
* 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.PyQt import uic from qgis.PyQt.QtWidgets import QWidget from qgis.core import QgsUnitTypes from qquake.gui.gui_utils import GuiUtils FORM_CLASS, _ = uic.loadUiType( GuiUtils.get_ui_file_path('output_options_base.ui')) class OutputOptionsWidget(QWidget, FORM_CLASS): def __init__(self, parent=None): """Constructor.""" super().__init__(parent) self.setupUi(self) self.depth_unit_combo_box.addItem(self.tr('Meters'), QgsUnitTypes.DistanceMeters) self.depth_unit_combo_box.addItem(self.tr('Kilometers'), QgsUnitTypes.DistanceKilometers) self.depth_values_combo_box.addItem(
* 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 import uic from qgis.PyQt.QtWidgets import QWidget from qgis.core import QgsStringUtils from qquake.gui.gui_utils import GuiUtils from qquake.services import SERVICE_MANAGER FORM_CLASS, _ = uic.loadUiType( GuiUtils.get_ui_file_path('service_information_widget.ui')) class ServiceInformationWidget(QWidget, FORM_CLASS): """ A widget for display of metadata relating to a service """ def __init__(self, iface, parent=None): """Constructor.""" super().__init__(parent) self.iface = iface self.setupUi(self) self.info_browser.viewport().setAutoFillBackground(False) self.layer_model = None self.service_type = None
QgsMessageBar, QgsNewNameDialog ) from qquake.fetcher import Fetcher from qquake.gui.filter_by_id_widget import FilterByIdWidget from qquake.gui.filter_parameter_widget import FilterParameterWidget from qquake.gui.filter_station_by_id_widget import FilterStationByIdWidget from qquake.gui.fetch_by_url_widget import FetchByUrlWidget from qquake.gui.gui_utils import GuiUtils from qquake.gui.ogc_service_options_widget import OgcServiceWidget from qquake.gui.service_configuration_widget import ServiceConfigurationDialog from qquake.gui.service_information_widget import ServiceInformationWidget from qquake.services import SERVICE_MANAGER FORM_CLASS, _ = uic.loadUiType(GuiUtils.get_ui_file_path('qquake_dialog_base.ui')) class QQuakeDialog(QDialog, FORM_CLASS): def __init__(self, iface, parent=None): """Constructor.""" super().__init__(parent) self.setupUi(self) self.setObjectName('QQuakeDialog') QgsGui.enableAutoGeometryRestore(self) self.fsdn_event_filter = FilterParameterWidget(iface, SERVICE_MANAGER.FDSNEVENT) vl = QVBoxLayout()