From 376ff9fcd399f524c8f943a832bfc9768934ed49 Mon Sep 17 00:00:00 2001
From: Manuel Kaufmann <humitos@gmail.com>
Date: Wed, 16 Jan 2013 11:03:26 -0300
Subject: [PATCH Jukebox 5/5] Unfullscreen when no more streams
If the user is watching a video in full screen and it finishes, we
unfullscreen the activity and show the playlist again.
Signed-off-by: Manuel Kaufmann <humitos@gmail.com>
---
activity.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/activity.py b/activity.py
index b05f46b..fe8b92d 100644
a
|
b
|
class JukeboxActivity(activity.Activity): |
108 | 108 | toolbar_box.show_all() |
109 | 109 | |
110 | 110 | self.connect('key_press_event', self.__key_press_event_cb) |
| 111 | self.connect('no-stream', self.__no_stream_cb) |
111 | 112 | |
112 | 113 | # We want to be notified when the activity gets the focus or |
113 | 114 | # loses it. When it is not active, we don't need to keep |
… |
… |
class JukeboxActivity(activity.Activity): |
186 | 187 | self.control._button_clicked_cb(None) |
187 | 188 | return True |
188 | 189 | |
| 190 | def __no_stream_cb(self, widget): |
| 191 | self._switch_canvas(show_video=False) |
| 192 | self._view_toolbar._show_playlist.set_active(True) |
| 193 | self.unfullscreen() |
| 194 | |
189 | 195 | def songchange(self, direction): |
190 | 196 | current_playing = self.playlist_widget._current_playing |
191 | 197 | if direction == 'prev' and current_playing > 0: |
… |
… |
class JukeboxActivity(activity.Activity): |
194 | 200 | self.playlist_widget._current_playing < len(self.playlist_widget._items) - 1: |
195 | 201 | self.play_index(self.playlist_widget._current_playing + 1) |
196 | 202 | else: |
197 | | self._switch_canvas(show_video=False) |
198 | 203 | self.emit('no-stream') |
199 | 204 | |
200 | 205 | def play_index(self, index): |