[gnome-music/freeze-break: 107/107] Merge branch 'playlists' into freeze-break



commit 41fa64f6efbf43b74ce6e54c82e81659a12dcdb3
Merge: 4baef35 1d3f3b1
Author: Arnel A. Borja <arnelborja src gnome org>
Date:   Wed Sep 11 00:38:10 2013 +0800

    Merge branch 'playlists' into freeze-break

 configure.ac                   |    1 +
 data/PlaylistControls.ui       |   95 +++++++++++
 data/PlaylistDialog.ui.in      |   92 +++++++++++
 data/application.css           |   17 ++
 data/gnome-music.gresource.xml |    2 +
 gnomemusic/Makefile.am         |    3 +-
 gnomemusic/grilo.py            |   28 +++-
 gnomemusic/playlists.py        |  104 ++++++++++++
 gnomemusic/query.py            |   21 +++
 gnomemusic/toolbar.py          |    4 +-
 gnomemusic/view.py             |  345 ++++++++++++++++++++++++++++++++++++++--
 gnomemusic/widgets.py          |   82 ++++++++++
 gnomemusic/window.py           |   21 ++-
 po/POTFILES.in                 |    3 +-
 po/POTFILES.skip               |    1 +
 po/zh_HK.po                    |   16 ++-
 po/zh_TW.po                    |   16 ++-
 17 files changed, 817 insertions(+), 34 deletions(-)
---
diff --cc gnomemusic/Makefile.am
index c1c857a,1428b59..6658fb7
--- a/gnomemusic/Makefile.am
+++ b/gnomemusic/Makefile.am
@@@ -6,12 -6,11 +6,13 @@@ app_PYTHON = 
        __init__.py \
        player.py \
        mpris.py \
 +      notification.py \
        toolbar.py \
        view.py \
-       grilo.py \
+       grilo.py  \
+       playlists.py\
        query.py \
        widgets.py \
 +      searchbar.py \
        window.py
  
diff --cc gnomemusic/view.py
index 63d90e1,372913e..6043fcc
--- a/gnomemusic/view.py
+++ b/gnomemusic/view.py
@@@ -61,12 -64,11 +64,12 @@@ class ViewContainer(Stack)
      errorIconName = 'dialog-error-symbolic'
      starIconName = 'starred-symbolic'
      countQuery = None
 +    filter = None
  
-     def __init__(self, title, header_bar, selection_toolbar, useStack=False):
+     def __init__(self, title, header_bar, selection_toolbar, use_sidebar=False, sidebar=None):
          Stack.__init__(self,
                         transition_type=StackTransitionType.CROSSFADE)
-         self._grid = Gtk.Grid(orientation=Gtk.Orientation.VERTICAL)
+         self._grid = Gtk.Grid(orientation=Gtk.Orientation.HORIZONTAL)
          self._iconWidth = -1
          self._iconHeight = 128
          self._offset = 0
diff --cc gnomemusic/window.py
index 3385e40,70bf818..68b2867
--- a/gnomemusic/window.py
+++ b/gnomemusic/window.py
@@@ -137,7 -136,8 +140,9 @@@ class Window(Gtk.ApplicationWindow)
              self.views.append(Views.Empty(self.toolbar, self.player))
              self._stack.add_titled(self.views[0], _("Empty"), _("Empty"))
  
 +        self.toolbar._search_button.connect('toggled', self._on_search_toggled)
+         self.selection_toolbar._add_to_playlist_button.connect(
+             'clicked', self._on_add_to_playlist_button_clicked)
  
          self.toolbar.set_state(ToolbarState.ALBUMS)
          self.toolbar.header_bar.show()
@@@ -158,21 -150,19 +163,31 @@@
  
      def _on_notify_mode(self, stack, param):
          #Slide out artist list on switching to artists view
-         if stack.get_visible_child() == self.views[1]:
+         if stack.get_visible_child() == self.views[1] or \
+            stack.get_visible_child() == self.views[3]:
              stack.get_visible_child().stack.set_visible_child_name('dummy')
-             stack.get_visible_child().stack.set_visible_child_name('artists')
+             stack.get_visible_child().stack.set_visible_child_name('sidebar')
 +        self._show_searchbar(False)
  
      def _toggle_view(self, btn, i):
          self._stack.set_visible_child(self.views[i])
  
 +    def _on_search_toggled(self, button, data=None):
 +        self._show_searchbar(button.get_active())
 +
 +    def _show_searchbar(self, show):
 +        self.toolbar.searchbar.set_reveal_child(show)
 +        self.toolbar._search_button.set_active(show)
 +        if show:
 +            self.toolbar.searchbar._search_entry.grab_focus()
 +        else:
 +            self.toolbar.searchbar._search_entry.set_text('')
++
+     def _on_add_to_playlist_button_clicked(self, widget):
+         self.playlists = Widgets.PlaylistDialog(self)
+         if self.playlists.dialog_box.run() == Gtk.ResponseType.ACCEPT:
+             playlist.add_to_playlist(
+                 self.playlists.get_selected(),
+                 self._stack.get_visible_child().get_selected_track_uris())
+         self.toolbar.set_selection_mode(False)
+         self.playlists.dialog_box.destroy()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]