Index: /home/michal/soft/elisa/elisa/elisa-plugins/elisa/plugins/slideshow/slideshow_controller.py =================================================================== --- /home/michal/soft/elisa/elisa/elisa-plugins/elisa/plugins/slideshow/slideshow_controller.py (wersja 5045) +++ /home/michal/soft/elisa/elisa/elisa-plugins/elisa/plugins/slideshow/slideshow_controller.py (kopia robocza) @@ -37,6 +37,7 @@ supported_models = ('base:list_model',) duration = 5.0 + backwards = False _call_later = None _playing = False @@ -64,7 +65,7 @@ return True elif input_event.action == EventAction.PAUSE: - self.playing = False + self._cancel_last_call_later() return True elif input_event.action == EventAction.STOP: @@ -76,10 +77,14 @@ def playing__set(self, playing): self._playing = playing - if playing: + if playing and not self.backwards: self.next_image() self._call_later = reactor.callLater(self.duration, self.next_image) + elif playing: + self.previous_image() + self._call_later = reactor.callLater(self.duration, + self.previous_image) else: self._cancel_last_call_later() @@ -88,7 +93,10 @@ def focused_changed(self, old_focused, new_focused): if new_focused == False and self.playing == True: - self.playing = False + self._cancel_last_call_later() + elif new_focused == True: + if self.playing: + self.playing = True def next_image(self): self._cancel_last_call_later() @@ -98,6 +106,7 @@ self.info("Loading image at index %r", index) self.current_index = index if self.playing == True: + self.backwards = False self._call_later = reactor.callLater(self.duration, self.next_image) return True @@ -113,6 +122,7 @@ self.info("Loading image at index %r", index) self.current_index = index if self.playing == True: + self.backwards = True self._call_later = reactor.callLater(self.duration, self.previous_image) return True