def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.setWindowTitle('Edit Nimby') rows = ['day', 'begin', 'dash', 'end', 'enable', 'allow', 'eject'] self.weekdays = [ 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday' ] self.days = ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'] self.time_format = 'hh:mm' self.te_begin = dict() self.te_end = dict() self.cb_enable = dict() self.cb_allow = dict() self.cb_eject = dict() toplayout = QtGui.QVBoxLayout(self) columns = QtGui.QHBoxLayout() toplayout.addLayout(columns) vlayouts = dict() for row in rows: vlayouts[row] = QtGui.QVBoxLayout() columns.addLayout(vlayouts[row]) daynum = 0 for day in self.days: time_begin = '00:00' time_end = '00:00' enable = False allow = True eject = False var = 'nimby_' + day if var in cgruconfig.VARS: line = cgruconfig.VARS[var] if line is None: continue lines = line.split(' ') if len(lines) < 2: continue time_begin = lines[0] time_end = lines[1] enable = False allow = True eject = False if 'nimby' in lines: allow = True if 'NIMBY' in lines: allow = False if 'Eject' in lines: eject = True if 'Enable' in lines: enable = True vlayouts['day'].addWidget(QtGui.QLabel(self.weekdays[daynum], self)) self.te_begin[day] = QtGui.QTimeEdit( QtCore.QTime.fromString(time_begin, self.time_format)) self.te_begin[day].setDisplayFormat(self.time_format) vlayouts['begin'].addWidget(self.te_begin[day]) label = QtGui.QLabel(' - ', self) label.setFixedWidth(16) vlayouts['dash'].addWidget(label) self.te_end[day] = QtGui.QTimeEdit( QtCore.QTime.fromString(time_end, self.time_format)) self.te_end[day].setDisplayFormat(self.time_format) vlayouts['end'].addWidget(self.te_end[day]) self.cb_enable[day] = QtGui.QCheckBox('Enable', self) self.cb_enable[day].setChecked(enable) vlayouts['enable'].addWidget(self.cb_enable[day]) self.cb_allow[day] = QtGui.QCheckBox('Allow My Jobs', self) self.cb_allow[day].setChecked(allow) vlayouts['allow'].addWidget(self.cb_allow[day]) self.cb_eject[day] = QtGui.QCheckBox('Eject Running Tasks', self) self.cb_eject[day].setChecked(eject) vlayouts['eject'].addWidget(self.cb_eject[day]) daynum += 1 hlayout = QtGui.QHBoxLayout() b_accept = QtGui.QPushButton('Accept', self) b_cancel = QtGui.QPushButton('Cancel', self) hlayout.addWidget(b_accept) hlayout.addWidget(b_cancel) toplayout.addLayout(hlayout) QtCore.QObject.connect(b_accept, QtCore.SIGNAL('pressed()'), self.applySettings) QtCore.QObject.connect(b_cancel, QtCore.SIGNAL('pressed()'), self.close) # Set window icon: iconpath = cgruutils.getIconFileName('afanasy') if iconpath is not None: self.setWindowIcon(QtGui.QIcon(iconpath)) self.show()
def __init__(self): # Main Window QtGui.QWidget.__init__(self) self.constructed = False self.evaluated = False self.output = '' self.setWindowTitle('Afanasy Starter CGRU ' + os.getenv('CGRU_VERSION', '')) self.fields = dict() self.labels = dict() # Get File Type dependant dicts self.labelNode_name = labelNodeNameDict() self.labelNode_tooltip = labelNodeTooltipsDict() self.labelTake_name = labelTakeNameDict() self.labelTake_tooltip = labelTakeTooltipsDict() # Top level layouts: topLayout = QtGui.QVBoxLayout(self) tabwidget = QtGui.QTabWidget(self) topLayout.addWidget(tabwidget) # General Tab: generalwidget = QtGui.QWidget(self) tabwidget.addTab(generalwidget, 'Scene') generallayout = QtGui.QVBoxLayout(generalwidget) # Job Tab: jobwidget = QtGui.QWidget(self) tabwidget.addTab(jobwidget, 'Job') joblayout = QtGui.QVBoxLayout(jobwidget) # Advanced Tab: auxwidget = QtGui.QWidget(self) tabwidget.addTab(auxwidget, 'Advanced') advlayout = QtGui.QVBoxLayout(auxwidget) # Service Type: lFileType = QtGui.QHBoxLayout() generallayout.addLayout(lFileType) lFileType.addWidget(QtGui.QLabel('Override Service Type:', self)) self.fields['servicetype'] = QtGui.QComboBox(self) lFileType.addWidget(self.fields['servicetype']) QtCore.QObject.connect(self.fields['servicetype'], QtCore.SIGNAL('currentIndexChanged(int)'), self.setFileType) # Scene: lScene = QtGui.QHBoxLayout() generallayout.addLayout(lScene) lScene.addWidget(QtGui.QLabel('File:', self)) self.fields['scenefile'] = QtGui.QLineEdit(Scene, self) lScene.addWidget(self.fields['scenefile']) QtCore.QObject.connect(self.fields['scenefile'], QtCore.SIGNAL('editingFinished()'), self.evaluate) bBrowseScene = QtGui.QPushButton('Browse', self) lScene.addWidget(bBrowseScene) QtCore.QObject.connect(bBrowseScene, QtCore.SIGNAL('pressed()'), self.browseScene) # Working Directory: lWDir = QtGui.QHBoxLayout() generallayout.addLayout(lWDir) lWDir.addWidget(QtGui.QLabel('Working Directory/Project:', self)) self.fields['wdir'] = QtGui.QLineEdit(self) lWDir.addWidget(self.fields['wdir']) QtCore.QObject.connect(self.fields['wdir'], QtCore.SIGNAL('editingFinished()'), self.evaluate) self.fields['scenewdir'] = QtGui.QCheckBox('Use Scene Folder', self) self.fields['scenewdir'].setChecked(True) QtCore.QObject.connect(self.fields['scenewdir'], QtCore.SIGNAL('stateChanged(int)'), self.evaluate) lWDir.addWidget(self.fields['scenewdir']) # Output images: lImages = QtGui.QHBoxLayout() generallayout.addLayout(lImages) lImages.addWidget(QtGui.QLabel('Output Images:', self)) self.fields['outimages'] = QtGui.QLineEdit(self) lImages.addWidget(self.fields['outimages']) QtCore.QObject.connect(self.fields['outimages'], QtCore.SIGNAL('editingFinished()'), self.evaluate) lImages.addWidget(QtGui.QLabel('Browse')) bBrowseOutImages = QtGui.QPushButton('File', self) lImages.addWidget(bBrowseOutImages) QtCore.QObject.connect(bBrowseOutImages, QtCore.SIGNAL('pressed()'), self.browseOutImages) bBrowseOutFolder = QtGui.QPushButton('Dir', self) lImages.addWidget(bBrowseOutFolder) QtCore.QObject.connect(bBrowseOutFolder, QtCore.SIGNAL('pressed()'), self.browseOutFolder) # Frames: lFrames = QtGui.QHBoxLayout() generallayout.addLayout(lFrames) lFrames.addWidget(QtGui.QLabel('Frames:', self)) self.fields['framestart'] = QtGui.QSpinBox(self) self.fields['framestart'].setRange(-1000000000, 1000000000) self.fields['framestart'].setValue(1) QtCore.QObject.connect(self.fields['framestart'], QtCore.SIGNAL('editingFinished()'), self.evaluate) lFrames.addWidget(self.fields['framestart']) self.fields['frameend'] = QtGui.QSpinBox(self) self.fields['frameend'].setRange(-1000000000, 1000000000) self.fields['frameend'].setValue(1) QtCore.QObject.connect(self.fields['frameend'], QtCore.SIGNAL('editingFinished()'), self.evaluate) lFrames.addWidget(self.fields['frameend']) lFrames.addWidget(QtGui.QLabel('by', self)) self.fields['frameby'] = QtGui.QSpinBox(self) lFrames.addWidget(self.fields['frameby']) QtCore.QObject.connect(self.fields['frameby'], QtCore.SIGNAL('editingFinished()'), self.evaluate) self.fields['frameby'].setRange(1, 1000000000) lFrames.addWidget(QtGui.QLabel('per task', self)) self.fields['framespt'] = QtGui.QSpinBox(self) lFrames.addWidget(self.fields['framespt']) QtCore.QObject.connect(self.fields['framespt'], QtCore.SIGNAL('editingFinished()'), self.evaluate) self.fields['framespt'].setRange(1, 1000000000) # Node / Camera / Take: lNode = QtGui.QHBoxLayout() generallayout.addLayout(lNode) self.labels['node'] = QtGui.QLabel(self.labelNode_name['default']) lNode.addWidget(self.labels['node']) self.labels['node'].setToolTip(self.labelNode_tooltip['default']) self.fields['node'] = QtGui.QLineEdit(self) lNode.addWidget(self.fields['node']) QtCore.QObject.connect(self.fields['node'], QtCore.SIGNAL('textEdited(QString)'), self.evaluate) self.labels['take'] = QtGui.QLabel(self.labelTake_name['default']) lNode.addWidget(self.labels['take']) self.labels['take'].setToolTip(self.labelTake_tooltip['default']) self.fields['take'] = QtGui.QLineEdit(self) lNode.addWidget(self.fields['take']) QtCore.QObject.connect(self.fields['take'], QtCore.SIGNAL('textEdited(QString)'), self.evaluate) # Advanced: # OS Type: osLayout = QtGui.QHBoxLayout() advlayout.addLayout(osLayout) osLayout.addWidget(QtGui.QLabel('Operating System Type:')) self.fields['os'] = QtGui.QLineEdit(self) osLayout.addWidget(self.fields['os']) QtCore.QObject.connect(self.fields['os'], QtCore.SIGNAL('textEdited(QString)'), self.evaluate) # Tasks Command: exelayout = QtGui.QHBoxLayout() advlayout.addLayout(exelayout) label = QtGui.QLabel('Tasks Executable:') label.setToolTip('Override launching programm') exelayout.addWidget(label) self.fields['exec'] = QtGui.QLineEdit(self) exelayout.addWidget(self.fields['exec']) QtCore.QObject.connect(self.fields['exec'], QtCore.SIGNAL('textEdited(QString)'), self.evaluate) self.execBrowseButton = QtGui.QPushButton('Browse', self) exelayout.addWidget(self.execBrowseButton) QtCore.QObject.connect(self.execBrowseButton, QtCore.SIGNAL('pressed()'), self.browseExec) # Extra Arguments: exarglayout = QtGui.QHBoxLayout() advlayout.addLayout(exarglayout) exarglayout.addWidget(QtGui.QLabel('Extra Arguments:')) self.fields['extrargs'] = QtGui.QLineEdit(self) exarglayout.addWidget(self.fields['extrargs']) QtCore.QObject.connect(self.fields['extrargs'], QtCore.SIGNAL('textEdited(QString)'), self.evaluate) # Preview: prvlayout = QtGui.QHBoxLayout() advlayout.addLayout(prvlayout) prvlayout.addWidget(QtGui.QLabel('Preview:')) self.fields['preview'] = QtGui.QLineEdit(self) prvlayout.addWidget(self.fields['preview']) QtCore.QObject.connect(self.fields['preview'], QtCore.SIGNAL('textEdited(QString)'), self.evaluate) # Job: lJobName = QtGui.QHBoxLayout() joblayout.addLayout(lJobName) lJobName.addWidget(QtGui.QLabel('Name:', self)) self.fields['jobname'] = QtGui.QLineEdit(self) lJobName.addWidget(self.fields['jobname']) QtCore.QObject.connect(self.fields['jobname'], QtCore.SIGNAL('textEdited(QString)'), self.evaluate) self.fields['jobnamescene'] = QtGui.QCheckBox('Use Scene Name', self) lJobName.addWidget(self.fields['jobnamescene']) self.fields['jobnamescene'].setChecked(True) QtCore.QObject.connect(self.fields['jobnamescene'], QtCore.SIGNAL('stateChanged(int)'), self.evaluate) # Capacity, max run tasks, priority: lCapMax = QtGui.QHBoxLayout() joblayout.addLayout(lCapMax) lCapMax.addWidget(QtGui.QLabel('Capacity:', self)) self.fields['capacity'] = QtGui.QSpinBox(self) lCapMax.addWidget(self.fields['capacity']) self.fields['capacity'].setRange(-1, 1000000) self.fields['capacity'].setValue(-1) QtCore.QObject.connect(self.fields['capacity'], QtCore.SIGNAL('valueChanged(int)'), self.evaluate) lCapMax.addWidget(QtGui.QLabel('Maximum Running Tasks:', self)) self.fields['maxruntasks'] = QtGui.QSpinBox(self) lCapMax.addWidget(self.fields['maxruntasks']) self.fields['maxruntasks'].setRange(-1, 1000000) self.fields['maxruntasks'].setValue(-1) QtCore.QObject.connect(self.fields['maxruntasks'], QtCore.SIGNAL('valueChanged(int)'), self.evaluate) lCapMax.addWidget(QtGui.QLabel('Priority:', self)) self.fields['priority'] = QtGui.QSpinBox(self) lCapMax.addWidget(self.fields['priority']) self.fields['priority'].setRange(-1, 250) self.fields['priority'].setValue(-1) QtCore.QObject.connect(self.fields['priority'], QtCore.SIGNAL('valueChanged(int)'), self.evaluate) # Depend Masks: lDepends = QtGui.QHBoxLayout() joblayout.addLayout(lDepends) lDepends.addWidget(QtGui.QLabel('Depend Mask:', self)) self.fields['dependmask'] = QtGui.QLineEdit(self) lDepends.addWidget(self.fields['dependmask']) QtCore.QObject.connect(self.fields['dependmask'], QtCore.SIGNAL('textEdited(QString)'), self.evaluate) lDepends.addWidget(QtGui.QLabel('Global:', self)) self.fields['dependglobal'] = QtGui.QLineEdit(self) lDepends.addWidget(self.fields['dependglobal']) QtCore.QObject.connect(self.fields['dependglobal'], QtCore.SIGNAL('textEdited(QString)'), self.evaluate) # Host Masks: lHostMasks = QtGui.QHBoxLayout() joblayout.addLayout(lHostMasks) lHostMasks.addWidget(QtGui.QLabel('Hosts Mask:', self)) self.fields['hostsmask'] = QtGui.QLineEdit(self) lHostMasks.addWidget(self.fields['hostsmask']) QtCore.QObject.connect(self.fields['hostsmask'], QtCore.SIGNAL('textEdited(QString)'), self.evaluate) lHostMasks.addWidget(QtGui.QLabel('Exclude:', self)) self.fields['hostsexclude'] = QtGui.QLineEdit(self) lHostMasks.addWidget(self.fields['hostsexclude']) QtCore.QObject.connect(self.fields['hostsexclude'], QtCore.SIGNAL('textEdited(QString)'), self.evaluate) # Presets: presetsLayout = QtGui.QHBoxLayout() topLayout.addLayout(presetsLayout) presetsLayout.addWidget(QtGui.QLabel('Recent:', self)) self.cbRecent = QtGui.QComboBox(self) presetsLayout.addWidget(self.cbRecent) self.bBrowseLoad = QtGui.QPushButton('Load', self) presetsLayout.addWidget(self.bBrowseLoad) QtCore.QObject.connect(self.bBrowseLoad, QtCore.SIGNAL('pressed()'), self.browseLoad) self.bBrowseSave = QtGui.QPushButton('Save', self) presetsLayout.addWidget(self.bBrowseSave) QtCore.QObject.connect(self.bBrowseSave, QtCore.SIGNAL('pressed()'), self.browseSave) # Command Field: self.teCmd = QtGui.QTextEdit(self) topLayout.addWidget(self.teCmd) # Buttons: buttonsLayout = QtGui.QHBoxLayout() topLayout.addLayout(buttonsLayout) self.bStart = QtGui.QPushButton('&Start', self) buttonsLayout.addWidget(self.bStart) QtCore.QObject.connect(self.bStart, QtCore.SIGNAL('pressed()'), self.start) self.fields['paused'] = QtGui.QCheckBox('Paused', self) buttonsLayout.addWidget(self.fields['paused']) QtCore.QObject.connect(self.fields['paused'], QtCore.SIGNAL('stateChanged(int)'), self.evaluate) self.bRefresh = QtGui.QPushButton('&Refresh', self) buttonsLayout.addWidget(self.bRefresh) QtCore.QObject.connect(self.bRefresh, QtCore.SIGNAL('pressed()'), self.evaluate) self.bQuitSave = QtGui.QPushButton('&Quit&&Store', self) buttonsLayout.addWidget(self.bQuitSave) QtCore.QObject.connect(self.bQuitSave, QtCore.SIGNAL('pressed()'), self.quitsave) self.constructed = True # Set window icon: iconpath = cgruutils.getIconFileName('afanasy') if iconpath is not None: self.setWindowIcon(QtGui.QIcon(iconpath)) # Refresh recent: self.refreshRecent() # Load last settings: if not self.load(FileLast): self.evaluate()
def __init__(self): QtGui.QWidget.__init__(self) self.constructed = False self.evaluated = False self.test = False self.setWindowTitle('Scan Scan - CGRU ' + cgruconfig.VARS['CGRU_VERSION']) self.mainLayout = QtGui.QVBoxLayout(self) self.tabwidget = QtGui.QTabWidget(self) self.generalwidget = QtGui.QWidget(self) self.tabwidget.addTab(self.generalwidget, 'General') self.generallayout = QtGui.QVBoxLayout(self.generalwidget) self.parameterswidget = QtGui.QWidget(self) self.tabwidget.addTab(self.parameterswidget, 'Parameters') self.parameterslayout = QtGui.QVBoxLayout(self.parameterswidget) self.mainLayout.addWidget(self.tabwidget) # General: self.lFormat = QtGui.QHBoxLayout() self.tFormat = QtGui.QLabel('Format:', self) self.tFormat.setToolTip('Movie resolution.\n' 'Format presets located in\n' + FormatsPath) self.cbFormat = QtGui.QComboBox(self) i = 0 for format in FormatValues: self.cbFormat.addItem(FormatNames[i], format) if format == Options.format: self.cbFormat.setCurrentIndex(i) i += 1 QtCore.QObject.connect(self.cbFormat, QtCore.SIGNAL('currentIndexChanged(int)'), self.evaluate) self.tCodec = QtGui.QLabel('Codec:', self) self.tCodec.setToolTip('Codec presets located in\n' + CodecsPath) self.cbCodec = QtGui.QComboBox(self) i = 0 for name in CodecNames: self.cbCodec.addItem(name, CodecFiles[i]) if os.path.basename(CodecFiles[i]) == Options.codec: self.cbCodec.setCurrentIndex(i) i += 1 QtCore.QObject.connect(self.cbCodec, QtCore.SIGNAL('currentIndexChanged(int)'), self.evaluate) self.tFPS = QtGui.QLabel('FPS:', self) self.tFPS.setToolTip('Frame rate.') self.cbFPS = QtGui.QComboBox(self) self.cbFPS.addItem('24') self.cbFPS.addItem('25') self.cbFPS.addItem('30') self.cbFPS.setCurrentIndex(0) QtCore.QObject.connect(self.cbFPS, QtCore.SIGNAL('currentIndexChanged(int)'), self.evaluate) self.lFormat.addWidget(self.tFormat) self.lFormat.addWidget(self.cbFormat) self.lFormat.addWidget(self.tFPS) self.lFormat.addWidget(self.cbFPS) self.lFormat.addWidget(self.tCodec) self.lFormat.addWidget(self.cbCodec) self.generallayout.addLayout(self.lFormat) self.lInput = QtGui.QHBoxLayout() self.tInput = QtGui.QLabel('Scan Folder', self) self.lInput.addWidget(self.tInput) self.editInput = QtGui.QLineEdit(InputFolder, self) QtCore.QObject.connect(self.editInput, QtCore.SIGNAL('textEdited(QString)'), self.evaluate) self.lInput.addWidget(self.editInput) self.btnInputBrowse = QtGui.QPushButton('Browse', self) QtCore.QObject.connect(self.btnInputBrowse, QtCore.SIGNAL('pressed()'), self.inputBrowse) self.lInput.addWidget(self.btnInputBrowse) self.generallayout.addLayout(self.lInput) self.lExtensions = QtGui.QHBoxLayout() self.tExtensions = QtGui.QLabel('Search extensions:', self) tooltip = 'Comma separated list.\n' \ 'Leave empty to find all known:\n' for ext in Extensions: tooltip += ext + ' ' self.tExtensions.setToolTip(tooltip) self.lExtensions.addWidget(self.tExtensions) self.editExtensions = QtGui.QLineEdit(Options.extensions, self) QtCore.QObject.connect(self.editExtensions, QtCore.SIGNAL('editingFinished()'), self.evaluate) self.lExtensions.addWidget(self.editExtensions) self.generallayout.addLayout(self.lExtensions) self.lInclude = QtGui.QHBoxLayout() self.tInclude = QtGui.QLabel('Include pattern:', self) self.lInclude.addWidget(self.tInclude) self.editInclude = QtGui.QLineEdit(Options.include, self) QtCore.QObject.connect(self.editInclude, QtCore.SIGNAL('textEdited(QString)'), self.evaluate) self.lInclude.addWidget(self.editInclude) self.generallayout.addLayout(self.lInclude) self.lExclude = QtGui.QHBoxLayout() self.tExclude = QtGui.QLabel('Exclude pattern:', self) self.lExclude.addWidget(self.tExclude) self.editExclude = QtGui.QLineEdit(Options.exclude, self) QtCore.QObject.connect(self.editExclude, QtCore.SIGNAL('textEdited(QString)'), self.evaluate) self.lExclude.addWidget(self.editExclude) self.generallayout.addLayout(self.lExclude) self.lDateTime = QtGui.QHBoxLayout() self.cDateTime = QtGui.QCheckBox('Skip folders ealier than:', self) QtCore.QObject.connect(self.cDateTime, QtCore.SIGNAL('stateChanged(int)'), self.evaluate) self.lDateTime.addWidget(self.cDateTime) self.eDateTime = QtGui.QDateTimeEdit( QtCore.QDateTime.currentDateTime(), self) self.eDateTime.setCalendarPopup(True) self.eDateTime.setDisplayFormat(DateTimeFormat) QtCore.QObject.connect(self.cDateTime, QtCore.SIGNAL('dateTimeChanged( QDateTime)'), self.evaluate) self.lDateTime.addWidget(self.eDateTime) self.generallayout.addLayout(self.lDateTime) self.lOutput = QtGui.QHBoxLayout() self.tOutput = QtGui.QLabel('Output Folder:', self) self.lOutput.addWidget(self.tOutput) self.editOutput = QtGui.QLineEdit(OutputFolder, self) QtCore.QObject.connect(self.editOutput, QtCore.SIGNAL('editingFinished()'), self.evaluate) self.lOutput.addWidget(self.editOutput) self.btnOutputBrowse = QtGui.QPushButton('Browse', self) QtCore.QObject.connect(self.btnOutputBrowse, QtCore.SIGNAL('pressed()'), self.browseOutput) self.lOutput.addWidget(self.btnOutputBrowse) self.generallayout.addLayout(self.lOutput) # Parameters: self.cAbsPath = QtGui.QCheckBox( 'Prefix movies names with images absolute input files path', self) self.cAbsPath.setChecked(Options.abspath) QtCore.QObject.connect(self.cAbsPath, QtCore.SIGNAL('stateChanged(int)'), self.evaluate) self.parameterslayout.addWidget(self.cAbsPath) self.lTemplates = QtGui.QHBoxLayout() self.tTemplate = QtGui.QLabel('Frame Template:', self) self.tTemplate.setToolTip('Frame template.\n' 'Templates are located in\n' + TemplatesPath) self.cbTemplate = QtGui.QComboBox(self) for template in Templates: self.cbTemplate.addItem(template) self.cbTemplate.setCurrentIndex(Template) self.lTemplates.addWidget(self.tTemplate) self.lTemplates.addWidget(self.cbTemplate) QtCore.QObject.connect(self.cbTemplate, QtCore.SIGNAL('currentIndexChanged(int)'), self.evaluate) self.parameterslayout.addLayout(self.lTemplates) self.lAspect = QtGui.QHBoxLayout() self.lAspect.addWidget(QtGui.QLabel('Input Images Aspect', self)) self.dsbAspect = QtGui.QDoubleSpinBox(self) self.dsbAspect.setRange(-1.0, 10.0) self.dsbAspect.setDecimals(6) self.dsbAspect.setValue(Options.aspect_in) QtCore.QObject.connect(self.dsbAspect, QtCore.SIGNAL('valueChanged(double)'), self.evaluate) self.lAspect.addWidget(self.dsbAspect) self.lAspect.addWidget(QtGui.QLabel(' (-1 = no changes) ', self)) self.parameterslayout.addLayout(self.lAspect) self.lAutoAspect = QtGui.QHBoxLayout() self.tAutoAspect = QtGui.QLabel('Auto Input Aspect', self) self.tAutoAspect.setToolTip( 'Images with width/height ratio > this value will be ' 'treated as 2:1.') self.lAutoAspect.addWidget(self.tAutoAspect) self.dsbAutoAspect = QtGui.QDoubleSpinBox(self) self.dsbAutoAspect.setRange(-1.0, 10.0) self.dsbAutoAspect.setDecimals(3) self.dsbAutoAspect.setValue(Options.aspect_auto) QtCore.QObject.connect(self.dsbAutoAspect, QtCore.SIGNAL('valueChanged(double)'), self.evaluate) self.lAutoAspect.addWidget(self.dsbAutoAspect) self.lAutoAspect.addWidget(QtGui.QLabel(' (-1 = no changes) ', self)) self.parameterslayout.addLayout(self.lAutoAspect) self.gCorrectionSettings = QtGui.QGroupBox('Image Correction') self.lCorr = QtGui.QHBoxLayout() self.gCorrectionSettings.setLayout(self.lCorr) self.tGamma = QtGui.QLabel('Gamma:', self) self.dsbGamma = QtGui.QDoubleSpinBox(self) self.dsbGamma.setRange(0.1, 10.0) self.dsbGamma.setDecimals(1) self.dsbGamma.setSingleStep(0.1) self.dsbGamma.setValue(1.0) QtCore.QObject.connect(self.dsbGamma, QtCore.SIGNAL('valueChanged(double)'), self.evaluate) self.lCorr.addWidget(self.tGamma) self.lCorr.addWidget(self.dsbGamma) self.parameterslayout.addWidget(self.gCorrectionSettings) # Bottom tab: self.cmdField = QtGui.QTextEdit(self) self.cmdField.setReadOnly(True) self.mainLayout.addWidget(self.cmdField) self.lProcess = QtGui.QHBoxLayout() self.btnStart = QtGui.QPushButton('Start', self) self.btnStart.setEnabled(False) QtCore.QObject.connect(self.btnStart, QtCore.SIGNAL('pressed()'), self.execute) self.btnStop = QtGui.QPushButton('Stop', self) self.btnStop.setEnabled(False) QtCore.QObject.connect(self.btnStop, QtCore.SIGNAL('pressed()'), self.processStop) self.btnTest = QtGui.QPushButton('Test', self) self.btnTest.setEnabled(False) QtCore.QObject.connect(self.btnTest, QtCore.SIGNAL('pressed()'), self.executeTest) self.lProcess.addWidget(self.btnTest) self.lProcess.addWidget(self.btnStart) self.lProcess.addWidget(self.btnStop) self.mainLayout.addLayout(self.lProcess) self.lAfanasy = QtGui.QHBoxLayout() self.cAfanasy = QtGui.QCheckBox('Afanasy', self) self.cAfanasy.setChecked(Options.afanasy != 0) QtCore.QObject.connect(self.cAfanasy, QtCore.SIGNAL('stateChanged(int)'), self.afanasy) self.tAfCapacity = QtGui.QLabel('Capacity:', self) self.sbAfCapacity = QtGui.QSpinBox(self) self.sbAfCapacity.setRange(-1, 1000000) self.sbAfCapacity.setValue(Options.afanasy) QtCore.QObject.connect(self.sbAfCapacity, QtCore.SIGNAL('valueChanged(int)'), self.evaluate) self.tAfMaxHosts = QtGui.QLabel('Maximum Hosts:', self) self.sbAfMaxHosts = QtGui.QSpinBox(self) self.sbAfMaxHosts.setRange(-1, 1000000) self.sbAfMaxHosts.setValue(Options.maxhosts) QtCore.QObject.connect(self.sbAfMaxHosts, QtCore.SIGNAL('valueChanged(int)'), self.evaluate) self.cAfPause = QtGui.QCheckBox('Pause', self) self.lAfanasy.addWidget(self.cAfanasy) self.lAfanasy.addWidget(self.tAfCapacity) self.lAfanasy.addWidget(self.sbAfCapacity) self.lAfanasy.addWidget(self.tAfMaxHosts) self.lAfanasy.addWidget(self.sbAfMaxHosts) self.lAfanasy.addWidget(self.cAfPause) self.mainLayout.addLayout(self.lAfanasy) self.constructed = True self.afanasy() self.evaluate()