goto first image if going to next and no image was previously selected

This commit is contained in:
Martin Baeuml
2011-07-07 10:46:27 +02:00
parent d0002ab5ac
commit fa7a547dea
+6 -2
View File
@@ -276,8 +276,12 @@ class LabelTool(QObject):
return self._model
def gotoNext(self):
if self._model is not None and self._current_image is not None:
next_image = self._current_image.getNextSibling()
if self._model is not None:
if self._current_image is not None:
next_image = self._current_image.getNextSibling()
else:
next_image = self._model.iterator(ImageModelItem).next()
if next_image is not None:
self.setCurrentImage(next_image)