Exemplo n.º 1
0
    def _updateList(self):
        _infoer.function = str(self._updateList)
        _infoer.write("%s " % str(self._ListBoxItemIdx2Key))
        #clear the listbox
        self.widget().listBox2.clear()

        #put all steps into the listbox
        for index in self._ListBoxItemIdx2Key:
            key = self._ListBoxItemIdx2Key[index]
            #if not mgr
            if not key == self._key:
                params = self._key2Params[key]
                self._key2Params[key] = params
                #insert into listview
                self.widget().listBox2.addItem(params.name)

        #select the added key
        if self._addedKey:
            # go to viewpoint
            params = ObjectMgr().getParamsOfObject(self._addedKey)
            params.isVisible = True
            if params.id:
                self._currentKey = self._addedKey
                self._addedKey = None
                self.setParams(self._currentKey, params)
            if self._fromPresentation:
                Application.vrpApp.mw.presenterManager.requestPresentationStep(
                )
                self._fromPresentation = False

        #select the current step
        self.widget().NameLE.setEnabled(False)
        if self._currentKey in self._key2ListBoxItemIdx:
            self.selectItem(self._key2ListBoxItemIdx[self._currentKey])
            self.widget().NameLE.setEnabled(True)
        else:
            self.widget().NameLE.setText('')
        # if no point, disable all buttons
        if len(self._key2ListBoxItemIdx) == 0:
            self._enableViewpoints(False)
            Application.vrpApp.mw.enableViewpoint(False)
        else:
            self._enableViewpoints(True)
            Application.vrpApp.mw.enableViewpoint(True)
Exemplo n.º 2
0
    def _updateList( self ):
        _infoer.function = str(self._updateList)
        _infoer.write("%s " %str(self._ListBoxItemIdx2Key))
        #clear the listbox
        self.widget().listBox2.clear()

        #put all steps into the listbox
        for index in self._ListBoxItemIdx2Key:
            key = self._ListBoxItemIdx2Key[index]
            #if not mgr
            if not key==self._key:
                params = self._key2Params[key]
                self._key2Params[key] = params
                #insert into listview
                self.widget().listBox2.addItem( params.name )

        #select the added key
        if self._addedKey:
            # go to viewpoint
            params = ObjectMgr().getParamsOfObject(self._addedKey)
            params.isVisible = True
            if  params.id:
                self._currentKey = self._addedKey
                self._addedKey = None
                self.setParams(self._currentKey, params)
            if self._fromPresentation:
                Application.vrpApp.mw.presenterManager.requestPresentationStep()
                self._fromPresentation = False

        #select the current step
        self.widget().NameLE.setEnabled(False)
        if self._currentKey in self._key2ListBoxItemIdx:
            self.selectItem( self._key2ListBoxItemIdx[self._currentKey] )
            self.widget().NameLE.setEnabled(True)
        else:
            self.widget().NameLE.setText('')
        # if no point, disable all buttons
        if len(self._key2ListBoxItemIdx) == 0:
            self._enableViewpoints(False)
            Application.vrpApp.mw.enableViewpoint(False)
        else:
            self._enableViewpoints(True)
            Application.vrpApp.mw.enableViewpoint(True)