def __init__(self, iface):
        """Constructor for the dialog.

        This dialog will allow the user to select layers and scenario details
        and subsequently run their model.

        :param iface: A QgisAppInterface instance we use to access QGIS via.
        :type iface: QgsAppInterface
        """
        QDockWidget.__init__(self, None)

        # Dirty hack to display a warning about this plugin.
        self.conflicting_plugin_detected = is_plugin_installed(
            'EmergencyMapper')

        self.setupUi(self)
        self.show_question_button.setVisible(False)
        self.progress_bar.hide()
        enable_messaging(self.results_webview, self)
        self.inasafe_version = get_version()

        self.set_dock_title()

        # Save reference to the QGIS interface
        self.iface = iface

        self.impact_function = None
        self.keyword_io = KeywordIO()
        self.state = None
        self.extent = Extent(self.iface)
        self.map_canvas = None

        # Flag used to prevent recursion and allow bulk loads of layers to
        # trigger a single event only
        self.get_layers_lock = False
        # Flag so we can see if the dock is busy processing
        self.busy = False

        self.show_only_visible_layers_flag = None
        self.set_layer_from_title_flag = None
        self.zoom_to_impact_flag = None
        self.use_selected_features_only = None
        self.hide_exposure_flag = None
        self.map_canvas = None
        self.developer_mode = None
        self.organisation_logo_path = None

        self.print_button.setEnabled(False)

        self.setup_button_connectors()

        self.iface.layerSavedAs.connect(self.save_auxiliary_files)
        self.iface.mapCanvas().extentsChanged.connect(self.extents_changed)

        # Current aggregation layer
        self._aggregation = None

        # Enable on the fly projection by default
        self.connect_layer_listener()
        self.question_group.setEnabled(False)
        self.question_group.setVisible(False)

        self.read_settings()  # get_project_layers called by this

        # debug_mode is a check box to know if we run the IF with debug mode.
        menu = QMenu()
        self.use_debug_action = QAction(tr('Debug analysis'), self)
        self.use_debug_action.setCheckable(True)
        self.use_debug_action.setChecked(
            setting('use_debug_analysis', False, bool))
        self.use_debug_action.toggled.connect(self.debug_group_toggled)
        menu.addAction(self.use_debug_action)
        self.disable_rounding_action = QAction(tr('Disable rounding'), self)
        self.disable_rounding_action.setCheckable(True)
        self.disable_rounding_action.setChecked(
            setting('disable_rounding', False, bool))
        self.disable_rounding_action.toggled.connect(self.debug_group_toggled)
        menu.addAction(self.disable_rounding_action)
        self.debug_group_button.setMenu(menu)
        self.debug_group_toggled()
        if self.developer_mode:
            self.debug_group_button.setVisible(True)
        else:
            # We overwrite the qsettings to be sure.
            self.debug_group_button.setVisible(False)
            self.disable_rounding_action.setChecked(False)
            self.use_debug_action.setChecked(False)

        # Check the validity
        self.validate_impact_function()

        # Default strings
        self.label_without_selection = tr(
            'will be affected? Summarise the results by')
        self.label_with_selection = tr(
            'will be affected? Summarise the results by selected '
            'features in')
        self.aggregation_question_label.setText(self.label_without_selection)
def __init__ ( self , iface ) : QDockWidget . __init__ ( self , None ) self . conflicting_plugin_detected = is_plugin_installed ( 'EmergencyMapper' ) self . setupUi ( self ) self . show_question_button . setVisible ( False ) self . progress_bar . hide ( ) enable_messaging ( self . results_webview , self ) self . inasafe_version = get_version ( ) self . set_dock_title ( ) self . iface = iface self . impact_function = None self . keyword_io = KeywordIO ( ) self . state = None self . extent = Extent ( self . iface ) self . map_canvas = None self . get_layers_lock = False self . busy = False self . show_only_visible_layers_flag = None self . set_layer_from_title_flag = None self . zoom_to_impact_flag = None self . use_selected_features_only = None self . hide_exposure_flag = None self . map_canvas = None self . developer_mode = None self . organisation_logo_path = None self . print_button . setEnabled ( False ) self . setup_button_connectors ( ) self . iface . layerSavedAs . connect ( self . save_auxiliary_files ) self . iface . mapCanvas ( ) . extentsChanged . connect ( self . extents_changed ) self . _aggregation = None self . connect_layer_listener ( ) self . question_group . setEnabled ( False ) self . question_group . setVisible ( False ) self . read_settings ( ) menu = QMenu ( ) self . use_debug_action = QAction ( tr ( 'Debug analysis' ) , self ) self . use_debug_action . setCheckable ( True ) self . use_debug_action . setChecked ( setting ( 'use_debug_analysis' , False , bool ) ) self . use_debug_action . toggled . connect ( self . debug_group_toggled ) menu . addAction ( self . use_debug_action ) self . disable_rounding_action = QAction ( tr ( 'Disable rounding' ) , self ) self . disable_rounding_action . setCheckable ( True ) self . disable_rounding_action . setChecked ( setting ( 'disable_rounding' , False , bool ) ) self . disable_rounding_action . toggled . connect ( self . debug_group_toggled ) menu . addAction ( self . disable_rounding_action ) self . debug_group_button . setMenu ( menu ) self . debug_group_toggled ( ) if self . developer_mode : self . debug_group_button . setVisible ( True ) else : self . debug_group_button . setVisible ( False ) self . disable_rounding_action . setChecked ( False ) self . use_debug_action . setChecked ( False ) self . validate_impact_function ( ) self . label_without_selection = tr ( 'will be affected? Summarise the results by' ) self . label_with_selection = tr ( 'will be affected? Summarise the results by selected ' 'features in' ) self . aggregation_question_label . setText ( self . label_without_selection )
Constructor for the dialog.

        This dialog will allow the user to select layers and scenario details
        and subsequently run their model.

        :param iface: A QgisAppInterface instance we use to access QGIS via.
        :type iface: QgsAppInterface