[gnome-music/wip/gbsneto/contained-playlists: 2/29] 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: 2/29] playlist: Turns python-specific fields into GObject properties
- Date: Thu, 1 Dec 2016 23:25:44 +0000 (UTC)
commit 5bca30bf6725e2e7c637d823678c3437f38eac52
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 6aed885..1f11b31 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]