def __init__(self): """Builds the initial combose box UI""" QtGui.QFrame.__init__(self) QtGui.QVBoxLayout(self) assetFrame = QtGui.QFrame(self) QtGui.QHBoxLayout(assetFrame) self.layout().addWidget(assetFrame) assetFrame.layout().addWidget(QtGui.QLabel("show:")) self.__showCombobox = QtGui.QComboBox() assetFrame.layout().addWidget(self.__showCombobox) assetFrame.layout().addWidget(QtGui.QLabel("shot:")) self.__shotCombobox = QtGui.QComboBox() assetFrame.layout().addWidget(self.__shotCombobox) assetFrame.layout().addWidget(QtGui.QLabel("asset:")) self.__assetCombobox = QtGui.QComboBox() assetFrame.layout().addWidget(self.__assetCombobox) assetFrame.layout().addWidget(QtGui.QLabel("version:")) self.__versionCombobox = QtGui.QComboBox() assetFrame.layout().addWidget(self.__versionCombobox) self.connect(self.__showCombobox, QtCore.SIGNAL("currentIndexChanged(QString)"), self.__updateShow) self.connect(self.__shotCombobox, QtCore.SIGNAL("currentIndexChanged(QString)"), self.__updateShot) self.connect(self.__assetCombobox, QtCore.SIGNAL("currentIndexChanged(QString)"), self.__updateAsset) self.connect(self.__versionCombobox, QtCore.SIGNAL("currentIndexChanged(QString)"), self.__updateVersion) # Modify the integrated QListViews to lay out the items every time the # view is resized, so that changes in the application font preferences # are correctly reflected for combobox in (self.__showCombobox, self.__shotCombobox, self.__assetCombobox, self.__versionCombobox): combobox.view().setResizeMode(QtGui.QListView.Adjust) self.__sandboxCheckBox = QtGui.QCheckBox('Save to Sandbox', self) self.layout().addWidget(self.__sandboxCheckBox) self.__showCombobox.addItems(_getShows())
def setDisplayMode(self, mode): """ Set display mode and corresponding tool tips, icons, etc. """ self.__displayMode = mode if self.__displayMode == (DISPLAY_LIGHTS | DISPLAY_CAMERAS): switchArea = self.getWidgetSwitchArea() self.__topHBox = QtGui.QFrame(switchArea) switchArea.layout().addWidget(self.__topHBox) self.__topHBox.setLayout(QtGui.QHBoxLayout()) spacer = QtGui.QLabel('', self) self.__topHBox.layout().addWidget(spacer) self.__topHBox.layout().setStretchFactor(spacer, 100) self.__lightsCheckbox = QtGui.QCheckBox("Lights", self.__topHBox) self.__lightsCheckbox.setChecked(True) self.__topHBox.layout().addWidget(self.__lightsCheckbox) QtCore.QObject.connect(self.__lightsCheckbox, QtCore.SIGNAL('stateChanged(int)'), self.__on_lightsCheckbox_stateChanged) self.__camerasCheckbox = QtGui.QCheckBox("Cameras", self.__topHBox) self.__camerasCheckbox.setChecked(True) self.__topHBox.layout().addWidget(self.__camerasCheckbox) QtCore.QObject.connect(self.__camerasCheckbox, QtCore.SIGNAL('stateChanged(int)'), self.__on_camerasCheckbox_stateChanged) self.setToolTip("Choose Light or Camera") elif mode & DISPLAY_LIGHTS: self.setScenegraphPixmap(self.__pixmaps['light']) self.setToolTip("Choose Light") else: self.setScenegraphPixmap(self.__pixmaps['camera']) self.setToolTip("Choose Camera")