Esempio n. 1
0
 def _refreshAssetButtonView(self):
     for _, button in self._uiWidget[_UiWidgetEnum.assetBtnList].iteritems():
         _pmCore.deleteUI(button)
     self._uiWidget[_UiWidgetEnum.assetBtnList] = {}
     for category in _Database.getCategoryList():
         _pmCore.setParent(self._uiWidget[category])
         for assetInfo in _Database.getAssetUnderCategory(category):
             id, sceneName, _, versionID, _, _, _ = assetInfo
             self._addAssetButton(id, sceneName, versionID)
Esempio n. 2
0
 def _deleteClicked(self, *args):
     current = _pmCore.textScrollList(self._textScrollList, query=True, selectItem=True)
     if not current:
         raise RuntimeError('Must select a category to delete.')
     current = current[0]
     if _Database.getAssetUnderCategory(current):
         raise RuntimeError('Can not delete category {0}, there are asset under this category.'.format(current))
     _Database.deleteCategory(current)
     _pmCore.textScrollList(self._textScrollList, edit=True, removeItem=current)
     
     self._updateCallback(None, None, current)
     
Esempio n. 3
0
 def _buildupWindow(self):
     if self._dockControl and self._dockControl.exists(self._winTitle):
         _pmCore.deleteUI(self._dockControl)
     self._window = _pmCore.window(title=self._winTitle)
     
     _pmCore.columnLayout()
     self._dockControl = _pmCore.dockControl(area='right', content=self._window, label=self._winTitle)
     tabLayout = _pmCore.tabLayout()
     self._uiWidget[_UiWidgetEnum.categoryTabLayout] = tabLayout
     for category in _Database.getCategoryList():
         childLayout = _pmCore.scrollLayout(width=300, height=300, childResizable=True)
         self._uiWidget[category] = _pmCore.gridLayout(numberOfColumns=3, cellHeight = self._iconSize, cellWidth=self._iconSize)
         for assetInfo in _Database.getAssetUnderCategory(category):
             id, sceneName, _, versionID, _, _, _ = assetInfo
             self._addAssetButton(id, sceneName, versionID)
         _pmCore.tabLayout(tabLayout, tabLabel=((childLayout, category),), edit=True)
         _pmCore.setParent('..')
         _pmCore.setParent('..')
         
     _pmCore.setParent('..')
     
     self._uiWidget[_UiWidgetEnum.sceneNameTextField] = _pmCore.textFieldGrp(label='Scene Name: ', width=300, columnAlign2=['left', 'left'], columnWidth2=[100, 195])
     self._uiWidget[_UiWidgetEnum.filePathTextField] = _pmCore.textFieldGrp(label='File Path: ', width=300, columnAlign2=['left', 'left'], columnWidth2=[100, 195])
     _pmCore.rowLayout(numberOfColumns=2)
     _pmCore.text(label="Current Version:", width=100, align='left')
     self._uiWidget[_UiWidgetEnum.versionNumText] = _pmCore.text(label="")
     _pmCore.setParent('..')
     self._uiWidget[_UiWidgetEnum.categoryCombox] = _pmCore.optionMenuGrp(label='Category: ', width=300, columnAlign2=['left', 'left'], columnWidth2=[100, 195])
     for category in _Database.getCategoryList():
         self._uiWidget.setdefault(_UiWidgetEnum.categoryMenuList, []).append(_pmCore.menuItem(label=category))
     _pmCore.text(label='Description:')
     self._uiWidget[_UiWidgetEnum.descriptionTextField] = _pmCore.scrollField(width=300, height=50)
 
     _pmCore.separator(style='single', horizontal=True)
     _pmCore.gridLayout(numberOfColumns=2, cellWidth=150)
     self._uiWidget[_UiWidgetEnum.updateAssetBtn] = _pmCore.button(label='Update Asset Info', command=_pmCore.Callback(self._updateAssetClicked))
     self._uiWidget[_UiWidgetEnum.addCommentBtn] = _pmCore.button(label='View Version & Comment', command=_pmCore.Callback(self._viewVersionListClicked))
     self._uiWidget[_UiWidgetEnum.addAssetBtn] = _pmCore.button(label='Add New Asset', command=_pmCore.Callback(self._addAssetClicked))
     self._uiWidget[_UiWidgetEnum.deleteAssetBtn] = _pmCore.button(label='Delete Asset', command=_pmCore.Callback(self._deleteAssetClicked))
     self._uiWidget[_UiWidgetEnum.addVersionBtn] = _pmCore.button(label='Add Version', command=_pmCore.Callback(self._addVersionClicked))
     self._uiWidget[_UiWidgetEnum.manageCategoryBtn] = _pmCore.button(label='Manage Category', command=self._manageCategoryClicked)
     
     _pmCore.setParent('..')