Skip to content

Commit d92f2ae

Browse files
committed
Merge branch 'tb/remove_save_dialogs_on_codebrowser_closing'
* tb/remove_save_dialogs_on_codebrowser_closing: Recreate global string for search box on panel initialization Move panel uninitialization IgorBeforeQuitHook: Make it work
2 parents 77ff5b1 + d95bcd7 commit d92f2ae

File tree

1 file changed

+26
-10
lines changed

1 file changed

+26
-10
lines changed

procedures/CodeBrowser_hooks.ipf

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,32 @@
66
// This file was created by () byte physics Thomas Braun, [email protected]
77
// (c) 2013
88

9-
static Function IgorBeforeQuitHook(igorApplicationNameStr)
10-
string igorApplicationNameStr
9+
static Function IgorBeforeQuitHook(unsavedExp, unsavedNotebooks, unsavedProcedures)
10+
variable unsavedExp, unsavedNotebooks, unsavedProcedures
11+
12+
string expName
1113

1214
preparePanelClose()
15+
markAsUnInitialized()
16+
17+
if(unsavedExp || unsavedNotebooks || unsavedProcedures)
18+
return 0
19+
endif
20+
21+
expName = IgorInfo(1)
22+
23+
if(!cmpstr(expName, "Untitled"))
24+
return 0
25+
endif
26+
27+
// experiment saved and pxp still exists -> silently save it
28+
// does not support unpacked experiments
29+
GetFileFolderInfo/P=home/Q/Z expName + ".pxp"
30+
if(!V_Flag)
31+
SaveExperiment
32+
return 1
33+
endif
34+
1335
return 0
1436
End
1537

@@ -20,14 +42,6 @@ static Function IgorBeforeNewHook(igorApplicationNameStr)
2042
return 0
2143
End
2244

23-
static Function BeforeExperimentSaveHook(rN,fileName,path,type,creator,kind)
24-
Variable rN,kind
25-
String fileName,path,type,creator
26-
27-
markAsUnInitialized()
28-
return 0
29-
End
30-
3145
Function initializePanel()
3246

3347
debugprint("called")
@@ -41,6 +55,8 @@ Function initializePanel()
4155
debugPrint("AfterCompiledHook: " + S_info)
4256

4357
updatePanel()
58+
59+
setGlobalStr("search","")
4460
End
4561

4662
// Prepare for panel closing, must be called before the panel is killed or the experiment closed

0 commit comments

Comments
 (0)