[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: pcb.git: branch: master updated (efe692e8e7539b5bc52a3734da6764bd41826ff8)



The branch, master has been updated
       via  efe692e8e7539b5bc52a3734da6764bd41826ff8 (commit)
      from  c07a6f7bd679489c7430b6b398e9afa926282b08 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 src/hid/gtk/ghid-main-menu.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)


=================
 Commit Messages
=================

commit efe692e8e7539b5bc52a3734da6764bd41826ff8
Author: Andrew Poelstra <asp11@xxxxxx>
Commit: Andrew Poelstra <asp11@xxxxxx>

    Block signals in ghid_main_menu_update_toggle_state()
    
    The function ghid_main_menu_update_toggle_state() is supposed to
    sync the menu checkboxes to the actual state of pcb, by checking
    the flags given in the resource file.
    
    If this function is emitting signals and changing pcb's state,
    this is a bug. Fortunately, this appears not to be the case, so
    the effect of this commit is to eliminate one more use of
    ghidgui->toggle_holdoff.

:100644 100644 5693c56... ed4e2e8... M	src/hid/gtk/ghid-main-menu.c

=========
 Changes
=========

commit efe692e8e7539b5bc52a3734da6764bd41826ff8
Author: Andrew Poelstra <asp11@xxxxxx>
Commit: Andrew Poelstra <asp11@xxxxxx>

    Block signals in ghid_main_menu_update_toggle_state()
    
    The function ghid_main_menu_update_toggle_state() is supposed to
    sync the menu checkboxes to the actual state of pcb, by checking
    the flags given in the resource file.
    
    If this function is emitting signals and changing pcb's state,
    this is a bug. Fortunately, this appears not to be the case, so
    the effect of this commit is to eliminate one more use of
    ghidgui->toggle_holdoff.

diff --git a/src/hid/gtk/ghid-main-menu.c b/src/hid/gtk/ghid-main-menu.c
index 5693c56..ed4e2e8 100644
--- a/src/hid/gtk/ghid-main-menu.c
+++ b/src/hid/gtk/ghid-main-menu.c
@@ -294,6 +294,8 @@ ghid_main_menu_real_add_resource (GHidMainMenu *menu, GtkMenuShell *shell,
               gtk_action_connect_accelerator (action);
               g_signal_connect (G_OBJECT (action), "activate", menu->action_cb,
                                 (gpointer) sub_res);
+              g_object_set_data (G_OBJECT (action), "resource",
+                                 (gpointer) sub_res);
               item = gtk_action_create_menu_item (action);
               gtk_menu_shell_append (shell, item);
               menu->actions = g_list_append (menu->actions, action);
@@ -498,11 +500,16 @@ ghid_main_menu_update_toggle_state (GHidMainMenu *menu,
   GList *list;
   for (list = menu->actions; list; list = list->next)
     {
+      Resource *res = g_object_get_data (G_OBJECT (list->data), "resource");
       const char *tf = g_object_get_data (G_OBJECT (list->data),
                                           "checked-flag");
       const char *af = g_object_get_data (G_OBJECT (list->data),
                                           "active-flag");
+      g_signal_handlers_block_by_func (G_OBJECT (list->data),
+                                       menu->action_cb, res);
       cb (GTK_ACTION (list->data), tf, af);
+      g_signal_handlers_unblock_by_func (G_OBJECT (list->data),
+                                         menu->action_cb, res);
     }
 }
 




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs