[gnome-music/playlists: 9/10] .



commit b19e9d167f678f5fab6918d4b1d11e5ad36f777a
Merge: 5de9bdc 4411477
Author: Eslam Mostafa <me eslammostafa com>
Date:   Tue Jul 2 03:00:21 2013 +0200

    .

 src/view.js    |   46 ++++++++++++++++++++++++++++++++++++++++++++++
 src/widgets.js |   32 ++++++++++++++++++++++++++++++++
 2 files changed, 78 insertions(+), 0 deletions(-)
---
diff --cc src/view.js
index f058c1a,5b7a616..a243bef
--- a/src/view.js
+++ b/src/view.js
@@@ -319,16 -319,43 +319,50 @@@ const Songs = new Lang.Class(
          this.countQuery = Query.songs_count;
          this._items = {};
          this.isStarred = null;
++<<<<<<< HEAD
 +        this.view = new Widgets.SongsList(player, this._model);
++=======
+         this.view = new Widgets.SongsList(player);
++>>>>>>> 4411477b1930fb8bf0910e666c6d4c28b1c3080c
          this._iconHeight = 32;
          this._iconWidth = 32;
          this._symbolicIcon = albumArtCache.makeDefaultIcon(this._iconHeight, this._iconWidth)
          this.player = player;
      },
  
++<<<<<<< HEAD
++=======
+     _addItem: function(source, param, item) {
+         if (item != null) {
+             this._offset += 1;
+             var iter = this._model.append();
+             if ((item.get_title() == null) && (item.get_url() != null)) {
+                 item.set_title (extractFileName(item.get_url()));
+             }
+             try{
+                 if (item.get_url())
+                     this.player.discoverer.discover_uri(item.get_url());
+                 this._model.set(
+                         iter,
+                         [5, 8, 9, 10],
+                         [item, nowPlayingIconName, false, false]
+                     );
+             } catch(err) {
+                 log(err.message);
+                 log("failed to discover url " + item.get_url());
+                 this._model.set(
+                         iter,
+                         [5, 8, 9, 10],
+                         [item, errorIconName, false, true]
+                     );
+             }
+         }
+     },
+ 
++>>>>>>> 4411477b1930fb8bf0910e666c6d4c28b1c3080c
      populate: function() {
          if (grilo.tracker != null)
 -            grilo.populateSongs (this._offset, Lang.bind(this, this._addItem, null));
 +            grilo.populateSongs (this._offset, Lang.bind(this, this.view.addItem, null));
      },
  
  });
