def saveSettings(self): settings = QSettings(ORGANIZATION, PROGRAM) if self.ui.rb_mono.isChecked(): channels = 1 elif self.ui.rb_stereo.isChecked(): channels = 2 else: channels = self.ui.sb_channels.value() settings.setValue("Geometry", self.saveGeometry()) settings.setValue("OutputFolder", self.ui.le_folder.text()) settings.setValue("FilenamePrefix", self.ui.le_prefix.text()) settings.setValue("EncodingFormat", self.ui.cb_format.currentText()) settings.setValue("EncodingDepth", self.ui.cb_depth.currentData()) settings.setValue("EncodingChannels", channels) settings.setValue("UseTransport", self.ui.group_time.isChecked()) settings.setValue("StartTime", self.ui.te_start.time()) settings.setValue("EndTime", self.ui.te_end.time()) settings.setValue("ExtraArgs", self.ui.le_extra_args.text().strip()) if self.ui.rb_source_default.isChecked(): settings.setValue("RecordingSource", 0) elif self.ui.rb_source_manual.isChecked(): settings.setValue("RecordingSource", 1) elif self.ui.rb_source_selected.isChecked(): settings.setValue("RecordingSource", 2) settings.beginWriteArray("Sources") for i, (client, port) in enumerate(self.rec_sources): settings.setArrayIndex(i) settings.setValue("Client", client) settings.setValue("Port", port) settings.endArray()
def save_perspectives(self, settings: QSettings): ''' Saves the perspectives to the given settings file. Parameters ---------- settings : QSettings ''' settings.beginWriteArray("Perspectives", len(self._mgr.perspectives)) for i, (key, perspective) in enumerate(self._mgr.perspectives.items()): settings.setArrayIndex(i) settings.setValue("Name", key) settings.setValue("State", perspective) settings.endArray()