[Xfce4-commits] <parole:master> Fully setup save playlist button
Sean Davis
noreply at xfce.org
Fri Oct 11 11:50:55 CEST 2013
Updating branch refs/heads/master
to 53f336f6e184e24a4c0e694f750b64df16d723b4 (commit)
from e2d530fe571cef6dd37aa0a780d9468b804c452c (commit)
commit 53f336f6e184e24a4c0e694f750b64df16d723b4
Author: Sean Davis <smd.seandavis at gmail.com>
Date: Sat Aug 24 06:44:48 2013 -0400
Fully setup save playlist button
src/parole-medialist.c | 5 +----
src/parole-medialist.h | 3 +++
src/parole-player.c | 29 +++++++++++++++++++++++++++++
3 files changed, 33 insertions(+), 4 deletions(-)
diff --git a/src/parole-medialist.c b/src/parole-medialist.c
index b5aa6d9..643ce56 100644
--- a/src/parole-medialist.c
+++ b/src/parole-medialist.c
@@ -145,9 +145,6 @@ void parole_media_list_close_save_dialog_cb (GtkButton *button,
void parole_media_list_save_playlist_cb (GtkButton *button,
ParolePlaylistSave *data);
-
-void parole_media_list_save_cb (GtkButton *button,
- ParoleMediaList *list);
gboolean parole_media_list_query_tooltip (GtkWidget *widget,
gint x,
@@ -810,7 +807,7 @@ void parole_media_list_format_cursor_changed_cb (GtkTreeView *view, ParolePlayli
}
/* Callback to save the current playlist */
-void parole_media_list_save_cb (GtkButton *button, ParoleMediaList *list)
+void parole_media_list_save_cb (GtkWidget *widget, ParoleMediaList *list)
{
ParolePlaylistSave *data;
GtkWidget *chooser;
diff --git a/src/parole-medialist.h b/src/parole-medialist.h
index 65412f9..8f81ac4 100644
--- a/src/parole-medialist.h
+++ b/src/parole-medialist.h
@@ -155,6 +155,9 @@ GtkTreeRowReference *parole_media_list_get_row_n (ParoleMediaList *list,
void parole_media_list_save_list (ParoleMediaList *list);
+void parole_media_list_save_cb (GtkWidget *widget,
+ ParoleMediaList *list);
+
void parole_media_list_grab_focus (ParoleMediaList *list);
void parole_media_list_set_repeat_toggled (ParoleMediaList *list,
diff --git a/src/parole-player.c b/src/parole-player.c
index 5643556..9419af1 100644
--- a/src/parole-player.c
+++ b/src/parole-player.c
@@ -174,6 +174,12 @@ void parole_player_menu_open_location_cb (GtkWidget *widget,
void parole_player_menu_add_cb (GtkWidget *widget,
ParolePlayer *player);
+
+void parole_player_media_menu_select_cb (GtkMenuItem *widget,
+ ParolePlayer *player);
+
+void parole_player_save_playlist_cb (GtkWidget *widget,
+ ParolePlayer *player);
void parole_player_menu_exit_cb (GtkWidget *widget,
ParolePlayer *player);
@@ -358,6 +364,7 @@ struct ParolePlayerPrivate
GtkWidget *volume;
GtkWidget *menu_bar;
+ GtkWidget *save_playlist;
GtkWidget *play_box;
gboolean exit;
@@ -2206,6 +2213,19 @@ parole_player_menu_add_cb (GtkWidget *widget, ParolePlayer *player)
parole_media_list_open (player->priv->list);
}
+void
+parole_player_save_playlist_cb (GtkWidget *widget, ParolePlayer *player)
+{
+ parole_media_list_save_cb(widget, player->priv->list);
+}
+
+void
+parole_player_media_menu_select_cb (GtkMenuItem *widget, ParolePlayer *player)
+{
+ gtk_widget_set_sensitive (player->priv->save_playlist,
+ !parole_media_list_is_empty (player->priv->list));
+}
+
void parole_player_open_preferences_cb (GtkWidget *widget, ParolePlayer *player)
{
ParoleConfDialog *dialog;
@@ -3064,6 +3084,15 @@ parole_player_init (ParolePlayer *player)
/* Menu Bar */
player->priv->menu_bar = GTK_WIDGET (gtk_builder_get_object (builder, "menubar"));
+ /* Save Playlist Menu Item */
+ player->priv->save_playlist = GTK_WIDGET (gtk_builder_get_object (builder, "menu-save-playlist"));
+ g_signal_connect( player->priv->save_playlist,
+ "activate",
+ G_CALLBACK(parole_player_save_playlist_cb),
+ PAROLE_PLAYER(player) );
+ g_signal_connect (gtk_builder_get_object (builder, "media-menu"), "select",
+ G_CALLBACK (parole_player_media_menu_select_cb), player);
+
/* Recent Menu */
recent_menu = GTK_WIDGET (gtk_builder_get_object (builder, "recent_menu"));
More information about the Xfce4-commits
mailing list