diff options
author | Treeki <treeki@gmail.com> | 2011-11-10 04:18:03 +0100 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2011-11-10 04:18:03 +0100 |
commit | 9d4c8e28b33689750e44b4c1f390caaf5c9b878e (patch) | |
tree | f70ff51930c0c1aa647d9050499358f80a983cee /src/ui.py | |
parent | a7655cdfd41c06f8a5ac9b696289ec74bbb4261a (diff) | |
download | koopatlas-9d4c8e28b33689750e44b4c1f390caaf5c9b878e.tar.gz koopatlas-9d4c8e28b33689750e44b4c1f390caaf5c9b878e.zip |
some work on the layer handling
Diffstat (limited to '')
-rw-r--r-- | src/ui.py | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -38,14 +38,11 @@ class KPLayerList(QtGui.QWidget): def selectedLayer(self): return KP.map.layers[self.listView.selectionModel().currentIndex().row()] - selectedLayerChanged = QtCore.pyqtSignal(KPLayer, KPLayer) + selectedLayerChanged = QtCore.pyqtSignal(KPLayer) @QtCore.pyqtSlot(QtCore.QModelIndex, QtCore.QModelIndex) def handleRowChanged(self, current, previous): - self.selectedLayerChanged.emit( - KP.map.layers[current.row()], - ((previous.row() >= 0) and KP.map.layers[previous.row()]) or None - ) + self.selectedLayerChanged.emit(KP.map.layers[current.row()]) def addLayer(self): @@ -146,6 +143,8 @@ class KPObjectSelector(QtGui.QListView): QtGui.QListView.setModel(self, model) + model.view = self + menuList = model.groupItem().getGroupList() string = QtCore.QString(QtCore.QChar(0x25BE)) @@ -234,6 +233,8 @@ class KPMainWindow(QtGui.QMainWindow): self.layerListDock = QtGui.QDockWidget('Layers') self.layerListDock.setWidget(self.layerList) + self.layerList.selectedLayerChanged.connect(self.scene.setCurrentLayer) + self.objectSelector = KPObjectSelector() self.updateObjectSelector() self.objectSelectorDock = QtGui.QDockWidget('Objects') @@ -252,8 +253,6 @@ class KPMainWindow(QtGui.QMainWindow): tileset = KPTileset.loadFromArc('/home/me/Dropbox/NEWERsmbw/Test3.arc') self.objectSelector.setModel(tileset.getModel()) - tileset.getModel().view = self.objectSelector - |