[gnome-music/wip/gbsneto/contained-playlists: 23/29] playlist: Add property getters and setters
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/gbsneto/contained-playlists: 23/29] playlist: Add property getters and setters
- Date: Thu, 1 Dec 2016 23:27:30 +0000 (UTC)
commit 0db56057bffb30173d08ffafe80dc9399b9d49e2
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Thu Dec 1 20:24:34 2016 -0200
playlist: Add property getters and setters
So we can bind these properties.
gnomemusic/playlists.py | 32 ++++++++++++++++++++++++++++++++
1 files changed, 32 insertions(+), 0 deletions(-)
---
diff --git a/gnomemusic/playlists.py b/gnomemusic/playlists.py
index 99d3d59..d10aabf 100644
--- a/gnomemusic/playlists.py
+++ b/gnomemusic/playlists.py
@@ -62,6 +62,38 @@ class Playlist(GObject.Object):
self.title = title
self.is_static = False
+ @log
+ def do_get_property(self, property):
+ if property.name == 'id':
+ return self.id
+ elif property.name == 'query':
+ return self.query
+ elif property.name == 'tag_text':
+ return self.tag_text
+ elif property.name == 'title':
+ return self.title
+ elif property.name == 'is_static':
+ return self.is_static
+ else:
+ raise AttributeError('Unknown property %s' % property.name)
+
+ @log
+ def do_set_property(self, property, value):
+ if property.name == 'id':
+ self.id = value
+ elif property.name == 'query':
+ self.query = value
+ elif property.name == 'tag_text':
+ self.tag_text = value
+ elif property.name == 'title':
+ self.title = value
+ elif property.name == 'is_static':
+ self.is_static = value
+ else:
+ raise AttributeError('Unknown property %s' % property.name)
+
+ self.notify(property.name)
+
class StaticPlaylist(Playlist):
"""Base class for static playlists"""
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]