[Xfce4-commits] <parole:master> Show playlist when more than one item added.
Sean Davis
noreply at xfce.org
Sun Dec 2 20:26:01 CET 2012
Updating branch refs/heads/master
to c307fad1f076c9d97113191bc8957a6bba586dc8 (commit)
from 83ce53e26e846ad3d8bb47fb582c3d6b8fd149ee (commit)
commit c307fad1f076c9d97113191bc8957a6bba586dc8
Author: Sean Davis <smd.seandavis at gmail.com>
Date: Sun Dec 2 07:37:45 2012 -0500
Show playlist when more than one item added.
src/parole-medialist.c | 13 +++++++++++++
src/parole-medialist.h | 3 +++
src/parole-player.c | 9 +++++++++
3 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/src/parole-medialist.c b/src/parole-medialist.c
index c90cd61..f898153 100644
--- a/src/parole-medialist.c
+++ b/src/parole-medialist.c
@@ -190,6 +190,7 @@ enum
URI_OPENED,
SHUFFLE_TOGGLED,
REPEAT_TOGGLED,
+ SHOW_PLAYLIST,
LAST_SIGNAL
};
@@ -288,6 +289,9 @@ parole_media_list_files_open (ParoleMediaList *list, GSList *files, gboolean emi
len = g_slist_length (files);
TRACE ("Adding files");
+ if ( len > 1 )
+ g_signal_emit (G_OBJECT (list), signals [SHOW_PLAYLIST], 0, TRUE);
+
if ( len != 0 )
{
if ( replace )
@@ -1354,6 +1358,15 @@ parole_media_list_class_init (ParoleMediaListClass *klass)
NULL, NULL,
g_cclosure_marshal_VOID__BOOLEAN,
G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
+
+ signals[SHOW_PLAYLIST] =
+ g_signal_new ("show-playlist",
+ PAROLE_TYPE_MEDIA_LIST,
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ParoleMediaListClass, show_playlist),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__BOOLEAN,
+ G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
g_type_class_add_private (klass, sizeof (ParoleMediaListPrivate));
diff --git a/src/parole-medialist.h b/src/parole-medialist.h
index ea788e4..8b6253e 100644
--- a/src/parole-medialist.h
+++ b/src/parole-medialist.h
@@ -67,6 +67,9 @@ typedef struct
void (*repeat_toggled) (ParoleMediaList *list,
gboolean repeat_toggled);
+
+ void (*show_playlist) (ParoleMediaList *list,
+ gboolean show_playlist);
} ParoleMediaListClass;
diff --git a/src/parole-player.c b/src/parole-player.c
index 808dd84..9d40010 100644
--- a/src/parole-player.c
+++ b/src/parole-player.c
@@ -1106,6 +1106,12 @@ parole_player_media_list_repeat_toggled_cb (ParoleMediaList *list, gboolean repe
}
static void
+parole_player_media_list_show_playlist_cb (ParoleMediaList *list, gboolean show_playlist, ParolePlayer *player)
+{
+ parole_player_set_playlist_visible (player, show_playlist);
+}
+
+static void
parole_player_media_progressed_cb (ParoleGst *gst, const ParoleStream *stream, gint64 value, ParolePlayer *player)
{
#ifdef DEBUG
@@ -2896,6 +2902,9 @@ parole_player_init (ParolePlayer *player)
g_signal_connect (player->priv->list, "shuffle-toggled",
G_CALLBACK (parole_player_media_list_shuffle_toggled_cb), player);
+
+ g_signal_connect (player->priv->list, "show-playlist",
+ G_CALLBACK (parole_player_media_list_show_playlist_cb), player);
/*
* Load auto saved media list.
More information about the Xfce4-commits
mailing list