diff options
Diffstat (limited to 'src/ui.py')
-rw-r--r-- | src/ui.py | 32 |
1 files changed, 31 insertions, 1 deletions
@@ -116,7 +116,6 @@ class KPPathNodeList(QtGui.QWidget): @QtCore.pyqtSlot(KPPathNodeItem, KPPathNodeItem) def handleRowChanged(self, currentItem, previousItem): - print currentItem, previousItem try: self.selectedLayerChanged.emit(currentItem.layer) previousItem.associate.qtItem.setLayerSelected(False) @@ -124,6 +123,18 @@ class KPPathNodeList(QtGui.QWidget): except: pass + if KP.app.keyboardModifiers() & Qt.ControlModifier: + layer = currentItem.layer + + KP.mainWindow.scene.clearSelection() + listToUse = layer.objects + layer.doodads + + for obj in listToUse: + item = obj.qtItem + if item: + item.setSelected(True) + + @QtCore.pyqtSlot(KPPathNodeItem, KPPathNodeItem) def jumpToPathNode(self, item): try: @@ -309,11 +320,30 @@ class KPLayerList(QtGui.QWidget): def selectedLayer(self): return KP.map.layers[self.selectedLayerIndex()] + def selectLayer(self, row): + index = self.listView.currentIndex() + newIndex = index.sibling(row, 0) + self.listView.setCurrentIndex(newIndex) + @QtCore.pyqtSlot(QtCore.QModelIndex) def handleRowChanged(self, current): self.selectedLayerChanged.emit(KP.map.layers[current.row()]) self.setButtonStates() + if KP.app.keyboardModifiers() & Qt.ControlModifier: + index = self.selectedLayerIndex() + layer = KP.map.layers[index] + + if (index != -1) and (len(KP.map.layers) > 1) and (not isinstance(layer, KPPathLayer)): + + KP.mainWindow.scene.clearSelection() + listToUse = layer.objects + + for obj in listToUse: + item = obj.qtItem + if item: + item.setSelected(True) + def addTileLayer(self): from dialogs import KPTilesetChooserDialog |