diff options
author | Treeki <treeki@gmail.com> | 2011-11-09 05:48:51 +0100 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2011-11-09 05:48:51 +0100 |
commit | 02a1d81d760525f515337d2109feba8887aa5edb (patch) | |
tree | 8e0fbf75554e5be33438df83d926f1acb1091228 /src/ui.py | |
parent | 8b93220d09adc6a56c9b0a7bfa3a9084e03ce25f (diff) | |
download | koopatlas-02a1d81d760525f515337d2109feba8887aa5edb.tar.gz koopatlas-02a1d81d760525f515337d2109feba8887aa5edb.zip |
a bunch of incomplete stuff
Diffstat (limited to '')
-rw-r--r-- | src/ui.py | 24 |
1 files changed, 15 insertions, 9 deletions
@@ -13,6 +13,7 @@ class KPLayerList(QtGui.QWidget): self.listView = QtGui.QListView() self.listView.setModel(self.model) + self.listView.selectionModel().currentRowChanged.connect(self.handleRowChanged) self.layout.addWidget(self.listView) self.toolbar = QtGui.QToolBar() @@ -35,6 +36,15 @@ class KPLayerList(QtGui.QWidget): def selectedLayer(self): return KP.map.layers[self.listView.selectionModel().currentIndex().row()] + selectedLayerChanged = QtCore.pyqtSignal(KPLayer, 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 + ) + def addLayer(self): KP.map.appendLayer(KP.map.createNewLayer()) @@ -162,21 +172,17 @@ class KPMainWindow(QtGui.QMainWindow): self.layerListDock.setWidget(self.layerList) self.objectSelector = KPObjectSelector() - # TODO: refactor this, this is just a bit of a hack for now - from wii.u8archive import WiiArchiveU8 - arc = WiiArchiveU8(open('/home/me/Dropbox/NEWERsmbw/Test2.arc', 'rb')) - img = arc.resolvePath('/BG_tex/Test2_tex.bin').data - obj = arc.resolvePath('/BG_unt/Test2.bin').data - objm = arc.resolvePath('/BG_unt/Test2_hd.bin').data - grp = arc.resolvePath('/BG_grp/Test2_grp.bin').data - TestTileset = KPTileset(img, obj, objm, grp) - self.objectSelector.setModel(TestTileset.getModel()) + self.updateObjectSelector() self.objectSelectorDock = QtGui.QDockWidget('Objects') self.objectSelectorDock.setWidget(self.objectSelector) self.addDockWidget(Qt.RightDockWidgetArea, self.layerListDock) self.addDockWidget(Qt.RightDockWidgetArea, self.objectSelectorDock) + + @QtCore.pyqtSlot() + def updateObjectSelector(self): + pass |