@@@ -455,18 -482,18 +489,30 @@@ const Playlists = new Lang.Class(
          this.view.set_hexpand(false);
          this.view.get_style_context().add_class("artist-panel");
          this.view.get_generic_view().get_selection().set_mode(Gtk.SelectionMode.SINGLE);
++<<<<<<< HEAD
 +        this._songsListWidget = new Widgets.SongsList(this.player, null);
 +        let builder = new Gtk.Builder();
 +        //builder.add_from_resource('/org/gnome/music/PlaylistControls.ui');
 +        //let controls = builder.get_object('container');
++=======
+         this._songsListWidget = new Widgets.SongsList(this.player);
+         let builder = new Gtk.Builder();
+         builder.add_from_resource('/org/gnome/music/PlaylistControls.ui');
+         let controls = builder.get_object('container');
++>>>>>>> 4411477b1930fb8bf0910e666c6d4c28b1c3080c
          builder.add_from_resource('/org/gnome/music/PlaylistSongs.ui');
          let songsFrame = builder.get_object('container');
          let viewport = builder.get_object('viewport');
          viewport.add(this._songsListWidget);
          this._grid.attach(new Gtk.Separator(), 0, 1, 1, 1);
          //this._grid.attach(controls, 0, 2, 1, 1);
++<<<<<<< HEAD
 +        this._grid.attach(new Gtk.Separator({orientation: Gtk.Orientation.VERTICAL}), 1, 0, 1, 2);
 +        this._grid.attach(songsFrame, 2, 0, 2, 2);
++=======
+         this._grid.attach(new Gtk.Separator({orientation: Gtk.Orientation.VERTICAL}), 1, 0, 1, 3);
+         this._grid.attach(songsFrame, 2, 0, 2, 3);
++>>>>>>> 4411477b1930fb8bf0910e666c6d4c28b1c3080c
          this._addListRenderers();
          if(Gtk.Settings.get_default().gtk_application_prefer_dark_theme) {
              this.view.get_generic_view().get_style_context().add_class("artist-panel-dark");
diff --cc src/widgets.js
index 422f39d,2c86766..7747873
--- a/src/widgets.js
+++ b/src/widgets.js
@@@ -637,64 -637,34 +637,90 @@@ const SongsList = new Lang.Class(
      Name: "SongsList",
      Extends: Gd.MainView,
  
++<<<<<<< HEAD
 +    _init: function(player, model){
++=======
+     _init: function(player){
++>>>>>>> 4411477b1930fb8bf0910e666c6d4c28b1c3080c
          this.parent();
          this.set_shadow_type(Gtk.ShadowType.NONE);
          this.player = player;
          this.set_view_type(Gd.MainViewType.LIST);
          this.get_generic_view().get_style_context().add_class("songs-list")
++<<<<<<< HEAD
 +        this.model = model;
 +        if (this.model == null) {
 +            this.model = Gtk.ListStore.new([
 +                GObject.TYPE_STRING,
 +                GObject.TYPE_STRING,
 +                GObject.TYPE_STRING,
 +                GObject.TYPE_STRING,
 +                GdkPixbuf.Pixbuf,
 +                GObject.TYPE_OBJECT,
 +                GObject.TYPE_BOOLEAN,
 +                GObject.TYPE_STRING,
 +                GObject.TYPE_BOOLEAN,
 +                GObject.TYPE_BOOLEAN
 +            ]);
 +        }
 +        this.set_model(this.model);
++=======
+         this._model = Gtk.ListStore.new([
+             GObject.TYPE_STRING,
+             GObject.TYPE_STRING,
+             GObject.TYPE_STRING,
+             GObject.TYPE_STRING,
+             GdkPixbuf.Pixbuf,
+             GObject.TYPE_OBJECT,
+             GObject.TYPE_BOOLEAN,
+             GObject.TYPE_STRING,
+             GObject.TYPE_BOOLEAN,
+             GObject.TYPE_BOOLEAN
+         ]);
+         this.set_model(this._model);
++>>>>>>> 4411477b1930fb8bf0910e666c6d4c28b1c3080c
          this._addListRenderers();
          this.show_all();
          this.connect('item-activated', Lang.bind(this, this._onItemActivated));
          this.player.connect('playlist-item-changed', Lang.bind(this, this.updateModel));
      },
  
++<<<<<<< HEAD
 +    addItem: function(source, param, item) {
 +        if (item != null) {
 +            this._offset += 1;
 +            var iter = this._model.append();
 +            if ((item.get_title() == null) && (item.get_url() != null)) {
 +                item.set_title (extractFileName(item.get_url()));
 +            }
 +            try{
 +                if (item.get_url())
 +                    this.player.discoverer.discover_uri(item.get_url());
 +                this._model.set(
 +                        iter,
 +                        [5, 8, 9, 10],
 +                        [item, nowPlayingIconName, false, false]
 +                    );
 +            } catch(err) {
 +                log(err.message);
 +                log("failed to discover url " + item.get_url());
 +                this._model.set(
 +                        iter,
 +                        [5, 8, 9, 10],
 +                        [item, errorIconName, false, true]
 +                    );
 +            }
 +        }
 +    },
 +
 +    update: function(title, playlist) {
 +        this.playlist = playlist;
 +        this.model.clear();
++=======
+     update: function(title, playlist) {
+         this.playlist = playlist;
+         this._model.clear();
++>>>>>>> 4411477b1930fb8bf0910e666c6d4c28b1c3080c
          this.show_all();
      },
  
@@@ -710,9 -680,9 +736,15 @@@
      },
  
      _onItemActivated: function (widget, id, path) {
++<<<<<<< HEAD
 +        var iter = this.model.get_iter(path)[1]
 +        if (this.model.get_value(iter, 7) != errorIconName) {
 +            this.player.setPlaylist("Playlist", null, this.model, iter, 5);
++=======
+         var iter = this._model.get_iter(path)[1]
+         if (this._model.get_value(iter, 7) != errorIconName) {
+             this.player.setPlaylist("Playlist", null, this._model, iter, 5);
++>>>>>>> 4411477b1930fb8bf0910e666c6d4c28b1c3080c
              this.player.setPlaying(true);
          }
      },


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