Example #1
0
    def createLocalControl(self,
                           pathObj=None,
                           treeStruct=None,
                           forceNewWindow=False):
        """Create a new local control object and add it to the list.

        Use an imported structure if given or open the file if path is given.
        Arguments:
            pathObj -- the path object or file object for the control to open
            treeStruct -- the imported structure to use
            forceNewWindow -- if True, use a new window regardless of option
        """
        localControl = treelocalcontrol.TreeLocalControl(
            self.allActions, pathObj, treeStruct, forceNewWindow)
        localControl.controlActivated.connect(self.updateLocalControlRef)
        localControl.controlClosed.connect(self.removeLocalControlRef)
        self.localControls.append(localControl)
        self.updateLocalControlRef(localControl)
        localControl.updateRightViews()
        localControl.updateCommandsAvail()
Example #2
0
    def createLocalControl(self, path='', model=None):
        """Create a new local control object and add it to the list.

        Use an imported model if given or open the file if path is given.
        Arguments:
            path -- the path for the control to open
            model -- the imported model to use
        """
        localControl = treelocalcontrol.TreeLocalControl(
            self.allActions, path, model)
        localControl.controlActivated.connect(self.updateLocalControlRef)
        localControl.controlClosed.connect(self.removeLocalControlRef)
        self.localControls.append(localControl)
        self.updateLocalControlRef(localControl)
        if self.pluginInterface:
            if not path and not model:
                self.pluginInterface.execCallback(
                    self.pluginInterface.fileNewCallbacks)
            self.pluginInterface.execCallback(
                self.pluginInterface.newWindowCallbacks)