Ticket #3714: 0005-Unfullscreen-when-no-more-streams.patch

File 0005-Unfullscreen-when-no-more-streams.patch, 1.7 KB (added by humitos, 11 years ago)
  • activity.py

    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): 
    108108        toolbar_box.show_all()
    109109
    110110        self.connect('key_press_event', self.__key_press_event_cb)
     111        self.connect('no-stream', self.__no_stream_cb)
    111112
    112113        # We want to be notified when the activity gets the focus or
    113114        # loses it. When it is not active, we don't need to keep
    class JukeboxActivity(activity.Activity): 
    186187            self.control._button_clicked_cb(None)
    187188            return True
    188189
     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
    189195    def songchange(self, direction):
    190196        current_playing = self.playlist_widget._current_playing
    191197        if direction == 'prev' and  current_playing > 0:
    class JukeboxActivity(activity.Activity): 
    194200                self.playlist_widget._current_playing < len(self.playlist_widget._items) - 1:
    195201            self.play_index(self.playlist_widget._current_playing + 1)
    196202        else:
    197             self._switch_canvas(show_video=False)
    198203            self.emit('no-stream')
    199204
    200205    def play_index(self, index):