gui/sidebar: Enable editing playlist treeview entries

But only for user playlists.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
Anna Schumaker 2016-10-01 10:56:21 -04:00
parent 3f9372051f
commit 466d9ce291
2 changed files with 9 additions and 3 deletions

View File

@ -11,6 +11,7 @@ enum sidebar_columns {
SB_IMAGE, SB_IMAGE,
SB_NAME, SB_NAME,
SB_TYPE, SB_TYPE,
SB_EDITABLE,
}; };
const gchar *SIDEBAR_SETTING = "gui.sidebar.pos"; const gchar *SIDEBAR_SETTING = "gui.sidebar.pos";
@ -33,9 +34,11 @@ static gchar *__gui_sidebar_size_str(struct playlist *playlist)
static void __gui_sidebar_set(GtkTreeIter *iter, const gchar *name, static void __gui_sidebar_set(GtkTreeIter *iter, const gchar *name,
const gchar *image, enum playlist_type_t type) const gchar *image, enum playlist_type_t type)
{ {
gtk_tree_store_set(gui_sidebar_store(), iter, SB_NAME, name, bool editable = (type == PL_USER);
SB_IMAGE, image, gtk_tree_store_set(gui_sidebar_store(), iter, SB_NAME, name,
SB_TYPE, type, -1); SB_IMAGE, image,
SB_TYPE, type,
SB_EDITABLE, editable, -1);
} }
static void __gui_sidebar_set_playlist(GtkTreeIter *iter, static void __gui_sidebar_set_playlist(GtkTreeIter *iter,

View File

@ -106,6 +106,8 @@
<column type="gchararray"/> <column type="gchararray"/>
<!-- column-name Type --> <!-- column-name Type -->
<column type="guint"/> <column type="guint"/>
<!-- column-name Editable -->
<column type="gboolean"/>
</columns> </columns>
</object> </object>
<object class="GtkTreeModelFilter" id="sidebar_filter"> <object class="GtkTreeModelFilter" id="sidebar_filter">
@ -791,6 +793,7 @@ audio-volume-medium</property>
<child> <child>
<object class="GtkCellRendererText" id="cellrenderertext1"/> <object class="GtkCellRendererText" id="cellrenderertext1"/>
<attributes> <attributes>
<attribute name="editable">3</attribute>
<attribute name="markup">1</attribute> <attribute name="markup">1</attribute>
</attributes> </attributes>
</child> </child>