# HG changeset patch # User nenolod # Date 1150094105 25200 # Node ID d7848ff5bbe5ca56e65895e524a7c62111133826 # Parent 42d4b152c14da588ab5d4fb114e77f86265d0816 [svn] - prefswin_page_destroy() code, example will be added to the scrobbler plugin momentarily diff -r 42d4b152c14d -r d7848ff5bbe5 ChangeLog --- a/ChangeLog Sun Jun 11 23:19:33 2006 -0700 +++ b/ChangeLog Sun Jun 11 23:35:05 2006 -0700 @@ -1,3 +1,13 @@ +2006-06-12 06:19:33 +0000 William Pitcock + revision [1280] + - API change, please move along + + + Changes: Modified: + +5 -5 trunk/audacious/prefswin.c + +1 -1 trunk/audacious/prefswin.h + + 2006-06-12 05:50:31 +0000 William Pitcock revision [1278] - place plugins we cannot register UIs for right now in a queue and register them later diff -r 42d4b152c14d -r d7848ff5bbe5 audacious/prefswin.c --- a/audacious/prefswin.c Sun Jun 11 23:19:33 2006 -0700 +++ b/audacious/prefswin.c Sun Jun 11 23:35:05 2006 -0700 @@ -2350,6 +2350,7 @@ return -1; } + /* Make sure the widgets are visible. */ gtk_widget_show(container); id = gtk_notebook_append_page(GTK_NOTEBOOK(category_notebook), container, NULL); @@ -2370,3 +2371,36 @@ return id; } + +void +prefswin_page_destroy(gint id) +{ + GtkTreeModel *model; + GtkTreeIter iter; + GtkTreeView *treeview = GTK_TREE_VIEW(category_treeview); + gboolean ret; + + if (category_notebook == NULL || treeview == NULL) + return; + + gtk_notebook_remove_page(GTK_NOTEBOOK(category_notebook), id); + + model = gtk_tree_view_get_model(treeview); + + if (model == NULL) + return; + + ret = gtk_tree_model_get_iter_first(model, &iter); + + while (ret == TRUE) + { + gint index = -1; + + gtk_tree_model_get(model, &iter, CATEGORY_VIEW_COL_ID, &index, -1); + + if (index == id) + gtk_list_store_remove(GTK_LIST_STORE(model), &iter); + + ret = gtk_tree_model_iter_next(model, &iter); + } +} diff -r 42d4b152c14d -r d7848ff5bbe5 audacious/prefswin.h --- a/audacious/prefswin.h Sun Jun 11 23:19:33 2006 -0700 +++ b/audacious/prefswin.h Sun Jun 11 23:35:05 2006 -0700 @@ -23,5 +23,6 @@ void show_prefs_window(void); gint prefswin_page_new(GtkWidget *container, gchar *name, gchar *imgurl); +void prefswin_page_destroy(gint id); #endif