from safe.common.version import get_version from safe import messaging as m from safe.messaging import styles from safe.utilities.styling import mmi_ramp_roman from safe.utilities.resources import html_footer, html_header, get_ui_class from safe.gui.tools.shake_grid.shake_grid import convert_mmi_data from safe.gui.tools.wizard.wizard_dialog import WizardDialog from safe.gui.tools.help.shakemap_converter_help import shakemap_converter_help from safe.gis.raster.reclassify import reclassify from safe.utilities.keyword_io import KeywordIO from safe.definitions.hazard_classifications import earthquake_mmi_scale INFO_STYLE = styles.BLUE_LEVEL_4_STYLE LOGGER = logging.getLogger('InaSAFE') FORM_CLASS = get_ui_class('shakemap_importer_dialog_base.ui') __copyright__ = "Copyright 2016, The InaSAFE Project" __license__ = "GPL version 3" __email__ = "*****@*****.**" __revision__ = '6f3bf743a6d2063acb6942ecaf3cea97f8f63944' class ShakemapConverterDialog(QDialog, FORM_CLASS): """Importer for shakemap grid.xml files.""" def __init__(self, parent=None, iface=None, dock_widget=None): """Constructor for the dialog.
# coding=utf-8 """Wizard Help Widget""" # noinspection PyPackageRequirements from PyQt4.QtGui import QWidget from safe.utilities.resources import get_ui_class, html_header, html_footer __copyright__ = "Copyright 2016, The InaSAFE Project" __license__ = "GPL version 3" __email__ = "*****@*****.**" __revision__ = 'bc3796555162c60f37041c9b01cea5ad77504d39' HELP_WIDGET = get_ui_class('wizard/wizard_help.ui') class WizardHelp(QWidget, HELP_WIDGET): """An abstract step. Each step is a tab meant to be placed in the wizard. Each derived class must implement mandatory methods. """ def __init__(self, parent=None): """Constructor :param parent: parent - widget to use as parent. :type parent: QWidget """ QWidget.__init__(self, parent) self.parent = parent
__revision__ = 'b9e2d7536ddcf682e32a156d6d8b0dbc0bb73cc4' __date__ = '26/02/2014' __copyright__ = ('Copyright 2012, Australia Indonesia Facility for ' 'Disaster Reduction') # This import is to enable SIP API V2 # noinspection PyUnresolvedReferences import qgis # pylint: disable=unused-import from PyQt4 import QtGui from safe.common.version import get_version from safe.defaults import limitations from safe.utilities.resources import resources_path, get_ui_class from safe.defaults import disclaimer FORM_CLASS = get_ui_class('about_dialog_base.ui') class AboutDialog(QtGui.QDialog, FORM_CLASS): """About dialog for the InaSAFE plugin.""" def __init__(self, parent=None): """Constructor for the dialog. :param parent: Parent widget of this dialog :type parent: QWidget """ QtGui.QDialog.__init__(self, parent) self.setupUi(self) self.setWindowTitle(self.tr('About InaSAFE %s' % get_version()))
from step_kw55_source import StepKwSource from step_kw60_title import StepKwTitle from step_kw65_summary import StepKwSummary from step_fc90_analysis import StepFcAnalysis from safe.gui.tools.wizard.wizard_help import WizardHelp from safe.gui.tools.wizard import STEP_KW, STEP_FC __copyright__ = "Copyright 2016, The InaSAFE Project" __license__ = "GPL version 3" __email__ = "*****@*****.**" __revision__ = 'e54efb23cb33ed813dec3545321e0284b904e7a6' LOGGER = logging.getLogger('InaSAFE') FORM_CLASS = get_ui_class('wizard/wizard_dialog_base.ui') class WizardDialog(QDialog, FORM_CLASS): """Dialog implementation class for the InaSAFE wizard.""" resized = pyqtSignal() def __init__(self, parent=None, iface=None, dock=None): """Constructor for the dialog. .. note:: In QtDesigner the advanced editor's predefined keywords list should be shown in english always, so when adding entries to cboKeyword, be sure to choose :safe_qgis:`Properties<<` and untick the :safe_qgis:`translatable` property.
from safe.definitions.layer_purposes import ( layer_purpose_exposure, layer_purpose_hazard, layer_purpose_aggregation) from safe.gui.tools.help.metadata_converter_help import metadata_converter_help from safe.utilities.i18n import tr from safe.utilities.keyword_io import KeywordIO from safe.utilities.metadata import active_classification from safe.utilities.metadata import ( convert_metadata, write_iso19115_metadata ) from safe.utilities.qgis_utilities import ( display_warning_message_box, display_success_message_bar) from safe.utilities.resources import ( get_ui_class, html_footer, html_header, resources_path) from safe.utilities.utilities import is_keyword_version_supported FORM_CLASS = get_ui_class('metadata_converter_dialog_base.ui') LOGGER = logging.getLogger('InaSAFE') accepted_layer_purposes = [ layer_purpose_hazard['key'], layer_purpose_exposure['key'], layer_purpose_aggregation['key'] ] class MetadataConverterDialog(QDialog, FORM_CLASS): """Dialog implementation class for the InaSAFE metadata converter tool.""" resized = pyqtSignal()
from safe.definitions.layer_purposes import layer_purpose_aggregation from safe.definitions import minimum_needs_post_processors from safe.gis.vector.prepare_vector_layer import ( clean_inasafe_fields) from safe.gis.vector.tools import ( create_memory_layer, copy_layer) from safe.gui.tools.help.needs_calculator_help import needs_calculator_help from safe.impact_function.postprocessors import run_single_post_processor from safe.messaging import styles from safe.utilities.qgis_utilities import display_critical_message_box from safe.utilities.resources import html_footer, html_header, get_ui_class from safe.utilities.utilities import humanise_exception INFO_STYLE = styles.BLUE_LEVEL_4_STYLE LOGGER = logging.getLogger('InaSAFE') FORM_CLASS = get_ui_class('needs_calculator_dialog_base.ui') class NeedsCalculatorDialog(QtGui.QDialog, FORM_CLASS): """Dialog implementation class for the InaSAFE minimum needs calculator. """ def __init__(self, parent=None): """Constructor for the minimum needs dialog. :param parent: Parent widget of this dialog. :type parent: QWidget """ QtGui.QDialog.__init__(self, parent) self.setupUi(self) self.setWindowTitle(self.tr(
from safe.gui.tools.help.extent_selector_help import extent_selector_help from safe.gui.tools.rectangle_map_tool import RectangleMapTool from safe.messaging import styles from safe.utilities.gis import wkt_to_rectangle from safe.utilities.resources import (html_header, html_footer, get_ui_class, resources_path) from safe.utilities.settings import setting, set_setting __copyright__ = "Copyright 2017, The InaSAFE Project" __license__ = "GPL version 3" __email__ = "*****@*****.**" __revision__ = 'b2d0c787b7d956ae517d9245e8cb7b285d71ce74' INFO_STYLE = styles.BLUE_LEVEL_4_STYLE LOGGER = logging.getLogger('InaSAFE') FORM_CLASS = get_ui_class('extent_selector_dialog_base.ui') class ExtentSelectorDialog(QDialog, FORM_CLASS): """Dialog for letting user determine analysis extents.""" extent_defined = pyqtSignal(QgsRectangle, QgsCoordinateReferenceSystem) clear_extent = pyqtSignal() extent_selector_closed = pyqtSignal() def __init__(self, iface, parent=None, extent=None, crs=None): """Constructor for the dialog. :param iface: A Quantum GIS QGisAppInterface instance. :type iface: QGisAppInterface
from PyQt4.QtCore import QSettings, pyqtSignature, QRegExp, pyqtSlot # noinspection PyPackageRequirements from PyQt4.QtGui import (QDialog, QProgressDialog, QMessageBox, QFileDialog, QRegExpValidator) from safe.common.exceptions import (CanceledImportDialogError, FileMissingError) from safe.utilities.resources import (html_footer, html_header, get_ui_class, resources_path) from safe.utilities.qgis_utilities import (display_warning_message_box, display_warning_message_bar) from safe.gui.tools.help.peta_jakarta_help import peta_jakarta_help LOGGER = logging.getLogger('InaSAFE') FORM_CLASS = get_ui_class('peta_jakarta_dialog_base.ui') __author__ = '*****@*****.**' __revision__ = '0eb7769082b7a27b52dcd7da34dcf5a26407c18a' __date__ = '23/11/2015' __copyright__ = ('Copyright 2015, Australia Indonesia Facility for ' 'Disaster Reduction') class PetaJakartaDialog(QDialog, FORM_CLASS): """Downloader for petajakarta data. .. versionadded: 3.3 """ def __init__(self, parent=None, iface=None): """Constructor for import dialog.
from safe import metadata # Aggregations' keywords DEFAULTS = get_defaults() female_ratio_attribute_key = DEFAULTS['FEMALE_RATIO_ATTR_KEY'] female_ratio_default_key = DEFAULTS['FEMALE_RATIO_KEY'] youth_ratio_attribute_key = DEFAULTS['YOUTH_RATIO_ATTR_KEY'] youth_ratio_default_key = DEFAULTS['YOUTH_RATIO_KEY'] adult_ratio_attribute_key = DEFAULTS['ADULT_RATIO_ATTR_KEY'] adult_ratio_default_key = DEFAULTS['ADULT_RATIO_KEY'] elderly_ratio_attribute_key = DEFAULTS['ELDERLY_RATIO_ATTR_KEY'] elderly_ratio_default_key = DEFAULTS['ELDERLY_RATIO_KEY'] LOGGER = logging.getLogger('InaSAFE') FORM_CLASS = get_ui_class('keywords_dialog_base.ui') class KeywordsDialog(QtGui.QDialog, FORM_CLASS): """Dialog implementation class for the InaSAFE keywords editor.""" def __init__(self, parent, iface, dock=None, layer=None): """Constructor for the dialog. .. note:: In QtDesigner the advanced editor's predefined keywords list should be shown in english always, so when adding entries to cboKeyword, be sure to choose :safe_qgis:`Properties<<` and untick the :safe_qgis:`translatable` property. :param parent: Parent widget of this dialog. :type parent: QWidget
from safe.messaging import styles from safe.report.impact_report import ImpactReport from safe.report.report_metadata import ( QgisComposerComponentsMetadata) from safe.utilities.i18n import tr from safe.utilities.resources import ( get_ui_class, resources_path, html_header, html_footer) from safe.utilities.settings import setting __copyright__ = "Copyright 2017, The InaSAFE Project" __license__ = "GPL version 3" __email__ = "*****@*****.**" __revision__ = 'bd00bfeac510722b427544b186bfa10861749e51' INFO_STYLE = styles.BLUE_LEVEL_4_STYLE FORM_CLASS = get_ui_class('print_report_dialog.ui') LOGGER = logging.getLogger('InaSAFE') class PrintReportDialog(QtWidgets.QDialog, FORM_CLASS): """Print report dialog for the InaSAFE plugin.""" def __init__(self, impact_function, iface, dock=None, parent=None): """Constructor for the dialog. :param iface: A Quantum GIS QgisAppInterface instance. :type iface: QgisAppInterface :param parent: Parent widget of this dialog :type parent: QWidget
from safe.utilities.file_downloader import FileDownloader from safe.utilities.qgis_utilities import display_warning_message_box from safe.utilities.qt import disable_busy_cursor from safe.utilities.resources import ( get_ui_class, html_footer, html_header, resources_path ) from safe.utilities.settings import setting # pylint: enable=unused-import LOGGER = logging.getLogger('InaSAFE') FORM_CLASS = get_ui_class('peta_bencana_dialog_base.ui') __copyright__ = "Copyright 2015, The InaSAFE Project" __license__ = "GPL version 3" __email__ = "*****@*****.**" __revision__ = 'bd00bfeac510722b427544b186bfa10861749e51' class PetaBencanaDialog(QDialog, FORM_CLASS): """Downloader for PetaBencana data. .. versionadded: 3.3 """ def __init__(self, parent=None, iface=None):
MultiExposureImpactFunction) from safe.messaging import styles from safe.report.impact_report import ImpactReport from safe.report.report_metadata import (QgisComposerComponentsMetadata) from safe.utilities.i18n import tr from safe.utilities.resources import (get_ui_class, resources_path, html_header, html_footer) from safe.utilities.settings import setting __copyright__ = "Copyright 2017, The InaSAFE Project" __license__ = "GPL version 3" __email__ = "*****@*****.**" __revision__ = 'bd00bfeac510722b427544b186bfa10861749e51' INFO_STYLE = styles.BLUE_LEVEL_4_STYLE FORM_CLASS = get_ui_class('print_report_dialog.ui') LOGGER = logging.getLogger('InaSAFE') class PrintReportDialog(QtWidgets.QDialog, FORM_CLASS): """Print report dialog for the InaSAFE plugin.""" def __init__(self, impact_function, iface, dock=None, parent=None): """Constructor for the dialog. :param iface: A Quantum GIS QgisAppInterface instance. :type iface: QgisAppInterface :param parent: Parent widget of this dialog :type parent: QWidget :param dock: Optional dock widget instance that we can notify of
InaSAFEError) from safe.definitions.constants import RECENT from safe.definitions.layer_purposes import ( layer_purpose_exposure, layer_purpose_hazard) from safe.definitions.utilities import get_field_groups from safe.gui.tools.help.field_mapping_help import field_mapping_help from safe.gui.widgets.field_mapping_widget import FieldMappingWidget from safe.utilities.default_values import set_inasafe_default_value_qsetting from safe.utilities.i18n import tr from safe.utilities.keyword_io import KeywordIO from safe.utilities.qgis_utilities import display_warning_message_box from safe.utilities.resources import ( get_ui_class, html_footer, html_header, resources_path) from safe.utilities.utilities import get_error_message FORM_CLASS = get_ui_class('field_mapping_dialog_base.ui') LOGGER = logging.getLogger('InaSAFE') class FieldMappingDialog(QDialog, FORM_CLASS): """Dialog implementation class for the InaSAFE field mapping tool.""" def __init__(self, parent=None, iface=None, setting=None): """Constructor.""" QDialog.__init__(self, parent) self.setupUi(self) self.setWindowTitle(self.tr('InaSAFE Field Mapping Tool')) icon = resources_path('img', 'icons', 'show-mapping-tool.svg')
""" __author__ = "*****@*****.**" __revision__ = "b9e2d7536ddcf682e32a156d6d8b0dbc0bb73cc4" __date__ = "28/09/2015" __copyright__ = "Copyright 2012, Australia Indonesia Facility for " "Disaster Reduction" # This import is to enable SIP API V2 # noinspection PyUnresolvedReferences import qgis # pylint: disable=unused-import from PyQt4 import QtGui from safe.common.version import get_version from safe.utilities.resources import get_ui_class, html_footer, html_header from safe.gui.tools.help.dock_help import dock_help FORM_CLASS = get_ui_class("help_dialog_base.ui") class HelpDialog(QtGui.QDialog, FORM_CLASS): """About dialog for the InaSAFE plugin.""" def __init__(self, parent=None): """Constructor for the dialog. :param parent: Parent widget of this dialog :type parent: QWidget """ QtGui.QDialog.__init__(self, parent) self.setupUi(self) self.setWindowTitle(self.tr("InaSAFE %s Help" % get_version()))
from safe.utilities.unicode import get_unicode # Aggregations' keywords DEFAULTS = get_defaults() female_ratio_attribute_key = DEFAULTS['FEMALE_RATIO_ATTR_KEY'] female_ratio_default_key = DEFAULTS['FEMALE_RATIO_KEY'] youth_ratio_attribute_key = DEFAULTS['YOUTH_RATIO_ATTR_KEY'] youth_ratio_default_key = DEFAULTS['YOUTH_RATIO_KEY'] adult_ratio_attribute_key = DEFAULTS['ADULT_RATIO_ATTR_KEY'] adult_ratio_default_key = DEFAULTS['ADULT_RATIO_KEY'] elderly_ratio_attribute_key = DEFAULTS['ELDERLY_RATIO_ATTR_KEY'] elderly_ratio_default_key = DEFAULTS['ELDERLY_RATIO_KEY'] LOGGER = logging.getLogger('InaSAFE') FORM_CLASS = get_ui_class('keywords_dialog_base.ui') class KeywordsDialog(QtGui.QDialog, FORM_CLASS): """Dialog implementation class for the InaSAFE keywords editor.""" def __init__(self, parent, iface, dock=None, layer=None): """Constructor for the dialog. .. note:: In QtDesigner the advanced editor's predefined keywords list should be shown in english always, so when adding entries to cboKeyword, be sure to choose :safe_qgis:`Properties<<` and untick the :safe_qgis:`translatable` property. :param parent: Parent widget of this dialog. :type parent: QWidget
# coding=utf-8 """Wizard Help Widget.""" # noinspection PyPackageRequirements from qgis.PyQt.QtWidgets import QWidget from safe.utilities.resources import get_ui_class, html_header, html_footer __copyright__ = "Copyright 2016, The InaSAFE Project" __license__ = "GPL version 3" __email__ = "*****@*****.**" __revision__ = 'bd00bfeac510722b427544b186bfa10861749e51' HELP_WIDGET = get_ui_class('wizard/wizard_help.ui') class WizardHelp(QWidget, HELP_WIDGET): """An abstract step. Each step is a tab meant to be placed in the wizard. Each derived class must implement mandatory methods. """ def __init__(self, parent=None): """Constructor :param parent: parent - widget to use as parent. :type parent: QWidget """ QWidget.__init__(self, parent)
from safe.common.exceptions import (CanceledImportDialogError, FileMissingError) from safe.definitions.peta_bencana import development_api, production_api from safe.gui.tools.help.peta_bencana_help import peta_bencana_help from safe.utilities.file_downloader import FileDownloader from safe.utilities.resources import (html_footer, html_header, get_ui_class, resources_path) from safe.utilities.qgis_utilities import (display_warning_message_box, display_warning_message_bar) from safe.utilities.settings import setting from safe.utilities.qt import disable_busy_cursor LOGGER = logging.getLogger('InaSAFE') FORM_CLASS = get_ui_class('peta_bencana_dialog_base.ui') __author__ = '*****@*****.**' __revision__ = '2f075ced569597e81df73adc9a7e1439daa99814' __date__ = '23/11/2015' __copyright__ = ('Copyright 2015, Australia Indonesia Facility for ' 'Disaster Reduction') class PetaBencanaDialog(QDialog, FORM_CLASS): """Downloader for PetaBencana data. .. versionadded: 3.3 """ def __init__(self, parent=None, iface=None): """Constructor for import dialog.
QDialog, QProgressDialog, QMessageBox, QFileDialog, QRegExpValidator) from safe.common.exceptions import ( CanceledImportDialogError, FileMissingError) from safe.utilities.resources import ( html_footer, html_header, get_ui_class, resources_path) from safe.utilities.qgis_utilities import ( display_warning_message_box, display_warning_message_bar) from safe.gui.tools.help.peta_jakarta_help import peta_jakarta_help LOGGER = logging.getLogger('InaSAFE') FORM_CLASS = get_ui_class('peta_jakarta_dialog_base.ui') __author__ = '*****@*****.**' __revision__ = 'e0a49bd2cd46fc60ba5f97d483593fd69731b84a' __date__ = '23/11/2015' __copyright__ = ('Copyright 2015, Australia Indonesia Facility for ' 'Disaster Reduction') class PetaJakartaDialog(QDialog, FORM_CLASS): """Downloader for petajakarta data. .. versionadded: 3.3 """ def __init__(self, parent=None, iface=None):
from qgis.core import ( QgsPoint, QgsRectangle, QgsCoordinateReferenceSystem, QgsApplication, QgsCoordinateTransform) from safe.utilities.resources import html_header, html_footer, get_ui_class from safe.gui.tools.rectangle_map_tool import RectangleMapTool from safe.messaging import styles from safe.gui.tools.help.extent_selector_help import extent_selector_help INFO_STYLE = styles.INFO_STYLE LOGGER = logging.getLogger('InaSAFE') FORM_CLASS = get_ui_class('extent_selector_dialog_base.ui') class ExtentSelectorDialog(QDialog, FORM_CLASS): """Dialog for letting user determine analysis extents. """ extent_defined = pyqtSignal(QgsRectangle, QgsCoordinateReferenceSystem) clear_extent = pyqtSignal() extent_selector_closed = pyqtSignal() def __init__(self, iface, parent=None, extent=None, crs=None): """Constructor for the dialog. :param iface: A Quantum GIS QGisAppInterface instance. :type iface: QGisAppInterface
from safe.common.utilities import temp_dir from safe import messaging as m from safe.messaging import styles from safe.report.template_composition import TemplateComposition from safe.utilities.resources import (html_header, html_footer, get_ui_class, resources_path) from safe.utilities.gis import qgis_version from safe.utilities.utilities import (html_to_file, add_ordered_combo_item) from safe.gui.tools.help.impact_merge_help import impact_merge_help from safe.utilities.keyword_io import KeywordIO from safe.defaults import (disclaimer, white_inasafe_logo_path, supporters_logo_path) from safe.utilities.unicode import get_string INFO_STYLE = styles.INFO_STYLE FORM_CLASS = get_ui_class('impact_merge_dialog_base.ui') class ImpactMergeDialog(QDialog, FORM_CLASS): """Tools for merging 2 impact layer based on different exposure.""" def __init__(self, parent=None, iface=None): """Constructor for dialog. :param parent: Optional widget to use as parent :type parent: QWidget :param iface: An instance of QGisInterface :type iface: QGisInterface """ QDialog.__init__(self, parent) self.parent = parent
# noinspection PyPackageRequirements from PyQt4.QtGui import QDialogButtonBox, QDialog, QFileDialog, QMessageBox from qgis.utils import iface from safe.common.version import get_version from safe import messaging as m from safe.messaging import styles from safe.utilities.styling import mmi_ramp from safe.utilities.resources import html_footer, html_header, get_ui_class from safe.gui.tools.shake_grid.shake_grid import convert_mmi_data from safe.gui.tools.help.shakemap_converter_help import shakemap_converter_help INFO_STYLE = styles.INFO_STYLE LOGGER = logging.getLogger('InaSAFE') FORM_CLASS = get_ui_class('shakemap_importer_dialog_base.ui') class ShakemapConverterDialog(QDialog, FORM_CLASS): """Importer for shakemap grid.xml files.""" def __init__(self, parent=None): """Constructor for the dialog. Show the grid converter dialog. :param parent: parent - widget to use as parent. :type parent: QWidget """ QDialog.__init__(self, parent) self.parent = parent
extension_siblings, login_user, upload) from safe.utilities.gis import qgis_version, layer_icon from safe.utilities.i18n import tr from safe.utilities.qgis_utilities import ( display_warning_message_box, display_success_message_bar) from safe.utilities.qt import disable_busy_cursor, enable_busy_cursor from safe.utilities.resources import get_ui_class, resources_path from safe.utilities.settings import set_setting, setting __copyright__ = 'Copyright 2018, The InaSAFE Project' __license__ = 'GPL version 3' __email__ = '*****@*****.**' __revision__ = 'bd00bfeac510722b427544b186bfa10861749e51' FORM_CLASS = get_ui_class('geonode_uploader.ui') GEONODE_USER = '******' GEONODE_PASSWORD = '******' GEONODE_URL = 'geonode_url' class GeonodeUploaderDialog(QDialog, FORM_CLASS): """Geonode uploader dialog.""" def __init__(self, parent=None): """Constructor for import dialog. :param parent: Optional widget to use as parent. :type parent: QWidget """
from safe.utilities.keyword_io import KeywordIO from safe.utilities.qgis_utilities import display_warning_message_bar from safe.utilities.qt import disable_busy_cursor, enable_busy_cursor from safe.utilities.resources import ( get_ui_class, resources_path, ) from safe.utilities.settings import setting from safe.utilities.utilities import ( is_keyword_version_supported, basestring_to_message, get_error_message, ) LOGGER = logging.getLogger('InaSAFE') FORM_CLASS = get_ui_class('multi_exposure_dialog_base.ui') INFO_STYLE = styles.BLUE_LEVEL_4_STYLE LOGO_ELEMENT = m.Brand() class MultiExposureDialog(QDialog, FORM_CLASS): """Dialog for multi exposure tool.""" def __init__(self, parent=None, iface=iface_object): """Constructor for the multi exposure dialog. :param parent: Parent widget of this dialog. :type parent: QWidget :param iface: An instance of QgisInterface :type iface: QgisInterface
from PyQt4.QtGui import QFileDialog, QIcon from safe.common.utilities import unique_filename, temp_dir from safe.datastore.folder import Folder from safe.gis.vector.multi_buffering import multi_buffering from safe.gui.tools.wizard.wizard_dialog import WizardDialog from safe.gui.tools.help.multi_buffer_help import multi_buffer_help from safe.messaging import styles from safe.utilities.resources import ( get_ui_class, resources_path, html_footer, html_header) INFO_STYLE = styles.BLUE_LEVEL_4_STYLE LOGGER = logging.getLogger('InaSAFE') FORM_CLASS = get_ui_class('multi_buffer_dialog_base.ui') class MultiBufferDialog(QtGui.QDialog, FORM_CLASS): """Dialog implementation class for the InaSAFE multi buffer tool.""" def __init__(self, parent=None, iface=None, dock_widget=None): """Constructor for the multi buffer dialog. :param parent: Parent widget of this dialog. :type parent: QWidget """ QtGui.QDialog.__init__(self, parent) self.setupUi(self) self.setWindowTitle(self.tr('InaSAFE Multi Buffer Tool')) self.parent = parent
from step_fc65_agglayer_disjoint import StepFcAggLayerDisjoint from step_fc70_extent import StepFcExtent from step_fc75_extent_disjoint import StepFcExtentDisjoint from step_fc80_params import StepFcParams from step_fc85_summary import StepFcSummary from.step_fc90_analysis import StepFcAnalysis __author__ = '*****@*****.**' __revision__ = '0eb7769082b7a27b52dcd7da34dcf5a26407c18a' __date__ = '21/02/2011' __copyright__ = ( 'Copyright 2012, Australia Indonesia Facility for Disaster Reduction') LOGGER = logging.getLogger('InaSAFE') FORM_CLASS = get_ui_class('wizard/wizard_dialog_base.ui') class WizardDialog(QDialog, FORM_CLASS): """Dialog implementation class for the InaSAFE wizard.""" def __init__(self, parent=None, iface=None, dock=None): """Constructor for the dialog. .. note:: In QtDesigner the advanced editor's predefined keywords list should be shown in english always, so when adding entries to cboKeyword, be sure to choose :safe_qgis:`Properties<<` and untick the :safe_qgis:`translatable` property. :param parent: Parent widget of this dialog.
from safe.definitions.constants import RECENT from safe.definitions.layer_purposes import ( layer_purpose_exposure, layer_purpose_hazard) from safe.definitions.utilities import get_field_groups from safe.gui.tools.help.field_mapping_help import field_mapping_help from safe.gui.widgets.field_mapping_widget import FieldMappingWidget from safe.utilities.default_values import set_inasafe_default_value_qsetting from safe.utilities.i18n import tr from safe.utilities.keyword_io import KeywordIO from safe.utilities.qgis_utilities import display_warning_message_box from safe.utilities.resources import ( get_ui_class, html_footer, html_header, resources_path) from safe.utilities.unicode import get_string from safe.utilities.utilities import get_error_message FORM_CLASS = get_ui_class('field_mapping_dialog_base.ui') LOGGER = logging.getLogger('InaSAFE') class FieldMappingDialog(QDialog, FORM_CLASS): """Dialog implementation class for the InaSAFE field mapping tool.""" def __init__(self, parent=None, iface=None, setting=None): """Constructor.""" QDialog.__init__(self, parent) self.setupUi(self) self.setWindowTitle(self.tr('InaSAFE Field Mapping Tool')) icon = resources_path('img', 'icons', 'show-mapping-tool.svg')
def get_wizard_step_ui_class(py_file_name): return get_ui_class(os.path.join( 'wizard', re.sub(r"pyc?$", "ui", os.path.basename(py_file_name))))
from safe.definitions.exposure import exposure_all from safe.definitions.layer_purposes import (layer_purpose_exposure, layer_purpose_hazard, layer_purpose_aggregation) from safe.gui.tools.help.metadata_converter_help import metadata_converter_help from safe.utilities.i18n import tr from safe.utilities.keyword_io import KeywordIO from safe.utilities.metadata import active_classification from safe.utilities.metadata import (convert_metadata, write_iso19115_metadata) from safe.utilities.qgis_utilities import (display_warning_message_box, display_success_message_bar) from safe.utilities.resources import (get_ui_class, html_footer, html_header, resources_path) from safe.utilities.utilities import is_keyword_version_supported FORM_CLASS = get_ui_class('metadata_converter_dialog_base.ui') LOGGER = logging.getLogger('InaSAFE') accepted_layer_purposes = [ layer_purpose_hazard['key'], layer_purpose_exposure['key'], layer_purpose_aggregation['key'] ] class MetadataConverterDialog(QDialog, FORM_CLASS): """Dialog implementation class for the InaSAFE metadata converter tool.""" resized = pyqtSignal() def __init__(self, parent=None, iface=None):
from safe.common.parameters.resource_parameter import ResourceParameter from safe.gui.tools.help.needs_manager_help import needs_manager_helps from safe.gui.tools.minimum_needs.needs_profile import NeedsProfile from safe.messaging import styles from safe.utilities.i18n import tr from safe.utilities.resources import ( resources_path, get_ui_class, html_footer, html_header) __copyright__ = "Copyright 2014, The InaSAFE Project" __license__ = "GPL version 3" __email__ = "*****@*****.**" __revision__ = 'fdf1afffab4271e5fbb873566278d5b4a7ff5722' INFO_STYLE = styles.BLUE_LEVEL_4_STYLE FORM_CLASS = get_ui_class('needs_manager_dialog_base.ui') class NeedsManagerDialog(QDialog, FORM_CLASS): """Dialog class for the InaSAFE global minimum needs configuration. .. versionadded:: 2.2. """ def __init__(self, parent=None, dock=None): """Constructor for the minimum needs dialog. :param parent: Parent widget of this dialog. :type parent: QWidget :param dock: Dock widget instance that we can notify of changes.
__author__ = '*****@*****.**' __revision__ = 'f5cb765df85c67ce3e69f83dfdee91ae743329b6' __date__ = '28/09/2015' __copyright__ = ('Copyright 2012, Australia Indonesia Facility for ' 'Disaster Reduction') # This import is to enable SIP API V2 # noinspection PyUnresolvedReferences import qgis # pylint: disable=unused-import from PyQt4 import QtGui from safe.common.version import get_version from safe.utilities.resources import get_ui_class, html_footer, html_header from safe.gui.tools.help.dock_help import dock_help FORM_CLASS = get_ui_class('help_dialog_base.ui') class HelpDialog(QtGui.QDialog, FORM_CLASS): """About dialog for the InaSAFE plugin.""" def __init__(self, parent=None): """Constructor for the dialog. :param parent: Parent widget of this dialog :type parent: QWidget """ QtGui.QDialog.__init__(self, parent) self.setupUi(self) self.setWindowTitle(self.tr('InaSAFE %s Help' % get_version()))
__author__ = '*****@*****.**' __revision__ = '37a1d2dc3b6017f6d0e7399526ef633aca3e3596' __date__ = '26/10/2013' __copyright__ = ('Copyright 2012, Australia Indonesia Facility for ' 'Disaster Reduction') # This import is to enable SIP API V2 # noinspection PyUnresolvedReferences import qgis # pylint: disable=unused-import from PyQt4 import QtGui, QtCore from PyQt4.QtCore import pyqtSignature, pyqtSlot from safe.utilities.resources import ( get_ui_class, resources_path, html_header, html_footer) from safe.gui.tools.help.impact_report_help import impact_report_help FORM_CLASS = get_ui_class('impact_report_dialog_base.ui') class ImpactReportDialog(QtGui.QDialog, FORM_CLASS): """Impact report dialog for the InaSAFE plugin.""" def __init__(self, iface, dock=None, parent=None): """Constructor for the dialog. :param iface: A Quantum GIS QGisAppInterface instance. :type iface: QGisAppInterface :param parent: Parent widget of this dialog :type parent: QWidget :param dock: Optional dock widget instance that we can notify of
__revision__ = '988a12b9d05925877373e8d75f6ac4e766e325e7' __date__ = '26/02/2014' __copyright__ = ('Copyright 2012, Australia Indonesia Facility for ' 'Disaster Reduction') # This import is to enable SIP API V2 # noinspection PyUnresolvedReferences import qgis # pylint: disable=unused-import from PyQt4 import QtGui from safe.common.version import get_version from safe.defaults import limitations from safe.utilities.resources import resources_path, get_ui_class from safe.defaults import disclaimer FORM_CLASS = get_ui_class('about_dialog_base.ui') class AboutDialog(QtGui.QDialog, FORM_CLASS): """About dialog for the InaSAFE plugin.""" def __init__(self, parent=None): """Constructor for the dialog. :param parent: Parent widget of this dialog :type parent: QWidget """ QtGui.QDialog.__init__(self, parent) self.setupUi(self) self.setWindowTitle(self.tr('About InaSAFE %s' % get_version())) self.parent = parent
validate_geo_array) from safe.utilities.osm_downloader import download from safe.utilities.qgis_utilities import ( display_warning_message_box, ) from safe.utilities.resources import (html_footer, html_header, get_ui_class, resources_path) from safe.utilities.settings import setting, set_setting __copyright__ = "Copyright 2012, The InaSAFE Project" __license__ = "GPL version 3" __email__ = "*****@*****.**" __revision__ = 'fdf1afffab4271e5fbb873566278d5b4a7ff5722' LOGGER = logging.getLogger('InaSAFE') FORM_CLASS = get_ui_class('osm_downloader_dialog_base.ui') class OsmDownloaderDialog(QDialog, FORM_CLASS): """Downloader for OSM data.""" def __init__(self, parent=None, iface=None): """Constructor for import dialog. :param parent: Optional widget to use as parent. :type parent: QWidget :param iface: An instance of QgisInterface. :type iface: QgisInterface """ QDialog.__init__(self, parent) self.parent = parent
html_header, html_footer, get_ui_class, resources_path) from safe.utilities.gis import qgis_version from safe.utilities.utilities import ( html_to_file, add_ordered_combo_item) from safe.gui.tools.help.impact_merge_help import impact_merge_help from safe.utilities.keyword_io import KeywordIO from safe.defaults import ( disclaimer, white_inasafe_logo_path, supporters_logo_path) from safe.utilities.unicode import get_string INFO_STYLE = styles.INFO_STYLE FORM_CLASS = get_ui_class('impact_merge_dialog_base.ui') class ImpactMergeDialog(QDialog, FORM_CLASS): """Tools for merging 2 impact layer based on different exposure.""" def __init__(self, parent=None, iface=None): """Constructor for dialog. :param parent: Optional widget to use as parent :type parent: QWidget :param iface: An instance of QGisInterface :type iface: QGisInterface """ QDialog.__init__(self, parent)
QFileDialog, QTableWidgetItem, QPushButton, QDialogButtonBox) from safe.gui.tools.batch import scenario_runner from safe.utilities.gis import extent_string_to_array, read_impact_layer from safe.utilities.resources import get_ui_class from safe.report.impact_report import ImpactReport from safe.common.exceptions import FileNotFoundError from safe.common.utilities import temp_dir from safe.utilities.help import show_context_help from safe.utilities.resources import resources_path LOGGER = logging.getLogger('InaSAFE') FORM_CLASS = get_ui_class('batch_dialog_base.ui') class BatchDialog(QDialog, FORM_CLASS): """Script Dialog for InaSAFE.""" def __init__(self, parent=None, iface=None, dock=None): """Constructor for the dialog. :param parent: Widget to use as parent. :type parent: PyQt4.QtGui.QWidget :param iface: A QGisAppInterface instance we use to access QGIS via. :type iface: QgsAppInterface :param dock: A Dock widget needed to run the scenarios with. On
QDialogButtonBox) from safe.gui.tools.batch import scenario_runner from safe.utilities.gis import extent_string_to_array, read_impact_layer from safe.report.impact_report import ImpactReport from safe.common.exceptions import FileNotFoundError from safe.common.utilities import temp_dir from safe.utilities.resources import ( html_footer, html_header, get_ui_class) from safe.messaging import styles from safe.utilities.resources import resources_path from safe.gui.tools.help.batch_help import batch_help INFO_STYLE = styles.INFO_STYLE LOGGER = logging.getLogger('InaSAFE') FORM_CLASS = get_ui_class('batch_dialog_base.ui') class BatchDialog(QDialog, FORM_CLASS): """Script Dialog for InaSAFE.""" def __init__(self, parent=None, iface=None, dock=None): """Constructor for the dialog. :param parent: Widget to use as parent. :type parent: PyQt4.QtGui.QWidget :param iface: A QGisAppInterface instance we use to access QGIS via. :type iface: QgsAppInterface :param dock: A Dock widget needed to run the scenarios with. On
from safe.utilities.gis import ( viewport_geo_array, rectangle_geo_array, validate_geo_array) from safe.utilities.resources import ( html_footer, html_header, get_ui_class, resources_path) from safe.messaging import styles from safe.utilities.qgis_utilities import ( display_warning_message_box, display_warning_message_bar) from safe.gui.tools.rectangle_map_tool import RectangleMapTool INFO_STYLE = styles.INFO_STYLE LOGGER = logging.getLogger('InaSAFE') FORM_CLASS = get_ui_class('osm_downloader_dialog_base.ui') class OsmDownloaderDialog(QDialog, FORM_CLASS): """Downloader for OSM data.""" def __init__(self, parent=None, iface=None): """Constructor for import dialog. :param parent: Optional widget to use as parent :type parent: QWidget :param iface: An instance of QGisInterface :type iface: QGisInterface """ QDialog.__init__(self, parent)
from safe_extras.parameters.parameter_exceptions import ( ValueOutOfBounds, InvalidMaximumError, InvalidMinimumError) from safe_extras.parameters.string_parameter import StringParameter from safe_extras.parameters.text_parameter import TextParameter from safe.utilities.resources import ( resources_path, get_ui_class, html_footer, html_header) from safe.messaging import styles from safe.gui.tools.minimum_needs.needs_profile import NeedsProfile from safe.utilities.i18n import tr from safe.gui.tools.help.needs_manager_help import needs_manager_helps INFO_STYLE = styles.INFO_STYLE FORM_CLASS = get_ui_class('needs_manager_dialog_base.ui') class NeedsManagerDialog(QDialog, FORM_CLASS): """Dialog class for the InaSAFE global minimum needs configuration. .. versionadded:: 2.2. """ def __init__(self, parent=None, dock=None): """Constructor for the minimum needs dialog. :param parent: Parent widget of this dialog. :type parent: QWidget :param dock: Dock widget instance that we can notify of changes.
# noinspection PyUnresolvedReferences import qgis # pylint: disable=unused-import # noinspection PyPackageRequirements from PyQt4 import QtGui, QtCore # noinspection PyPackageRequirements from PyQt4.QtCore import pyqtSignature from safe.utilities.help import show_context_help from safe.common.utilities import temp_dir from safe.defaults import (disclaimer, default_organisation_logo_path, default_north_arrow_path, get_defaults) from safe.utilities.keyword_io import KeywordIO from safe.utilities.resources import get_ui_class from safe.common.version import get_version FORM_CLASS = get_ui_class('options_dialog_base.ui') class OptionsDialog(QtGui.QDialog, FORM_CLASS): """Options dialog for the InaSAFE plugin.""" def __init__(self, iface, dock=None, parent=None): """Constructor for the dialog. :param iface: A Quantum GIS QGisAppInterface instance. :type iface: QGisAppInterface :param parent: Parent widget of this dialog :type parent: QWidget :param dock: Optional dock widget instance that we can notify of changes to the keywords.
from PyQt4.QtCore import pyqtSignature from safe.common.version import get_version from safe.storage.core import read_layer as safe_read_layer from safe.storage.vector import Vector from safe.utilities.gis import is_point_layer, is_polygon_layer from safe.utilities.resources import html_footer, html_header, get_ui_class from safe.utilities.utilities import add_ordered_combo_item from safe.utilities.help import show_context_help from safe.impact_functions.core import evacuated_population_weekly_needs from safe import messaging as m from safe.messaging import styles INFO_STYLE = styles.INFO_STYLE LOGGER = logging.getLogger('InaSAFE') FORM_CLASS = get_ui_class('needs_calculator_dialog_base.ui') class NeedsCalculatorDialog(QtGui.QDialog, FORM_CLASS): """Dialog implementation class for the InaSAFE minimum needs dialog. """ def __init__(self, parent=None): """Constructor for the minimum needs dialog. :param parent: Parent widget of this dialog. :type parent: QWidget """ QtGui.QDialog.__init__(self, parent) self.setupUi(self)
__author__ = '*****@*****.**' __revision__ = '2125fd80224d97278a3e4b80775a678d109f3bf7' __date__ = '26/10/2013' __copyright__ = ('Copyright 2012, Australia Indonesia Facility for ' 'Disaster Reduction') # This import is to enable SIP API V2 # noinspection PyUnresolvedReferences import qgis # pylint: disable=unused-import from PyQt4 import QtGui, QtCore from PyQt4.QtCore import pyqtSignature, pyqtSlot from safe.utilities.resources import (get_ui_class, resources_path, html_header, html_footer) from safe.gui.tools.help.impact_report_help import impact_report_help FORM_CLASS = get_ui_class('impact_report_dialog_base.ui') class ImpactReportDialog(QtGui.QDialog, FORM_CLASS): """Impact report dialog for the InaSAFE plugin.""" def __init__(self, iface, dock=None, parent=None): """Constructor for the dialog. :param iface: A Quantum GIS QGisAppInterface instance. :type iface: QGisAppInterface :param parent: Parent widget of this dialog :type parent: QWidget :param dock: Optional dock widget instance that we can notify of changes to the keywords.
# coding=utf-8 """Help Dialog.""" # This import is to enable SIP API V2 # noinspection PyUnresolvedReferences import qgis # pylint: disable=unused-import from PyQt4 import QtGui from PyQt4.QtCore import Qt from safe.utilities.resources import (get_ui_class, html_footer, html_help_header) from safe.gui.tools.help.dock_help import dock_help FORM_CLASS = get_ui_class('help_dialog_base.ui') __copyright__ = "Copyright 2016, The InaSAFE Project" __license__ = "GPL version 3" __email__ = "*****@*****.**" __revision__ = '448552b25f4b8806c004fcd94d3760c636c9dbe9' class HelpDialog(QtGui.QDialog, FORM_CLASS): """About dialog for the InaSAFE plugin.""" def __init__(self, parent=None, message=None): """Constructor for the dialog. :param message: An optional message object to display in the dialog. :type message: Message.Message :param parent: Parent widget of this dialog :type parent: QWidget
from safe_extras.parameters.qt_widgets.parameter_container import ( ParameterContainer) from safe_extras.parameters.parameter_exceptions import CollectionLengthError from safe.common.resource_parameter import ResourceParameter from safe.common.resource_parameter_widget import ResourceParameterWidget from safe.utilities.resources import html_footer, html_header, get_ui_class from safe.gui.tools.help.function_options_help import function_options_help try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _fromUtf8(text): return text LOGGER = logging.getLogger('InaSAFE') FORM_CLASS = get_ui_class('function_options_dialog_base.ui') # FIXME (Tim and Ole): Change to ConfigurationDialog throughout # Maybe also change filename and Base name accordingly. class FunctionOptionsDialog(QtGui.QDialog, FORM_CLASS): """ConfigurableImpactFunctions Dialog for InaSAFE. """ def __init__(self, parent=None): """Constructor for the dialog. This dialog will show the user the form for editing impact functions parameters if any. :param parent: Optional widget to use as parent
from qgis.PyQt.QtCore import pyqtSlot from qgis.PyQt.QtGui import QIcon from qgis.core import QgsMapLayerProxyModel from safe.common.utilities import unique_filename, temp_dir from safe.datastore.folder import Folder from safe.gis.vector.multi_buffering import multi_buffering from safe.gui.tools.help.multi_buffer_help import multi_buffer_help from safe.gui.tools.wizard.wizard_dialog import WizardDialog from safe.messaging import styles from safe.utilities.resources import (get_ui_class, resources_path, html_footer, html_header) INFO_STYLE = styles.BLUE_LEVEL_4_STYLE LOGGER = logging.getLogger('InaSAFE') FORM_CLASS = get_ui_class('multi_buffer_dialog_base.ui') class MultiBufferDialog(QtWidgets.QDialog, FORM_CLASS): """Dialog implementation class for the InaSAFE multi buffer tool.""" def __init__(self, parent=None, iface=None, dock_widget=None): """Constructor for the multi buffer dialog. :param parent: Parent widget of this dialog. :type parent: QWidget """ QtWidgets.QDialog.__init__(self, parent) self.setupUi(self) self.setWindowTitle(self.tr('InaSAFE Multi Buffer Tool')) icon = resources_path('img', 'icons', 'show-multi-buffer.svg') self.setWindowIcon(QtGui.QIcon(icon))
def get_wizard_step_ui_class(py_file_name): return get_ui_class( os.path.join('wizard', re.sub(r"pyc?$", "ui", os.path.basename(py_file_name))))
QgsRasterLayer, QgsVectorLayer) from safe.gis.reclassify_gdal import reclassify_polygonize from safe.gui.tools.help.raster_reclassify_help import raster_reclassify_help from safe.utilities.keyword_io import KeywordIO from safe.utilities.resources import get_ui_class, html_header, html_footer from safe.utilities.utilities import add_ordered_combo_item, \ ranges_according_thresholds_list from safe.impact_functions.registry import Registry from safe_extras.parameters.qt_widgets.parameter_container import \ ParameterContainer LOGGER = logging.getLogger('InaSAFE') FORM_CLASS = get_ui_class('raster_reclassify_dialog_base.ui') __author__ = 'Rizky Maulana Nugraha <*****@*****.**>' __date__ = '5/30/16' class RasterReclassifyDialog(QDialog, FORM_CLASS): def __init__(self, parent=None, iface=None): """Constructor for Raster Reclassification to Vector Polygon. .. versionadded: 3.4 :param parent: Optional widget to use as parent :type parent: QWidget