def loadCompleted(self, *args, **kwargs): self.lockView(False) if 'dataset_name' in kwargs: filedir = kwargs['dataset_base'] filename = kwargs['dataset_name'] tree = kwargs['dataset_tree'] links = kwargs['dataset_references'] paths = kwargs['dataset_paths'] fgprint = Q7FingerPrint(self, filedir, filename, tree, links, paths, **kwargs) else: fgprint = self.signals.fgprint if len(fgprint) > 1: MSG.wError(self, 200, 'Load error', fgprint[1]) elif fgprint.tree is None: MSG.wError(self, 201, 'Load error', 'Fatal error while loading file, empty tree') else: Q7TreeModel(fgprint.index) child = Q7Tree(self, '/', fgprint.index) child.show() self.setHistory(fgprint.filedir, fgprint.filename) self.updateViews() fgprint.getInfo(force=True) self.signals.fgprint = None Q7FingerPrint.killProxy() self.readyCursor()
def edit(self): self._T('edit new') tree = CGL.newCGNSTree() tc = self.newtreecount self.busyCursor() fgprint = Q7FingerPrint(self, '.', 'new#%.3d.hdf' % tc, tree, [], []) Q7TreeModel(fgprint.index) child = Q7Tree(self, '/', fgprint.index) fgprint._status = [Q7FingerPrint.STATUS_MODIFIED] self.readyCursor() self.newtreecount += 1 child.show()
def show(T, *args): from CGNS.NAV.moption import Q7OptionContext as OCTXT import qtpy.QtCore as QtCore from qtpy.QtWidgets import QApplication, QSplashScreen from qtpy.QtGui import QPixmap from CGNS.NAV.wcontrol import Q7Main from CGNS.NAV.wfile import Q7File from CGNS.NAV.winfo import Q7Info from CGNS.NAV.woption import Q7Option from CGNS.NAV.wtree import Q7Tree from CGNS.NAV.mtree import Q7TreeModel from CGNS.NAV.wfingerprint import Q7FingerPrint from CGNS.NAV.wquery import Q7Query from CGNS.NAV.whelp import Q7Help def dummy(*args): pass app = QApplication(args) app.updateViews = dummy app.removeTreeStatus = dummy app.addTreeStatus = dummy app.loadOptions = dummy app.addLine = dummy app.delLine = dummy app.transientRecurse = False app.transientVTK = False app.verbose = True app._application = app app.wOption = Q7Option(app) app.wOption.reset() app.processEvents() fgprint = Q7FingerPrint(app, '.', '<run-time>', T, [], []) Q7TreeModel(fgprint.index) child = Q7Tree(app, '/', fgprint.index) for wg in [ child.bSave, child.bQueryView, child.bSaveAs, child.bInfo, child.bCheck, child.bCheckList, child.bClearChecks, child.bPatternView, child.bToolsView, child.bFormView, child.bSelectLinkSrc, child.bSelectLinkDst, child.bBackControl ]: wg.setEnabled(False) fgprint._status = [Q7FingerPrint.STATUS_MODIFIED] child.show() app.exec_()
def loadQ7Tree(self, fgprint): from CGNS.NAV.wtree import Q7Tree from CGNS.NAV.mtree import Q7TreeModel Q7TreeModel(fgprint.index) return Q7Tree(self, '/', fgprint.index)