def init_config(self): self.mediaPathValueLabel.setText(config.load().get('save_path')) self.mediaSaveOptionCheckBox.setCheckState( Qt.CheckState(config.load().get('media_save_option', 0))) self.insecureCheckBox.setCheckState( Qt.CheckState(config.load().get('insecure', 0))) self.downlaodCaptionheckBox.setCheckState( Qt.CheckState(config.load().get('caption', 0))) self.mergeCheckBox.setCheckState( Qt.CheckState(config.load().get('merge', 0)))
def set_loaded_ui_values(self, ui_values: list[str]): """Sets the ui according to the given list of ui values. Note: The ui_values param is expected to be one of the arrays of the array of values of IO.load_time_lapse_config Args: ui_values (list[str]): A list of ui values which will define the new UI states """ self.window.lineEdit_name.setText(ui_values[0]) self.window.lineEdit_IP_address.setText(ui_values[1]) self.window.lineEdit_timelapse_path.setText(ui_values[2]) self.window.spinBox_time_till_next_image.setValue(int(ui_values[3])) self.window.spinBox_fps.setValue(int(ui_values[4])) self.window.checkBox_delete_images.setCheckState( Qt.CheckState(ui_values[5] == "True"))