load_schematic(): do not invoke trim_wires (if enabled) if called non interactively with reset_undo == 0 (it will change name of top schematic in tab and window title while netlisting)

This commit is contained in:
stefan schippers 2024-12-16 16:44:56 +01:00
parent 5bc194f3a5
commit 158ed8decc
2 changed files with 6 additions and 3 deletions

View File

@ -207,6 +207,7 @@ int set_modify(int mod)
tclvareval("wm title ", top_path, " \"xschem - [file tail [xschem get schname]]\"", NULL);
tclvareval("wm iconname ", top_path, " \"xschem - [file tail [xschem get schname]]\"", NULL);
}
dbg(1, "modified=%d, schname=%s\n", xctx->modified, xctx->current_name);
if(xctx->modified) tcleval("set_tab_names *");
else tcleval("set_tab_names");
}

View File

@ -3397,8 +3397,10 @@ int load_schematic(int load_symbols, const char *fname, int reset_undo, int aler
xctx->prep_net_structs=0;
xctx->prep_hash_inst=0;
xctx->prep_hash_wires=0;
if(reset_undo) xctx->clear_undo();
if(reset_undo) xctx->prev_set_modify = -1; /* will force set_modify(0) to set window title */
if(reset_undo) {
xctx->clear_undo();
xctx->prev_set_modify = -1; /* will force set_modify(0) to set window title */
}
else xctx->prev_set_modify = 0; /* will prevent set_modify(0) from setting window title */
if(fname && fname[0]) {
int generator = 0;
@ -3527,7 +3529,7 @@ int load_schematic(int load_symbols, const char *fname, int reset_undo, int aler
if(reset_undo) set_modify(0);
}
check_collapsing_objects();
if(tclgetboolvar("autotrim_wires")) trim_wires();
if(reset_undo && tclgetboolvar("autotrim_wires")) trim_wires();
update_conn_cues(WIRELAYER, 0, 0);
if(xctx->hilight_nets && load_symbols) {
propagate_hilights(1, 1, XINSERT_NOREPLACE);