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 <Anna@NoWheyCreamery.com>
This commit is contained in:
parent
fac383e9fc
commit
4990d68711
|
@ -53,6 +53,20 @@ void __gui_pl_user_editing_started(GtkCellRenderer *renderer,
|
||||||
gtk_entry_set_text(GTK_ENTRY(editable), playlist->pl_name);
|
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()
|
void gui_pl_user_init()
|
||||||
{
|
{
|
||||||
idle_schedule(IDLE_SYNC, __gui_pl_user_init_idle, NULL);
|
idle_schedule(IDLE_SYNC, __gui_pl_user_init_idle, NULL);
|
||||||
|
|
|
@ -792,6 +792,7 @@ audio-volume-medium</property>
|
||||||
<property name="title" translatable="yes">column</property>
|
<property name="title" translatable="yes">column</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkCellRendererText" id="cellrenderertext1">
|
<object class="GtkCellRendererText" id="cellrenderertext1">
|
||||||
|
<signal name="edited" handler="__gui_pl_user_edited" swapped="no"/>
|
||||||
<signal name="editing-started" handler="__gui_pl_user_editing_started" swapped="no"/>
|
<signal name="editing-started" handler="__gui_pl_user_editing_started" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
<attributes>
|
<attributes>
|
||||||
|
|
Loading…
Reference in New Issue