From: <te...@us...> - 2003-08-05 17:50:40
|
Update of /cvsroot/quickrip/quickrip/qt In directory sc8-pr-cvs1:/tmp/cvs-serv26132/qt Added Files: qtgui.py qtmain.py qtprogressdialogue.py qtsettings.py Log Message: Added base.py, Removed dvd.py, Moved qt files into "qt" subdirectory, Changed config.py to fit new base.py Changed quickrip.py to handle qt subdirectory A LOT IS NOW BROKEN! CLI AND QT INTERFACES NEED WORK TO MAKE THEM WORK WITH NEW BASE CLASS, DUE TO SOME MAJOR CHANGES, AND THE REPLACEMENT OF 'TRACK' WITH 'TITLE' --- NEW FILE: qtgui.py --- #!/usr/bin/env python """ gui.py - GUI specific functions for QuickRip copyright: (C) 2003, Tom Chance license: GNU General Public License (GPL) (see LICENSE file) web: http://quickrip.sf.net email: tom...@gm... """ import sys, os, re from base import * try: from qt import * except: print """ Unable to load the PyQt module! Check it's installed properly. If you think it is, but you still get this message, please see the frequent problems page online at http://quickrip.sf.net/fp.shtml Press Enter for the full Qt error message """ deleteme = raw_input() del deleteme import qt from qtmain import MainWindow from qtsettings import dialogSettings from qtprogressdialogue import dialogueProgress # QuickRip global configuration. import config __app__ = config.app __author__ = config.author __version__ = config.version __date__ = config.date __copyright__ = config.copyright __license__ = config.license class GUI(DVD, MainWindow): """GUI-specific functions to add a Qt GUI to the DVD class: changeState() - start/stop the ripping process int_startScanning() - notify user that the DVD is being scanned int_noTracks() - notify user that no tracks were found int_dispDVD() - display information about the DVD int_dispTrack() - display information about scanned track int_finishScanning() - notify user that scanning has finished int_startRipping() - notify user that ripping has started int_newTrack() - notify that ripping has begun on a new track int_newPass() - notify that new ripping pass has begun int_updateProgress() - update any ripping progress display being used int_finishRipping() - notify user that ripping has finished""" def __init__(self, app, parent=None): self.app = app MainWindow.__init__(self, parent) self.setIcon(QPixmap(config.icon)) # set application icon... self.DVD_DEVICE = "/dev/dvd" self.cwd = os.getcwd() self.alangs = [] self.slangs = [] self.tracks = [] self.dio = {0 : 'None', 1: 'dint', 2: 'il', 3: 'lavcdeint', 4: 'pp=lb'} self.aro = {0: 'Default', 1: '4:3', 2: '16:9', 3: '2.35:1'} self.configfile = os.path.join(os.path.expanduser("~"),".quickriprc") (self.config, self.parser) = self.loadConfig() self.outputDir.setText(self.config['outputdir']) self.outdir = self.config['outputdir'] def int_configError(self, bin): self.errormsg = "QuickRip was unable to find " + bin + " on your system.\nCheck it is installed then retry" QMessageBox.critical(self, "QuickRip Error", self.errormsg, "OK") sys.exit(2) def int_startScanning(self): print "* Scanning DVD..." self.b_ScanDVD.setText("Scanning...") self.dvdTracks.clear() def int_noTracks(self): QMessageBox.warning(self, "QuickRip Error", "QuickRip was unable to find any " "DVD tracks.\n\nCheck:\n* Mplayer and Transcode are " "installed\n* The program paths are correct in Settings\n" "* Mplayer can play DVDs\n* You have a DVD " "in your drive", "OK") self.b_ScanDVD.setText("Scan DVD") def int_dispDVD(self): #print "Found %s titles" % (self.numtitles) #print "Found audio languages %s" % (self.alangs) #print "Found subtitle languages %s" % (self.slangs) print "Found %s titles\nFound audio languages %s\nFound subtitle languages %s\n" % \ (self.numtitles, self.alangs, self.slangs) # Add languages to drop-down menus for lang in self.alangs: self.aLang.insertItem(lang, -1) for lang in self.slangs: self.subTitles.insertItem(lang, -1) def int_dispTrack(self, track): self.track = track print "Track %2s: %2s" % (self.track['id'], self.track['timelabel']) item = QListViewItem(self.dvdTracks,None) item.setText(0, self.track['name']) item.setText(1, str(self.track['timelabel'])) item.info = self.track for i in range(int(self.track['numchapters']) + 1): if i > 0: if i < 10: i = "0" + str(i) chap_label = "Chapter %s" % (i) subitem = QListViewItem(item,None) subitem.setText(0, self.tr(chap_label)) self.app.processEvents() def int_finishScanning(self): print "* Finished scanning" self.b_ScanDVD.setText("Scan DVD") def int_startRipping(self): print "* Starting ripping" def int_newTrack(self, name, number, total, vbr): print "*\tRipping track '%s' (%s of %s) at %skbps" % (name, number, total, vbr) if self.config['passes'] is 1: self.Dialogue.pm_audioPass.setProgress(-1) elif self.config['passes'] is 2: self.Dialogue.pm_audioPass.setProgress(-1) self.Dialogue.pm_videoPass1.setProgress(-1) elif not self.config['passes'] or self.config['passes'] is 3: self.Dialogue.pm_audioPass.setProgress(-1) self.Dialogue.pm_videoPass1.setProgress(-1) self.Dialogue.pm_videoPass2.setProgress(-1) self.Dialogue.rippingXofY.setText("".join(["Ripping ", str(name), " (", str(number), " of ", str(total), ")"])) def int_newPass(self, passtype): self.passtype = passtype if self.passtype is "video1": self.Dialogue.pm_audioPass.setProgress(100) elif self.passtype is "video2": self.Dialogue.pm_videoPass1.setProgress(100) def int_updateProgress(self, perc, trem, tpass): self.percentage = perc self.trem = trem self.tpass = tpass eta = "".join(["ETA: ", str(trem), " (approximately)"]) self.Dialogue.l_ETA.setText(eta) if self.tpass is "all": self.Dialogue.pm_audioPass.setProgress(int(perc)) elif self.tpass is "audio": self.Dialogue.pm_audioPass.setProgress(int(perc)) elif self.tpass is "video1": self.Dialogue.pm_videoPass1.setProgress(int(perc)) elif self.tpass is "video2": self.Dialogue.pm_videoPass2.setProgress(int(perc)) self.app.processEvents() def int_finishRipping(self): if self.config['passes'] is 1: self.Dialogue.pm_audioPass.setProgress(100) elif self.config['passes'] is 2: self.Dialogue.pm_videoPass1.setProgress(100) elif not self.config['passes'] or self.config['passes'] is 3: self.Dialogue.pm_videoPass2.setProgress(100) print "* Ripping finished" self.Dialogue.rippingXofY.setText("Waiting to start...") os.popen("rm divx2pass.log 2>/dev/null") os.popen("rm " + self.outdir + "frameno.avi 2>/dev/null") self.Dialogue.b_changeState.setText("Start") self.Dialogue.b_closeProgressDialogue.setEnabled(1) self.Dialogue.l_ETA.setText("ETA: N/A") self.state = "stopped" os.chdir(self.cwd) def selectTrack(self, const, qpoint, col): """Select tracks to rip by setting column 2 to 'yes'""" # Check the mouse isn't clicking in blank space self.track = self.dvdTracks.selectedItem() try: checker = self.track.text(0) del checker except: return # Check if the user has clicked on a title or a chapter chap = re.compile('Chapter.*') if not chap.search(str(self.track.text(0))): # Stop short of tagging for ripping unless "Rip" column is selected if col is not 2: self.updateTrackDisplay(self.track) return if self.track.info['rip'] is "yes": self.track.setPixmap(2, self.image_blank) self.updateTrackRip(self.track, mode="remove") else: self.track.setPixmap(2, self.image_tick) self.updateTrackRip(self.track, mode="add") self.checkEnableRip() def updateTrackDisplay(self, track): self.track = track self.track.info['name'] = self.track.text(0) if abs(int(str(self.fileSize.cleanText())) - self.track.info['size']) > 1: self.fileSize.setValue(self.track.info['size']) if abs(self.audioBitRate.currentItem() - self.track.info['abr_id']) > 1: self.audioBitRate.setCurrentItem(self.track.info['abr_id']) self.track.info['abr'] = self.audioBitRate.currentText() if abs(int(str(self.videoBitRate.cleanText())) - self.track.info['vbr']) > 1: self.videoBitRate.setValue(self.track.info['vbr']) self.videoBitRateSlider.setValue(self.track.info['vbr']) def updateTrackRip(self, track, mode): """Update track's rip attribute""" if not len(self.tracks): return # Add/remove "rip" status to/from track self.mode = mode if self.mode is "remove": self.track.info['rip'] = "no" elif self.mode is "add": self.track.info['rip'] = "yes" self.updateTrackDisplay(self.track) def newFileSize(self, filesize): self.track = self.dvdTracks.selectedItem() self.filesize = int(str(self.fileSize.cleanText())) self.track.info['size'] = int(self.filesize) self.track.info['vbr'] = self.calcRate(self.track.info['time'], self.track.info['abr'], self.track.info['size']) #print "new file size, changing video bitrate to %s (size: %s, length %s, abr %s)" % (self.track.info['vbr'], self.track.info['size'], self.track.info['time'], self.track.info['abr']) self.updateTrackDisplay(self.track) def newBitrate(self, bitrate): self.track = self.dvdTracks.selectedItem() self.bitrate = int(str(self.videoBitRate.cleanText())) self.track.info['vbr'] = self.bitrate self.track.info['size'] = self.calcFileSize(self.track.info['time'], self.track.info['abr'], self.track.info['vbr']) #print "new bitrate, changing file size to %s (vbr: %s, length %s, abr %s)" % (self.track.info['size'],self.track.info['vbr'], self.track.info['time'], self.track.info['abr']) self.updateTrackDisplay(self.track) def newAudioBitrate(self, bitrate): self.track = self.dvdTracks.selectedItem() self.audiobitrate = int(str(self.audioBitRate.currentText())) print self.audiobitrate self.track.info['abr'] = self.audiobitrate self.track.info['vbr'] = self.calcRate(self.track.info['time'], self.track.info['abr'], self.track.info['size']) self.updateTrackDisplay(self.track) def checkEnableRip(self): r = str(self.videoBitRate.cleanText()) o = str(self.outputDir.text()) t = 0 for track in self.tracks: if track['rip'] is "yes": t = 1 if len(r) > 0 and len(o) > 0 and t is 1: self.b_RipDVD.setEnabled(1) else: self.b_RipDVD.setEnabled(0) def renameTrack(self, item): """Set ViewListItem to be renamed""" self.item = item self.item.setRenameEnabled(0, 1) self.item.startRename(0) def browseHD(self): """Launch file dialogue and set output directory""" directory = QFileDialog.getExistingDirectory(self.config['outputdir'], \ self, \ "get existing directory", \ "Choose a directory", \ 1 ) self.outputDir.setText(str(directory)) self.outdir = str(directory) self.checkEnableRip() def openRipDialogue(self): try: os.chdir(config.qr_dir) except OSError, msg: print "\n***Unable to change to directory", qr_dir, "\n(", msg, ")\n" #import output #print output.bold("DEVELOPER: UNCOMMENT THE CHDIR CODE! (LINE 282, GUI.PY)") self.state = "stopped" self.Dialogue = dialogueProgress(self) self.Dialogue.connect(self.Dialogue.b_changeState,SIGNAL("clicked()"),self.changeState) self.Dialogue.b_changeState.setText("Start") self.Dialogue.b_closeProgressDialogue.setEnabled(1) self.Dialogue.rippingXofY.setText("Waiting to start...") # Add in progress bars appropriate to number of passes l_audiopass = QHBoxLayout(None,0,6,"l_audiopass") self.Dialogue.textLabel3 = QLabel(self.Dialogue.groupBox3,"textlabel3") l_audiopass.addWidget(self.Dialogue.textLabel3) self.Dialogue.pm_audioPass = QProgressBar(self.Dialogue.groupBox3,"pm_audioPass") self.Dialogue.pm_audioPass.setMinimumSize(QSize(400,0)) l_audiopass.addWidget(self.Dialogue.pm_audioPass) self.Dialogue.groupBox3Layout.addLayout(l_audiopass,2,0) self.Dialogue.textLabel3.setText(self.tr("Progress:")) if self.config['passes'] is 2 or self.config['passes'] is 3: l_videopass1 = QHBoxLayout(None,0,6,"l_videopass1") self.Dialogue.textLabel4 = QLabel(self.Dialogue.groupBox3,"textlabel4") l_videopass1.addWidget(self.Dialogue.textLabel4) self.Dialogue.pm_videoPass1 = QProgressBar(self.Dialogue.groupBox3,"pm_videoPass1") self.Dialogue.pm_videoPass1.setMinimumSize(QSize(400,0)) l_videopass1.addWidget(self.Dialogue.pm_videoPass1) self.Dialogue.groupBox3Layout.addLayout(l_videopass1,3,0) self.Dialogue.textLabel3.setText(self.tr("Audio pass:")) self.Dialogue.textLabel4.setText(self.tr("Video pass:")) if self.config['passes'] is 3: l_videopass2 = QHBoxLayout(None,0,6,"l_videopass1") self.Dialogue.textLabel5 = QLabel(self.Dialogue.groupBox3,"textlabel5") l_videopass2.addWidget(self.Dialogue.textLabel5) self.Dialogue.pm_videoPass2 = QProgressBar(self.Dialogue.groupBox3,"pm_videoPass2") self.Dialogue.pm_videoPass2.setMinimumSize(QSize(400,0)) l_videopass2.addWidget(self.Dialogue.pm_videoPass2) self.Dialogue.groupBox3Layout.addLayout(l_videopass2,4,0) self.Dialogue.textLabel3.setText(self.tr("Audio pass:")) self.Dialogue.textLabel4.setText(self.tr("Video pass 1:")) self.Dialogue.textLabel5.setText(self.tr("Video pass 2:")) # if self.config['passes'] is 1: # from guiprogressdialogue_1pass import dialogProgress # elif self.config['passes'] is 2: # from guiprogressdialogue_2pass import dialogProgress # elif not self.config['passes'] or self.config['passes'] is 3: # from guiprogressdialogue_3pass import dialogProgress self.Dialogue.exec_loop() def changeState(self): """Switch dialogue between stopped and ripping, changing buttons and starting/stopping ripping process""" if self.state is "stopped": self.Dialogue.b_changeState.setText("Stop") self.Dialogue.b_closeProgressDialogue.setEnabled(0) os.chdir(self.outdir) self.volumead = str(self.volume.currentText()) self.aLanguage = str(self.aLang.currentText()) self.sLanguage = str(self.subTitles.currentText()) self.ripDVD() elif self.state is "ripping": print "* Ripping aborted" self.Dialogue.rippingXofY.setText("Waiting to start...") try: pid = self.pipe.pid os.kill(pid, 9) os.waitpid(pid, os.WNOHANG) except: pass os.popen("rm divx2pass.log 2>/dev/null") os.popen("rm " + self.outdir + "frameno.avi 2>/dev/null") self.Dialogue.b_changeState.setText("Start") self.Dialogue.b_closeProgressDialogue.setEnabled(1) if self.config['passes'] is 1: self.Dialogue.pm_audioPass.setProgress(-1) elif self.config['passes'] is 2: self.Dialogue.pm_audioPass.setProgress(-1) self.Dialogue.pm_videoPass1.setProgress(-1) #elif self.config['passes'] == 0 or self.config['passes'] == 3: elif not self.config['passes'] or self.config['passes'] is 3: self.Dialogue.pm_audioPass.setProgress(-1) self.Dialogue.pm_videoPass1.setProgress(-1) self.Dialogue.pm_videoPass2.setProgress(-1) self.state = "stopped" os.chdir(self.cwd) def openSettingsDialogue(self): """Open the settings dialogue box, connecting slots to functions""" self.Dialogue = dialogSettings(self) # Set-up defauls from config file self.Dialogue.mplayer.setText(self.config['mplayer']) self.Dialogue.mencoder.setText(self.config['mencoder']) self.Dialogue.tcprobe.setText(self.config['tcprobe']) self.Dialogue.dvdDevice.setText(self.config['dvd_device']) self.Dialogue.outputDir.setText(self.config['outputdir']) self.Dialogue.deInterlacing.setCurrentItem(int(self.config['deinterlacing'])) self.Dialogue.aspectRatio.setCurrentItem(int(self.config['aspectratio'])) self.Dialogue.encoderPasses.setCurrentItem(int(self.config['passes'])) self.Dialogue.videoCodec.setCurrentItem(int(self.config['videocodec'])) if self.config['pdamode'] == 1: self.Dialogue.c_pdamode.setChecked(1) # Connect functions self.connect(self.Dialogue.b_browseMPlayer,SIGNAL("clicked()"),self.browseMPlayer) self.connect(self.Dialogue.b_browseMencoder,SIGNAL("clicked()"),self.browseMencoder) self.connect(self.Dialogue.b_browseTcprobe,SIGNAL("clicked()"),self.browseTcprobe) self.connect(self.Dialogue.b_browseDVD,SIGNAL("clicked()"),self.browseDVD) self.connect(self.Dialogue.b_selectOutputDir,SIGNAL("clicked()"),self.selectOutDir) self.connect(self.Dialogue.b_OK,SIGNAL("clicked()"),self.changeSettings) self.connect(self.Dialogue.b_Save,SIGNAL("clicked()"),self.saveSettings) self.Dialogue.exec_loop() def browseMPlayer(self): """Launch file dialogue and set path to MPlayer""" self.path = re.compile('(/.*)/.*').search(self.config['mplayer']).group(1) mplayer = QFileDialog.getOpenFileName( self.path, \ "*", \ self, \ "open file dialog", \ "Choose path to MPlayer") self.Dialogue.mplayer.setText(str(mplayer)) def browseMencoder(self): """Launch file dialogue and set path to Mencoder""" self.path = re.compile('(/.*)/.*').search(self.config['mencoder']).group(1) mencoder = QFileDialog.getOpenFileName( self.path, \ "*", \ self, \ "open file dialog", \ "Choose path to Mencoder") self.Dialogue.mencoder.setText(str(mencoder)) def browseTcprobe(self): """Launch file dialogue and set path to Tcprobe""" self.path = re.compile('(/.*)/.*').search(self.config['tcprobe']).group(1) tcprobe = QFileDialog.getOpenFileName( self.path, \ "*", \ self, \ "open file dialog", \ "Choose path to Tcprobe") self.Dialogue.tcprobe.setText(str(tcprobe)) def browseDVD(self): """Launch file dialogue and set path to dvd device""" try: self.path = re.compile('(/.*)/.*').search(self.config['dvd_device']).group(1) except: self.path = os.path.join("/", "dev", "dvd") dvd_device = QFileDialog.getOpenFileName( self.path, \ "*", \ self, \ "open file dialog", \ "Choose path to DVD Device") self.Dialogue.dvdDevice.setText(str(dvd_device)) def selectOutDir(self): """Launch file dialogue and set output directory""" directory = QFileDialog.getExistingDirectory(self.config['outputdir'], \ self, \ "get existing directory", \ "Choose a directory", \ 1 ) self.Dialogue.outputDir.setText(str(directory)) def changeSettings(self): self.config['mplayer'] = self.Dialogue.mplayer.text() self.config['mencoder'] = self.Dialogue.mencoder.text() self.config['tcprobe'] = self.Dialogue.tcprobe.text() self.config['dvd_device'] = self.Dialogue.dvdDevice.text() self.config['outputdir'] = self.Dialogue.outputDir.text() self.config['deinterlacing'] = self.Dialogue.deInterlacing.currentItem() self.config['aspectratio'] = self.Dialogue.aspectRatio.currentItem() self.config['passes'] = self.Dialogue.encoderPasses.currentItem() self.config['videocodec'] = self.Dialogue.videoCodec.currentItem() if self.Dialogue.c_pdamode.isChecked(): self.config['pdamode'] = 1 else: self.config['pdamode'] = 0 self.Dialogue.accept() def saveSettings(self): print "* Saving new settings to ~/.quickriprc" self.config['mplayer'] = self.Dialogue.mplayer.text() self.config['mencoder'] = self.Dialogue.mencoder.text() self.config['tcprobe'] = self.Dialogue.tcprobe.text() self.config['dvd_device'] = self.Dialogue.dvdDevice.text() self.config['outputdir'] = self.Dialogue.outputDir.text() self.config['deinterlacing'] = self.Dialogue.deInterlacing.currentItem() self.config['aspectratio'] = self.Dialogue.aspectRatio.currentItem() self.config['passes'] = self.Dialogue.encoderPasses.currentItem() self.config['videocodec'] = self.Dialogue.videoCodec.currentItem() if self.Dialogue.c_pdamode.isChecked(): self.config['pdamode'] = 1 else: self.config['pdamode'] = 0 self.parser.set('paths', 'mplayer', self.config['mplayer']) self.parser.set('paths', 'mencoder', self.config['mencoder']) self.parser.set('paths', 'tcprobe', self.config['tcprobe']) self.parser.set('paths', 'dvd_device', self.config['dvd_device']) self.parser.set('paths', 'outputdir', self.config['outputdir']) self.parser.set('mencoder', 'deinterlacing', self.config['deinterlacing']) self.parser.set('mencoder', 'aspectratio', self.config['aspectratio']) self.parser.set('mencoder', 'passes', self.config['passes']) self.parser.set('mencoder', 'pdamode', self.config['pdamode']) self.parser.set('mencoder', 'videocodec', self.config['videocodec']) self.parser.write(open(self.configfile, 'w')) def main(): print "%s v%s, %s\n" % (__app__, __version__, __copyright__) app = QApplication(sys.argv) QObject.connect(app, SIGNAL('lastWindowClosed()'), app, SLOT('quit()')) win = GUI(app) app.setMainWidget(win) win.show() app.exec_loop() --- NEW FILE: qtmain.py --- # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'guimain.ui' # # Created: jeu jui 31 14:08:59 2003 # by: The PyQt User Interface Compiler (pyuic) 3.6 # # WARNING! All changes made in this file will be lost! from qt import * image0_data = [ "323 100 1077 2", ".# c None", ".r c #000000", "dm c #000008", ".E c #000400", "fV c #000808", [...1626 lines suppressed...] def renameTrack(self): print "MainWindow.renameTrack(): Not implemented yet" def openSettingsDialogue(self): print "MainWindow.openSettingsDialogue(): Not implemented yet" def browseHD(self): print "MainWindow.browseHD(): Not implemented yet" def newBitrate(self): print "MainWindow.newBitrate(): Not implemented yet" def newFileSize(self): print "MainWindow.newFileSize(): Not implemented yet" def newAudioBitrate(self): print "MainWindow.newAudioBitrate(): Not implemented yet" def openRipDialogue(self): print "MainWindow.openRipDialogue(): Not implemented yet" --- NEW FILE: qtprogressdialogue.py --- # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'ui/guiprogressdialogue.ui' # # Created: Wed Jul 16 16:58:50 2003 # by: The PyQt User Interface Compiler (pyuic) 3.6 # # WARNING! All changes made in this file will be lost! from qt import * image0_data = [ "16 16 39 1", ". c None", "# c #000000", "B c #080c08", "w c #101410", "D c #181810", "a c #181c18", "s c #202018", "r c #292820", "K c #313029", "c c #393c31", "G c #414439", "b c #4a4841", "p c #52504a", "y c #6a695a", "I c #6a6962", "q c #737562", "f c #7b756a", "J c #7b796a", "z c #9c9583", "l c #a4a194", "t c #aca594", "F c #acaa94", "C c #b4b2a4", "A c #bdbaa4", "v c #c5beac", "i c #cdcab4", "h c #d5ceb4", "j c #d5cebd", "n c #d5d2bd", "u c #ded6bd", "H c #ded6c5", "o c #dedac5", "k c #e6dec5", "e c #e6decd", "E c #e6e2cd", "d c #eee6cd", "g c #eeead5", "m c #fff6de", "x c #ffffe6", "................", ".......#abc##...", ".......ddeeef##.", "...##..ghihjkl#.", "..#fm..gnoknjep#", ".#qed...drstunv#", "#wejox...###khda", "#yohop#....#ohdr", "#zujA#....#rkjeB", "#lujC#....#heuz#", "#qohor##x...gea#", "#DEjnoFCem..xG#.", ".#fehhjhjm..##..", "..#fdkHodz......", "...#DIzJK##.....", "....#####......." ] class dialogueProgress(QDialog): def __init__(self,parent = None,name = None,modal = 0,fl = 0): QDialog.__init__(self,parent,name,modal,fl) self.image0 = QPixmap(image0_data) if not name: self.setName("dialogueProgress") self.setIcon(self.image0) dialogueProgressLayout = QGridLayout(self,1,1,11,6,"dialogueProgressLayout") self.groupBox3 = QGroupBox(self,"groupBox3") self.groupBox3.setColumnLayout(0,Qt.Vertical) self.groupBox3.layout().setSpacing(6) self.groupBox3.layout().setMargin(11) self.groupBox3Layout = QGridLayout(self.groupBox3.layout()) self.groupBox3Layout.setAlignment(Qt.AlignTop) self.rippingXofY = QLabel(self.groupBox3,"rippingXofY") self.rippingXofY.setSizePolicy(QSizePolicy(7,0,0,0,self.rippingXofY.sizePolicy().hasHeightForWidth())) self.groupBox3Layout.addWidget(self.rippingXofY,0,0) self.l_ETA = QLabel(self.groupBox3,"l_ETA") self.groupBox3Layout.addWidget(self.l_ETA,1,0) spacer = QSpacerItem(21,20,QSizePolicy.Minimum,QSizePolicy.Expanding) self.groupBox3Layout.addItem(spacer,4,0) layout8 = QHBoxLayout(None,0,6,"layout8") spacer_2 = QSpacerItem(31,31,QSizePolicy.Expanding,QSizePolicy.Minimum) layout8.addItem(spacer_2) self.b_changeState = QPushButton(self.groupBox3,"b_changeState") self.b_changeState.setSizePolicy(QSizePolicy(0,0,0,0,self.b_changeState.sizePolicy().hasHeightForWidth())) layout8.addWidget(self.b_changeState) spacer_3 = QSpacerItem(31,31,QSizePolicy.Expanding,QSizePolicy.Minimum) layout8.addItem(spacer_3) self.b_closeProgressDialogue = QPushButton(self.groupBox3,"b_closeProgressDialogue") self.b_closeProgressDialogue.setEnabled(0) self.b_closeProgressDialogue.setSizePolicy(QSizePolicy(0,0,0,0,self.b_closeProgressDialogue.sizePolicy().hasHeightForWidth())) layout8.addWidget(self.b_closeProgressDialogue) spacer_4 = QSpacerItem(31,31,QSizePolicy.Expanding,QSizePolicy.Minimum) layout8.addItem(spacer_4) self.groupBox3Layout.addLayout(layout8,5,0) dialogueProgressLayout.addWidget(self.groupBox3,0,0) self.languageChange() self.resize(QSize(567,201).expandedTo(self.minimumSizeHint())) # self.clearWState(Qt.WState_Polished) self.connect(self.b_closeProgressDialogue,SIGNAL("clicked()"),self,SLOT("accept()")) def languageChange(self): self.setCaption(self.tr("Ripping Progress")) self.groupBox3.setTitle(self.tr("Ripping Progress")) self.rippingXofY.setText(self.tr("Ripping Track x of y")) self.l_ETA.setText(self.tr("ETA: N/A")) self.b_changeState.setText(self.tr("Start")) QToolTip.add(self.b_changeState,self.tr("Stop the ripping process")) self.b_closeProgressDialogue.setText(self.tr("Close")) QToolTip.add(self.b_closeProgressDialogue,self.tr("Close window when finished")) --- NEW FILE: qtsettings.py --- # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'ui/guisettings.ui' # # Created: Thu Jul 24 12:57:03 2003 # by: The PyQt User Interface Compiler (pyuic) 3.6 # # WARNING! All changes made in this file will be lost! from qt import * image0_data = [ "16 16 59 1", ". c None", "# c #000000", "B c #000400", "O c #080c08", "C c #181410", "V c #181818", "E c #181c18", "a c #201c18", "y c #202018", "U c #202020", "L c #292820", "x c #292829", "I c #312c29", "4 c #393431", "c c #393c31", "Y c #4a4441", "b c #524841", "H c #5a554a", "u c #5a5552", "1 c #6a6962", "F c #736d62", "v c #737562", "o c #7b756a", "g c #7b796a", "Z c #7b7973", "3 c #837d73", "S c #9c9583", "2 c #a4998b", "0 c #a49d94", "J c #a4a194", "P c #aca194", "n c #aca594", "z c #acaa9c", "R c #bdb2a4", "W c #bdb6a4", "K c #c5baac", "A c #c5beac", "i c #cdcab4", "k c #d5cab4", "j c #d5cebd", "D c #d5d2bd", "l c #ded2bd", "t c #ded2c5", "Q c #ded6bd", "r c #ded6c5", "G c #dedac5", "m c #e6dac5", "s c #e6decd", "e c #e6e2cd", "M c #eedecd", "N c #eee2cd", "f c #eee2d5", "w c #eee6cd", "d c #eee6d5", "q c #f6ead5", "h c #f6eed5", "X c #fff6de", "p c #fffae6", "T c #ffffee", "................", ".......#abc##...", ".......ddefeg##.", "...##..hijklmn#.", "..#op..qrmsrtsu#", ".#vew...wxyzrrAB", "#CfDsp...###sjqE", "#FmjGH#....#GjwI", "#JGjK#....#LMjNO", "#PQDR#....#DsGS#", "#FsjsL##T...qsU#", "#VNlDmzWeX..pY#.", ".#Zstjljth..##..", "..#gNsrmN0......", "...#a1234##.....", "....#####......." ] image1_data = [ "18 18 54 1", ". c None", "e c #000000", "d c #101800", "a c #181c18", "b c #201c20", "f c #313031", "c c #414041", "W c #414441", "T c #4a444a", "R c #525552", "V c #5a555a", "K c #5a595a", "F c #626162", "I c #626562", "J c #6a656a", "y c #6a696a", "H c #6a6d6a", "s c #6aa5a4", "q c #6aa5ac", "r c #6aaaac", "L c #736d73", "o c #737173", "m c #737573", "t c #73aaac", "n c #7b757b", "G c #7b797b", "B c #837d83", "z c #838183", "v c #8b858b", "g c #8b898b", "# c #8bee18", "Q c #949194", "Z c #acaaac", "u c #acbebd", "X c #b4b6b4", "p c #b4bebd", "Y c #bdb6bd", "U c #bdbebd", "P c #cdcacd", "O c #d5d2d5", "N c #dedede", "S c #e6dee6", "M c #e6e6e6", "E c #f6e6de", "x c #f6eade", "D c #f6eae6", "A c #ffeae6", "l c #ffeee6", "C c #ffeeee", "k c #fff2ee", "j c #fff6f6", "w c #fffaf6", "i c #fffaff", "h c #ffffff", "..#abccccccccabde.", "..fgchhijjkklcmbee", ".abccccccccabcnaee", "agchhijjkklcmbobee", "bgchpqrstulcnaoaee", "avchwwkkllxcobybee", "bzcipstqruAcoayaee", "aBcijjkCDAEcybFbee", "bGGccccccccyyaFaee", "anomooHHyyIJFbKbee", "booLcccccccFFaKaee", "aoHcMNOPcQgcKbRbee", "bHHcScTUcvvcKaVaee", "ayIcOWIXcBGcRbfeee", "bIJcPUYZcmncVaeeee", "ebabccccababaeeee.", "eeeeeeeeeeeeeeee..", ".eeeeeeeeeeeeee..." ] image2_data = [ "16 14 7 1", ". c None", "d c #000000", "c c #004000", "b c #008100", "a c #00c200", "e c #410000", "# c #c5ffc5", "...............#", "..............#a", ".............#ab", "............#abc", "...........#abcd", "..#b......#abcd.", ".#aab....#abce..", "dcbaab..#abcd...", ".dcbaab#abce....", "..ecbaaabce.....", "...dcbabcd......", "....dcbcd.......", ".....ded........", "................" ] image3_data = [ "16 16 80 2", "Qt c None", ".P c #000000", "#i c #180000", ".G c #200000", ".e c #200808", ".O c #410000", ".Y c #4a0000", ".o c #4a3c39", "#h c #520400", "#k c #5a0408", ".v c #5a484a", "#l c #940400", "#g c #ac0000", "#j c #b40000", "#n c #b40408", "#f c #b40808", ".F c #b43031", "#. c #bd0408", "#c c #bd0808", "#m c #bd0810", ".n c #bd4c52", ".5 c #c50408", ".X c #cd0c08", ".u c #d56562", ".N c #e62020", "#d c #f60000", ".d c #f6797b", ".7 c #ff0000", ".4 c #ff0400", "#e c #ff0408", "## c #ff0808", ".Z c #ff0c10", ".6 c #ff1010", ".w c #ff1818", ".8 c #ff1c20", ".Q c #ff2420", ".1 c #ff2429", ".0 c #ff2829", ".W c #ff2c31", "#a c #ff3431", ".H c #ff3439", ".V c #ff3839", ".R c #ff4041", ".M c #ff4441", ".L c #ff5052", ".E c #ff595a", ".D c #ff5d5a", ".B c #ff7173", ".t c #ff757b", ".# c #ff797b", ".s c #ff7d7b", ".C c #ff7d83", ".A c #ff8183", ".y c #ff8583", ".a c #ff858b", ".b c #ff898b", ".c c #ff8d8b", ".r c #ff8d94", ".I c #ff9194", ".q c #ff999c", "#b c #ff9d9c", ".x c #ff9da4", ".2 c #ffa1a4", ".z c #ffa5a4", ".m c #ffa5ac", ".p c #ffaeac", ".S c #ffb2b4", ".l c #ffb6b4", ".g c #ffb6bd", ".h c #ffbabd", ".k c #ffc2c5", ".j c #ffc6c5", ".i c #ffc6cd", ".K c #ffdede", ".9 c #ffdee6", ".T c #ffe6ee", ".3 c #fff2f6", ".J c #fff6ff", ".U c #fffaff", ".f c #ffffff", "QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", "QtQtQtQt.#.a.b.c.b.b.d.eQtQtQtQt", "QtQt.f.b.g.h.i.j.k.l.m.n.oQtQtQt", "QtQt.g.p.q.b.r.r.b.s.t.#.u.vQtQt", "Qt.w.x.y.t.z.A.#.B.c.C.D.E.F.GQt", "Qt.H.b.E.I.f.k.E.B.J.K.L.M.N.O.P", "Qt.Q.E.R.E.h.f.S.T.U.t.V.W.X.Y.P", "Qt.w.Q.Z.0.1.2.f.3.L.w.w.4.5.O.P", "Qt.6.w.7.7.8.9.3.f.b.7.7.7#..O.P", "Qt####.7#a.T.3.H.A.f#b##.7#c.O.P", "Qt#d#e.7.0.k.R.7.7#b.r.4.7#f.O.P", "Qt.G#g.7.7#e.7.7.7.7.7.7.5#h.P.P", "QtQt#i#j.7.7.7.7.7.7.7.5#k.P.P.P", "QtQtQt#i#l#m#f#f#f#f#n#h.P.P.PQt", "QtQtQtQt#i.Y.Y.O.O.O.O.P.P.PQtQt", "QtQtQtQtQt.P.P.P.P.P.P.P.PQtQtQt" ] class dialogSettings(QDialog): def __init__(self,parent = None,name = None,modal = 0,fl = 0): QDialog.__init__(self,parent,name,modal,fl) self.image0 = QPixmap(image0_data) self.image1 = QPixmap(image1_data) self.image2 = QPixmap(image2_data) self.image3 = QPixmap(image3_data) if not name: self.setName("dialogSettings") self.setSizePolicy(QSizePolicy(5,5,0,0,self.sizePolicy().hasHeightForWidth())) self.setIcon(self.image0) dialogSettingsLayout = QGridLayout(self,1,1,12,6,"dialogSettingsLayout") self.groupBox1 = QGroupBox(self,"groupBox1") self.groupBox1.setSizePolicy(QSizePolicy(5,1,0,0,self.groupBox1.sizePolicy().hasHeightForWidth())) self.groupBox1.setColumnLayout(0,Qt.Vertical) self.groupBox1.layout().setSpacing(6) self.groupBox1.layout().setMargin(12) groupBox1Layout = QGridLayout(self.groupBox1.layout()) groupBox1Layout.setAlignment(Qt.AlignTop) self.l_tcprobe = QLabel(self.groupBox1,"l_tcprobe") self.l_tcprobe.setSizePolicy(QSizePolicy(0,0,0,0,self.l_tcprobe.sizePolicy().hasHeightForWidth())) groupBox1Layout.addWidget(self.l_tcprobe,2,0) self.b_browseMPlayer = QPushButton(self.groupBox1,"b_browseMPlayer") groupBox1Layout.addWidget(self.b_browseMPlayer,0,2) self.l_mplayer = QLabel(self.groupBox1,"l_mplayer") self.l_mplayer.setSizePolicy(QSizePolicy(0,0,0,0,self.l_mplayer.sizePolicy().hasHeightForWidth())) groupBox1Layout.addWidget(self.l_mplayer,0,0) self.l_mencoder = QLabel(self.groupBox1,"l_mencoder") self.l_mencoder.setSizePolicy(QSizePolicy(0,0,0,0,self.l_mencoder.sizePolicy().hasHeightForWidth())) groupBox1Layout.addWidget(self.l_mencoder,1,0) self.outputDir = QLineEdit(self.groupBox1,"outputDir") groupBox1Layout.addMultiCellWidget(self.outputDir,5,5,0,1) self.b_selectOutputDir = QPushButton(self.groupBox1,"b_selectOutputDir") groupBox1Layout.addWidget(self.b_selectOutputDir,5,2) self.l_outputDir = QLabel(self.groupBox1,"l_outputDir") self.l_outputDir.setSizePolicy(QSizePolicy(5,0,0,0,self.l_outputDir.sizePolicy().hasHeightForWidth())) groupBox1Layout.addMultiCellWidget(self.l_outputDir,4,4,0,2) self.textLabel1 = QLabel(self.groupBox1,"textLabel1") groupBox1Layout.addWidget(self.textLabel1,3,0) self.mencoder = QLineEdit(self.groupBox1,"mencoder") self.mencoder.setSizePolicy(QSizePolicy(3,0,0,0,self.mencoder.sizePolicy().hasHeightForWidth())) groupBox1Layout.addWidget(self.mencoder,1,1) self.mplayer = QLineEdit(self.groupBox1,"mplayer") self.mplayer.setSizePolicy(QSizePolicy(3,0,0,0,self.mplayer.sizePolicy().hasHeightForWidth())) groupBox1Layout.addWidget(self.mplayer,0,1) self.tcprobe = QLineEdit(self.groupBox1,"tcprobe") self.tcprobe.setSizePolicy(QSizePolicy(3,0,0,0,self.tcprobe.sizePolicy().hasHeightForWidth())) groupBox1Layout.addWidget(self.tcprobe,2,1) self.dvdDevice = QLineEdit(self.groupBox1,"dvdDevice") self.dvdDevice.setSizePolicy(QSizePolicy(3,0,0,0,self.dvdDevice.sizePolicy().hasHeightForWidth())) groupBox1Layout.addWidget(self.dvdDevice,3,1) self.b_browseMencoder = QPushButton(self.groupBox1,"b_browseMencoder") groupBox1Layout.addWidget(self.b_browseMencoder,1,2) self.b_browseTcprobe = QPushButton(self.groupBox1,"b_browseTcprobe") groupBox1Layout.addWidget(self.b_browseTcprobe,2,2) self.b_browseDVD = QPushButton(self.groupBox1,"b_browseDVD") groupBox1Layout.addWidget(self.b_browseDVD,3,2) dialogSettingsLayout.addWidget(self.groupBox1,0,0) self.groupBox2 = QGroupBox(self,"groupBox2") self.groupBox2.setSizePolicy(QSizePolicy(5,1,0,0,self.groupBox2.sizePolicy().hasHeightForWidth())) self.groupBox2.setColumnLayout(0,Qt.Vertical) self.groupBox2.layout().setSpacing(6) self.groupBox2.layout().setMargin(12) groupBox2Layout = QGridLayout(self.groupBox2.layout()) groupBox2Layout.setAlignment(Qt.AlignTop) self.l_aspectRatio = QLabel(self.groupBox2,"l_aspectRatio") self.l_aspectRatio.setSizePolicy(QSizePolicy(5,0,0,0,self.l_aspectRatio.sizePolicy().hasHeightForWidth())) groupBox2Layout.addWidget(self.l_aspectRatio,0,2) self.l_deinterlacing = QLabel(self.groupBox2,"l_deinterlacing") self.l_deinterlacing.setSizePolicy(QSizePolicy(5,0,0,0,self.l_deinterlacing.sizePolicy().hasHeightForWidth())) groupBox2Layout.addWidget(self.l_deinterlacing,0,0) self.deInterlacing = QComboBox(0,self.groupBox2,"deInterlacing") groupBox2Layout.addWidget(self.deInterlacing,0,1) self.l_Passes = QLabel(self.groupBox2,"l_Passes") self.l_Passes.setSizePolicy(QSizePolicy(1,0,0,0,self.l_Passes.sizePolicy().hasHeightForWidth())) groupBox2Layout.addWidget(self.l_Passes,1,0) self.c_pdamode = QCheckBox(self.groupBox2,"c_pdamode") groupBox2Layout.addWidget(self.c_pdamode,2,0) self.encoderPasses = QComboBox(0,self.groupBox2,"encoderPasses") self.encoderPasses.setSizePolicy(QSizePolicy(1,0,0,0,self.encoderPasses.sizePolicy().hasHeightForWidth())) groupBox2Layout.addWidget(self.encoderPasses,1,1) self.textLabel1_2 = QLabel(self.groupBox2,"textLabel1_2") groupBox2Layout.addWidget(self.textLabel1_2,1,2) self.aspectRatio = QComboBox(0,self.groupBox2,"aspectRatio") groupBox2Layout.addWidget(self.aspectRatio,0,3) self.videoCodec = QComboBox(0,self.groupBox2,"videoCodec") groupBox2Layout.addWidget(self.videoCodec,1,3) dialogSettingsLayout.addWidget(self.groupBox2,1,0) layout2 = QHBoxLayout(None,0,6,"layout2") self.b_Save = QPushButton(self,"b_Save") self.b_Save.setIconSet(QIconSet(self.image1)) layout2.addWidget(self.b_Save) spacer = QSpacerItem(170,20,QSizePolicy.Expanding,QSizePolicy.Minimum) layout2.addItem(spacer) self.b_OK = QPushButton(self,"b_OK") self.b_OK.setIconSet(QIconSet(self.image2)) layout2.addWidget(self.b_OK) self.b_Cancel = QPushButton(self,"b_Cancel") self.b_Cancel.setIconSet(QIconSet(self.image3)) layout2.addWidget(self.b_Cancel) dialogSettingsLayout.addLayout(layout2,2,0) self.languageChange() self.resize(QSize(519,436).expandedTo(self.minimumSizeHint())) # self.clearWState(Qt.WState_Polished) self.connect(self.b_Cancel,SIGNAL("clicked()"),self,SLOT("accept()")) self.l_tcprobe.setBuddy(self.tcprobe) self.l_mplayer.setBuddy(self.mplayer) self.l_mencoder.setBuddy(self.mencoder) self.l_outputDir.setBuddy(self.outputDir) self.l_aspectRatio.setBuddy(self.aspectRatio) self.l_deinterlacing.setBuddy(self.deInterlacing) self.l_Passes.setBuddy(self.encoderPasses) def languageChange(self): self.setCaption(self.tr("Configuration - QuickRip")) self.groupBox1.setTitle(self.tr("&Paths")) self.l_tcprobe.setText(self.tr("&Tcprobe:")) self.b_browseMPlayer.setText(self.tr("&Browse")) self.b_browseMPlayer.setAccel(self.tr("Alt+B")) self.l_mplayer.setText(self.tr("&MPlayer:")) self.l_mencoder.setText(self.tr("Mencode&r:")) QToolTip.add(self.outputDir,self.tr("Directory where QuickRip saves files")) QWhatsThis.add(self.outputDir,self.tr("The default directory where\n" "QuickRip should save ripped\n" "DVD files")) self.b_selectOutputDir.setText(self.tr("Brow&se")) self.b_selectOutputDir.setAccel(self.tr("Alt+S")) self.l_outputDir.setText(self.tr("&Default output directory:")) self.textLabel1.setText(self.tr("DVD device:")) self.mencoder.setText(QString.null) QToolTip.add(self.mencoder,self.tr("Path to mencoder binary")) QWhatsThis.add(self.mencoder,self.tr("The path to <tt>mencoder</tt> binary\n" "(e.g. <tt>/usr/bin/mencoder</tt>)")) self.mplayer.setText(QString.null) QToolTip.add(self.mplayer,self.tr("Path to mplayer binary")) QWhatsThis.add(self.mplayer,self.tr("The path to <tt>mplayer</tt> binary\n" "(e.g. <tt>/usr/bin/mplayer</tt>)")) self.tcprobe.setText(QString.null) QToolTip.add(self.tcprobe,self.tr("Path to tcprobe binary")) QWhatsThis.add(self.tcprobe,self.tr("The path to the <tt>tcprobe</tt> binary\n" "(e.g. <tt>/usr/bin/tcprobe</tt>)")) self.dvdDevice.setText(QString.null) QToolTip.add(self.dvdDevice,self.tr("Path to tcprobe binary")) QWhatsThis.add(self.dvdDevice,self.tr("The path to the <tt>tcprobe</tt> binary\n" "(e.g. <tt>/usr/bin/tcprobe</tt>)")) self.b_browseMencoder.setText(self.tr("B&rowse")) self.b_browseMencoder.setAccel(self.tr("Alt+R")) self.b_browseTcprobe.setText(self.tr("Bro&wse")) self.b_browseTcprobe.setAccel(self.tr("Alt+W")) self.b_browseDVD.setText(self.tr("Bro&wse")) self.b_browseDVD.setAccel(self.tr("Alt+W")) self.groupBox2.setTitle(self.tr("Me&ncoder Options")) self.l_aspectRatio.setText(self.tr("As&pect ratio:")) self.l_deinterlacing.setText(self.tr("&De-Interlacing:")) self.deInterlacing.clear() self.deInterlacing.insertItem(self.tr("None")) self.deInterlacing.insertItem(self.tr("-vop dint")) self.deInterlacing.insertItem(self.tr("-vop il")) self.deInterlacing.insertItem(self.tr("-vop lavcdeint")) self.deInterlacing.insertItem(self.tr("-vop pp=lb")) QToolTip.add(self.deInterlacing,self.tr("De-Interlacing options. See documentation.")) QWhatsThis.add(self.deInterlacing,self.tr("De-Interlacing options. For more information on de-interlacing consult the QuickRip and Mplayer documentation.")) self.l_Passes.setText(self.tr("&Encoder passes:")) self.c_pdamode.setText(self.tr("&PDA mode")) self.c_pdamode.setAccel(self.tr("Alt+P")) self.encoderPasses.clear() self.encoderPasses.insertItem(self.tr("Default")) self.encoderPasses.insertItem(self.tr("One Pass")) self.encoderPasses.insertItem(self.tr("Two Pass")) self.encoderPasses.insertItem(self.tr("Three Pass")) self.textLabel1_2.setText(self.tr("Video codec:")) self.aspectRatio.clear() self.aspectRatio.insertItem(self.tr("Default")) self.aspectRatio.insertItem(self.tr("4:3")) self.aspectRatio.insertItem(self.tr("16:9")) self.aspectRatio.insertItem(self.tr("2.35:1")) QToolTip.add(self.aspectRatio,self.tr("Aspect ratio of video")) QWhatsThis.add(self.aspectRatio,self.tr("The aspect ratio of the video. Change if the output appears stretched. \n" "DVDs have aspect ratios printed on their cases.")) self.videoCodec.clear() self.videoCodec.insertItem(self.tr("DivX")) self.videoCodec.insertItem(self.tr("XviD")) QToolTip.add(self.videoCodec,self.tr("Aspect ratio of video")) QWhatsThis.add(self.videoCodec,self.tr("The aspect ratio of the video. Change if the output appears stretched. \n" "DVDs have aspect ratios printed on their cases.")) self.b_Save.setText(self.tr("&Save settings","g")) self.b_Save.setAccel(self.tr("Alt+S")) self.b_OK.setText(self.tr("&OK","g")) self.b_OK.setAccel(self.tr("Alt+O")) self.b_Cancel.setText(self.tr("&Cancel","g")) self.b_Cancel.setAccel(self.tr("Alt+C")) |