code: def import_setting(self):
          
          LOGGER.debug('Import button clicked')
          home_directory = os.path.expanduser('~')
          file_path, __ = QFileDialog.getOpenFileName(
              self,
              self.tr('Import InaSAFE settings'),
              home_directory,
              self.tr('JSON File (*.json)'))
          if file_path:
              title = tr('Import InaSAFE Settings.')
              question = tr(
                  'This action will replace your current InaSAFE settings with '
                  'the setting from the file. This action is not reversible. '
                  'Are you sure to import InaSAFE Setting?')
              answer = QMessageBox.question(
                  self, title, question, QMessageBox.Yes | QMessageBox.No)
              if answer == QMessageBox.Yes:
                  LOGGER.debug('Import from %s' % file_path)
                  import_setting(file_path)
docs: Import setting to a file.