def adjust_page_2_controls(self): self.cbo_mapping.clear() self.cbo_mapping.addItem("") self.cbo_mapping.addItems(self.app.core.get_field_mappings_file_names(self.current_point_name())) if self.rad_refactor.isChecked(): self.lbl_refactor_source.setEnabled(True) self.mMapLayerComboBox.setEnabled(True) self.lbl_field_mapping.setEnabled(True) self.cbo_mapping.setEnabled(True) self.import_layer_changed(self.mMapLayerComboBox.currentLayer()) disable_next_wizard(self) self.wizardPage2.setFinalPage(True) self.txt_help_page_2.setHtml(self.help_strings.get_refactor_help_string(self._db, self._layers[self.current_point_name()])) elif self.rad_csv.isChecked(): self.lbl_refactor_source.setEnabled(False) self.mMapLayerComboBox.setEnabled(False) self.lbl_field_mapping.setEnabled(False) self.cbo_mapping.setEnabled(False) self.lbl_refactor_source.setStyleSheet('') enable_next_wizard(self) self.wizardPage2.setFinalPage(False) self.txt_help_page_2.setHtml(self.help_strings.WIZ_ADD_POINTS_SURVEY_PAGE_2_OPTION_CSV)
def adjust_page_1_controls(self): self.cbo_mapping.clear() self.cbo_mapping.addItem("") self.cbo_mapping.addItems( self.app.core.get_field_mappings_file_names( self.EDITING_LAYER_NAME)) if self.rad_refactor.isChecked(): self.lbl_refactor_source.setEnabled(True) self.mMapLayerComboBox.setEnabled(True) self.lbl_field_mapping.setEnabled(True) self.cbo_mapping.setEnabled(True) disable_next_wizard(self) self.wizardPage1.setFinalPage(True) finish_button_text = QCoreApplication.translate( "WizardTranslations", "Import") self.txt_help_page_1.setHtml( self.help_strings.get_refactor_help_string( self._db, self._layers[self.EDITING_LAYER_NAME])) self.wizardPage1.setButtonText(QWizard.FinishButton, finish_button_text) elif self.rad_create_manually.isChecked(): self.lbl_refactor_source.setEnabled(False) self.mMapLayerComboBox.setEnabled(False) self.lbl_field_mapping.setEnabled(False) self.cbo_mapping.setEnabled(False) enable_next_wizard(self) self.wizardPage1.setFinalPage(False) finish_button_text = QCoreApplication.translate( "WizardTranslations", "Create") self.txt_help_page_1.setHtml( self.wizard_config[WIZARD_HELP_PAGES][WIZARD_HELP1]) self.wizardPage2.setButtonText(QWizard.FinishButton, finish_button_text)
def adjust_page_2_controls(self): self.cbo_mapping.clear() self.cbo_mapping.addItem("") self.cbo_mapping.addItems( self.qgis_utils.get_field_mappings_file_names( self.current_point_name())) if self.rad_refactor.isChecked(): self.lbl_refactor_source.setEnabled(True) self.mMapLayerComboBox.setEnabled(True) self.lbl_field_mapping.setEnabled(True) self.cbo_mapping.setEnabled(True) disable_next_wizard(self) self.wizardPage2.setFinalPage(True) self.txt_help_page_2.setHtml( self.help_strings.get_refactor_help_string( self._db, self._layers[self.current_point_name()][LAYER])) elif self.rad_csv.isChecked(): self.lbl_refactor_source.setEnabled(False) self.mMapLayerComboBox.setEnabled(False) self.lbl_field_mapping.setEnabled(False) self.cbo_mapping.setEnabled(False) enable_next_wizard(self) self.wizardPage2.setFinalPage(False) self.txt_help_page_2.setHtml( self.help_strings.WIZ_ADD_POINTS_OPERATION_PAGE_2_OPTION_CSV)
def current_page_changed(self, id): """ Reset the Next button. Needed because Next might have been disabled by a condition in a another SLOT. """ enable_next_wizard(self) if id == self.dict_pages_ids[self.wizardPage2]: self.adjust_page_1_controls() self.set_buttons_visible(True) self.set_buttons_enabled(True)
def __option_changed(self, e: EnumFeatureCreationMode): self.__wp_select_source.set_help_text( self.__view_config[WIZARD_SELECT_SOURCE_HELP][e]) finish_button_text = self.__view_config[WIZARD_FINISH_BUTTON_TEXT][e] self.__wizard.setButtonText(QWizard.FinishButton, finish_button_text) # new self.__wp_select_source.get_wizard_page().setFinalPage( e == EnumFeatureCreationMode.REFACTOR_FIELDS) if e == EnumFeatureCreationMode.REFACTOR_FIELDS: disable_next_wizard(self.__wizard) else: enable_next_wizard(self.__wizard)
def current_page_changed(self, id): """ Reset the Next button. Needed because Next might have been disabled by a condition in a another SLOT. """ enable_next_wizard(self) if id == self.dict_pages_ids[self.wizardPage2]: self.adjust_page_2_controls() elif id == self.dict_pages_ids[self.wizardPage3]: self.set_buttons_visible(False) self.set_buttons_enabled(False) QCoreApplication.processEvents() self.check_z_in_geometry() QCoreApplication.processEvents() self.fill_long_lat_combos("") QCoreApplication.processEvents() self.set_buttons_visible(True) self.set_buttons_enabled(True)