From 43aa70b5a1e574a4e133a4bb9c50ab3ad9006139 Mon Sep 17 00:00:00 2001 From: Colin Noga Date: Fri, 30 Dec 2011 04:28:58 -0600 Subject: cleaning up some loose ends --- src/editorui/editormain.py | 2 +- src/ui.py | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/editorui/editormain.py b/src/editorui/editormain.py index 6161e7d..32fd94b 100644 --- a/src/editorui/editormain.py +++ b/src/editorui/editormain.py @@ -64,7 +64,7 @@ class KPMapScene(QtGui.QGraphicsScene): @QtCore.pyqtSlot(int) - def viewportUpdateProxy(self, valueA = None, value = None): + def viewportUpdateProxy(self, value): self.views()[0].viewport().update() diff --git a/src/ui.py b/src/ui.py index d5418bc..310e3b7 100644 --- a/src/ui.py +++ b/src/ui.py @@ -773,7 +773,9 @@ class KPMainWindow(QtGui.QMainWindow): @QtCore.pyqtSlot(KPLayer) def handleSelectedLayerChanged(self, layer): - self.pathNodeList.tree.selectionModel().clearSelection() + sel = self.pathNodeList.tree.selectionModel() + if sel: + sel.clearSelection() self.scene.setCurrentLayer(layer) @@ -795,7 +797,9 @@ class KPMainWindow(QtGui.QMainWindow): @QtCore.pyqtSlot(KPLayer) def handleSelectedPathNodeLayerChanged(self, layer): - self.layerList.listView.selectionModel().clearSelection() + sel = self.layerList.listView.selectionModel() + if sel: + sel.clearSelection() self.scene.setCurrentLayer(layer) @@ -810,7 +814,9 @@ class KPMainWindow(QtGui.QMainWindow): @QtCore.pyqtSlot(int, KPTileObject) def handleSelectedObjectChanged(self, index, obj): - self.doodadSelector.listView.selectionModel().clearSelection() + sel = self.doodadSelector.listView.selectionModel() + if sel: + sel.clearSelection() self.editor.objectToPaint = obj self.editor.objectIDToPaint = index @@ -819,7 +825,9 @@ class KPMainWindow(QtGui.QMainWindow): @QtCore.pyqtSlot(object) def handleSelectedDoodadChanged(self, doodad): - self.objectSelector.listView.selectionModel().clearSelection() + sel = self.objectSelector.listView.selectionModel() + if sel: + sel.clearSelection() self.editor.doodadToPaint = doodad self.editor.typeToPaint = 'doodad' -- cgit v1.2.3