main.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:desktop-stream-viewer 作者: AbiosGaming 项目源码 文件源码
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.")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号