@@ -306,15 +306,29 @@ def show_subframe(self, name, frameclass, **opts):
306
306
self .subframes [name ] = frameclass (self , ** opts )
307
307
308
308
def onPanelExposed (self , ** kws ):
309
- # called when notebook is selected
309
+ # called when notebook is selected: process group
310
310
fname = self .controller .filelist .GetStringSelection ()
311
311
if fname in self .controller .file_groups :
312
312
gname = self .controller .file_groups [fname ]
313
313
dgroup = self .controller .get_group (gname )
314
- self .ensure_xas_processed (dgroup )
314
+ if dgroup .datatype == 'xas' :
315
+ self .ensure_xas_processed (dgroup )
315
316
self .fill_form (dgroup )
316
317
self .process (dgroup = dgroup )
317
318
319
+ def onPanelHidden (self , ** kws ):
320
+ # called when notebook is de-selected: save config
321
+ fname = self .controller .filelist .GetStringSelection ()
322
+ if fname in self .controller .file_groups :
323
+ gname = self .controller .file_groups [fname ]
324
+ dgroup = self .controller .get_group (gname )
325
+ if dgroup is None :
326
+ return
327
+ conf = self .get_config ()
328
+ conf .update (self .read_form ())
329
+ setattr (dgroup .config , self .configname , conf )
330
+
331
+
318
332
def write_message (self , msg , panel = 0 ):
319
333
self .controller .write_message (msg , panel = panel )
320
334
0 commit comments