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

Re: gEDA-user: [Patches] GTK Recent-file-manager



Am 01.01.2011 23:10, schrieb Felix Ruoff:
Am 01.01.2011 21:35, schrieb Felix Ruoff:
Am 01.01.2011 20:30, schrieb kai-martin knaak:
Hmm. Isolated patches make testing a bit awkward. What might be ok
for simple additions gets progressively less fun for more complicated
changes.

Can you set up a git repository of pcb with your patches applied?
(The way Peter Clifton makes his GL-enabled version of pcb available to
potential testers)

---<)kaimartin(>---
(...)

I have figured out myself how to set up a git repository on github. The page, where you can browse it online is https://github.com/fruoff/pcb-fruoff .

If you like, you can get the branch with the following command:

git clone git://github.com/fruoff/pcb-fruoff.git

And now, the same for gaf/gschem (I forgot to create this yesterday evening):

git clone git://github.com/fruoff/gaf-fruoff.git

This repository has applied the gschem-patch for the GTK recent-manager and the appended patch. The appended patch fixes a warning, if there are menu-items without action (e.g. the recent-files - topitem (labeled 'Recent Files' (Zuletzt geöffnet))). I have also send all these Patches to the sourceforge-tracker. Thanks to Bert, who has already leaved a comment there!

Kind regards,
Felix
From 71b8a5a3e8e2831065291bd1f6f629cb78b67f18 Mon Sep 17 00:00:00 2001
From: Felix Ruoff <Felix@xxxxxxxxxxxxxxxxxx>
Date: Sat, 9 Oct 2010 18:35:33 +0200
Subject: [PATCH] Fix warning on moving over menu-item without action

Fix a warning at the info-dialog if the mouse moves over a menu-item which has no action defined, e.g. the top item of a submenu.
---
 gschem/src/x_menus.c |   30 ++++++++++++++----------------
 1 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/gschem/src/x_menus.c b/gschem/src/x_menus.c
index 6ea77ed..5a7e9ba 100644
--- a/gschem/src/x_menus.c
+++ b/gschem/src/x_menus.c
@@ -105,7 +105,6 @@ get_main_menu(GSCHEM_TOPLEVEL *w_current)
   char **raw_menu_name = g_malloc (sizeof(char *));
   char *menu_item_name;
   char *raw_menu_item_name;
-  char *menu_item_func;
   char *menu_item_hotkey_func;
   char *menu_item_stock;
   char *menu_item_keys;
@@ -149,11 +148,6 @@ get_main_menu(GSCHEM_TOPLEVEL *w_current)
 
       raw_menu_item_name = SCM_STRING_CHARS (scm_item_name);
 
-      if (scm_is_false (scm_item_func))
-        menu_item_func = "no-action";
-      else
-        menu_item_func = SCM_SYMBOL_CHARS (scm_item_func);
-
       if (scm_is_false (scm_item_hotkey_func))
         menu_item_hotkey_func = NULL;
       else
@@ -187,17 +181,21 @@ get_main_menu(GSCHEM_TOPLEVEL *w_current)
           menu_item_keys = "";
         }
 
-        action = gschem_action_new (menu_item_func,  /* Action name */
-                                    menu_item_name,  /* Text */
-                                    menu_item_name,  /* Tooltip */
-                                    menu_item_stock, /* Icon stock ID */
-                                    menu_item_keys); /* Accelerator string */
-        menu_item = gtk_action_create_menu_item (GTK_ACTION (action));
-        gtk_menu_append (GTK_MENU (menu), menu_item);
+        if(scm_is_false (scm_item_func)) {
+          menu_item = gtk_menu_item_new_with_mnemonic(menu_item_name);
+        } else {
+          action = gschem_action_new (SCM_SYMBOL_CHARS (scm_item_func),  /* Action name */
+                                      menu_item_name,  /* Text */
+                                      menu_item_name,  /* Tooltip */
+                                      menu_item_stock, /* Icon stock ID */
+                                      menu_item_keys); /* Accelerator string */
+          menu_item = gtk_action_create_menu_item (GTK_ACTION (action));
+          g_signal_connect (G_OBJECT(action), "activate",
+                            G_CALLBACK(g_menu_execute),
+                            w_current);
+        }
 
-        g_signal_connect (G_OBJECT(action), "activate",
-                          G_CALLBACK(g_menu_execute),
-                          w_current);
+        gtk_menu_append (GTK_MENU (menu), menu_item);
       }
 
       gtk_widget_show (menu_item);
-- 
1.7.1


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