Index: trunk/doc-rnd/conf/sources.html =================================================================== --- trunk/doc-rnd/conf/sources.html (revision 2037) +++ trunk/doc-rnd/conf/sources.html (revision 2038) @@ -21,32 +21,38 @@ recommended should hold system and installation specific settigns, e.g. path to the system-wise installed footprint library + default.pcb + 300 + /usr/share/pcb-rnd/default.pcb + deprecated + pcb editable defaults + user - 300 + 400 ~/.pcb-rnd/pcb-conf.lht recommended store user preferences, user's common footprint lib path, etc; this is the first file the user can modify (even from the GUI) environment - 400 + 500 environment variables (TODO) occassional inject the same (temporary) settings in multiple pcb-rnd sessions without having to change config files project - 500 + 600 projdect.lht in the project directory optional local project settings - useful for large projects with multiple design (.pcb) files design - 600 + 700 saved in the design (.pcb) file optional, common per design deviation from the user+system config cli - 700 + 800 command line argument occassional inject/change a setting for a single session; useful in batch/automated processing Index: trunk/src/buffer.c =================================================================== --- trunk/src/buffer.c (revision 2037) +++ trunk/src/buffer.c (revision 2038) @@ -778,7 +778,7 @@ PCBTypePtr newPCB = CreateNewPCB(); /* new data isn't added to the undo list */ - if (!ParsePCB(newPCB, Filename, 0)) { + if (!ParsePCB(newPCB, Filename, CFR_invalid)) { /* clear data area and replace pointer */ ClearBuffer(Buffer); free(Buffer->Data); Index: trunk/src/conf.c =================================================================== --- trunk/src/conf.c (revision 2037) +++ trunk/src/conf.c (revision 2038) @@ -37,13 +37,14 @@ int conf_root_lock[CFR_max]; htsp_t *conf_fields = NULL; static const int conf_default_prio[] = { -/* CFR_INTERNAL */ 100, -/* CFR_SYSTEM */ 200, -/* CFR_USER */ 300, -/* CFR_ENV */ 400, -/* CFR_PROJECT */ 500, -/* CFR_DESIGN */ 600, -/* CFR_CLI */ 700 +/* CFR_INTERNAL */ 100, +/* CFR_SYSTEM */ 200, +/* CFR_DEFAULTPCB */ 300, +/* CFR_USER */ 400, +/* CFR_ENV */ 500, +/* CFR_PROJECT */ 600, +/* CFR_DESIGN */ 700, +/* CFR_CLI */ 800 }; extern const char *conf_internal; @@ -149,12 +150,14 @@ conf_role_t conf_role_parse(const char *s) { - if (strcasecmp(s, "system") == 0) return CFR_SYSTEM; - if (strcasecmp(s, "user") == 0) return CFR_USER; - if (strcasecmp(s, "project") == 0) return CFR_PROJECT; - if (strcasecmp(s, "design") == 0) return CFR_DESIGN; - if (strcasecmp(s, "cli") == 0) return CFR_CLI; - return POL_invalid; + if (strcasecmp(s, "internal") == 0) return CFR_INTERNAL; + if (strcasecmp(s, "system") == 0) return CFR_SYSTEM; + if (strcasecmp(s, "defaultpcb") == 0) return CFR_DEFAULTPCB; + if (strcasecmp(s, "user") == 0) return CFR_USER; + if (strcasecmp(s, "project") == 0) return CFR_PROJECT; + if (strcasecmp(s, "design") == 0) return CFR_DESIGN; + if (strcasecmp(s, "cli") == 0) return CFR_CLI; + return CFR_invalid; } Index: trunk/src/conf.h =================================================================== --- trunk/src/conf.h (revision 2037) +++ trunk/src/conf.h (revision 2038) @@ -117,11 +117,12 @@ typedef enum { CFR_INTERNAL, CFR_SYSTEM, + CFR_DEFAULTPCB, /* default.pcb */ CFR_USER, - CFR_ENV, /* env vars */ - CFR_PROJECT, /* project specific, from a local file */ - CFR_DESIGN, /* from the design file */ - CFR_CLI, /* from the command line */ + CFR_ENV, /* env vars */ + CFR_PROJECT, /* project specific, from a local file */ + CFR_DESIGN, /* from the design file */ + CFR_CLI, /* from the command line */ CFR_max, CFR_invalid = CFR_max } conf_role_t; Index: trunk/src/create.c =================================================================== --- trunk/src/create.c (revision 2037) +++ trunk/src/create.c (revision 2038) @@ -176,7 +176,7 @@ PCB = NULL; dpcb = -1; - conf_list_foreach_path_first(dpcb, &conf_core.rc.default_pcb_file, LoadPCB(__path__, false, true)); + conf_list_foreach_path_first(dpcb, &conf_core.rc.default_pcb_file, LoadPCB(__path__, false, 1)); if (dpcb == 0) { nw = PCB; Index: trunk/src/file_act.c =================================================================== --- trunk/src/file_act.c (revision 2037) +++ trunk/src/file_act.c (revision 2038) @@ -133,7 +133,7 @@ else if (strcasecmp(function, "Layout") == 0) { if (!PCB->Changed || gui->confirm_dialog(_("OK to override layout data?"), 0)) - LoadPCB(name, true, false); + LoadPCB(name, true, 0); } else if (strcasecmp(function, "Netlist") == 0) { Index: trunk/src/main.c =================================================================== --- trunk/src/main.c (revision 2037) +++ trunk/src/main.c (revision 2038) @@ -464,7 +464,7 @@ /* keep filename even if initial load command failed; * file might not exist */ - if (LoadPCB(command_line_pcb, true, false)) + if (LoadPCB(command_line_pcb, true, 0)) PCB->Filename = strdup(command_line_pcb); } Index: trunk/src/plug_io.c =================================================================== --- trunk/src/plug_io.c (revision 2037) +++ trunk/src/plug_io.c (revision 2038) @@ -195,12 +195,13 @@ * If revert is true, we pass "revert" as a parameter * to the HID's PCBChanged action. */ -int real_load_pcb(char *Filename, bool revert, bool require_font, bool is_misc) +static int real_load_pcb(char *Filename, bool revert, bool require_font, int how) { const char *unit_suffix; char *new_filename; PCBTypePtr newPCB = CreateNewPCB_(false); PCBTypePtr oldPCB; + conf_role_t settings_dest; #ifdef DEBUG double elapsed; clock_t start, end; @@ -216,14 +217,21 @@ /* mark the default font invalid to know if the file has one */ newPCB->Font.Valid = false; + switch(how) { + case 0: settings_dest = CFR_DESIGN; break; + case 1: settings_dest = CFR_DEFAULTPCB; break; + case 2: settings_dest = CFR_invalid; break; + default: abort(); + } + /* new data isn't added to the undo list */ - if (!ParsePCB(PCB, new_filename, !is_misc)) { + if (!ParsePCB(PCB, new_filename, settings_dest)) { RemovePCB(oldPCB); CreateNewPCBPost(PCB, 0); ResetStackAndVisibility(); - if (!is_misc) { + if (how == 0) { /* update cursor location */ Crosshair.X = PCB_CLAMP(PCB->CursorX, 0, PCB->MaxWidth); Crosshair.Y = PCB_CLAMP(PCB->CursorY, 0, PCB->MaxHeight); @@ -249,7 +257,7 @@ if (unit_suffix && *unit_suffix) { const Unit *new_unit = get_unit_struct(unit_suffix); if (new_unit) - conf_set(CFR_DESIGN, "editor/grid_unit", -1, unit_suffix, POL_OVERWRITE); + conf_set(settings_dest, "editor/grid_unit", -1, unit_suffix, POL_OVERWRITE); } AttributePut(PCB, "PCB::grid::unit", conf_core.editor.grid_unit->suffix); @@ -258,7 +266,7 @@ set_some_route_style(); - if (!is_misc) { + if (how == 0) { if (revert) hid_actionl("PCBChanged", "revert", NULL); else @@ -486,9 +494,9 @@ /* --------------------------------------------------------------------------- * Load PCB */ -int LoadPCB(char *file, bool require_font, bool is_misc) +int LoadPCB(char *file, bool require_font, int how) { - return real_load_pcb(file, false, require_font, is_misc); + return real_load_pcb(file, false, require_font, how); } /* --------------------------------------------------------------------------- Index: trunk/src/plug_io.h =================================================================== --- trunk/src/plug_io.h (revision 2037) +++ trunk/src/plug_io.h (revision 2038) @@ -29,6 +29,7 @@ #define PCB_PLUG_IO_H #include "global.h" +#include "conf.h" /**************************** API definition *********************************/ struct plug_io_s { @@ -36,9 +37,10 @@ void *plugin_data; /* Attempt to load a pcb design from Filename to Ptr. - If load_settings is non-zero, CRF_DESIGN is replaced by settings loaded from the file. + Conf subtree at settings_dest is replaced by settings loaded from the + file unless it's CFR_invalid. Return 0 on success. */ - int (*parse_pcb)(plug_io_t *ctx, PCBTypePtr Ptr, char *Filename, int load_settings); + int (*parse_pcb)(plug_io_t *ctx, PCBTypePtr Ptr, char *Filename, conf_role_t settings_dest); /* Attempt to load an element from Filename to Ptr. Return 0 on success. */ int (*parse_element)(plug_io_t *ctx, DataTypePtr Ptr, const char *name); @@ -73,7 +75,7 @@ FILE *CheckAndOpenFile(char *, bool, bool, bool *, bool *); FILE *OpenConnectionDataFile(void); int SavePCB(char *); -int LoadPCB(char *, bool, bool); +int LoadPCB(char *, bool, int how); /* how: 0=normal pcb; 1=default.pcb, 2=misc (do not load settings) */ void EnableAutosave(void); void Backup(void); void SaveInTMP(void); @@ -88,9 +90,7 @@ void set_some_route_style(); int WritePCBFile(char *); int WritePipe(char *, bool); -int real_load_pcb(char *Filename, bool revert, bool require_font, bool is_misc); - #ifndef HAS_ATEXIT #ifdef HAS_ON_EXIT void GlueEmergencySave(int, caddr_t); Index: trunk/src_plugins/io_pcb/parse_l.c =================================================================== --- trunk/src_plugins/io_pcb/parse_l.c (revision 2037) +++ trunk/src_plugins/io_pcb/parse_l.c (revision 2038) @@ -698,7 +698,7 @@ DataTypePtr yyData; ElementTypePtr yyElement; FontTypePtr yyFont; -int yyLoadSettings; +conf_role_t yy_settings_dest; FlagType yy_pcb_flags; static int parse_number (void); @@ -2442,7 +2442,7 @@ int ret; fp_fopen_ctx_t st; - yyLoadSettings = 0; + yy_settings_dest = CFR_invalid; yyPCB = NULL; yyData = Ptr; yyFont = &PCB->Font; @@ -2482,7 +2482,7 @@ conf_set(target, path, arr_idx, new_val, pol); \ } while(0) \ -int io_pcb_ParsePCB(plug_io_t *ctx, PCBTypePtr Ptr, char *Filename, int load_settings) +int io_pcb_ParsePCB(plug_io_t *ctx, PCBTypePtr Ptr, char *Filename, conf_role_t settings_dest) { int retval; yyPCB = Ptr; @@ -2489,37 +2489,37 @@ yyData = NULL; yyFont = NULL; yyElement = NULL; - yyLoadSettings = load_settings; - if (load_settings) - conf_reset(CFR_DESIGN, Filename); + yy_settings_dest = settings_dest; + if (settings_dest != CFR_invalid) + conf_reset(settings_dest, Filename); setlocale(LC_ALL, "C"); /* make sure numerics are read predictably */ retval = Parse(NULL, conf_core.rc.file_command, conf_core.rc.file_path, Filename, NULL); setlocale(LC_ALL, ""); - if (load_settings) { + if (settings_dest != CFR_invalid) { /* overwrite settings from the flags, mark them not-to-save */ - CONF_SET(CFR_DESIGN, "plugins/mincut/enable", -1, CONF_BOOL_FLAG(ENABLEMINCUTFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/show_number", -1, CONF_BOOL_FLAG(SHOWNUMBERFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/show_drc", -1, CONF_BOOL_FLAG(SHOWDRCFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/rubber_band_mode", -1, CONF_BOOL_FLAG(RUBBERBANDFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/auto_drc", -1, CONF_BOOL_FLAG(AUTODRCFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/all_direction_lines", -1, CONF_BOOL_FLAG(ALLDIRECTIONFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/swap_start_direction", -1, CONF_BOOL_FLAG(SWAPSTARTDIRFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/unique_names", -1, CONF_BOOL_FLAG(UNIQUENAMEFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/clear_line", -1, CONF_BOOL_FLAG(CLEARNEWFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/full_poly", -1, CONF_BOOL_FLAG(NEWFULLPOLYFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/snap_pin", -1, CONF_BOOL_FLAG(SNAPPINFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/orthogonal_moves", -1, CONF_BOOL_FLAG(ORTHOMOVEFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/live_routing", -1, CONF_BOOL_FLAG(LIVEROUTEFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/lock_names", -1, CONF_BOOL_FLAG(LOCKNAMESFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/only_names", -1, CONF_BOOL_FLAG(ONLYNAMESFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/hide_names", -1, CONF_BOOL_FLAG(HIDENAMESFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/thin_draw", -1, CONF_BOOL_FLAG(THINDRAWFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/thin_draw_poly", -1, CONF_BOOL_FLAG(THINDRAWPOLYFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/local_ref", -1, CONF_BOOL_FLAG(LOCALREFFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/check_planes", -1, CONF_BOOL_FLAG(CHECKPLANESFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/description", -1, CONF_BOOL_FLAG(DESCRIPTIONFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/name_on_pcb", -1, CONF_BOOL_FLAG(NAMEONPCBFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/show_mask", -1, CONF_BOOL_FLAG(SHOWMASKFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "plugins/mincut/enable", -1, CONF_BOOL_FLAG(ENABLEMINCUTFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/show_number", -1, CONF_BOOL_FLAG(SHOWNUMBERFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/show_drc", -1, CONF_BOOL_FLAG(SHOWDRCFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/rubber_band_mode", -1, CONF_BOOL_FLAG(RUBBERBANDFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/auto_drc", -1, CONF_BOOL_FLAG(AUTODRCFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/all_direction_lines", -1, CONF_BOOL_FLAG(ALLDIRECTIONFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/swap_start_direction", -1, CONF_BOOL_FLAG(SWAPSTARTDIRFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/unique_names", -1, CONF_BOOL_FLAG(UNIQUENAMEFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/clear_line", -1, CONF_BOOL_FLAG(CLEARNEWFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/full_poly", -1, CONF_BOOL_FLAG(NEWFULLPOLYFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/snap_pin", -1, CONF_BOOL_FLAG(SNAPPINFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/orthogonal_moves", -1, CONF_BOOL_FLAG(ORTHOMOVEFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/live_routing", -1, CONF_BOOL_FLAG(LIVEROUTEFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/lock_names", -1, CONF_BOOL_FLAG(LOCKNAMESFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/only_names", -1, CONF_BOOL_FLAG(ONLYNAMESFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/hide_names", -1, CONF_BOOL_FLAG(HIDENAMESFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/thin_draw", -1, CONF_BOOL_FLAG(THINDRAWFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/thin_draw_poly", -1, CONF_BOOL_FLAG(THINDRAWPOLYFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/local_ref", -1, CONF_BOOL_FLAG(LOCALREFFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/check_planes", -1, CONF_BOOL_FLAG(CHECKPLANESFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/description", -1, CONF_BOOL_FLAG(DESCRIPTIONFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/name_on_pcb", -1, CONF_BOOL_FLAG(NAMEONPCBFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/show_mask", -1, CONF_BOOL_FLAG(SHOWMASKFLAG, yy_pcb_flags), POL_OVERWRITE); /* don't save this because it is saved manually as PCB::grid::unit */ CONF_NO_ATTRIB("editor/grid_unit"); @@ -2546,7 +2546,7 @@ yyFont = Ptr; yyElement = NULL; - yyLoadSettings = 0; + yy_settings_dest = CFR_invalid; r = Parse(NULL, conf_core.rc.font_command, NULL, Filename, NULL); if (r == 0) { #ifdef DEBUG Index: trunk/src_plugins/io_pcb/parse_l.h =================================================================== --- trunk/src_plugins/io_pcb/parse_l.h (revision 2037) +++ trunk/src_plugins/io_pcb/parse_l.h (revision 2038) @@ -34,7 +34,7 @@ #include "global.h" #include "plug_io.h" -int io_pcb_ParsePCB(plug_io_t *ctx, PCBTypePtr, char *, int load_settings); +int io_pcb_ParsePCB(plug_io_t *ctx, PCBTypePtr Ptr, char *Filename, conf_role_t settings_dest); int io_pcb_ParseElement(plug_io_t *ctx, DataTypePtr, const char *); int io_pcb_ParseFont(plug_io_t *ctx, FontTypePtr, char *); Index: trunk/src_plugins/io_pcb/parse_l.l =================================================================== --- trunk/src_plugins/io_pcb/parse_l.l (revision 2037) +++ trunk/src_plugins/io_pcb/parse_l.l (revision 2038) @@ -81,7 +81,7 @@ DataTypePtr yyData; ElementTypePtr yyElement; FontTypePtr yyFont; -int yyLoadSettings; +conf_role_t yy_settings_dest; FlagType yy_pcb_flags; static int parse_number (void); @@ -323,7 +323,7 @@ int ret; fp_fopen_ctx_t st; - yyLoadSettings = 0; + yy_settings_dest = CFR_invalid; yyPCB = NULL; yyData = Ptr; yyFont = &PCB->Font; @@ -363,7 +363,7 @@ conf_set(target, path, arr_idx, new_val, pol); \ } while(0) \ -int io_pcb_ParsePCB(plug_io_t *ctx, PCBTypePtr Ptr, char *Filename, int load_settings) +int io_pcb_ParsePCB(plug_io_t *ctx, PCBTypePtr Ptr, char *Filename, conf_role_t settings_dest) { int retval; yyPCB = Ptr; @@ -370,37 +370,37 @@ yyData = NULL; yyFont = NULL; yyElement = NULL; - yyLoadSettings = load_settings; - if (load_settings) - conf_reset(CFR_DESIGN, Filename); + yy_settings_dest = settings_dest; + if (settings_dest != CFR_invalid) + conf_reset(settings_dest, Filename); setlocale(LC_ALL, "C"); /* make sure numerics are read predictably */ retval = Parse(NULL, conf_core.rc.file_command, conf_core.rc.file_path, Filename, NULL); setlocale(LC_ALL, ""); - if (load_settings) { + if (settings_dest != CFR_invalid) { /* overwrite settings from the flags, mark them not-to-save */ - CONF_SET(CFR_DESIGN, "plugins/mincut/enable", -1, CONF_BOOL_FLAG(ENABLEMINCUTFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/show_number", -1, CONF_BOOL_FLAG(SHOWNUMBERFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/show_drc", -1, CONF_BOOL_FLAG(SHOWDRCFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/rubber_band_mode", -1, CONF_BOOL_FLAG(RUBBERBANDFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/auto_drc", -1, CONF_BOOL_FLAG(AUTODRCFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/all_direction_lines", -1, CONF_BOOL_FLAG(ALLDIRECTIONFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/swap_start_direction", -1, CONF_BOOL_FLAG(SWAPSTARTDIRFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/unique_names", -1, CONF_BOOL_FLAG(UNIQUENAMEFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/clear_line", -1, CONF_BOOL_FLAG(CLEARNEWFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/full_poly", -1, CONF_BOOL_FLAG(NEWFULLPOLYFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/snap_pin", -1, CONF_BOOL_FLAG(SNAPPINFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/orthogonal_moves", -1, CONF_BOOL_FLAG(ORTHOMOVEFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/live_routing", -1, CONF_BOOL_FLAG(LIVEROUTEFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/lock_names", -1, CONF_BOOL_FLAG(LOCKNAMESFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/only_names", -1, CONF_BOOL_FLAG(ONLYNAMESFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/hide_names", -1, CONF_BOOL_FLAG(HIDENAMESFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/thin_draw", -1, CONF_BOOL_FLAG(THINDRAWFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/thin_draw_poly", -1, CONF_BOOL_FLAG(THINDRAWPOLYFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/local_ref", -1, CONF_BOOL_FLAG(LOCALREFFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/check_planes", -1, CONF_BOOL_FLAG(CHECKPLANESFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/description", -1, CONF_BOOL_FLAG(DESCRIPTIONFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/name_on_pcb", -1, CONF_BOOL_FLAG(NAMEONPCBFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(CFR_DESIGN, "editor/show_mask", -1, CONF_BOOL_FLAG(SHOWMASKFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "plugins/mincut/enable", -1, CONF_BOOL_FLAG(ENABLEMINCUTFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/show_number", -1, CONF_BOOL_FLAG(SHOWNUMBERFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/show_drc", -1, CONF_BOOL_FLAG(SHOWDRCFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/rubber_band_mode", -1, CONF_BOOL_FLAG(RUBBERBANDFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/auto_drc", -1, CONF_BOOL_FLAG(AUTODRCFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/all_direction_lines", -1, CONF_BOOL_FLAG(ALLDIRECTIONFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/swap_start_direction", -1, CONF_BOOL_FLAG(SWAPSTARTDIRFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/unique_names", -1, CONF_BOOL_FLAG(UNIQUENAMEFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/clear_line", -1, CONF_BOOL_FLAG(CLEARNEWFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/full_poly", -1, CONF_BOOL_FLAG(NEWFULLPOLYFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/snap_pin", -1, CONF_BOOL_FLAG(SNAPPINFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/orthogonal_moves", -1, CONF_BOOL_FLAG(ORTHOMOVEFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/live_routing", -1, CONF_BOOL_FLAG(LIVEROUTEFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/lock_names", -1, CONF_BOOL_FLAG(LOCKNAMESFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/only_names", -1, CONF_BOOL_FLAG(ONLYNAMESFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/hide_names", -1, CONF_BOOL_FLAG(HIDENAMESFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/thin_draw", -1, CONF_BOOL_FLAG(THINDRAWFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/thin_draw_poly", -1, CONF_BOOL_FLAG(THINDRAWPOLYFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/local_ref", -1, CONF_BOOL_FLAG(LOCALREFFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/check_planes", -1, CONF_BOOL_FLAG(CHECKPLANESFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/description", -1, CONF_BOOL_FLAG(DESCRIPTIONFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/name_on_pcb", -1, CONF_BOOL_FLAG(NAMEONPCBFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/show_mask", -1, CONF_BOOL_FLAG(SHOWMASKFLAG, yy_pcb_flags), POL_OVERWRITE); /* don't save this because it is saved manually as PCB::grid::unit */ CONF_NO_ATTRIB("editor/grid_unit"); @@ -427,7 +427,7 @@ yyFont = Ptr; yyElement = NULL; - yyLoadSettings = 0; + yy_settings_dest = CFR_invalid; r = Parse(NULL, conf_core.rc.font_command, NULL, Filename, NULL); if (r == 0) { #ifdef DEBUG Index: trunk/src_plugins/io_pcb/parse_y.c =================================================================== --- trunk/src_plugins/io_pcb/parse_y.c (revision 2037) +++ trunk/src_plugins/io_pcb/parse_y.c (revision 2038) @@ -133,7 +133,7 @@ extern FontTypePtr yyFont; extern int yylineno; /* linenumber */ extern char *yyfilename; /* in this file */ -extern int yyLoadSettings; +extern conf_role_t yy_settings_dest; extern FlagType yy_pcb_flags; static char *layer_group_string; @@ -1812,8 +1812,8 @@ { PCBTypePtr pcb_save = PCB; - if (yyLoadSettings && (layer_group_string == NULL)) - conf_set(CFR_DESIGN, "design/groups", -1, conf_core.design.groups, POL_OVERWRITE); + if ((yy_settings_dest != CFR_invalid) && (layer_group_string == NULL)) + conf_set(yy_settings_dest, "design/groups", -1, conf_core.design.groups, POL_OVERWRITE); CreateNewPCBPost (yyPCB, 0); if (ParseGroupString(layer_group_string, &yyPCB->LayerGroups, yyData->LayerN)) { @@ -1957,11 +1957,11 @@ yyPCB->Grid = OU ((yyvsp[-4].measure)); yyPCB->GridOffsetX = OU ((yyvsp[-3].measure)); yyPCB->GridOffsetY = OU ((yyvsp[-2].measure)); - if (yyLoadSettings) { + if (yy_settings_dest != CFR_invalid) { if ((yyvsp[-1].integer)) - conf_set(CFR_DESIGN, "editor/draw_grid", -1, "true", POL_OVERWRITE); + conf_set(yy_settings_dest, "editor/draw_grid", -1, "true", POL_OVERWRITE); else - conf_set(CFR_DESIGN, "editor/draw_grid", -1, "false", POL_OVERWRITE); + conf_set(yy_settings_dest, "editor/draw_grid", -1, "false", POL_OVERWRITE); } } #line 1968 "parse_y.tab.c" /* yacc.c:1646 */ @@ -1973,11 +1973,11 @@ yyPCB->Grid = NU ((yyvsp[-4].measure)); yyPCB->GridOffsetX = NU ((yyvsp[-3].measure)); yyPCB->GridOffsetY = NU ((yyvsp[-2].measure)); - if (yyLoadSettings) { + if (yy_settings_dest != CFR_invalid) { if ((yyvsp[-1].integer)) - conf_set(CFR_DESIGN, "editor/draw_grid", -1, "true", POL_OVERWRITE); + conf_set(yy_settings_dest, "editor/draw_grid", -1, "true", POL_OVERWRITE); else - conf_set(CFR_DESIGN, "editor/draw_grid", -1, "false", POL_OVERWRITE); + conf_set(yy_settings_dest, "editor/draw_grid", -1, "false", POL_OVERWRITE); } } #line 1984 "parse_y.tab.c" /* yacc.c:1646 */ Index: trunk/src_plugins/io_pcb/parse_y.y =================================================================== --- trunk/src_plugins/io_pcb/parse_y.y (revision 2037) +++ trunk/src_plugins/io_pcb/parse_y.y (revision 2038) @@ -78,7 +78,7 @@ extern FontTypePtr yyFont; extern int yylineno; /* linenumber */ extern char *yyfilename; /* in this file */ -extern int yyLoadSettings; +extern conf_role_t yy_settings_dest; extern FlagType yy_pcb_flags; static char *layer_group_string; @@ -203,8 +203,8 @@ { PCBTypePtr pcb_save = PCB; - if (yyLoadSettings && (layer_group_string == NULL)) - conf_set(CFR_DESIGN, "design/groups", -1, conf_core.design.groups, POL_OVERWRITE); + if ((yy_settings_dest != CFR_invalid) && (layer_group_string == NULL)) + conf_set(yy_settings_dest, "design/groups", -1, conf_core.design.groups, POL_OVERWRITE); CreateNewPCBPost (yyPCB, 0); if (ParseGroupString(layer_group_string, &yyPCB->LayerGroups, yyData->LayerN)) { @@ -391,11 +391,11 @@ yyPCB->Grid = OU ($3); yyPCB->GridOffsetX = OU ($4); yyPCB->GridOffsetY = OU ($5); - if (yyLoadSettings) { + if (yy_settings_dest != CFR_invalid) { if ($6) - conf_set(CFR_DESIGN, "editor/draw_grid", -1, "true", POL_OVERWRITE); + conf_set(yy_settings_dest, "editor/draw_grid", -1, "true", POL_OVERWRITE); else - conf_set(CFR_DESIGN, "editor/draw_grid", -1, "false", POL_OVERWRITE); + conf_set(yy_settings_dest, "editor/draw_grid", -1, "false", POL_OVERWRITE); } } ; @@ -406,11 +406,11 @@ yyPCB->Grid = NU ($3); yyPCB->GridOffsetX = NU ($4); yyPCB->GridOffsetY = NU ($5); - if (yyLoadSettings) { + if (yy_settings_dest != CFR_invalid) { if ($6) - conf_set(CFR_DESIGN, "editor/draw_grid", -1, "true", POL_OVERWRITE); + conf_set(yy_settings_dest, "editor/draw_grid", -1, "true", POL_OVERWRITE); else - conf_set(CFR_DESIGN, "editor/draw_grid", -1, "false", POL_OVERWRITE); + conf_set(yy_settings_dest, "editor/draw_grid", -1, "false", POL_OVERWRITE); } } ; Index: trunk/src_plugins/shand_cmd/command.c =================================================================== --- trunk/src_plugins/shand_cmd/command.c (revision 2037) +++ trunk/src_plugins/shand_cmd/command.c (revision 2038) @@ -131,7 +131,7 @@ } if (!PCB->Changed || gui->confirm_dialog("OK to override layout data?", 0)) - LoadPCB(filename, true, false); + LoadPCB(filename, true, 0); free(name); return (0); }