Exemple #1
0
 def Convert():
     func = Functions()
     InFile = getattr(self, convertID+'InEdit').text()
     if InFile:
         dialog = QFileDialog()
         dialog.raise_()
         fileName, _ = dialog.getSaveFileName(self, "Save As...", InFile, "All Files (*.*)", options=QFileDialog.Options())
         if fileName:
             convertBtn = getattr(self, convertID+'ConvertBtn')
             old_text = convertBtn.text()
             convertBtn.setText('proc...')
             self.setEnabled(False)
             QApplication.processEvents()
             if fileName != InFile:
                 print("Saving file as "+ fileName)
                 if convertID == "At3":
                     if self.At3EditorEdit.text() and self.FFEditorEdit.text():
                         func.At3Convert(InFile, fileName)
                     else:
                         self.make_ErrorMessage("FFMpeg or the At3Tool has not been configured in the settings.")
                 elif convertID == "Vid":
                     if self.FFEditorEdit.text():
                         func.VidConvert(InFile, fileName)
                     else:
                         self.make_ErrorMessage("FFMpeg has not been configured in the settings.")
                 elif convertID == "Pmf":
                     func.PmfConvert(InFile, fileName)
                 convertBtn.setText(old_text)
             else:
                 self.make_ErrorMessage("You can't save over the file you are converting!")
             self.setEnabled(True)
     else:
         self.make_ErrorMessage('You are missing an input file.')