Feature Fanchart:

1. radial text in later generation
 2. correct positioning for all fonts
 3  adapting size of font to box height


svn: r20321
This commit is contained in:
Benny Malengier
2012-09-03 22:09:47 +00:00
parent beed421150
commit 9321422b48
3 changed files with 165 additions and 57 deletions

View File

@@ -63,7 +63,8 @@ class FanChartGramplet(FanChartGrampsGUI, Gramplet):
def __init__(self, gui, nav_group=0):
Gramplet.__init__(self, gui, nav_group)
FanChartGrampsGUI.__init__(self, 6, 0, True, self.on_childmenu_changed)
FanChartGrampsGUI.__init__(self, 6, 0, True, True,
self.on_childmenu_changed)
self.set_fan(FanChartWidget(self.dbstate, self.on_popup))
# Replace the standard textview with the fan chart widget:
self.gui.get_container_widget().remove(self.gui.textview)

View File

@@ -61,6 +61,7 @@ class FanChartView(FanChartGrampsGUI, NavigationView):
('interface.fanview-maxgen', 9),
('interface.fanview-background', 0),
('interface.fanview-childrenring', True),
('interface.fanview-radialtext', True),
)
def __init__(self, pdata, dbstate, uistate, nav_group=0):
self.dbstate = dbstate
@@ -74,6 +75,7 @@ class FanChartView(FanChartGrampsGUI, NavigationView):
self._config.get('interface.fanview-maxgen'),
self._config.get('interface.fanview-background'),
self._config.get('interface.fanview-childrenring'),
self._config.get('interface.fanview-radialtext'),
self.on_childmenu_changed)
dbstate.connect('active-changed', self.active_changed)
@@ -239,7 +241,7 @@ class FanChartView(FanChartGrampsGUI, NavigationView):
"""
Function that builds the widget in the configuration dialog
"""
table = Gtk.Table(3, 2)
table = Gtk.Table(4, 2)
table.set_border_width(12)
table.set_col_spacings(6)
table.set_row_spacings(6)
@@ -258,6 +260,9 @@ class FanChartView(FanChartGrampsGUI, NavigationView):
(2, _('Gender Colors')),
(3, _('White'))),
callback=self.cb_update_background)
configdialog.add_checkbox(table,
_('Allow radial text at generation 6'),
3, 'interface.fanview-radialtext')
return _('Layout'), table
@@ -269,6 +274,8 @@ class FanChartView(FanChartGrampsGUI, NavigationView):
"""
self._config.connect('interface.fanview-childrenring',
self.cb_update_childrenring)
self._config.connect('interface.fanview-radialtext',
self.cb_update_radialtext)
def cb_update_maxgen(self, spinbtn, constant):
self.maxgen = spinbtn.get_value_as_int()
@@ -291,6 +298,16 @@ class FanChartView(FanChartGrampsGUI, NavigationView):
self.childring = False
self.update()
def cb_update_radialtext(self, client, cnxn_id, entry, data):
"""
Called when the configuration menu changes the childrenring setting.
"""
if entry == 'True':
self.radialtext = True
else:
self.radialtext = False
self.update()
#------------------------------------------------------------------------
#
# CairoPrintSave class