def _save_window_state(self):
     """
     Save the state of this mainwindow’s toolbars and dockwidgets to
     the config.
     """
     hexstate = qbytearray_to_hexstate(self.saveState())
     CONF.set('main', 'window/state', hexstate)
Пример #2
0
def set_select_file_dialog_dir(directory):
    """"
    Save in the user configs the directory that should be displayed
    by default in file dialogs.
    """
    if directory is None or not osp.exists(directory):
        directory = get_home_dir()
    CONF.set('main', 'select_file_dialog_dir', directory)
 def set_workdir(self, workdir):
     if osp.exists(workdir):
         self._workdir = workdir
         CONF.set('main', 'working_dir', workdir)
         self.workdir_ledit.setText(workdir)
         if self.data_downloader is not None:
             self.data_downloader.workdir = workdir
         self.gapfiller.set_workdir(workdir)
     else:
         self.set_workdir(get_home_dir())
Пример #4
0
 def close(self):
     CONF.set('gapfill_data', 'nbr_of_station', self.Nmax.value())
     CONF.set('gapfill_data', 'max_horiz_dist', self.distlimit.value())
     CONF.set('gapfill_data', 'max_vert_dist', self.altlimit.value())
     CONF.set('gapfill_data', 'regression_model',
              'OLS' if self.RMSE_regression.isChecked() else 'LAD')
     super().close()
 def _save_window_geometry(self):
     """
     Save the geometry of this mainwindow to the config.
     """
     hexstate = qbytearray_to_hexstate(self.saveGeometry())
     CONF.set('main', 'window/geometry', hexstate)
Пример #6
0
    def closeEvent(self, event):
        self._save_window_geometry()

        # Proximity Filter Options.
        CONF.set('download_data', 'proximity_filter',
                 self.prox_grpbox.isChecked())
        CONF.set('download_data', 'latitude', self.lat)
        CONF.set('download_data', 'longitude', self.lon)
        CONF.set('download_data', 'radius_index',
                 self.radius_SpinBox.currentIndex())
        CONF.set('download_data', 'province_index',
                 self.prov_widg.currentIndex())

        # Data Availability Filter Options.
        CONF.set('download_data', 'data_availability_filter',
                 self.year_widg.isChecked())
        CONF.set('download_data', 'min_nbr_of_years', self.nbrYear.value())
        CONF.set('download_data', 'year_range_left_bound',
                 self.minYear.value())
        CONF.set('download_data', 'year_range_right_bound',
                 self.maxYear.value())
        event.accept()