예제 #1
0
 def updateNewButton(self):
     if self.isLocked():
         pixmap = studioqt.pixmap('lock', color=self.iconColor())
         self.ui.createButton.setEnabled(True)
         self.ui.createButton.setIcon(pixmap)
     else:
         pixmap = studioqt.pixmap('add', color=self.iconColor())
         self.ui.createButton.setEnabled(True)
         self.ui.createButton.setIcon(pixmap)
         self.ui.createButton.show()
 def updateNewButton(self):
     if self.isLocked():
         pixmap = studioqt.pixmap('lock', color=self.iconColor())
         self.ui.createButton.setEnabled(True)
         self.ui.createButton.setIcon(pixmap)
     else:
         pixmap = studioqt.pixmap('add', color=self.iconColor())
         self.ui.createButton.setEnabled(True)
         self.ui.createButton.setIcon(pixmap)
         self.ui.createButton.show()
예제 #3
0
파일: messagebox.py 프로젝트: jonntd/mira
 def question(parent, title, message, options):
     mb = MessageBox(parent)
     mb.setText(message)
     mb.setOptions(options)
     mb.header().setStyleSheet('background-color: rgb(50,150,200);')
     p = studioqt.pixmap('question')
     mb.setPixmap(p)
     mb.setWindowTitle(title)
     mb.setTitleText(title)
     a = mb.exec_()
     return mb._standardButtonClicked
예제 #4
0
파일: messagebox.py 프로젝트: jonntd/mira
 def critical(parent, title, message):
     mb = MessageBox(parent)
     mb.setText(message)
     mb.setOptions(QtWidgets.QDialogButtonBox.Ok)
     mb.header().setStyleSheet('background-color: rgb(200,50,50);')
     p = studioqt.pixmap('critical')
     mb.setPixmap(p)
     mb.setWindowTitle(title)
     mb.setTitleText(title)
     a = mb.exec_()
     return mb._standardButtonClicked
예제 #5
0
 def question(parent, title, message, options):
     mb = MessageBox(parent)
     mb.setText(message)
     mb.setOptions(options)
     mb.header().setStyleSheet('background-color: rgb(50,150,200);')
     p = studioqt.pixmap('question')
     mb.setPixmap(p)
     mb.setWindowTitle(title)
     mb.setTitleText(title)
     a = mb.exec_()
     return mb._standardButtonClicked
예제 #6
0
 def critical(parent, title, message):
     mb = MessageBox(parent)
     mb.setText(message)
     mb.setOptions(QtWidgets.QDialogButtonBox.Ok)
     mb.header().setStyleSheet('background-color: rgb(200,50,50);')
     p = studioqt.pixmap('critical')
     mb.setPixmap(p)
     mb.setWindowTitle(title)
     mb.setTitleText(title)
     a = mb.exec_()
     return mb._standardButtonClicked
