31
31
extern gnomeradio_settings settings;
33
extern gboolean main_visible;
33
35
static GtkWidget *device_entry;
34
36
static GtkWidget *mixer_combo;
35
37
static GtkWidget *mute_on_exit_cb;
310
312
v_scb = gtk_tree_view_get_vadjustment(GTK_TREE_VIEW(list_view));
311
313
gtk_adjustment_set_value(v_scb, v_scb->upper);
313
gtk_combo_box_append_text(GTK_COMBO_BOX(preset_combo), ps->title);
314
mom_ps = g_list_length(settings.presets) - 1;
315
preset_combo_set_item(mom_ps);
316
gtk_combo_box_append_text(GTK_COMBO_BOX(preset_combo), ps->title);
317
mom_ps = g_list_length(settings.presets) - 1;
318
preset_combo_set_item(mom_ps);
317
menuitems = GTK_MENU_SHELL(tray_menu)->children;
318
menuitem = gtk_menu_item_new_with_label(ps->title);
320
gtk_menu_shell_insert(GTK_MENU_SHELL(tray_menu), menuitem, mom_ps);
321
g_signal_connect(G_OBJECT(menuitem), "activate", (GCallback)preset_menuitem_activate_cb, (gpointer)mom_ps);
322
gtk_widget_show(menuitem);
320
menuitems = GTK_MENU_SHELL(tray_menu)->children;
321
menuitem = gtk_menu_item_new_with_label(ps->title);
323
gtk_menu_shell_insert(GTK_MENU_SHELL(tray_menu), menuitem, mom_ps);
324
g_signal_connect(G_OBJECT(menuitem), "activate", (GCallback)preset_menuitem_activate_cb, (gpointer)mom_ps);
325
gtk_widget_show(menuitem);
324
328
buffer = g_strdup_printf("%d", g_list_length(settings.presets) - 1);
325
329
path = gtk_tree_path_new_from_string(buffer);
356
360
gtk_tree_model_get_iter(GTK_TREE_MODEL(list_store), &iter, path);
357
361
gtk_list_store_remove(list_store, &iter);
359
gtk_combo_box_remove_text(GTK_COMBO_BOX(preset_combo), *row + 1);
360
if (--mom_ps < 0) mom_ps = 0;
361
if (!g_list_length(settings.presets)) mom_ps = -1;
362
preset_combo_set_item(mom_ps);
364
gtk_combo_box_remove_text(GTK_COMBO_BOX(preset_combo), *row + 1);
365
if (--mom_ps < 0) mom_ps = 0;
366
if (!g_list_length(settings.presets)) mom_ps = -1;
367
preset_combo_set_item(mom_ps);
364
menuitems = GTK_MENU_SHELL(tray_menu)->children;
365
g_assert(*row < g_list_length(menuitems));
366
menuitem = g_list_nth_data(menuitems, *row);
367
gtk_widget_destroy(menuitem);
369
menuitems = GTK_MENU_SHELL(tray_menu)->children;
370
g_assert(*row < g_list_length(menuitems));
371
menuitem = g_list_nth_data(menuitems, *row);
372
gtk_widget_destroy(menuitem);
369
375
gtk_tree_path_prev(path);
370
376
gtk_tree_view_set_cursor(GTK_TREE_VIEW(list_view), path, NULL, FALSE);
420
426
if (ps->title) g_free(ps->title);
421
427
ps->title = g_strdup(new_val);
423
gtk_combo_box_remove_text(GTK_COMBO_BOX(preset_combo), *row + 1);
424
gtk_combo_box_insert_text(GTK_COMBO_BOX(preset_combo), *row + 1, ps->title);
426
preset_combo_set_item(mom_ps);
428
menuitems = GTK_MENU_SHELL(tray_menu)->children;
429
g_assert(mom_ps < g_list_length(menuitems));
430
menuitem = g_list_nth_data(menuitems, mom_ps);
431
gtk_widget_destroy(menuitem);
432
menuitem = gtk_menu_item_new_with_label(ps->title);
434
gtk_menu_shell_insert(GTK_MENU_SHELL(tray_menu), menuitem, *row);
435
g_signal_connect(G_OBJECT(menuitem), "activate", (GCallback)preset_menuitem_activate_cb, (gpointer)mom_ps);
436
gtk_widget_show(menuitem);
430
gtk_combo_box_remove_text(GTK_COMBO_BOX(preset_combo), *row + 1);
431
gtk_combo_box_insert_text(GTK_COMBO_BOX(preset_combo), *row + 1, ps->title);
433
preset_combo_set_item(mom_ps);
435
menuitems = GTK_MENU_SHELL(tray_menu)->children;
436
g_assert(mom_ps < g_list_length(menuitems));
437
menuitem = g_list_nth_data(menuitems, mom_ps);
438
gtk_widget_destroy(menuitem);
439
menuitem = gtk_menu_item_new_with_label(ps->title);
441
gtk_menu_shell_insert(GTK_MENU_SHELL(tray_menu), menuitem, *row);
442
g_signal_connect(G_OBJECT(menuitem), "activate", (GCallback)preset_menuitem_activate_cb, (gpointer)mom_ps);
443
gtk_widget_show(menuitem);
438
446
gtk_tree_model_get_iter(GTK_TREE_MODEL(list_store), &iter, path);
439
447
gtk_list_store_set(GTK_LIST_STORE(list_store), &iter, 0, new_val, -1);