[gnome-music/wip/gbsneto/contained-playlists: 9/35] playlist: Turns python-specific fields into GObject properties
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/gbsneto/contained-playlists: 9/35] playlist: Turns python-specific fields into GObject properties
- Date: Tue, 6 Dec 2016 16:38:58 +0000 (UTC)
commit 6529740aa38d68bc537f423254e2a44c4d6ce302
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Mon Nov 28 18:12:45 2016 +0100
playlist: Turns python-specific fields into GObject properties
Now that Playlist is a GObject, we can have the old Python-specific
fields turned into properties, which will allow us to e.g. notify
when something changes, bind them with other widgets, among others.
gnomemusic/playlists.py | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/gnomemusic/playlists.py b/gnomemusic/playlists.py
index 45bfd57..1051949 100644
--- a/gnomemusic/playlists.py
+++ b/gnomemusic/playlists.py
@@ -42,11 +42,13 @@ logger = logging.getLogger(__name__)
class Playlist(GObject.Object):
""" Base class of static and intelligent playlists """
- ID = None
- QUERY = None
- TAG_TEXT = ""
- TITLE = ""
+ __gproperties__ = {
+ 'id': (str, 'Identifier', 'id', '', GObject.ParamFlags.READWRITE),
+ 'query': (str, 'Query', 'query', '', GObject.ParamFlags.READWRITE),
+ 'tag_text': (str, 'Tag', 'tag', '', GObject.ParamFlags.READWRITE),
+ 'title': (str, 'Title', 'title', '', GObject.ParamFlags.READWRITE),
+ }
class StaticPlaylists:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]