예제 #7
0
 def __init__(self, library):
     """
     :type library: studiolibrary.Library
     """
     QtGui.QWidget.__init__(self, None)
     studiolibrary.MayaDockWidgetMixin.__init__(self, None)
     studioqt.loadUi(self)
     logger.info("Loading library window '{0}'".format(library.name()))
     self.setUniqueObjectName('studiolibrary')
     studiolibrary.analytics().logScreen('MainWindow')
     self._pSize = None
     self._pShow = None
     self._library = None
     self._isDebug = False
     self._isLocked = False
     self._isLoaded = False
     self._showFolders = False
     self._updateThread = None
     self._showLabelsAction = True
     self._saveSettingsOnClose = True
     self.ui.dialogWidget = None
     self.ui.createWidget = None
     self.ui.previewWidget = None
     self._isFoldersWidgetVisible = True
     self._isPreviewWidgetVisible = True
     self._isMenuBarWidgetVisible = True
     self._isStatusBarWidgetVisible = True
     self.ui.previewFrame = QtGui.QFrame(self)
     self.ui.statusWidget = studiolibrary.StatusWidget(self)
     self.ui.recordsWidget = studioqt.ListWidget(self)
     self.ui.foldersWidget = studiolibrary.FoldersWidget(self)
     self.setMinimumWidth(5)
     self.setMinimumHeight(5)
     pixmap = studioqt.pixmap('settings', color=self.iconColor())
     self.ui.settingsButton.setIconSize(QtCore.QSize(26, 26))
     self.ui.settingsButton.setIcon(pixmap)
     pixmap = studioqt.pixmap('add', color=self.iconColor())
     self.ui.createButton.setIconSize(QtCore.QSize(32, 32))
     self.ui.createButton.setIcon(pixmap)
     self.ui.updateButton.hide()
     self.layout().setContentsMargins(0, 0, 0, 0)
     self.ui.splitter = QtGui.QSplitter(QtCore.Qt.Horizontal, self)
     self.ui.splitter.setHandleWidth(1)
     self.ui.splitter.setChildrenCollapsible(False)
     self.ui.viewLayout.insertWidget(1, self.ui.splitter)
     self.ui.splitter.insertWidget(0, self.ui.foldersWidget)
     self.ui.splitter.insertWidget(1, self.ui.recordsWidget)
     self.ui.splitter.setStretchFactor(0, False)
     self.ui.splitter.setStretchFactor(2, False)
     vbox = QtGui.QVBoxLayout()
     self.ui.previewFrame.setLayout(vbox)
     self.ui.previewFrame.layout().setSpacing(0)
     self.ui.previewFrame.layout().setContentsMargins(0, 0, 0, 0)
     self.ui.previewFrame.setMinimumWidth(5)
     self.ui.viewLayout.insertWidget(2, self.ui.previewFrame)
     self.ui.splitter.insertWidget(2, self.ui.previewFrame)
     self.ui.statusLayout.addWidget(self.ui.statusWidget)
     self.ui.updateButton.clicked.connect(self.help)
     self.ui.createButton.clicked.connect(self.showNewMenu)
     self.ui.settingsButton.clicked.connect(self.showSettingsMenu)
     self.dockingChanged.connect(self.updateWindowTitle)
     folderWidget = self.foldersWidget()
     folderWidget.onDropped.connect(self.onRecordDropped)
     folderWidget.onSelectionChanged.connect(self.folderSelectionChanged)
     folderWidget.onShowContextMenu.connect(self.onShowFolderContextMenu)
     recordsWidget = self.recordsWidget()
     recordsWidget.itemDropped.connect(self.onRecordDropped)
     recordsWidget.itemOrderChanged.connect(self.onRecordOrderChanged)
     recordsWidget.onShowContextMenu.connect(self.onShowRecordContextMenu)
     recordsWidget.onSelectionChanged.connect(self.onRecordSelectionChanged)
     studiolibrary.Record.onSaved.connect(self.onRecordSaved)
     studiolibrary.SettingsDialog.onColorChanged.connect(self.onSettingsColorChanged)
     studiolibrary.SettingsDialog.onBackgroundColorChanged.connect(self.onSettingsBackgroundColorChanged)
     self.checkForUpdates()
     self.setLibrary(library)
 def __init__(self, library):
     """
     :type library: studiolibrary.Library
     """
     QtGui.QWidget.__init__(self, None)
     studiolibrary.MayaDockWidgetMixin.__init__(self, None)
     studioqt.loadUi(self)
     logger.info("Loading library window '{0}'".format(library.name()))
     self.setUniqueObjectName('studiolibrary')
     studiolibrary.analytics().logScreen('MainWindow')
     self._pSize = None
     self._pShow = None
     self._library = None
     self._isDebug = False
     self._isLocked = False
     self._isLoaded = False
     self._showFolders = False
     self._updateThread = None
     self._showLabelsAction = True
     self._saveSettingsOnClose = True
     self.ui.dialogWidget = None
     self.ui.createWidget = None
     self.ui.previewWidget = None
     self._isFoldersWidgetVisible = True
     self._isPreviewWidgetVisible = True
     self._isMenuBarWidgetVisible = True
     self._isStatusBarWidgetVisible = True
     self.ui.previewFrame = QtGui.QFrame(self)
     self.ui.statusWidget = studiolibrary.StatusWidget(self)
     self.ui.recordsWidget = studioqt.ListWidget(self)
     self.ui.foldersWidget = studiolibrary.FoldersWidget(self)
     self.setMinimumWidth(5)
     self.setMinimumHeight(5)
     pixmap = studioqt.pixmap('settings', color=self.iconColor())
     self.ui.settingsButton.setIconSize(QtCore.QSize(26, 26))
     self.ui.settingsButton.setIcon(pixmap)
     pixmap = studioqt.pixmap('add', color=self.iconColor())
     self.ui.createButton.setIconSize(QtCore.QSize(32, 32))
     self.ui.createButton.setIcon(pixmap)
     self.ui.updateButton.hide()
     self.layout().setContentsMargins(0, 0, 0, 0)
     self.ui.splitter = QtGui.QSplitter(QtCore.Qt.Horizontal, self)
     self.ui.splitter.setHandleWidth(1)
     self.ui.splitter.setChildrenCollapsible(False)
     self.ui.viewLayout.insertWidget(1, self.ui.splitter)
     self.ui.splitter.insertWidget(0, self.ui.foldersWidget)
     self.ui.splitter.insertWidget(1, self.ui.recordsWidget)
     self.ui.splitter.setStretchFactor(0, False)
     self.ui.splitter.setStretchFactor(2, False)
     vbox = QtGui.QVBoxLayout()
     self.ui.previewFrame.setLayout(vbox)
     self.ui.previewFrame.layout().setSpacing(0)
     self.ui.previewFrame.layout().setContentsMargins(0, 0, 0, 0)
     self.ui.previewFrame.setMinimumWidth(5)
     self.ui.viewLayout.insertWidget(2, self.ui.previewFrame)
     self.ui.splitter.insertWidget(2, self.ui.previewFrame)
     self.ui.statusLayout.addWidget(self.ui.statusWidget)
     self.ui.updateButton.clicked.connect(self.help)
     self.ui.createButton.clicked.connect(self.showNewMenu)
     self.ui.settingsButton.clicked.connect(self.showSettingsMenu)
     self.dockingChanged.connect(self.updateWindowTitle)
     folderWidget = self.foldersWidget()
     folderWidget.onDropped.connect(self.onRecordDropped)
     folderWidget.onSelectionChanged.connect(self.folderSelectionChanged)
     folderWidget.onShowContextMenu.connect(self.onShowFolderContextMenu)
     recordsWidget = self.recordsWidget()
     recordsWidget.itemDropped.connect(self.onRecordDropped)
     recordsWidget.itemOrderChanged.connect(self.onRecordOrderChanged)
     recordsWidget.onShowContextMenu.connect(self.onShowRecordContextMenu)
     recordsWidget.onSelectionChanged.connect(self.onRecordSelectionChanged)
     studiolibrary.Record.onSaved.connect(self.onRecordSaved)
     studiolibrary.SettingsDialog.onColorChanged.connect(
         self.onSettingsColorChanged)
     studiolibrary.SettingsDialog.onBackgroundColorChanged.connect(
         self.onSettingsBackgroundColorChanged)
     self.checkForUpdates()
     self.setLibrary(library)