@@ -54,7 +54,7 @@ class VisualGedcomIds():
5454 def __init__ (self ):
5555
5656 self .ids = [
57- 'ID_CBMarksOn' , 'ID_CBHeatMap' , 'ID_CBBornMark' , 'ID_CBDieMark' , 'ID_LISTMapStyle' ,
57+ 'ID_CBMarksOn' , 'ID_CBHeatMap' , 'ID_CBFlyTo' , ' ID_CBBornMark' , 'ID_CBDieMark' , 'ID_LISTMapStyle' ,
5858 'ID_CBMarkStarOn' , 'ID_RBGroupBy' , 'ID_CBUseAntPath' , 'ID_CBMapTimeLine' ,
5959 'ID_CBHomeMarker' , 'ID_LISTHeatMapTimeStep' , 'ID_TEXTGEDCOMinput' , 'ID_TEXTResult' ,
6060 'ID_RBResultHTML' , 'ID_TEXTMain' , 'ID_TEXTName' , 'ID_INTMaxMissing' , 'ID_INTMaxLineWeight' ,
@@ -75,6 +75,7 @@ def __init__(self):
7575 self .IDs ['ID_CBUseAntPath' ]: ('UseAntPath' , 'Redraw' ),
7676 self .IDs ['ID_CBMapTimeLine' ]: ('MapTimeLine' , 'Redraw' ),
7777 self .IDs ['ID_CBHomeMarker' ]: ('HomeMarker' , 'Redraw' ),
78+ self .IDs ['ID_CBFlyTo' ]: ('UseBalloonFlyto' , 'Redraw' ),
7879 self .IDs ['ID_LISTHeatMapTimeStep' ]: ('MapTimeLine' , 'Redraw' ),
7980 self .IDs ['ID_TEXTGEDCOMinput' ]: ('GEDCOMinput' , 'Reload' ),
8081 self .IDs ['ID_TEXTResult' ]: ('Result' , 'Redraw' ),
@@ -86,7 +87,6 @@ def __init__(self):
8687 self .IDs ['ID_CBUseGPS' ]: ('UseGPS' , 'Reload' ),
8788 self .IDs ['ID_CBCacheOnly' ]: ('CacheOnly' , 'Reload' ),
8889 self .IDs ['ID_CBAllEntities' ]: ('AllEntities' , 'Redraw' ),
89- # self.IDs['ID_LISTPlaceType']: ('PlaceType', 'Redraw'),
9090 self .IDs ['ID_CBMapControl' ]: ('showLayerControl' , 'Redraw' ),
9191 self .IDs ['ID_CBMapMini' ]: ('mapMini' , 'Redraw' ),
9292 self .IDs ['ID_BTNLoad' ]: 'Load' ,
@@ -118,7 +118,7 @@ def __init__(self):
118118 self .COLORs ['GRID_BACK' ]: ['WHITE' ], # Alternate DARK SLATE GREY
119119 self .COLORs ['TITLE_TEXT' ]: ['WHITE' ],
120120 self .COLORs ['TITLE_BACK' ]: ['KHAKI' ],
121- self .COLORs ['BUSY_BACK' ]: ['KHAKI ' ]
121+ self .COLORs ['BUSY_BACK' ]: ['YELLOW ' ]
122122
123123 }
124124 for colorToValue in self .colors :
@@ -835,11 +835,11 @@ def LayoutOptions(self, panel):
835835 box .Add (wx .StaticLine (panel ), 0 , wx .EXPAND )
836836
837837
838- self .id .txtinfile = wx .StaticText (panel , - 1 , "Input file: " )
838+ self .id .txtinfile = wx .Button (panel , - 1 , "Input file: " )
839839 self .id .txtinfile .SetBackgroundColour (self .id .GetColor ('BTN_DIRECTORY' ))
840840 self .id .TEXTGEDCOMinput = wx .TextCtrl (panel , self .id .IDs ['ID_TEXTGEDCOMinput' ], "" , size = (250 ,20 ))
841841 self .id .TEXTGEDCOMinput .Enable (False )
842- self .id .txtoutfile = wx .StaticText (panel , - 1 , "Output file: " )
842+ self .id .txtoutfile = wx .Button (panel , - 1 , "Output file: " )
843843 self .id .txtoutfile .SetBackgroundColour (self .id .GetColor ('BTN_DIRECTORY' ))
844844 self .id .TEXTResult = wx .TextCtrl (panel , self .id .IDs ['ID_TEXTResult' ], "" , size = (250 ,20 ))
845845 self .id .txtinfile .Bind (wx .EVT_LEFT_DOWN , self .frame .OnFileOpenDialog )
@@ -938,22 +938,23 @@ def LayoutOptions(self, panel):
938938 if False :
939939 txtMissing = wx .StaticText (kboxIn , - 1 , "Max generation missing: " )
940940 self .id .INTMaxMissing = wx .TextCtrl (kboxIn , self .id .IDs ['ID_INTMaxMissing' ], "" , size = (20 ,20 ))
941- txtLine = wx .StaticText (kboxIn , - 1 , "Line maximum weight: " )
942- self .id .INTMaxLineWeight = wx .TextCtrl (kboxIn , self .id .IDs ['ID_INTMaxLineWeight' ], "" , size = (20 ,20 ))
943941 l1 = wx .BoxSizer (wx .HORIZONTAL )
944942 l1 .AddMany ([txtMissing , (0 ,20 ), self .id .INTMaxMissing ])
945- l2 = wx .BoxSizer (wx .HORIZONTAL )
946- l2 .AddMany ([txtLine , (0 ,20 ), self .id .INTMaxLineWeight ])
943+
947944 kboxIn .AddMany ([l1 , (4 ,4 ,), l2 ])
948945 # self.id.ID_INTMaxMissing 'MaxMissing'
949- # self.id.ID_INTMaxLineWeight 'MaxLineWeight'
950946
947+ kboxs = [wx .BoxSizer (wx .HORIZONTAL ), (4 ,4 ), wx .BoxSizer (wx .HORIZONTAL )]
948+ self .id .CBFlyTo = wx .CheckBox (kbox , self .id .IDs ['ID_CBFlyTo' ], "FlyTo Balloon" , style = wx .NO_BORDER )
949+ self .id .ID_INTMaxLineWeight = wx .SpinCtrl (kbox , self .id .IDs ['ID_INTMaxLineWeight' ], "" , min = 1 , max = 100 , initial = 20 )
950+ kboxs [0 ].AddMany ([wx .StaticText (kbox , - 1 , " " ), self .id .CBFlyTo ])
951+ kboxs [2 ].AddMany ([self .id .ID_INTMaxLineWeight , wx .StaticText (kbox , - 1 , " Max Line Weight" )])
952+ kboxIn .AddMany (kboxs )
951953
952954 ksizer .Add ( kboxIn , wx .LEFT , kOtherBorder + 10 )
953955 kbox .SetSizer (ksizer )
954956 self .kbox = kbox
955957
956-
957958 #
958959 # Grid View Options
959960 #
@@ -1017,13 +1018,14 @@ def LayoutOptions(self, panel):
10171018 self .Bind (wx .EVT_CHECKBOX , self .EvtCheckBox , id = self .id .IDs ['ID_CBHomeMarker' ])
10181019 self .Bind (wx .EVT_CHECKBOX , self .EvtCheckBox , id = self .id .IDs ['ID_CBMarkStarOn' ])
10191020 self .Bind (wx .EVT_CHECKBOX , self .EvtCheckBox , id = self .id .IDs ['ID_CBHeatMap' ])
1021+ self .Bind (wx .EVT_CHECKBOX , self .EvtCheckBox , id = self .id .IDs ['ID_CBFlyTo' ])
10201022 self .Bind (wx .EVT_CHECKBOX , self .EvtCheckBox , id = self .id .IDs ['ID_CBMapTimeLine' ])
10211023 self .Bind (wx .EVT_CHECKBOX , self .EvtCheckBox , id = self .id .IDs ['ID_CBUseAntPath' ])
10221024 self .Bind (wx .EVT_CHECKBOX , self .EvtCheckBox , id = self .id .IDs ['ID_CBUseGPS' ])
10231025 self .Bind (wx .EVT_CHECKBOX , self .EvtCheckBox , id = self .id .IDs ['ID_CBCacheOnly' ])
10241026 self .Bind (wx .EVT_CHECKBOX , self .EvtCheckBox , id = self .id .IDs ['ID_CBAllEntities' ])
10251027 self .Bind (wx .EVT_CHECKBOX , self .EvtCheckBox , id = self .id .IDs ['ID_CBGridView' ])
1026- # self.Bind(wx.EVT_CHECKLISTBOX , self.EvtListBox , id = self.id.IDs['ID_LISTPlaceType '])
1028+ self .Bind (wx .EVT_SPINCTRL , self .EvtSpinCtrl , id = self .id .IDs ['ID_INTMaxLineWeight ' ])
10271029 self .Bind (wx .EVT_CHOICE , self .EvtListBox , id = self .id .IDs ['ID_LISTMapStyle' ])
10281030 self .Bind (wx .EVT_BUTTON , self .EvtButton , id = self .id .IDs ['ID_BTNLoad' ])
10291031 self .Bind (wx .EVT_BUTTON , self .EvtButton , id = self .id .IDs ['ID_BTNUpdate' ])
@@ -1196,6 +1198,16 @@ def EvtListBox(self, event):
11961198 _log .error ("Uncontrol LISTbox" )
11971199
11981200
1201+ def EvtSpinCtrl (self , event ):
1202+ eventid = event .GetId ()
1203+ _log .debug ('%s, %s, %s' , event .GetString (), event .IsSelection (), event .GetSelection ())
1204+ _ = event .GetEventObject ()
1205+ if eventid == self .id .IDs ['ID_INTMaxLineWeight' ]:
1206+ panel .gO .MaxLineWeight = event .GetSelection ()
1207+ self .NeedRedraw ()
1208+ else :
1209+ _log .error ("Uncontrol SPINbox" )
1210+
11991211 def EvtSlider (self , event ):
12001212
12011213 _log .debug ('%s' , event .GetSelection ())
@@ -1339,7 +1351,8 @@ def SetupButtonState(self):
13391351 self .id .CBMapMini ,
13401352 self .id .CBHeatMap ,
13411353 self .id .CBUseAntPath ,
1342- self .id .RBGroupBy
1354+ self .id .RBGroupBy ,
1355+ self .id .LISTHeatMapTimeStep
13431356 ]
13441357 marks_controls = [
13451358 self .id .CBBornMark ,
@@ -1348,7 +1361,9 @@ def SetupButtonState(self):
13481361 self .id .CBMarkStarOn ,
13491362 ]
13501363 kml_controls = [
1351-
1364+ self .id .CBFlyTo ,
1365+ self .id .ID_INTMaxLineWeight
1366+
13521367 ]
13531368
13541369 # Enable/Disable marker-dependent controls if markers are off
@@ -1376,7 +1391,8 @@ def SetupButtonState(self):
13761391 # Only enable time step if timeline is enabled
13771392 if self .gO .get ('MapTimeLine' ):
13781393 self .id .LISTHeatMapTimeStep .Enable ()
1379-
1394+ for ctrl in kml_controls :
1395+ ctrl .Disable ()
13801396
13811397 else :
13821398 # In KML mode, disable HTML controls and enable KML controls
@@ -1414,13 +1430,15 @@ def SetupOptions(self):
14141430 self .id .CBHomeMarker .SetValue (self .gO .get ('HomeMarker' ))
14151431 self .id .CBMarkStarOn .SetValue (self .gO .get ('MarkStarOn' ))
14161432 self .id .CBHeatMap .SetValue (self .gO .get ('HeatMap' ))
1433+ self .id .CBFlyTo .SetValue (self .gO .get ('UseBalloonFlyto' ))
14171434 self .id .CBMapTimeLine .SetValue (self .gO .get ('MapTimeLine' ))
14181435 self .id .CBUseAntPath .SetValue (self .gO .get ('UseAntPath' ))
14191436 self .id .CBUseGPS .SetValue (self .gO .get ('UseGPS' ))
14201437 self .id .CBAllEntities .SetValue (self .gO .get ('AllEntities' ))
14211438 self .id .CBCacheOnly .SetValue (self .gO .get ('CacheOnly' ))
14221439 self .id .LISTHeatMapTimeStep .SetValue (self .gO .get ('HeatMapTimeStep' ))
14231440 self .id .LISTMapType .SetSelection (self .id .LISTMapType .FindString (self .gO .get ('MapStyle' )))
1441+ self .id .ID_INTMaxLineWeight .SetValue (self .gO .get ('MaxLineWeight' ))
14241442
14251443
14261444# places = self.gO.get('PlaceType')
@@ -1496,7 +1514,7 @@ def runCMDfile(self, cmdline, cmdfile, isHTML=False):
14961514 if ' ' in cmdline :
14971515 cmdline = self .gO .get ('CSVcmdline' ).replace ('$n' , f'{ cmdfile } ' )
14981516 _log .info (f'shell run `{ cmdfile } `' )
1499- if gOp .cmdline .startswith ('http' ):
1517+ if self . gOp .cmdline .startswith ('http' ):
15001518 webbrowser .open (cmdline , new = 0 , autoraise = True )
15011519 else :
15021520 subprocess .run (cmdline , shell = True )
@@ -1516,7 +1534,12 @@ def SaveTrace(self):
15161534 return
15171535 tracepath = os .path .splitext (self .gO .Result )[0 ] + ".trace.txt"
15181536 # indentpath = os.path.splitext(self.gO.Result)[0] + ".indent.txt"
1519- trace = open (tracepath , 'w' )
1537+ try :
1538+ trace = open (tracepath , 'w' )
1539+ except Exception as e :
1540+ logging .error ("Error: Could not open trace file %s for writing %s" , tracepath , e )
1541+ BackgroundProcess .SayErrorMessage (f"Error: Could not open trace file { tracepath } for writing { e } " )
1542+ return
15201543 # indent = open(indentpath , 'w')
15211544 trace .write ("id\t Name\t Year\t Where\t GPS\t Path\n " )
15221545 # indent.write("this is an indented file with the number of generations driven by the parents\nid\tName\tYear\tWhere\tGPS\n")
@@ -1533,7 +1556,8 @@ def SaveTrace(self):
15331556 # indent.close()
15341557 _log .info (f"Trace file saved { tracepath } " )
15351558 # _log.info(f"Indent file saved {indentpath}")
1536- BackgroundProcess .SayInfoMessage (f"Trace file saved: { tracepath } " ,True )
1559+ withall = "with all people" if self .gO .get ('AllEntities' ) else ""
1560+ BackgroundProcess .SayInfoMessage (f"Trace file { withall } saved: { tracepath } " ,True )
15371561
15381562 def OpenBrowser (self ):
15391563 if self .gO .get ('ResultHTML' ):
0 commit comments