From 4990d68711d37cf372d7874ff6bd948fda14b54d Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Sat, 1 Oct 2016 11:39:27 -0400 Subject: [PATCH] gui/playlists/user: Respond to the "edited" signal We use this to perform user playlist renames with the user-entered text. Signed-off-by: Anna Schumaker --- gui/playlists/user.c | 14 ++++++++++++++ share/ocarina/ocarina.ui | 1 + 2 files changed, 15 insertions(+) diff --git a/gui/playlists/user.c b/gui/playlists/user.c index 21e50bae..2f495974 100644 --- a/gui/playlists/user.c +++ b/gui/playlists/user.c @@ -53,6 +53,20 @@ void __gui_pl_user_editing_started(GtkCellRenderer *renderer, gtk_entry_set_text(GTK_ENTRY(editable), playlist->pl_name); } +void __gui_pl_user_edited(GtkCellRendererText *renderer, gchar *path, + gchar *new_name, gpointer data) +{ + struct playlist *playlist; + GtkTreeIter iter; + + if (!gui_sidebar_iter_from_string(path, &iter)) + return; + + playlist = gui_sidebar_iter_playlist(&iter); + pl_user_rename(playlist, new_name); + gui_sidebar_iter_update_playlist(&iter, playlist); +} + void gui_pl_user_init() { idle_schedule(IDLE_SYNC, __gui_pl_user_init_idle, NULL); diff --git a/share/ocarina/ocarina.ui b/share/ocarina/ocarina.ui index c898be3d..a0d50a6c 100644 --- a/share/ocarina/ocarina.ui +++ b/share/ocarina/ocarina.ui @@ -792,6 +792,7 @@ audio-volume-medium column +