Index: trunk/src/brave.c =================================================================== --- trunk/src/brave.c (revision 21898) +++ trunk/src/brave.c (revision 21899) @@ -229,7 +229,7 @@ PCB_DAD_END(dlg); - PCB_DAD_NEW(dlg, "Brave features", dlg, pcb_true, NULL); + PCB_DAD_NEW("brave", dlg, "Brave features", dlg, pcb_true, NULL); brave2dlg(dlg_hid_ctx); PCB_DAD_RUN(dlg); PCB_DAD_FREE(dlg); Index: trunk/src/gui_act.c =================================================================== --- trunk/src/gui_act.c (revision 21898) +++ trunk/src/gui_act.c (revision 21899) @@ -1711,7 +1711,7 @@ pcb_hid_t *printer = pcb_hid_find_printer(); printer->calibrate(0.0, 0.0); - if (pcb_attribute_dialog(printer_calibrate_attrs, 3, printer_calibrate_values, "Printer Calibration Values", NULL)) + if (pcb_attribute_dialog("printer_calibrate", printer_calibrate_attrs, 3, printer_calibrate_values, "Printer Calibration Values", NULL)) return 1; printer->calibrate(printer_calibrate_values[1].real_value, printer_calibrate_values[2].real_value); PCB_ACT_IRES(0); Index: trunk/src/hid.h =================================================================== --- trunk/src/hid.h (revision 21898) +++ trunk/src/hid.h (revision 21899) @@ -375,8 +375,9 @@ non-zero if an error occurred (usually, this means the user cancelled the dialog or something). title is the title of the dialog box The HID may choose to ignore it or it may use it for a tooltip or - text in a dialog box, or a help string. */ - void *(*attr_dlg_new)(pcb_hid_attribute_t *attrs, int n_attrs, pcb_hid_attr_val_t *results, const char *title, void *caller_data, pcb_bool modal, void (*button_cb)(void *caller_data, pcb_hid_attr_ev_t ev)); /* returns hid_ctx */ + text in a dialog box, or a help string. Id is used in some events (e.g. + for window placement) and is strdup'd. */ + void *(*attr_dlg_new)(const char *id, pcb_hid_attribute_t *attrs, int n_attrs, pcb_hid_attr_val_t *results, const char *title, void *caller_data, pcb_bool modal, void (*button_cb)(void *caller_data, pcb_hid_attr_ev_t ev)); /* returns hid_ctx */ int (*attr_dlg_run)(void *hid_ctx); void (*attr_dlg_free)(void *hid_ctx); /* results_ is avalibale after this call */ @@ -565,7 +566,7 @@ /* non-zero if DAD dialogs are available currently */ #define PCB_HAVE_GUI_ATTR_DLG \ ((pcb_gui != NULL) && (pcb_gui->gui) && (pcb_gui->attr_dlg_new != NULL) && (pcb_gui->attr_dlg_new != pcb_nogui_attr_dlg_new)) -void *pcb_nogui_attr_dlg_new(pcb_hid_attribute_t *attrs_, int n_attrs_, pcb_hid_attr_val_t * results_, const char *title_, void *caller_data, pcb_bool modal, void (*button_cb)(void *caller_data, pcb_hid_attr_ev_t ev)); +void *pcb_nogui_attr_dlg_new(const char *id, pcb_hid_attribute_t *attrs_, int n_attrs_, pcb_hid_attr_val_t * results_, const char *title_, void *caller_data, pcb_bool modal, void (*button_cb)(void *caller_data, pcb_hid_attr_ev_t ev)); #endif Index: trunk/src/hid_attrib.c =================================================================== --- trunk/src/hid_attrib.c (revision 21898) +++ trunk/src/hid_attrib.c (revision 21899) @@ -326,7 +326,7 @@ return cnt; } -int pcb_attribute_dialog_(pcb_hid_attribute_t *attrs, int n_attrs, pcb_hid_attr_val_t *results, const char *title, void *caller_data, int *already_free) +int pcb_attribute_dialog_(const char *id, pcb_hid_attribute_t *attrs, int n_attrs, pcb_hid_attr_val_t *results, const char *title, void *caller_data, int *already_free) { int rv; void *hid_ctx; @@ -334,7 +334,7 @@ if ((pcb_gui == NULL) || (pcb_gui->attr_dlg_new == NULL)) return -1; - hid_ctx = pcb_gui->attr_dlg_new(attrs, n_attrs, results, title, caller_data, pcb_true, NULL); + hid_ctx = pcb_gui->attr_dlg_new(id, attrs, n_attrs, results, title, caller_data, pcb_true, NULL); rv = pcb_gui->attr_dlg_run(hid_ctx); if ((already_free == NULL) || (*already_free == 0)) pcb_gui->attr_dlg_free(hid_ctx); @@ -342,7 +342,7 @@ return rv ? 0 : 1; } -int pcb_attribute_dialog(pcb_hid_attribute_t *attrs, int n_attrs, pcb_hid_attr_val_t *results, const char *title, void *caller_data) +int pcb_attribute_dialog(const char *id, pcb_hid_attribute_t *attrs, int n_attrs, pcb_hid_attr_val_t *results, const char *title, void *caller_data) { - return pcb_attribute_dialog_(attrs, n_attrs, results, title, caller_data, NULL); + return pcb_attribute_dialog_(id, attrs, n_attrs, results, title, caller_data, NULL); } Index: trunk/src/hid_attrib.h =================================================================== --- trunk/src/hid_attrib.h (revision 21898) +++ trunk/src/hid_attrib.h (revision 21899) @@ -180,8 +180,8 @@ int pcb_hid_attrdlg_num_children(pcb_hid_attribute_t *attrs, int start_from, int n_attrs); /* Invoke a simple modal attribute dialog if GUI is available */ -int pcb_attribute_dialog_(pcb_hid_attribute_t *attrs, int n_attrs, pcb_hid_attr_val_t *results, const char *title, void *caller_data, int *already_freed); -int pcb_attribute_dialog(pcb_hid_attribute_t *attrs, int n_attrs, pcb_hid_attr_val_t *results, const char *title, void *caller_data); +int pcb_attribute_dialog_(const char *id, pcb_hid_attribute_t *attrs, int n_attrs, pcb_hid_attr_val_t *results, const char *title, void *caller_data, int *already_freed); +int pcb_attribute_dialog(const char *id, pcb_hid_attribute_t *attrs, int n_attrs, pcb_hid_attr_val_t *results, const char *title, void *caller_data); /* Convert between compflag bit value and name */ Index: trunk/src/hid_dad.h =================================================================== --- trunk/src/hid_dad.h (revision 21898) +++ trunk/src/hid_dad.h (revision 21899) @@ -70,24 +70,24 @@ table ## _ret_override.already_freed = 1; \ } while(0) -#define PCB_DAD_NEW(table, title, caller_data, modal, ev_cb) \ +#define PCB_DAD_NEW(id, table, title, caller_data, modal, ev_cb) \ do { \ if (table ## _result == NULL) \ PCB_DAD_ALLOC_RESULT(table); \ table ## _ret_override.already_freed = 0; \ - table ## _hid_ctx = pcb_gui->attr_dlg_new(table, table ## _len, table ## _result, title, caller_data, modal, ev_cb); \ + table ## _hid_ctx = pcb_gui->attr_dlg_new(id, table, table ## _len, table ## _result, title, caller_data, modal, ev_cb); \ } while(0) #define PCB_DAD_RUN(table) pcb_hid_dad_run(table ## _hid_ctx, &table ## _ret_override) /* failed is non-zero on cancel */ -#define PCB_DAD_AUTORUN(table, title, caller_data, failed) \ +#define PCB_DAD_AUTORUN(id, table, title, caller_data, failed) \ do { \ if (table ## _result == NULL) \ PCB_DAD_ALLOC_RESULT(table); \ table ## _ret_override.valid = 0; \ table ## _ret_override.already_freed = 0; \ - failed = pcb_attribute_dialog_(table, table ## _len, table ## _result, title, caller_data, &(table ## _ret_override.already_freed)); \ + failed = pcb_attribute_dialog_(id,table, table ## _len, table ## _result, title, caller_data, &(table ## _ret_override.already_freed)); \ if (table ## _ret_override.valid) \ failed = table ## _ret_override.value; \ table ## _ret_override.already_freed = 1; \ Index: trunk/src/hid_dlg.c =================================================================== --- trunk/src/hid_dlg.c (revision 21898) +++ trunk/src/hid_dlg.c (revision 21899) @@ -223,7 +223,7 @@ PCB_DAD_END(ctx.dlg); PCB_DAD_END(ctx.dlg); - PCB_DAD_NEW(ctx.dlg, "pcb-rnd progress", &ctx, pcb_false, progress_close_cb); + PCB_DAD_NEW("progress", ctx.dlg, "pcb-rnd progress", &ctx, pcb_false, progress_close_cb); active = 1; cancelled = 0; Index: trunk/src/hid_nogui.c =================================================================== --- trunk/src/hid_nogui.c (revision 21898) +++ trunk/src/hid_nogui.c (revision 21899) @@ -384,7 +384,7 @@ return pcb_strdup(answer); } -void *pcb_nogui_attr_dlg_new(pcb_hid_attribute_t *attrs_, int n_attrs_, pcb_hid_attr_val_t * results_, const char *title_, void *caller_data, pcb_bool modal, void (*button_cb)(void *caller_data, pcb_hid_attr_ev_t ev)) +void *pcb_nogui_attr_dlg_new(const char *id, pcb_hid_attribute_t *attrs_, int n_attrs_, pcb_hid_attr_val_t * results_, const char *title_, void *caller_data, pcb_bool modal, void (*button_cb)(void *caller_data, pcb_hid_attr_ev_t ev)) { CRASH("attr_dlg_new"); } Index: trunk/src/hid_nogui.h =================================================================== --- trunk/src/hid_nogui.h (revision 21898) +++ trunk/src/hid_nogui.h (revision 21899) @@ -5,7 +5,7 @@ pcb_hid_t *pcb_hid_nogui_get_hid(void); /* For checking if attr dialogs are not available: */ -void *pcb_nogui_attr_dlg_new(pcb_hid_attribute_t *attrs_, int n_attrs_, pcb_hid_attr_val_t * results_, const char *title_, void *caller_data, pcb_bool modal, void (*button_cb)(void *caller_data, pcb_hid_attr_ev_t ev)); +void *pcb_nogui_attr_dlg_new(const char *id, pcb_hid_attribute_t *attrs_, int n_attrs_, pcb_hid_attr_val_t * results_, const char *title_, void *caller_data, pcb_bool modal, void (*button_cb)(void *caller_data, pcb_hid_attr_ev_t ev)); int pcb_nogui_progress(long so_far, long total, const char *message); Index: trunk/src_plugins/asm/asm.c =================================================================== --- trunk/src_plugins/asm/asm.c (revision 21898) +++ trunk/src_plugins/asm/asm.c (revision 21899) @@ -560,7 +560,7 @@ PCB_DAD_END(asm_ctx.dlg); asm_ctx.active = 1; - PCB_DAD_NEW(asm_ctx.dlg, "Hand assembly with pcb-rnd", &asm_ctx, pcb_false, asm_close_cb); + PCB_DAD_NEW("asm", asm_ctx.dlg, "Hand assembly with pcb-rnd", &asm_ctx, pcb_false, asm_close_cb); /* expand all groups by default */ for(g = (group_t **)asm_ctx.grps.array, n = 0; n < asm_ctx.grps.used; g++,n++) Index: trunk/src_plugins/ddraft/constraint_gui.c =================================================================== --- trunk/src_plugins/ddraft/constraint_gui.c (revision 21898) +++ trunk/src_plugins/ddraft/constraint_gui.c (revision 21899) @@ -324,7 +324,7 @@ /* set up the context */ cnstgui_ctx.active = 1; - PCB_DAD_NEW(cnstgui_ctx.dlg, "Drawing constraints", &cnstgui_ctx, pcb_false, cnstgui_close_cb); + PCB_DAD_NEW("constraint", cnstgui_ctx.dlg, "Drawing constraints", &cnstgui_ctx, pcb_false, cnstgui_close_cb); cons_changed(); Index: trunk/src_plugins/dialogs/TEMPLATE.c =================================================================== --- trunk/src_plugins/dialogs/TEMPLATE.c (revision 21898) +++ trunk/src_plugins/dialogs/TEMPLATE.c (revision 21899) @@ -83,7 +83,7 @@ /* set up the context */ foo_ctx.active = 1; - PCB_DAD_NEW(foo_ctx.dlg, "EDIT THIS: title", &foo_ctx, pcb_false, foo_close_cb); + PCB_DAD_NEW("EDIT_THIS_ID", foo_ctx.dlg, "EDIT THIS: title", &foo_ctx, pcb_false, foo_close_cb); } static const char pcb_acts_Foo[] = "Foo(object)\n"; <<<- edit this Index: trunk/src_plugins/dialogs/TEMPLATE_MODAL.c =================================================================== --- trunk/src_plugins/dialogs/TEMPLATE_MODAL.c (revision 21898) +++ trunk/src_plugins/dialogs/TEMPLATE_MODAL.c (revision 21899) @@ -64,7 +64,7 @@ /* set up the context */ ctx.attrs = dlg; - PCB_DAD_NEW(dlg, "EDIT THIS: title", &ctx, pcb_true, NULL); + PCB_DAD_NEW("EDIT_THIS_ID", dlg, "EDIT THIS: title", &ctx, pcb_true, NULL); PCB_DAD_RUN(dlg); PCB_DAD_FREE(dlg); } Index: trunk/src_plugins/dialogs/act_dad.c =================================================================== --- trunk/src_plugins/dialogs/act_dad.c (revision 21898) +++ trunk/src_plugins/dialogs/act_dad.c (revision 21899) @@ -534,7 +534,7 @@ rv = -1; } else { - PCB_DAD_NEW(dad->dlg, txt, dad, (cmd[3] == '_'), dad_close_cb); + PCB_DAD_NEW(dlgname, dad->dlg, txt, dad, (cmd[3] == '_'), dad_close_cb); rv = PCB_DAD_CURRENT(dad->dlg); } } Index: trunk/src_plugins/dialogs/dlg_about.c =================================================================== --- trunk/src_plugins/dialogs/dlg_about.c (revision 21898) +++ trunk/src_plugins/dialogs/dlg_about.c (revision 21899) @@ -97,7 +97,7 @@ about_ctx.active = 1; /* this is the modal version - please consider using the non-modal version */ - PCB_DAD_NEW(about_ctx.dlg, "About pcb-rnd", &about_ctx, pcb_false, about_close_cb); + PCB_DAD_NEW("about", about_ctx.dlg, "About pcb-rnd", &about_ctx, pcb_false, about_close_cb); } static const char pcb_acts_About[] = "About()\n"; Index: trunk/src_plugins/dialogs/dlg_comm_m.c =================================================================== --- trunk/src_plugins/dialogs/dlg_comm_m.c (revision 21898) +++ trunk/src_plugins/dialogs/dlg_comm_m.c (revision 21899) @@ -51,7 +51,7 @@ PCB_DAD_BUTTON_CLOSES(dlg, clbtn); PCB_DAD_END(dlg); - PCB_DAD_NEW(dlg, title, NULL, pcb_true, NULL); + PCB_DAD_NEW("prompt_for", dlg, title, NULL, pcb_true, NULL); PCB_DAD_RUN(dlg); res->type = FGW_STR | FGW_DYN; @@ -99,7 +99,7 @@ PCB_DAD_END(dlg); res->type = FGW_INT; - PCB_DAD_AUTORUN(dlg, title, NULL, res->val.nat_int); + PCB_DAD_AUTORUN("message", dlg, title, NULL, res->val.nat_int); PCB_DAD_FREE(dlg); return 0; Index: trunk/src_plugins/dialogs/dlg_export.c =================================================================== --- trunk/src_plugins/dialogs/dlg_export.c (revision 21898) +++ trunk/src_plugins/dialogs/dlg_export.c (revision 21899) @@ -181,7 +181,7 @@ /* set up the context */ export_ctx.active = 1; - PCB_DAD_NEW(export_ctx.dlg, title, &export_ctx, pcb_false, export_close_cb); + PCB_DAD_NEW("export", export_ctx.dlg, title, &export_ctx, pcb_false, export_close_cb); } static const char pcb_acts_ExportGUI[] = "ExportGUI()\n"; Index: trunk/src_plugins/dialogs/dlg_flag_edit.c =================================================================== --- trunk/src_plugins/dialogs/dlg_flag_edit.c (revision 21898) +++ trunk/src_plugins/dialogs/dlg_flag_edit.c (revision 21899) @@ -134,7 +134,7 @@ ctx.attrs = dlg; - PCB_DAD_NEW(dlg, "Edit flags", &ctx, pcb_true, NULL); + PCB_DAD_NEW("flags", dlg, "Edit flags", &ctx, pcb_true, NULL); val.func = fe_attr_chg; pcb_gui->attr_dlg_property(dlg_hid_ctx, PCB_HATP_GLOBAL_CALLBACK, &val); Index: trunk/src_plugins/dialogs/dlg_fontsel.c =================================================================== --- trunk/src_plugins/dialogs/dlg_fontsel.c (revision 21898) +++ trunk/src_plugins/dialogs/dlg_fontsel.c (revision 21899) @@ -128,7 +128,7 @@ PCB_DAD_END(fontsel_ctx.dlg); fontsel_ctx.active = 1; - PCB_DAD_NEW(fontsel_ctx.dlg, "Font selection", &fontsel_ctx, pcb_true, fontsel_close_cb); + PCB_DAD_NEW("fontsel", fontsel_ctx.dlg, "Font selection", &fontsel_ctx, pcb_true, fontsel_close_cb); } static const char pcb_acts_Fontsel[] = "Fontsel2()\n"; Index: trunk/src_plugins/dialogs/dlg_layer_binding.c =================================================================== --- trunk/src_plugins/dialogs/dlg_layer_binding.c (revision 21898) +++ trunk/src_plugins/dialogs/dlg_layer_binding.c (revision 21899) @@ -348,7 +348,7 @@ ctx.attrs = dlg; - PCB_DAD_NEW(dlg, "Layer bindings", &ctx, pcb_true, NULL); + PCB_DAD_NEW("layer_binding", dlg, "Layer bindings", &ctx, pcb_true, NULL); val.func = lb_attr_chg; pcb_gui->attr_dlg_property(dlg_hid_ctx, PCB_HATP_GLOBAL_CALLBACK, &val); lb_data2dialog(dlg_hid_ctx, &ctx); Index: trunk/src_plugins/dialogs/dlg_layer_flags.c =================================================================== --- trunk/src_plugins/dialogs/dlg_layer_flags.c (revision 21898) +++ trunk/src_plugins/dialogs/dlg_layer_flags.c (revision 21899) @@ -21,7 +21,7 @@ attr[1].default_val.int_value = ly->comb & PCB_LYC_SUB; attr[2].default_val.int_value = ly->comb & PCB_LYC_AUTO; - ar = pcb_attribute_dialog(attr,sizeof(attr)/sizeof(attr[0]), rv, "Edit the properties of a logical layer", NULL); + ar = pcb_attribute_dialog("layer_prop", attr,sizeof(attr)/sizeof(attr[0]), rv, "Edit the properties of a logical layer", NULL); if (ar == 0) { pcb_layer_combining_t comb = 0; @@ -92,7 +92,7 @@ } orig_loc = attr[3].default_val.int_value; - ar = pcb_attribute_dialog(attr, sizeof(attr)/sizeof(attr[0]) - omit_loc, rv, "Edit the properties of a layer group (physical layer)", NULL); + ar = pcb_attribute_dialog("layer_grp_prop", attr, sizeof(attr)/sizeof(attr[0]) - omit_loc, rv, "Edit the properties of a layer group (physical layer)", NULL); if (ar == 0) { if (strcmp(g->name, attr[0].default_val.str_value) != 0) { Index: trunk/src_plugins/dialogs/dlg_lib_pstk.c =================================================================== --- trunk/src_plugins/dialogs/dlg_lib_pstk.c (revision 21898) +++ trunk/src_plugins/dialogs/dlg_lib_pstk.c (revision 21899) @@ -572,7 +572,7 @@ else name = pcb_strdup("pcb-rnd padstacks - board"); - PCB_DAD_NEW(ctx->dlg, name, ctx, modal, pstklib_close_cb); + PCB_DAD_NEW("pstk_lib", ctx->dlg, name, ctx, modal, pstklib_close_cb); pstklib_data2dlg(ctx); free(name); Index: trunk/src_plugins/dialogs/dlg_padstack.c =================================================================== --- trunk/src_plugins/dialogs/dlg_padstack.c (revision 21898) +++ trunk/src_plugins/dialogs/dlg_padstack.c (revision 21899) @@ -571,7 +571,7 @@ PCB_DAD_BUTTON_CLOSES(dlg, clbtn); PCB_DAD_END(dlg); - PCB_DAD_NEW(dlg, "Edit padstack shape", pse, pcb_true, NULL); + PCB_DAD_NEW("padstack_shape", dlg, "Edit padstack shape", pse, pcb_true, NULL); pse->shape_chg = dlg; /* pse_ps2dlg(dlg_hid_ctx, pse);*/ @@ -857,7 +857,7 @@ PCB_DAD_BUTTON_CLOSES(dlg, clbtn); PCB_DAD_END(dlg); - PCB_DAD_NEW(dlg, "Edit padstack", pse, pcb_true, NULL); + PCB_DAD_NEW("padstack", dlg, "Edit padstack", pse, pcb_true, NULL); pse->attrs = dlg; pse_ps2dlg(dlg_hid_ctx, pse); if (target_tab > 0) Index: trunk/src_plugins/dialogs/dlg_pinout.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pinout.c (revision 21898) +++ trunk/src_plugins/dialogs/dlg_pinout.c (revision 21899) @@ -166,7 +166,7 @@ sprintf(title, "Subcircuit #%ld (%s) pinout", sc->ID, sc->refdes); else sprintf(title, "Subcircuit #%ld pinout", sc->ID); - PCB_DAD_NEW(ctx->dlg, title, ctx, pcb_false, pinout_close_cb); + PCB_DAD_NEW("pinout", ctx->dlg, title, ctx, pcb_false, pinout_close_cb); } static const char pcb_acts_Pinout[] = "Pinout()\n"; Index: trunk/src_plugins/dialogs/dlg_plugins.c =================================================================== --- trunk/src_plugins/dialogs/dlg_plugins.c (revision 21898) +++ trunk/src_plugins/dialogs/dlg_plugins.c (revision 21899) @@ -79,7 +79,7 @@ PCB_DAD_BUTTON_CLOSES(dlg, clbtn); PCB_DAD_END(dlg); - PCB_DAD_NEW(dlg, "Manage plugins", NULL, pcb_true, NULL); + PCB_DAD_NEW("plugins", dlg, "Manage plugins", NULL, pcb_true, NULL); PCB_DAD_RUN(dlg); PCB_DAD_FREE(dlg); Index: trunk/src_plugins/dialogs/dlg_pref.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref.c (revision 21898) +++ trunk/src_plugins/dialogs/dlg_pref.c (revision 21899) @@ -308,7 +308,7 @@ /* set up the context */ pref_ctx.active = 1; - PCB_DAD_NEW(pref_ctx.dlg, "pcb-rnd preferences", &pref_ctx, pcb_false, pref_close_cb); + PCB_DAD_NEW("preferences", pref_ctx.dlg, "pcb-rnd preferences", &pref_ctx, pcb_false, pref_close_cb); PCB_DAD_SET_VALUE(pref_ctx.dlg_hid_ctx, pref_ctx.wrole, int_value, 2); pref_ctx.role = CFR_DESIGN; Index: trunk/src_plugins/dialogs/dlg_pref_confedit.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_confedit.c (revision 21898) +++ trunk/src_plugins/dialogs/dlg_pref_confedit.c (revision 21899) @@ -338,7 +338,7 @@ PCB_DAD_BUTTON_CLOSES(ctx->dlg, clbtn); PCB_DAD_END(ctx->dlg); - PCB_DAD_NEW(ctx->dlg, "pcb-rnd conf item", ctx, pcb_false, pref_conf_edit_close_cb); + PCB_DAD_NEW("pref_confedit", ctx->dlg, "pcb-rnd conf item", ctx, pcb_false, pref_conf_edit_close_cb); if (is_read_only(ctx)) { int n; Index: trunk/src_plugins/dialogs/dlg_pref_lib.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_lib.c (revision 21898) +++ trunk/src_plugins/dialogs/dlg_pref_lib.c (revision 21899) @@ -262,7 +262,7 @@ PCB_DAD_BUTTON_CLOSES(ctx.dlg, clbtn); PCB_DAD_END(ctx.dlg); - PCB_DAD_NEW(ctx.dlg, "Edit library path", &ctx, pcb_true, NULL); + PCB_DAD_NEW("pref_lib_path", ctx.dlg, "Edit library path", &ctx, pcb_true, NULL); if (PCB_DAD_RUN(ctx.dlg) != 0) { PCB_DAD_FREE(ctx.dlg); return -1; @@ -364,7 +364,7 @@ PCB_DAD_END(ctx->dlg); ctx->active = 1; - PCB_DAD_NEW(ctx->dlg, "pcb-rnd preferences: library help", ctx, pcb_false, pref_libhelp_close_cb); + PCB_DAD_NEW("pref_lib_path_help", ctx->dlg, "pcb-rnd preferences: library help", ctx, pcb_false, pref_libhelp_close_cb); } static void libhelp_btn(void *hid_ctx, void *caller_data, pcb_hid_attribute_t *attr) Index: trunk/src_plugins/dialogs/dlg_test.c =================================================================== --- trunk/src_plugins/dialogs/dlg_test.c (revision 21898) +++ trunk/src_plugins/dialogs/dlg_test.c (revision 21899) @@ -193,7 +193,7 @@ PCB_DAD_BUTTON_CLOSES(ctx.dlg, clbtn); PCB_DAD_END(ctx.dlg); - PCB_DAD_AUTORUN(ctx.dlg, "attribute dialog test", &ctx, failed); + PCB_DAD_AUTORUN("dlg_test", ctx.dlg, "attribute dialog test", &ctx, failed); if (failed) pcb_message(PCB_MSG_WARNING, "Test dialog cancelled"); Index: trunk/src_plugins/dialogs/dlg_undo.c =================================================================== --- trunk/src_plugins/dialogs/dlg_undo.c (revision 21898) +++ trunk/src_plugins/dialogs/dlg_undo.c (revision 21899) @@ -144,7 +144,7 @@ /* set up the context */ undo_ctx.active = 1; - PCB_DAD_NEW(undo_ctx.dlg, "pcb-rnd undo list", &undo_ctx, pcb_false, undo_close_cb); + PCB_DAD_NEW("undo", undo_ctx.dlg, "pcb-rnd undo list", &undo_ctx, pcb_false, undo_close_cb); undo_data2dlg(&undo_ctx); } Index: trunk/src_plugins/dialogs/dlg_view.c =================================================================== --- trunk/src_plugins/dialogs/dlg_view.c (revision 21898) +++ trunk/src_plugins/dialogs/dlg_view.c (revision 21899) @@ -567,7 +567,7 @@ } -static void pcb_dlg_view_full(view_ctx_t *ctx, const char *title) +static void pcb_dlg_view_full(const char *id, view_ctx_t *ctx, const char *title) { const char *hdr[] = { "ID", "title", NULL }; @@ -638,12 +638,12 @@ PCB_DAD_END(ctx->dlg); PCB_DAD_END(ctx->dlg); - PCB_DAD_NEW(ctx->dlg, title, ctx, pcb_false, view_close_cb); + PCB_DAD_NEW(id, ctx->dlg, title, ctx, pcb_false, view_close_cb); ctx->active = 1; } -static void pcb_dlg_view_simplified(view_ctx_t *ctx, const char *title) +static void pcb_dlg_view_simplified(const char *id, view_ctx_t *ctx, const char *title) { pcb_view_t *v; @@ -696,7 +696,7 @@ PCB_DAD_END(ctx->dlg); - PCB_DAD_NEW(ctx->dlg, title, ctx, pcb_false, view_close_cb); + PCB_DAD_NEW(id, ctx->dlg, title, ctx, pcb_false, view_close_cb); ctx->active = 1; @@ -730,9 +730,9 @@ drc_gui_ctx.refresh = drc_refresh; pcb_drc_all(); if (pcb_strcasecmp(dlg_type, "simple") == 0) - pcb_dlg_view_simplified(&drc_gui_ctx, "DRC violations"); + pcb_dlg_view_simplified("drc_simple", &drc_gui_ctx, "DRC violations"); else - pcb_dlg_view_full(&drc_gui_ctx, "DRC violations"); + pcb_dlg_view_full("drc_full", &drc_gui_ctx, "DRC violations"); } view2dlg(&drc_gui_ctx); @@ -754,9 +754,9 @@ io_gui_ctx.lst = &pcb_io_incompat_lst; io_gui_ctx.refresh = NULL; if (pcb_strcasecmp(dlg_type, "simple") == 0) - pcb_dlg_view_simplified(&io_gui_ctx, "IO incompatibilities in last save"); + pcb_dlg_view_simplified("io_incompat_simple", &io_gui_ctx, "IO incompatibilities in last save"); else - pcb_dlg_view_full(&io_gui_ctx, "IO incompatibilities in last save"); + pcb_dlg_view_full("io_incompat_full", &io_gui_ctx, "IO incompatibilities in last save"); } view2dlg(&io_gui_ctx); Index: trunk/src_plugins/export_openems/mesh.c =================================================================== --- trunk/src_plugins/export_openems/mesh.c (revision 21898) +++ trunk/src_plugins/export_openems/mesh.c (revision 21899) @@ -880,7 +880,7 @@ PCB_DAD_BUTTON_CLOSES(ia.dlg, clbtn); PCB_DAD_END(ia.dlg); - PCB_DAD_NEW(ia.dlg, "mesher", &ia, 0, ia_close_cb); + PCB_DAD_NEW("mesh", ia.dlg, "mesher", &ia, 0, ia_close_cb); PCB_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.dens_obj, coord_value, PCB_MM_TO_COORD(0.15)); PCB_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.dens_gap, coord_value, PCB_MM_TO_COORD(0.5)); Index: trunk/src_plugins/export_ps/ps.c =================================================================== --- trunk/src_plugins/export_ps/ps.c (revision 21898) +++ trunk/src_plugins/export_ps/ps.c (revision 21899) @@ -1461,7 +1461,7 @@ ps_calib_attribute_list[0].default_val.str_value = pcb_strdup("lpr"); } - if (pcb_attribute_dialog(ps_calib_attribute_list, 1, vals, _("Print Calibration Page"), NULL)) + if (pcb_attribute_dialog("ps_calibrate", ps_calib_attribute_list, 1, vals, _("Print Calibration Page"), NULL)) return; if (use_command || strchr(vals[0].str_value, '|')) { Index: trunk/src_plugins/extedit/extedit_dad.c =================================================================== --- trunk/src_plugins/extedit/extedit_dad.c (revision 21898) +++ trunk/src_plugins/extedit/extedit_dad.c (revision 21899) @@ -123,7 +123,7 @@ PCB_DAD_BUTTON_CLOSES(ee.dlg, clbtn); PCB_DAD_END(ee.dlg); - PCB_DAD_NEW(ee.dlg, "External editor", &ee, pcb_true, NULL); + PCB_DAD_NEW("extedit", ee.dlg, "External editor", &ee, pcb_true, NULL); ee_data2dialog(&ee); res = PCB_DAD_RUN(ee.dlg); Index: trunk/src_plugins/hid_lesstif/dialogs.c =================================================================== --- trunk/src_plugins/hid_lesstif/dialogs.c (revision 21898) +++ trunk/src_plugins/hid_lesstif/dialogs.c (revision 21899) @@ -860,7 +860,7 @@ XtDestroyWidget(w); } -void *lesstif_attr_dlg_new(pcb_hid_attribute_t *attrs, int n_attrs, pcb_hid_attr_val_t *results, const char *title, void *caller_data, pcb_bool modal, void (*button_cb)(void *caller_data, pcb_hid_attr_ev_t ev)) +void *lesstif_attr_dlg_new(const char *id, pcb_hid_attribute_t *attrs, int n_attrs, pcb_hid_attr_val_t *results, const char *title, void *caller_data, pcb_bool modal, void (*button_cb)(void *caller_data, pcb_hid_attr_ev_t ev)) { Widget topform, main_tbl; int i; @@ -922,7 +922,7 @@ stdarg(XmNminHeight, ctx->minh); XtSetValues(XtParent(ctx->dialog), stdarg_args, stdarg_n); - pcb_event(PCB_EVENT_DAD_NEW_DIALOG, "ps", ctx, "TODO"); + pcb_event(PCB_EVENT_DAD_NEW_DIALOG, "ps", ctx, id); if (!modal) XtManageChild(ctx->dialog); Index: trunk/src_plugins/hid_lesstif/main.c =================================================================== --- trunk/src_plugins/hid_lesstif/main.c (revision 21898) +++ trunk/src_plugins/hid_lesstif/main.c (revision 21899) @@ -3430,7 +3430,7 @@ extern void lesstif_logv(enum pcb_message_level level, const char *fmt, va_list ap); -extern void *lesstif_attr_dlg_new(pcb_hid_attribute_t *attrs_, int n_attrs_, pcb_hid_attr_val_t *results_, const char *title_, void *caller_data, pcb_bool modal, void (*button_cb)(void *caller_data, pcb_hid_attr_ev_t ev)); +extern void *lesstif_attr_dlg_new(const char *id, pcb_hid_attribute_t *attrs_, int n_attrs_, pcb_hid_attr_val_t *results_, const char *title_, void *caller_data, pcb_bool modal, void (*button_cb)(void *caller_data, pcb_hid_attr_ev_t ev)); extern int lesstif_attr_dlg_run(void *hid_ctx); extern void lesstif_attr_dlg_free(void *hid_ctx); Index: trunk/src_plugins/hid_remote/remote.c =================================================================== --- trunk/src_plugins/hid_remote/remote.c (revision 21898) +++ trunk/src_plugins/hid_remote/remote.c (revision 21899) @@ -351,7 +351,7 @@ { } -static void *remote_attr_dlg_new(pcb_hid_attribute_t *attrs_, int n_attrs_, pcb_hid_attr_val_t * results_, const char *title_, void *caller_data, pcb_bool modal, void (*button_cb)(void *caller_data, pcb_hid_attr_ev_t ev)) +static void *remote_attr_dlg_new(const char *id, pcb_hid_attribute_t *attrs_, int n_attrs_, pcb_hid_attr_val_t * results_, const char *title_, void *caller_data, pcb_bool modal, void (*button_cb)(void *caller_data, pcb_hid_attr_ev_t ev)) { return NULL; } Index: trunk/src_plugins/lib_gtk_common/dlg_attribute.c =================================================================== --- trunk/src_plugins/lib_gtk_common/dlg_attribute.c (revision 21898) +++ trunk/src_plugins/lib_gtk_common/dlg_attribute.c (revision 21899) @@ -751,7 +751,7 @@ return 1; } -void *ghid_attr_dlg_new(pcb_gtk_common_t *com, pcb_hid_attribute_t *attrs, int n_attrs, pcb_hid_attr_val_t *results, const char *title, void *caller_data, pcb_bool modal, void (*button_cb)(void *caller_data, pcb_hid_attr_ev_t ev)) +void *ghid_attr_dlg_new(pcb_gtk_common_t *com, const char *id, pcb_hid_attribute_t *attrs, int n_attrs, pcb_hid_attr_val_t *results, const char *title, void *caller_data, pcb_bool modal, void (*button_cb)(void *caller_data, pcb_hid_attr_ev_t ev)) { GtkWidget *content_area; GtkWidget *main_vbox; @@ -789,7 +789,7 @@ force_label = !PCB_HATT_IS_COMPOSITE(attrs[0].type); ghid_attr_dlg_add(ctx, main_vbox, NULL, 0, (attrs[0].pcb_hatt_flags & PCB_HATF_LABEL) || force_label); - pcb_event(PCB_EVENT_DAD_NEW_DIALOG, "ps", ctx, "TODO"); + pcb_event(PCB_EVENT_DAD_NEW_DIALOG, "ps", ctx, id); gtk_widget_show_all(ctx->dialog); Index: trunk/src_plugins/lib_gtk_common/dlg_attribute.h =================================================================== --- trunk/src_plugins/lib_gtk_common/dlg_attribute.h (revision 21898) +++ trunk/src_plugins/lib_gtk_common/dlg_attribute.h (revision 21899) @@ -2,7 +2,7 @@ #include "hid.h" #include "glue.h" -void *ghid_attr_dlg_new(pcb_gtk_common_t *com, pcb_hid_attribute_t *attrs, int n_attrs, pcb_hid_attr_val_t *results, const char *title, void *caller_data, pcb_bool modal, void (*button_cb)(void *caller_data, pcb_hid_attr_ev_t ev)); +void *ghid_attr_dlg_new(pcb_gtk_common_t *com, const char *id, pcb_hid_attribute_t *attrs, int n_attrs, pcb_hid_attr_val_t *results, const char *title, void *caller_data, pcb_bool modal, void (*button_cb)(void *caller_data, pcb_hid_attr_ev_t ev)); int ghid_attr_dlg_run(void *hid_ctx); void ghid_attr_dlg_free(void *hid_ctx); void ghid_attr_dlg_property(void *hid_ctx, pcb_hat_property_t prop, const pcb_hid_attr_val_t *val); Index: trunk/src_plugins/lib_gtk_common/dlg_library_param.c =================================================================== --- trunk/src_plugins/lib_gtk_common/dlg_library_param.c (revision 21898) +++ trunk/src_plugins/lib_gtk_common/dlg_library_param.c (revision 21899) @@ -453,7 +453,7 @@ if (dirty) /* had to replace the filter text, make it effective */ attr_change_cb(NULL, NULL, &attrs[0]); - if (pcb_attribute_dialog(attrs, numattr, res, descr, NULL) == 0) + if (pcb_attribute_dialog("lib_param", attrs, numattr, res, descr, NULL) == 0) sres = gen_cmd(entry->name, attrs, res, numattr, ctx.first_optional); else sres = NULL; /* cancel */ Index: trunk/src_plugins/lib_gtk_hid/glue_hid.c =================================================================== --- trunk/src_plugins/lib_gtk_hid/glue_hid.c (revision 21898) +++ trunk/src_plugins/lib_gtk_hid/glue_hid.c (revision 21899) @@ -337,9 +337,9 @@ return pcb_gtk_fileselect(ghid_port.top_window, title, descr, default_file, default_ext, history_tag, flags); } -static void *ghid_attr_dlg_new_(pcb_hid_attribute_t *attrs, int n_attrs, pcb_hid_attr_val_t *results, const char *title, void *caller_data, pcb_bool modal, void (*button_cb)(void *caller_data, pcb_hid_attr_ev_t ev)) +static void *ghid_attr_dlg_new_(const char *id, pcb_hid_attribute_t *attrs, int n_attrs, pcb_hid_attr_val_t *results, const char *title, void *caller_data, pcb_bool modal, void (*button_cb)(void *caller_data, pcb_hid_attr_ev_t ev)) { - return ghid_attr_dlg_new(&ghidgui->common, attrs, n_attrs, results, title, caller_data, modal, button_cb); + return ghid_attr_dlg_new(&ghidgui->common, id, attrs, n_attrs, results, title, caller_data, modal, button_cb); } static void ghid_beep() Index: trunk/src_plugins/lib_polyhelp/polyhelp.c =================================================================== --- trunk/src_plugins/lib_polyhelp/polyhelp.c (revision 21898) +++ trunk/src_plugins/lib_polyhelp/polyhelp.c (revision 21899) @@ -409,7 +409,7 @@ attrs[4].type = PCB_HATT_BOOL; attrs[4].default_val.int_value = results[4].int_value; - if (pcb_attribute_dialog(attrs, nattr, results, "Polygon hatch", NULL) != 0) + if (pcb_attribute_dialog("poly_hatch", attrs, nattr, results, "Polygon hatch", NULL) != 0) return 1; period = results[0].coord_value; Index: trunk/src_plugins/report/report.c =================================================================== --- trunk/src_plugins/report/report.c (revision 21898) +++ trunk/src_plugins/report/report.c (revision 21899) @@ -96,7 +96,7 @@ PCB_DAD_BUTTON_CLOSES(ctx->dlg, clbtn); PCB_DAD_END(ctx->dlg); - PCB_DAD_NEW(ctx->dlg, name, ctx, pcb_false, rdialog_close_cb); + PCB_DAD_NEW("report", ctx->dlg, name, ctx, pcb_false, rdialog_close_cb); } Index: trunk/src_plugins/script/script_act.c =================================================================== --- trunk/src_plugins/script/script_act.c (revision 21898) +++ trunk/src_plugins/script/script_act.c (revision 21899) @@ -197,7 +197,7 @@ PCB_DAD_END(idlang.dlg); - PCB_DAD_AUTORUN(idlang.dlg, "load script", NULL, failed); + PCB_DAD_AUTORUN("script_load", idlang.dlg, "load script", NULL, failed); if ((!failed) && (script_load(idlang.dlg_result[idlang.wid].str_value, fn, idlang.dlg_result[idlang.wlang].str_value) == 0)) script_dlg_s2d(ctx); @@ -250,7 +250,7 @@ /* set up the context */ script_dlg.active = 1; - PCB_DAD_NEW(script_dlg.dlg, "pcb-rnd Scripts", &script_dlg, pcb_false, script_dlg_close_cb); + PCB_DAD_NEW("scripts", script_dlg.dlg, "pcb-rnd Scripts", &script_dlg, pcb_false, script_dlg_close_cb); script_dlg_s2d(&script_dlg); } Index: trunk/src_plugins/shape/shape_dialog.c =================================================================== --- trunk/src_plugins/shape/shape_dialog.c (revision 21898) +++ trunk/src_plugins/shape/shape_dialog.c (revision 21899) @@ -343,7 +343,7 @@ PCB_DAD_BUTTON_CLOSES(shp->dlg, clbtn); PCB_DAD_END(shp->dlg); - PCB_DAD_NEW(shp->dlg, "dlg_shape", shp, modal, shp_close_cb); + PCB_DAD_NEW("shape", shp->dlg, "dlg_shape", shp, modal, shp_close_cb); PCB_DAD_SET_VALUE(shp->dlg_hid_ctx, shp->dia, coord_value, PCB_MM_TO_COORD(25.4)); /* suppress a runtime warning on invalid dia (zero) */ shp_chg_circle(shp->dlg_hid_ctx, shp, NULL); shp_chg_roundrect(shp->dlg_hid_ctx, shp, NULL);