def __init__(self, specification, context, parent=None, embedBrowser=False, embedDetails=True, session=None): super(ItemCreateWidget, self).__init__(parent=parent) l = FnAssetAPI.l self._embedBrowser = embedBrowser self._embedDetails = embedDetails layout = QtGui.QVBoxLayout() self.setLayout(layout) if not session: session = FnAssetAPI.ui.UISessionManager.currentSession() if embedBrowser: widgetIdentifier = FnAssetAPI.ui.constants.kBrowserWidgetId else: widgetIdentifier = FnAssetAPI.ui.constants.kInlinePickerWidgetId pickerCls = session.getManagerWidget(widgetIdentifier, instantiate=False) self.parentPicker = pickerCls(specification, context) if embedDetails: destGbox = QtGui.QGroupBox(l("{publish} To")) layout.addWidget(destGbox) destLayout = QtGui.QVBoxLayout() destGbox.setLayout(destLayout) destLayout.addWidget(self.parentPicker) else: layout.addWidget(self.parentPicker) self.itemSpreadsheet = None if embedDetails: self.itemSpreadsheet = ItemSpreadsheetWidget() self.itemsGbox = QtGui.QGroupBox("Items") itemsLayout = QtGui.QVBoxLayout() self.itemsGbox.setLayout(itemsLayout) itemsLayout.addWidget(self.itemSpreadsheet) layout.addWidget(self.itemsGbox) self.__items = []
def _drawOptions(self, layout): optionsBox = QtGui.QGroupBox("Options") optionsLayout = QtGui.QVBoxLayout() optionsBox.setLayout(optionsLayout) layout.addWidget(optionsBox) # See if we have any options from the manager self._managerOptions = self._session.getManagerWidget( FnAssetAPI.ui.constants.kRegistrationManagerOptionsWidgetId, throw=False, args=(self._specification, self._context)) if self._managerOptions: optionsLayout.addWidget(self._managerOptions) optionsLayout.addSpacing(10) return optionsLayout