summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/editorui/editormain.py2
-rw-r--r--src/ui.py16
2 files changed, 13 insertions, 5 deletions
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'