add tcl in addition to sch and sym in default search filter in load_file_dialog

This commit is contained in:
stefan schippers 2024-03-01 00:29:23 +01:00
parent 1cb94bedd6
commit 263b72de03
5 changed files with 4 additions and 6 deletions

View File

@ -594,7 +594,7 @@ void ask_new_file(void)
if(xctx->modified) {
if(save(1) == -1 ) return; /* user cancels save, so do nothing. */
}
tcleval("load_file_dialog {Load file} *.\\{sch,sym\\} INITIALLOADDIR");
tcleval("load_file_dialog {Load file} *.\\{sch,sym,tcl\\} INITIALLOADDIR");
my_snprintf(f, S(f),"%s", tclresult());
if(f[0]) {
char win_path[WINDOW_PATH_SIZE];
@ -2119,7 +2119,6 @@ int descend_schematic(int instnumber, int fallback, int alert)
my_strncpy(filename, xctx->sch[xctx->currsch], S(filename));
my_snprintf(cmd, S(cmd), "save_file_dialog {Save file} * INITIALLOADDIR {%s}", filename);
/* my_snprintf(cmd, S(cmd), "save_file_dialog {Save file} *.\\{sch,sym\\} INITIALLOADDIR {%s}", filename); */
tcleval(cmd);
my_strncpy(res, tclresult(), S(res));
if(!res[0]) return 0;

View File

@ -311,7 +311,6 @@ void merge_file(int selection_load, const char ext[])
if(selection_load==0)
{
if(!strcmp(ext,"")) {
/* my_snprintf(tmp, S(tmp), "load_file_dialog {Merge file} *.\\{sch,sym\\} INITIALLOADDIR"); */
my_snprintf(tmp, S(tmp), "load_file_dialog {Merge file} {} INITIALLOADDIR");
tcleval(tmp);
if(!strcmp(tclresult(),"")) return;

View File

@ -2537,7 +2537,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
tcleval(f);
my_strncpy(f, abs_sym_path(tclresult(), ""), S(f));
} else {
tcleval("load_file_dialog {Load file} *.\\{sch,sym\\} INITIALLOADDIR");
tcleval("load_file_dialog {Load file} *.\\{sch,sym,tcl\\} INITIALLOADDIR");
if(tclresult()[0]) {
my_snprintf(f, S(f), "%s", tclresult());
} else {

View File

@ -735,7 +735,7 @@ int compare_schematics(const char *f)
dbg(1, "compare_schematics(): xctx->sch_to_compare=%s\n", xctx->sch_to_compare);
/* set filename of schematic to compare */
if(f == NULL) {
tcleval("load_file_dialog {Schematic to compare with} *.\\{sch,sym\\} INITIALLOADDIR");
tcleval("load_file_dialog {Schematic to compare with} *.\\{sch,sym,tcl\\} INITIALLOADDIR");
if(tclresult()[0]) my_strncpy(xctx->sch_to_compare, tclresult(), S(xctx->sch_to_compare));
else my_strncpy(xctx->sch_to_compare, "", S(xctx->sch_to_compare));
} else if(f[0] != '\0') {

View File

@ -3793,7 +3793,7 @@ proc load_file_dialog {{msg {}} {ext {}} {global_initdir {INITIALINSTDIR}}
label .load.buttons_bot.label -text { File:}
entry .load.buttons_bot.entry -highlightcolor red -highlightthickness 2
label .load.buttons_bot.srclab -text { Search:}
entry .load.buttons_bot.src -width 12 -highlightcolor red -highlightthickness 2
entry .load.buttons_bot.src -width 18 -highlightcolor red -highlightthickness 2
.load.buttons_bot.src delete 0 end
.load.buttons_bot.src insert 0 $file_dialog_globfilter
if { $file_dialog_save_initialfile ne {} } {