Skip to content

Commit 8c69874

Browse files
committed
Add GSAS-II version to notebook before save and exit, as per #177
1 parent ea22478 commit 8c69874

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

GSASII/GSASIIdataGUI.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4497,7 +4497,7 @@ def MoveTreeItems(self,event):
44974497

44984498
def ExitMain(self, event):
44994499
'''Called if exit selected or the main window is closed
4500-
rescord last position of data & plot windows; saved to config.py file
4500+
record last position of data & plot windows to config
45014501
NB: not called if console window closed
45024502
'''
45034503
if self.GPXtree.GetCount() > 1:
@@ -4517,6 +4517,17 @@ def ExitMain(self, event):
45174517
elif result == wx.ID_CANCEL:
45184518
return
45194519
else:
4520+
# add a version number to Notebook before exiting
4521+
try:
4522+
gv = GSASIIpath.getSavedVersionInfo()
4523+
if gv is not None:
4524+
for item in gv.git_tags+gv.git_prevtags:
4525+
if item.isnumeric(): ver = int(item)
4526+
if '?' not in gv.git_versiontag: tag = gv.git_versiontag
4527+
rtext = f'version {gv.git_version[:8]} {ver}/{tag}'
4528+
self.AddToNotebook(rtext,'VER')
4529+
except:
4530+
pass
45204531
if not self.OnFileSave(event): return
45214532
try:
45224533
FrameInfo = {'Main_Pos':tuple(self.GetPosition()),
@@ -7498,11 +7509,13 @@ def onPlotNotebook():
74987509
filterLbls = ['all',
74997510
'Timestamps','Refinement results','Variables',
75007511
'Comments','Charge flip','Fourier','Peak fit',
7501-
'Constraints','Restraints','Rigid Bodies','Cell params']
7512+
'Constraints','Restraints','Rigid Bodies',
7513+
'Cell params','GSAS-II version #']
75027514
filterPrefix = ['',
75037515
'TS', 'REF','VARS',
75047516
'CM', 'CF', 'FM', 'PF',
7505-
'CNSTR','RSTR','RB','CEL']
7517+
'CNSTR','RSTR','RB',
7518+
'CEL','VER']
75067519
cId = GetGPXtreeItemId(G2frame,G2frame.root, 'Controls')
75077520
if cId:
75087521
controls = G2frame.GPXtree.GetItemPyData(cId)

0 commit comments

Comments
 (0)