summaryrefslogtreecommitdiff
path: root/src/ui.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui.py')
-rw-r--r--src/ui.py16
1 files changed, 12 insertions, 4 deletions
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'