def generate_conf(self):
"""Generate a config from the provided settings."""
# Quality options should be provided as a comma-separated string.
quality_text = self.dialog.findChild(QtCore.QObject, QUALITY_SETTINGS).text()
quality_options = [quality.strip()
for quality
in quality_text.split(CONFIG_QUALITY_DELIMITER_SPLIT)]
# Set new cfg values
cfg[CONFIG_QUALITY] = quality_options
cfg[CONFIG_BUFFER_STREAM] = self.dialog.findChild(QtCore.QObject, RECORD_SETTINGS).isChecked()
cfg[CONFIG_MUTE] = self.dialog.findChild(QtCore.QObject, MUTE_SETTINGS).isChecked()
cfg[CONFIG_BUFFER_SIZE] = self.dialog.findChild(QtCore.QObject, BUFFER_SIZE).value()
QtWidgets.QMessageBox.critical(
self,
"Caution",
"Some of your changes may require a restart in order to take effect."
)
try:
cfg.dump()
except IOError:
print("Could not dump config file.")
评论列表
文章目录