spct_optionsdialog.py 文件源码

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

项目:specton 作者: somesortoferror 项目源码 文件源码
def __init__(self):
        super(OptionsDialog, self).__init__()
        self.ui = Ui_optionsDialog()
        self.ui.setupUi(self)
        lineEdit_filemaskregex = self.findChild(QLineEdit, "lineEdit_filemaskregex")
        filemask_regex = cfg.settings.value('Options/FilemaskRegEx', defaultfilemask)
        if not filemask_regex == "":
            lineEdit_filemaskregex.setText(filemask_regex)
        else:
            lineEdit_filemaskregex.setText(defaultfilemask)
        lineEdit_mediainfo_path = self.findChild(QLineEdit, "lineEdit_mediainfo_path")
        lineEdit_mediainfo_path.setText(findMediaInfoBin())
        lineEdit_mp3guessenc_path = self.findChild(QLineEdit, "lineEdit_mp3guessenc_path")
        lineEdit_mp3guessenc_path.setText(findGuessEncBin())
        lineEdit_sox_path = self.findChild(QLineEdit, "lineEdit_sox_path")
        lineEdit_sox_path.setText(findSoxBin())
        lineEdit_ffprobe_path = self.findChild(QLineEdit, "lineEdit_ffprobe_path")
        lineEdit_ffprobe_path.setText(findffprobeBin())
        lineEdit_aucdtect_path = self.findChild(QLineEdit, "lineEdit_aucdtect_path")
        lineEdit_aucdtect_path.setText(findauCDtectBin())
        checkBox_recursive = self.findChild(QCheckBox, "checkBox_recursive")
        checkBox_recursive.setChecked(cfg.settings.value('Options/RecurseDirectories', True, type=bool))
        checkBox_followsymlinks = self.findChild(QCheckBox, "checkBox_followsymlinks")
        checkBox_followsymlinks.setChecked(cfg.settings.value('Options/FollowSymlinks', False, type=bool))
        checkBox_cache = self.findChild(QCheckBox, "checkBox_cache")
        checkBox_cache.setChecked(cfg.settings.value('Options/UseCache', True, type=bool))
        checkBox_cacheraw = self.findChild(QCheckBox, "checkBox_cacheraw")
        checkBox_cacheraw.setChecked(cfg.settings.value('Options/CacheRawOutput', False, type=bool))
        spinBox_processes = self.findChild(QSpinBox, "spinBox_processes")
        spinBox_processes.setValue(cfg.settings.value('Options/Processes', 0, type=int))
        spinBox_spectrogram_palette = self.findChild(QSpinBox, "spinBox_spectrogram_palette")
        spinBox_spectrogram_palette.setValue(cfg.settings.value('Options/SpectrogramPalette', 1, type=int))
        checkBox_debug = self.findChild(QCheckBox, "checkBox_debug")
        checkBox_debug.setChecked(cfg.settings.value("Options/Debug", False, type=bool))
        checkBox_savewindowstate = self.findChild(QCheckBox, "checkBox_savewindowstate")
        checkBox_savewindowstate.setChecked(cfg.settings.value("Options/SaveWindowState", True, type=bool))
        checkBox_clearfilelist = self.findChild(QCheckBox, "checkBox_clearfilelist")
        checkBox_clearfilelist.setChecked(cfg.settings.value('Options/ClearFilelist', True, type=bool))
        checkBox_spectrogram = self.findChild(QCheckBox, "checkBox_spectrogram")
        checkBox_spectrogram.setChecked(cfg.settings.value('Options/EnableSpectrogram', True, type=bool))
        checkBox_bitrate_graph = self.findChild(QCheckBox, "checkBox_bitrate_graph")
        checkBox_bitrate_graph.setChecked(cfg.settings.value('Options/EnableBitGraph', True, type=bool))
        checkBox_aucdtect_scan = self.findChild(QCheckBox, "checkBox_aucdtect_scan")
        checkBox_aucdtect_scan.setChecked(cfg.settings.value('Options/auCDtect_scan', False, type=bool))
        horizontalSlider_aucdtect_mode = self.findChild(QSlider, "horizontalSlider_aucdtect_mode")
        horizontalSlider_aucdtect_mode.setValue(cfg.settings.value('Options/auCDtect_mode', 8, type=int))

        pushButton_mediainfo_path = self.findChild(QPushButton, "pushButton_mediainfo_path")
        pushButton_mediainfo_path.clicked.connect(self.choosePathButton)
        pushButton_mp3guessenc_path = self.findChild(QPushButton, "pushButton_mp3guessenc_path")
        pushButton_mp3guessenc_path.clicked.connect(self.choosePathButton)
        pushButton_sox_path = self.findChild(QPushButton, "pushButton_sox_path")
        pushButton_sox_path.clicked.connect(self.choosePathButton)
        pushButton_ffprobe_path = self.findChild(QPushButton, "pushButton_ffprobe_path")
        pushButton_ffprobe_path.clicked.connect(self.choosePathButton)
        pushButton_aucdtect_path = self.findChild(QPushButton, "pushButton_aucdtect_path")
        pushButton_aucdtect_path.clicked.connect(self.choosePathButton)
        buttonBox = self.findChild(QDialogButtonBox, "buttonBox")
        buttonBox.button(QDialogButtonBox.Save).clicked.connect(self.saveSettings)
        buttonBox.button(QDialogButtonBox.Discard).clicked.connect(self.close)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号