@@ -307,7 +307,8 @@ def __populate_gui(self, event):
307
307
self .track ,
308
308
self .event ,
309
309
self .citation ,
310
- form_id )
310
+ form_id ,
311
+ self .action_callback )
311
312
312
313
self .headings = HeadingsTab (self .dbstate ,
313
314
self .uistate ,
@@ -370,6 +371,9 @@ def help_clicked(self, obj):
370
371
"""
371
372
display_help (webpage = 'Form_Addons' )
372
373
374
+ def action_callback (self , section , object , row , column , value , command ):
375
+ exec (command )
376
+
373
377
#------------------------------------------------------------------------
374
378
#
375
379
# Headings Tab
@@ -477,11 +481,12 @@ class DetailsTab(GrampsTab):
477
481
"""
478
482
Details tab in the form editor.
479
483
"""
480
- def __init__ (self , dbstate , uistate , track , event , citation , form_id ):
484
+ def __init__ (self , dbstate , uistate , track , event , citation , form_id , action_callback ):
481
485
self .db = dbstate .db
482
486
self .event = event
483
487
self .citation = citation
484
488
self .form_id = form_id
489
+ self ._action_callback = action_callback
485
490
GrampsTab .__init__ (self , dbstate , uistate , track , _ ('Details' ))
486
491
487
492
self .populate_gui (event )
@@ -502,7 +507,7 @@ def build_interface(self):
502
507
if section_type == 'multi' :
503
508
section = MultiSection (self .dbstate , self .uistate , self .track ,
504
509
self .event , self .citation , self .form_id ,
505
- role )
510
+ role , self . _action_callback )
506
511
elif section_type == 'person' :
507
512
section = PersonSection (self .dbstate , self .uistate , self .track ,
508
513
self .event , self .citation , self .form_id ,
@@ -555,7 +560,7 @@ class MultiSection(Gtk.Box):
555
560
SelectPerson = SelectorFactory ('Person' )
556
561
557
562
def __init__ (self , dbstate , uistate , track , event , citation , form_id ,
558
- section ):
563
+ section , action_callback ):
559
564
Gtk .Box .__init__ (self , orientation = Gtk .Orientation .VERTICAL )
560
565
561
566
self .dbstate = dbstate
@@ -567,6 +572,8 @@ def __init__(self, dbstate, uistate, track, event, citation, form_id,
567
572
self .event = event
568
573
self .citation = citation
569
574
575
+ self ._action_callback = action_callback
576
+
570
577
self .model = None
571
578
self .columns = []
572
579
self .initial_people = []
@@ -626,7 +633,7 @@ def __init__(self, dbstate, uistate, track, event, citation, form_id,
626
633
down_btn .connect ('clicked' , self .__move_person , 'down' )
627
634
hbox .pack_start (down_btn , expand = False , fill = True , padding = 0 )
628
635
629
- self .entry_grid = EntryGrid (callback = self .change_person )
636
+ self .entry_grid = EntryGrid (callback = self .change_person , action_callback = self . action_callback )
630
637
631
638
self .pack_start (hbox , expand = False , fill = True , padding = 0 )
632
639
self .pack_start (self .entry_grid , expand = True , fill = True , padding = 0 )
@@ -701,6 +708,9 @@ def change_person(self, model, iter_):
701
708
if person :
702
709
self .model .set_value (iter_ , 0 , person .get_handle ())
703
710
711
+ def action_callback (self , row , column , command ):
712
+ self ._action_callback (self , self .model [row ][0 ], row , column , self .model [row ][column ], command )
713
+
704
714
def __new_person_row (self , person ):
705
715
"""
706
716
Create a new model entry for a person.
0 commit comments