gnomeradio r208 - in trunk: . src
- From: mfcn svn gnome org
- To: svn-commits-list gnome org
- Subject: gnomeradio r208 - in trunk: . src
- Date: Sat, 13 Sep 2008 21:00:09 +0000 (UTC)
Author: mfcn
Date: Sat Sep 13 21:00:09 2008
New Revision: 208
URL: http://svn.gnome.org/viewvc/gnomeradio?rev=208&view=rev
Log:
* src/gui.c (main):
* src/prefs.c (add_button_clicked_cb), (del_button_clicked_cb),
(name_cell_edited_cb):
Don't update menus while main-view and tray-icon are not visible yet
Modified:
trunk/ChangeLog
trunk/src/gui.c
trunk/src/prefs.c
Modified: trunk/src/gui.c
==============================================================================
--- trunk/src/gui.c (original)
+++ trunk/src/gui.c Sat Sep 13 21:00:09 2008
@@ -54,6 +54,8 @@
int mom_ps;
gnomeradio_settings settings;
+gboolean main_visible;
+
static GtkWidget *drawing_area;
static GdkPixmap *digits, *signal_s, *stereo;
static GtkWidget *freq_scale;
@@ -1110,6 +1112,7 @@
NULL);
gtk_window_set_default_icon_name("gnomeradio");
/* Main app */
+ main_visible = FALSE;
app = gnome_radio_gui();
/* Initizialize GStreamer */
@@ -1150,6 +1153,7 @@
preset_combo_set_item(mom_ps);
gtk_widget_show_all(app);
+ main_visible = TRUE;
/* Create an tray icon */
create_tray_icon(app);
Modified: trunk/src/prefs.c
==============================================================================
--- trunk/src/prefs.c (original)
+++ trunk/src/prefs.c Sat Sep 13 21:00:09 2008
@@ -30,6 +30,8 @@
extern int mom_ps;
extern gnomeradio_settings settings;
+extern gboolean main_visible;
+
static GtkWidget *device_entry;
static GtkWidget *mixer_combo;
static GtkWidget *mute_on_exit_cb;
@@ -310,16 +312,18 @@
v_scb = gtk_tree_view_get_vadjustment(GTK_TREE_VIEW(list_view));
gtk_adjustment_set_value(v_scb, v_scb->upper);
- gtk_combo_box_append_text(GTK_COMBO_BOX(preset_combo), ps->title);
- mom_ps = g_list_length(settings.presets) - 1;
- preset_combo_set_item(mom_ps);
-
- menuitems = GTK_MENU_SHELL(tray_menu)->children;
- menuitem = gtk_menu_item_new_with_label(ps->title);
-
- gtk_menu_shell_insert(GTK_MENU_SHELL(tray_menu), menuitem, mom_ps);
- g_signal_connect(G_OBJECT(menuitem), "activate", (GCallback)preset_menuitem_activate_cb, (gpointer)mom_ps);
- gtk_widget_show(menuitem);
+ if (main_visible) {
+ gtk_combo_box_append_text(GTK_COMBO_BOX(preset_combo), ps->title);
+ mom_ps = g_list_length(settings.presets) - 1;
+ preset_combo_set_item(mom_ps);
+
+ menuitems = GTK_MENU_SHELL(tray_menu)->children;
+ menuitem = gtk_menu_item_new_with_label(ps->title);
+
+ gtk_menu_shell_insert(GTK_MENU_SHELL(tray_menu), menuitem, mom_ps);
+ g_signal_connect(G_OBJECT(menuitem), "activate", (GCallback)preset_menuitem_activate_cb, (gpointer)mom_ps);
+ gtk_widget_show(menuitem);
+ }
buffer = g_strdup_printf("%d", g_list_length(settings.presets) - 1);
path = gtk_tree_path_new_from_string(buffer);
@@ -356,15 +360,17 @@
gtk_tree_model_get_iter(GTK_TREE_MODEL(list_store), &iter, path);
gtk_list_store_remove(list_store, &iter);
- gtk_combo_box_remove_text(GTK_COMBO_BOX(preset_combo), *row + 1);
- if (--mom_ps < 0) mom_ps = 0;
- if (!g_list_length(settings.presets)) mom_ps = -1;
- preset_combo_set_item(mom_ps);
-
- menuitems = GTK_MENU_SHELL(tray_menu)->children;
- g_assert(*row < g_list_length(menuitems));
- menuitem = g_list_nth_data(menuitems, *row);
- gtk_widget_destroy(menuitem);
+ if (main_visible) {
+ gtk_combo_box_remove_text(GTK_COMBO_BOX(preset_combo), *row + 1);
+ if (--mom_ps < 0) mom_ps = 0;
+ if (!g_list_length(settings.presets)) mom_ps = -1;
+ preset_combo_set_item(mom_ps);
+
+ menuitems = GTK_MENU_SHELL(tray_menu)->children;
+ g_assert(*row < g_list_length(menuitems));
+ menuitem = g_list_nth_data(menuitems, *row);
+ gtk_widget_destroy(menuitem);
+ }
gtk_tree_path_prev(path);
gtk_tree_view_set_cursor(GTK_TREE_VIEW(list_view), path, NULL, FALSE);
@@ -420,20 +426,22 @@
if (ps->title) g_free(ps->title);
ps->title = g_strdup(new_val);
- gtk_combo_box_remove_text(GTK_COMBO_BOX(preset_combo), *row + 1);
- gtk_combo_box_insert_text(GTK_COMBO_BOX(preset_combo), *row + 1, ps->title);
- mom_ps = *row;
- preset_combo_set_item(mom_ps);
-
- menuitems = GTK_MENU_SHELL(tray_menu)->children;
- g_assert(mom_ps < g_list_length(menuitems));
- menuitem = g_list_nth_data(menuitems, mom_ps);
- gtk_widget_destroy(menuitem);
- menuitem = gtk_menu_item_new_with_label(ps->title);
-
- gtk_menu_shell_insert(GTK_MENU_SHELL(tray_menu), menuitem, *row);
- g_signal_connect(G_OBJECT(menuitem), "activate", (GCallback)preset_menuitem_activate_cb, (gpointer)mom_ps);
- gtk_widget_show(menuitem);
+ if (main_visible) {
+ gtk_combo_box_remove_text(GTK_COMBO_BOX(preset_combo), *row + 1);
+ gtk_combo_box_insert_text(GTK_COMBO_BOX(preset_combo), *row + 1, ps->title);
+ mom_ps = *row;
+ preset_combo_set_item(mom_ps);
+
+ menuitems = GTK_MENU_SHELL(tray_menu)->children;
+ g_assert(mom_ps < g_list_length(menuitems));
+ menuitem = g_list_nth_data(menuitems, mom_ps);
+ gtk_widget_destroy(menuitem);
+ menuitem = gtk_menu_item_new_with_label(ps->title);
+
+ gtk_menu_shell_insert(GTK_MENU_SHELL(tray_menu), menuitem, *row);
+ g_signal_connect(G_OBJECT(menuitem), "activate", (GCallback)preset_menuitem_activate_cb, (gpointer)mom_ps);
+ gtk_widget_show(menuitem);
+ }
gtk_tree_model_get_iter(GTK_TREE_MODEL(list_store), &iter, path);
gtk_list_store_set(GTK_LIST_STORE(list_store), &iter, 0, new_val, -1);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]