[gnome-music/wip/jfelder/empty-playlist-v2: 1/2] grltrackerplaylists: Add an icon_name property to playlists
- From: Jean Felder <jfelder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/jfelder/empty-playlist-v2: 1/2] grltrackerplaylists: Add an icon_name property to playlists
- Date: Wed, 27 Jan 2021 15:13:36 +0000 (UTC)
commit 258d805d45b5da1095c6947e770bc0825e730cb5
Author: Jean Felder <jfelder src gnome org>
Date: Thu Sep 12 22:44:00 2019 +0200
grltrackerplaylists: Add an icon_name property to playlists
This property will be used in the next commit to display an empty view
when a playlist is empty.
data/icons/playlist2-symbolic.svg | 6 ++++++
data/org.gnome.Music.gresource.xml | 1 +
gnomemusic/grilowrappers/grltrackerplaylists.py | 6 ++++++
3 files changed, 13 insertions(+)
---
diff --git a/data/icons/playlist2-symbolic.svg b/data/icons/playlist2-symbolic.svg
new file mode 100644
index 000000000..ed1ea2eb5
--- /dev/null
+++ b/data/icons/playlist2-symbolic.svg
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16">
+ <g fill="#2e3436">
+ <path d="M3 3v2h10V3zm0 4v2h7.979V7zm0 4v2h5.01L8 11z"/>
+ <path d="M12 7v3.27a2 2 0 00-1-.27 2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2V9h2V7h-2z"/>
+ </g>
+</svg>
diff --git a/data/org.gnome.Music.gresource.xml b/data/org.gnome.Music.gresource.xml
index 4ef28690c..5566b2498 100644
--- a/data/org.gnome.Music.gresource.xml
+++ b/data/org.gnome.Music.gresource.xml
@@ -4,6 +4,7 @@
<file alias="gtk/help-overlay.ui" preprocess="xml-stripblanks">ui/help-overlay.ui</file>
<file>org.gnome.Music.css</file>
<file>icons/initial-state.png</file>
+ <file>icons/playlist2-symbolic.svg</file>
<file preprocess="xml-stripblanks">ui/AboutDialog.ui</file>
<file preprocess="xml-stripblanks">ui/AlbumCover.ui</file>
<file preprocess="xml-stripblanks">ui/AlbumWidget.ui</file>
diff --git a/gnomemusic/grilowrappers/grltrackerplaylists.py b/gnomemusic/grilowrappers/grltrackerplaylists.py
index 720c541ca..e7ca7ccb1 100644
--- a/gnomemusic/grilowrappers/grltrackerplaylists.py
+++ b/gnomemusic/grilowrappers/grltrackerplaylists.py
@@ -269,6 +269,7 @@ class Playlist(GObject.GObject):
count = GObject.Property(type=int, default=0)
creation_date = GObject.Property(type=GLib.DateTime, default=None)
+ icon_name = GObject.Property(type=str, default="playlist2-symbolic")
is_smart = GObject.Property(type=bool, default=False)
pl_id = GObject.Property(type=str, default=None)
query = GObject.Property(type=str, default=None)
@@ -825,6 +826,7 @@ class MostPlayed(SmartPlaylist):
self.props.tag_text = "MOST_PLAYED"
# TRANSLATORS: this is a playlist name
self._title = _("Most Played")
+ self.props.icon_name = "audio-speakers-symbolic"
self.props.query = """
SELECT
%(media_type)s AS ?type
@@ -878,6 +880,7 @@ class NeverPlayed(SmartPlaylist):
self.props.tag_text = "NEVER_PLAYED"
# TRANSLATORS: this is a playlist name
self._title = _("Never Played")
+ self.props.icon_name = "dialog-question-symbolic"
self.props.query = """
SELECT
%(media_type)s AS ?type
@@ -930,6 +933,7 @@ class RecentlyPlayed(SmartPlaylist):
self.props.tag_text = "RECENTLY_PLAYED"
# TRANSLATORS: this is a playlist name
self._title = _("Recently Played")
+ self.props.icon_name = "document-open-recent-symbolic"
sparql_midnight_dateTime_format = "%Y-%m-%dT00:00:00Z"
days_difference = 7
@@ -992,6 +996,7 @@ class RecentlyAdded(SmartPlaylist):
self.props.tag_text = "RECENTLY_ADDED"
# TRANSLATORS: this is a playlist name
self._title = _("Recently Added")
+ self.props.icon_name = "list-add-symbolic"
sparql_midnight_dateTime_format = "%Y-%m-%dT00:00:00Z"
days_difference = 7
@@ -1054,6 +1059,7 @@ class Favorites(SmartPlaylist):
self.props.tag_text = "FAVORITES"
# TRANSLATORS: this is a playlist name
self._title = _("Favorite Songs")
+ self.props.icon_name = "starred-symbolic"
self.props.query = """
SELECT
%(media_type)s AS ?type
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]