comparison src/streambrowser/streambrowser.c @ 2790:c156102069ae

background fetching of streaming info is now indicated in gui
author Calin Crisan ccrisan@gmail.com
date Wed, 09 Jul 2008 22:07:55 +0300
parents 3a615c9d2bb1
children f9c6a9cb442e
comparison
equal deleted inserted replaced
2789:b34c4e3d9488 2790:c156102069ae
152 } 152 }
153 153
154 static void gui_init() 154 static void gui_init()
155 { 155 {
156 /* the plugin services menu */ 156 /* the plugin services menu */
157 playlist_menu_item = gtk_image_menu_item_new_with_label("Streambrowser"); 157 playlist_menu_item = gtk_image_menu_item_new_with_label(_("Streambrowser"));
158 gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(playlist_menu_item), gtk_image_new_from_stock(GTK_STOCK_CDROM, GTK_ICON_SIZE_MENU)); 158 gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(playlist_menu_item), gtk_image_new_from_stock(GTK_STOCK_CDROM, GTK_ICON_SIZE_MENU));
159 gtk_widget_show(playlist_menu_item); 159 gtk_widget_show(playlist_menu_item);
160 g_signal_connect(G_OBJECT(playlist_menu_item), "activate", G_CALLBACK(on_plugin_services_menu_item_click), NULL); 160 g_signal_connect(G_OBJECT(playlist_menu_item), "activate", G_CALLBACK(on_plugin_services_menu_item_click), NULL);
161 audacious_menu_plugin_item_add(AUDACIOUS_MENU_PLAYLIST_RCLICK, playlist_menu_item); 161 audacious_menu_plugin_item_add(AUDACIOUS_MENU_PLAYLIST_RCLICK, playlist_menu_item);
162 162
163 main_menu_item = gtk_image_menu_item_new_with_label("Streambrowser"); 163 main_menu_item = gtk_image_menu_item_new_with_label(_("Streambrowser"));
164 gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(main_menu_item), gtk_image_new_from_stock(GTK_STOCK_CDROM, GTK_ICON_SIZE_MENU)); 164 gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(main_menu_item), gtk_image_new_from_stock(GTK_STOCK_CDROM, GTK_ICON_SIZE_MENU));
165 gtk_widget_show(main_menu_item); 165 gtk_widget_show(main_menu_item);
166 g_signal_connect(G_OBJECT(main_menu_item), "activate", G_CALLBACK(on_plugin_services_menu_item_click), NULL); 166 g_signal_connect(G_OBJECT(main_menu_item), "activate", G_CALLBACK(on_plugin_services_menu_item_click), NULL);
167 audacious_menu_plugin_item_add(AUDACIOUS_MENU_MAIN, main_menu_item); 167 audacious_menu_plugin_item_add(AUDACIOUS_MENU_MAIN, main_menu_item);
168 168
302 } 302 }
303 /* update a category */ 303 /* update a category */
304 else if (data->category != NULL) { 304 else if (data->category != NULL) {
305 /* shoutcast */ 305 /* shoutcast */
306 if (strncmp(data->streamdir->name, SHOUTCAST_NAME, strlen(SHOUTCAST_NAME)) == 0) { 306 if (strncmp(data->streamdir->name, SHOUTCAST_NAME, strlen(SHOUTCAST_NAME)) == 0) {
307 gdk_threads_enter();
308 streambrowser_win_set_category_state(data->streamdir, data->category, TRUE);
309 gdk_threads_leave();
310
307 shoutcast_category_fetch(data->category); 311 shoutcast_category_fetch(data->category);
308 312
309 gdk_threads_enter(); 313 gdk_threads_enter();
310 streambrowser_win_set_category(data->streamdir, data->category); 314 streambrowser_win_set_category(data->streamdir, data->category);
315 streambrowser_win_set_category_state(data->streamdir, data->category, FALSE);
311 gdk_threads_leave(); 316 gdk_threads_leave();
312 } 317 }
313 } 318 }
314 /* update a streamdir */ 319 /* update a streamdir */
315 else if (data->streamdir != NULL) { 320 else if (data->streamdir != NULL) {
334 } 339 }
335 } 340 }
336 341
337 g_free(data); 342 g_free(data);
338 343
339 /* check to see if there are pending update requests */ 344 /* check to see if there are queued update requests */
340 345
341 data = NULL; 346 data = NULL;
342 g_mutex_lock(update_thread_mutex); 347 g_mutex_lock(update_thread_mutex);
343 update_thread_count--; 348 update_thread_count--;
344 349