diff options
author | Leandro A. F. Pereira <leandro@hardinfo.org> | 2009-05-01 21:48:01 -0300 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2009-05-01 21:48:01 -0300 |
commit | d42d81949a49fa71cc84f2e4120b65fd91cb61b2 (patch) | |
tree | 6b0bf5d4b4c22f69a21f1e4f9d18d528469c3d5c /hardinfo2/shell.c | |
parent | ddf9b782e39355db410ae4225d7a41a8dea902c4 (diff) |
Makes the XMLRPC client synchronous (fixes some stability problems)
Diffstat (limited to 'hardinfo2/shell.c')
-rw-r--r-- | hardinfo2/shell.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/hardinfo2/shell.c b/hardinfo2/shell.c index 7ffd1b52..3451a8f4 100644 --- a/hardinfo2/shell.c +++ b/hardinfo2/shell.c @@ -437,6 +437,7 @@ static void view_menu_select_entry(gpointer data, gpointer data2) static void add_module_to_menu(gchar * name, GdkPixbuf * pixbuf) { + GtkAction *action; gchar *about_module = g_strdup_printf("AboutModule%s", name); gint merge_id; @@ -461,6 +462,14 @@ static void add_module_to_menu(gchar * name, GdkPixbuf * pixbuf) stock_icon_register_pixbuf(pixbuf, name); + if ((action = gtk_action_group_get_action(shell->action_group, name))) { + gtk_action_group_remove_action(shell->action_group, action); + } + + if ((action = gtk_action_group_get_action(shell->action_group, about_module))) { + gtk_action_group_remove_action(shell->action_group, action); + } + gtk_action_group_add_actions(shell->action_group, entries, 2, NULL); merge_id = gtk_ui_manager_new_merge_id(shell->ui_manager); @@ -483,6 +492,7 @@ static void add_module_entry_to_view_menu(gchar * module, gchar * name, GdkPixbuf * pixbuf, GtkTreeIter * iter) { + GtkAction *action; gint merge_id; GtkActionEntry entries[] = { { @@ -496,6 +506,11 @@ add_module_entry_to_view_menu(gchar * module, gchar * name, }; stock_icon_register_pixbuf(pixbuf, name); + + if ((action = gtk_action_group_get_action(shell->action_group, name))) { + gtk_action_group_remove_action(shell->action_group, action); + } + gtk_action_group_add_actions(shell->action_group, entries, 1, iter); merge_id = gtk_ui_manager_new_merge_id(shell->ui_manager); |