[gnome-music/wip/merge: 221/343] fix selection bar
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/merge: 221/343] fix selection bar
- Date: Thu, 25 Jul 2013 11:31:23 +0000 (UTC)
commit 2437e324f4f7ebdcbd0d54a57cd3b70ea055d012
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date: Wed Jul 17 14:52:58 2013 +0200
fix selection bar
gnomemusic/toolbar.py | 3 ++-
gnomemusic/view.py | 7 +++----
gnomemusic/widgets.py | 10 ++++++----
3 files changed, 11 insertions(+), 9 deletions(-)
---
diff --git a/gnomemusic/toolbar.py b/gnomemusic/toolbar.py
index 123d5dd..a067cc0 100644
--- a/gnomemusic/toolbar.py
+++ b/gnomemusic/toolbar.py
@@ -64,7 +64,7 @@ class Toolbar(GObject.GObject):
self.emit('state-changed')
def _update(self):
- if (self._state == ToolbarState.SINGLE or self._selectionMode):
+ if self._state == ToolbarState.SINGLE:
self.header_bar.set_custom_title(None)
self._backButton.show()
else:
@@ -76,6 +76,7 @@ class Toolbar(GObject.GObject):
self.header_bar.set_custom_title(self._selectionMenuButton)
self._closeSeparator.hide()
self._closeButton.hide()
+
else:
self._closeSeparator.show()
self._closeButton.show()
diff --git a/gnomemusic/view.py b/gnomemusic/view.py
index 9dd5622..fce9e33 100644
--- a/gnomemusic/view.py
+++ b/gnomemusic/view.py
@@ -122,10 +122,9 @@ class ViewContainer(Gtk.Stack):
if self == widget.get_visible_child() and not self._init:
self._populate()
- def _on_view_selection_changed(self):
+ def _on_view_selection_changed(self, widget):
items = self.view.get_selection()
- self.selection_toolbar._add_to_playlist_button.sensitive =\
- items.length > 0
+ self.selection_toolbar._add_to_playlist_button.set_sensitive(len(items) > 0)
def _populate(self, data=None):
self._init = True
@@ -250,7 +249,7 @@ class Albums(ViewContainer):
def _on_state_changed(self, widget, data=None):
if (self.header_bar.get_stack() is not None) and \
(self == self.header_bar.get_stack().get_visible_child()):
- self.visible_child = self._grid
+ self.set_visible_child(self._grid)
def _on_item_activated(self, widget, id, path):
iter = self._model.get_iter(path)
diff --git a/gnomemusic/widgets.py b/gnomemusic/widgets.py
index b440193..512e69d 100644
--- a/gnomemusic/widgets.py
+++ b/gnomemusic/widgets.py
@@ -165,6 +165,8 @@ class AlbumWidget(Gtk.EventBox):
widget.text = self.player.seconds_to_string(duration)
def update(self, artist, album, item, header_bar, selection_toolbar):
+ self.selection_toolbar = selection_toolbar
+ self.header_bar = header_bar
released_date = item.get_publication_date()
if released_date is not None:
self.ui.get_object("released_label_info").set_text(
@@ -214,9 +216,9 @@ class AlbumWidget(Gtk.EventBox):
self.player.connect('playlist-item-changed', self.update_model)
#self.emit('loaded')
- def _on_view_selection_changed(self):
+ def _on_view_selection_changed(self, widget):
items = self.view.get_selection()
- self.selection_toolbar._add_to_playlist_button.sensitive = items.length
+ self.selection_toolbar._add_to_playlist_button.set_sensitive(len(items) > 0)
def _on_header_cancel_button_clicked(self, button):
self.view.set_selection_mode(False)
@@ -224,7 +226,7 @@ class AlbumWidget(Gtk.EventBox):
self.header_bar.header_bar.title = self.album
def _on_header_select_button_toggled(self, button):
- if(button.get_active()):
+ if button.get_active():
self.view.set_selection_mode(True)
self.header_bar.set_selection_mode(True)
self.player.eventBox.set_visible(False)
@@ -235,7 +237,7 @@ class AlbumWidget(Gtk.EventBox):
self.header_bar.set_selection_mode(False)
self.header_bar.title = self.album
self.selection_toolbar.eventbox.set_visible(False)
- if(self.player.PlaybackStatus != 'Stopped'):
+ if(self.player.get_playback_status() != 'Stopped'):
self.player.eventBox.set_visible(True)
def _on_get_album_songs(self, source, prefs, track, a, b, c):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]