コード例 #1
0
 def __save_file(self):
     '''Opens file dialog and sets and saves the settings to a ini file.
     '''
     filename = save_file_dialog(self, self.default_folder,
                                 "Save measuring unit settings file",
                                 "Settings file (*.ini)")
     if filename:
         settings = MeasuringSettings()
         settings.set_settings(self)
         settings.save_settings(filename)
コード例 #2
0
 def __load_file(self):
     '''Opens file dialog and loads and shows selected ini file's values.
     '''
     filename = open_file_dialog(self, self.default_folder,
                                 "Load measuring unit settings file",
                                 "Settings file (*.ini)")
     if filename:  # TODO: toistuvaa koodia
         settings = MeasuringSettings()
         settings.load_settings(filename)
         self.masses.load_isotopes(settings.element.name,
                                   self.isotopeComboBox,
                                   str(settings.element.isotope))
         settings.show(self)
コード例 #3
0
 def __load_file(self, settings_type):
     '''Opens file dialog and loads and shows selected ini file's values.
     
     Args:
         settings_type: (string) selects which settings file type will be loaded. 
                        Can be "MEASURING_UNIT_SETTINGS", 
                        "DEPTH_PROFILE_SETTINGS" or "CALIBRATION_SETTINGS"
     '''
     if settings_type == "MEASURING_UNIT_SETTINGS":
         settings = MeasuringSettings()
     elif settings_type == "DEPTH_PROFILE_SETTINGS":
         settings = DepthProfileSettings()
     elif settings_type == "CALIBRATION_SETTINGS":
         settings = CalibrationParameters()
     else:
         return
     
     filename = open_file_dialog(self, self.project.directory,
                                 "Open settings file", "Settings file (*.ini)")
     if filename:
         settings.load_settings(filename)
         if settings_type == "MEASURING_UNIT_SETTINGS":
             self.masses.load_isotopes(settings.element.name,
                                       self.isotopeComboBox,
                                       str(settings.element.isotope))
         settings.show(self)
コード例 #4
0
 def __save_file(self, settings_type):
     '''Opens file dialog and sets and saves the settings to a ini file.
     '''
     
     if settings_type == "MEASURING_UNIT_SETTINGS":
         settings = MeasuringSettings()
     elif settings_type == "DEPTH_PROFILE_SETTINGS":
         settings = DepthProfileSettings()
     elif settings_type == "CALIBRATION_SETTINGS":
         settings = CalibrationParameters()
     else:
         return
     
     filename = save_file_dialog(self, self.project.directory,
                                 "Open measuring unit settings file",
                                 "Settings file (*.ini)")
     if filename:
         settings.set_settings(self)
         settings.save_settings(filename)