static void gu_nav_page_set_type(void *opaque, const char *type) { gu_nav_page_t *gnp = opaque; if(gnp->gnp_pageroot != NULL) gtk_widget_destroy(gnp->gnp_pageroot); if(type == NULL) return; if(!strcmp(type, "directory") || !strcmp(type, "playlist")) { gu_directory_create(gnp); } else if(!strcmp(type, "playqueue")) { gu_directory_create(gnp); } else if(!strcmp(type, "home")) { gu_home_create(gnp); } else if(!strcmp(type, "video")) { gu_video_create(gnp); } else if(!strcmp(type, "openerror")) { gu_openerror_create(gnp); } else if(!strcmp(type, "settings")) { gu_settings_create(gnp); } else { GtkWidget *l; char str[256]; snprintf(str, sizeof(str), "Can not display page type: %s", type); gnp->gnp_pageroot = gtk_vbox_new(FALSE, 3); gtk_container_add(GTK_CONTAINER(gnp->gnp_pagebin), gnp->gnp_pageroot); l = gtk_label_new(str); gtk_box_pack_start(GTK_BOX(gnp->gnp_pageroot), l, FALSE, FALSE, 0); gtk_widget_show_all(gnp->gnp_pageroot); } }
static void gu_nav_page_set_type(void *opaque, const char *type) { gu_nav_page_t *gnp = opaque; if(gnp->gnp_pageroot != NULL) gtk_widget_destroy(gnp->gnp_pageroot); if(type == NULL) return; if(!strcmp(type, "directory") || !strcmp(type, "playlist")) { gu_directory_create(gnp); } else if(!strcmp(type, "playqueue")) { gu_directory_create(gnp); } else if(!strcmp(type, "home")) { gu_home_create(gnp); } else if(!strcmp(type, "video")) { gu_video_create(gnp); } else { TRACE(TRACE_ERROR, "GU", "Can not display page type: %s", type); } }