Skip to content

Commit 9ba295b

Browse files
committed
IgorBeforeQuitHook: Make it work
The signature of IgorBeforeQuitHook was wrong and therefore the function got never called by Igor Pro. Additionally we want to suppress save dialogs if this is possible in a safe way.
1 parent 77ff5b1 commit 9ba295b

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

procedures/CodeBrowser_hooks.ipf

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,31 @@
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+
16+
if(unsavedExp || unsavedNotebooks || unsavedProcedures)
17+
return 0
18+
endif
19+
20+
expName = IgorInfo(1)
21+
22+
if(!cmpstr(expName, "Untitled"))
23+
return 0
24+
endif
25+
26+
// experiment saved and pxp still exists -> silently save it
27+
// does not support unpacked experiments
28+
GetFileFolderInfo/P=home/Q/Z expName + ".pxp"
29+
if(!V_Flag)
30+
SaveExperiment
31+
return 1
32+
endif
33+
1334
return 0
1435
End
1536

0 commit comments

Comments
 (0)