Index: src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/actions/actions.c =================================================================== --- src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/actions/actions.c (revision 1525) +++ src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/actions/actions.c (revision 1526) @@ -95,28 +95,7 @@ return hid_parse_command(cmdline); } -void create_menu(const char *path_, const char *action, const char *mnemonic, const char *hotkey, const char *tooltip) +void create_menu(const char *path, const char *action, const char *mnemonic, const char *hotkey, const char *tooltip) { -#define MENU_MAX 32 - const char *menu[MENU_MAX]; - int n; - char *s, *path = strdup(path_); - - menu[0] = path; - for(n = 1, s = path; *s != '\0'; s++) { - if (*s == '/') { - *s = '\0'; - s++; - menu[n] = s; - n++; - if (n == MENU_MAX-1) { - Message("create_menu(): menu path '%s' too long\n", path_); - break; - } - } - } - menu[n] = NULL; - - gui->create_menu(menu, action, mnemonic, hotkey, tooltip); - free(path); + gui->create_menu(path, action, mnemonic, hotkey, tooltip); } Index: src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_plugin.c =================================================================== --- src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_plugin.c (revision 1525) +++ src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_plugin.c (revision 1526) @@ -29,7 +29,7 @@ int ev; char *ev_args; hid_gpmi_script_info_t *i; - const char *menu[] = {"Plugins", "GPMI scripting", "Scripts", NULL}; + const char *menu = "/main_menu/Plugins/GPMI scripting/Scripts"; gui->create_menu(menu, "gpmi_scripts()", "S", "Altg", "Manage GPMI scripts"); @@ -141,9 +141,9 @@ char *dir, *libdirg, *libdirh, *wdir, *wdirh, *hdirh, *home; void **gpmi_asm_scriptname; - libdirg = resolve_path_inplace(Concat(PCBLIBDIR, PCB_DIR_SEPARATOR_S "plugins", NULL)); - libdirh = resolve_path_inplace(Concat(PCBLIBDIR, PCB_DIR_SEPARATOR_S "plugins" PCB_DIR_SEPARATOR_S, HOST, NULL)); - wdirh = resolve_path_inplace(Concat ("plugins" PCB_DIR_SEPARATOR_S, HOST, NULL)); + libdirg = resolve_path_inplace(Concat(PCBLIBDIR, PCB_DIR_SEPARATOR_S "plugins", NULL), 0); + libdirh = resolve_path_inplace(Concat(PCBLIBDIR, PCB_DIR_SEPARATOR_S "plugins" PCB_DIR_SEPARATOR_S, HOST, NULL), 0); + wdirh = resolve_path_inplace(Concat ("plugins" PCB_DIR_SEPARATOR_S, HOST, NULL), 0); wdir = Concat("plugins", NULL); home = getenv ("PCB_RND_GPMI_HOME"); @@ -150,7 +150,7 @@ if (home == NULL) home = homedir; - hdirh = resolve_path_inplace(Concat(home, PCB_DIR_SEPARATOR_S ".pcb" PCB_DIR_SEPARATOR_S "plugins" PCB_DIR_SEPARATOR_S, HOST, NULL)); + hdirh = resolve_path_inplace(Concat(home, PCB_DIR_SEPARATOR_S ".pcb" PCB_DIR_SEPARATOR_S "plugins" PCB_DIR_SEPARATOR_S, HOST, NULL), 0); fprintf(stderr, "gpmi dirs: lg=%s lh=%s wh=%s w=%s hh=%s\n", libdirg, libdirh, wdirh, wdir, hdirh); @@ -194,7 +194,7 @@ if (home != NULL) { hid_gpmi_load_dir (hdirh, 0); - dir = resolve_path_inplace(Concat(home, PCB_DIR_SEPARATOR_S ".pcb" PCB_DIR_SEPARATOR_S "plugins", NULL)); + dir = resolve_path_inplace(Concat(home, PCB_DIR_SEPARATOR_S ".pcb" PCB_DIR_SEPARATOR_S "plugins", NULL), 0); hid_gpmi_load_dir(dir, 1); free(dir); }