Index: trunk/src/gui_act.c =================================================================== --- trunk/src/gui_act.c (revision 16515) +++ trunk/src/gui_act.c (revision 16516) @@ -1379,7 +1379,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_gui->attribute_dialog(attr,sizeof(attr)/sizeof(attr[0]), rv, "Edit layer properties", "Edit the properties of a logical layer", NULL); + ar = pcb_attribute_dialog(attr,sizeof(attr)/sizeof(attr[0]), rv, "Edit layer properties", "Edit the properties of a logical layer", NULL); if (ar == 0) { pcb_layer_combining_t comb = 0; @@ -1494,7 +1494,7 @@ attr[0].default_val.str_value = pcb_strdup(g->name); - ar = pcb_gui->attribute_dialog(attr,sizeof(attr)/sizeof(attr[0]), rv, "Edit layer properties", "Edit the properties of a logical layer", NULL); + ar = pcb_attribute_dialog(attr,sizeof(attr)/sizeof(attr[0]), rv, "Edit layer properties", "Edit the properties of a logical layer", NULL); if (ar == 0) { if (strcmp(g->name, attr[0].default_val.str_value) != 0) { Index: trunk/src/hid_attrib.c =================================================================== --- trunk/src/hid_attrib.c (revision 16515) +++ trunk/src/hid_attrib.c (revision 16516) @@ -261,3 +261,10 @@ } return cnt; } + +int pcb_attribute_dialog(pcb_hid_attribute_t *attrs, int n_attrs, pcb_hid_attr_val_t *results, const char *title, const char *descr, void *caller_data) +{ + if ((pcb_gui == NULL) || (pcb_gui->attribute_dialog == NULL)) + return -1; + return pcb_gui->attribute_dialog(attrs, n_attrs, results, title, descr, caller_data); +} \ No newline at end of file Index: trunk/src/hid_attrib.h =================================================================== --- trunk/src/hid_attrib.h (revision 16515) +++ trunk/src/hid_attrib.h (revision 16516) @@ -113,4 +113,7 @@ /* Count the number of direct children, start_from the first children */ 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, const char *descr, void *caller_data); + #endif Index: trunk/src/hid_dad.h =================================================================== --- trunk/src/hid_dad.h (revision 16515) +++ trunk/src/hid_dad.h (revision 16516) @@ -74,7 +74,7 @@ do { \ if (table ## _result == NULL) \ PCB_DAD_ALLOC_RESULT(table); \ - pcb_gui->attribute_dialog(table, table ## _len, table ## _result, title, descr, caller_data); \ + pcb_attribute_dialog(table, table ## _len, table ## _result, title, descr, caller_data); \ } while(0) /* Return the index of the item currenty being edited */ Index: trunk/src_plugins/export_ps/ps.c =================================================================== --- trunk/src_plugins/export_ps/ps.c (revision 16515) +++ trunk/src_plugins/export_ps/ps.c (revision 16516) @@ -1523,7 +1523,7 @@ ps_calib_attribute_list[0].default_val.str_value = pcb_strdup("lpr"); } - if (pcb_gui->attribute_dialog(ps_calib_attribute_list, 1, vals, _("Print Calibration Page"), _("Generates a printer calibration page"), NULL)) + if (pcb_attribute_dialog(ps_calib_attribute_list, 1, vals, _("Print Calibration Page"), _("Generates a printer calibration page"), NULL)) return; if (use_command || strchr(vals[0].str_value, '|')) { Index: trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/dialogs/dialogs.c =================================================================== --- trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/dialogs/dialogs.c (revision 16515) +++ trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/dialogs/dialogs.c (revision 16516) @@ -87,5 +87,5 @@ else hid->result = calloc(sizeof(pcb_hid_attribute_t), hid->attr_num); - return pcb_gui->attribute_dialog(hid->attr, hid->attr_num, hid->result, title, descr, NULL); + return pcb_attribute_dialog(hid->attr, hid->attr_num, hid->result, title, descr, NULL); } Index: trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/manage_scripts.c =================================================================== --- trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/manage_scripts.c (revision 16515) +++ trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/manage_scripts.c (revision 16516) @@ -68,7 +68,7 @@ if (operations != NULL) attr_make_enum(&attr[1], "operation", "Choose what to do with the script", operations, *operation); - res = pcb_gui->attribute_dialog(attr, 1 + (operations != NULL), result, "GPMI manage scripts - select script", "Select one of the scripts already loaded", NULL); + res = pcb_attribute_dialog(attr, 1 + (operations != NULL), result, "GPMI manage scripts - select script", "Select one of the scripts already loaded", NULL); /* free scrl slots before return */ for(s = scrl; *s != NULL; s++) @@ -149,7 +149,7 @@ attr_make_enum(&attr[0], "module", "Select a GPMI module to interpret the script", modules, default_mod); - if (pcb_gui->attribute_dialog(attr, 1, result, "GPMI manage scripts - select module", "Select one of GPMI modules to interpret the script", NULL)) + if (pcb_attribute_dialog(attr, 1, result, "GPMI manage scripts - select module", "Select one of GPMI modules to interpret the script", NULL)) return NULL; if (result[0].int_value < 0) @@ -173,7 +173,7 @@ attr_make_label_str(&attr[0], "File name: ", i->name, "File name of the script (if not absolute, it's relative to the config file)"); attr_make_label_str(&attr[1], "GPMI module: ", i->module_name, "Name of the GPMI module that is interpreting the script"); attr_make_label_str(&attr[2], "Config file: ", cf, "Name of config file that requested the script to be loaded "); - pcb_gui->attribute_dialog(attr, 3, result, "GPMI manage scripts - script details", "Displaying detailed info on a script already loaded", NULL); + pcb_attribute_dialog(attr, 3, result, "GPMI manage scripts - script details", "Displaying detailed info on a script already loaded", NULL); free((char *)attr[0].name); free((char *)attr[1].name); free((char *)attr[2].name); Index: trunk/src_plugins/hid_lesstif/dialogs.c =================================================================== --- trunk/src_plugins/hid_lesstif/dialogs.c (revision 16515) +++ trunk/src_plugins/hid_lesstif/dialogs.c (revision 16516) @@ -1391,7 +1391,7 @@ { pcb_hid_t *printer = pcb_hid_find_printer(); printer->calibrate(0.0, 0.0); - if (pcb_gui->attribute_dialog(printer_calibrate_attrs, 3, + if (pcb_attribute_dialog(printer_calibrate_attrs, 3, printer_calibrate_values, "Printer Calibration Values", "Enter calibration values for your printer", NULL)) return 1; Index: trunk/src_plugins/lib_gtk_common/act_print.c =================================================================== --- trunk/src_plugins/lib_gtk_common/act_print.c (revision 16515) +++ trunk/src_plugins/lib_gtk_common/act_print.c (revision 16516) @@ -95,7 +95,7 @@ pcb_hid_t *printer = pcb_hid_find_printer(); printer->calibrate(0.0, 0.0); - if (pcb_gui->attribute_dialog(printer_calibrate_attrs, 3, + if (pcb_attribute_dialog(printer_calibrate_attrs, 3, printer_calibrate_values, _("Printer Calibration Values"), _("Enter calibration values for your printer"), NULL)) return 1; Index: trunk/src_plugins/lib_polyhelp/polyhelp.c =================================================================== --- trunk/src_plugins/lib_polyhelp/polyhelp.c (revision 16515) +++ trunk/src_plugins/lib_polyhelp/polyhelp.c (revision 16516) @@ -405,7 +405,7 @@ attrs[4].type = PCB_HATT_BOOL; attrs[4].default_val.int_value = results[4].int_value; - if (pcb_gui->attribute_dialog(attrs, nattr, results, "Polygon hatch", "Hatch a polygon", NULL) != 0) + if (pcb_attribute_dialog(attrs, nattr, results, "Polygon hatch", "Hatch a polygon", NULL) != 0) return 1; period = results[0].coord_value;