Convert Gtk Table widgets into Grid widgets

This commit is contained in:
Nick Hall 2015-02-04 22:56:24 +00:00
parent 9faca8b943
commit 89da611e38
22 changed files with 581 additions and 685 deletions

View File

@ -105,7 +105,7 @@ class DisplayNameEditor(ManagedWindow):
Gtk.Dialog(_('Display Name Editor'), Gtk.Dialog(_('Display Name Editor'),
buttons=(Gtk.STOCK_CLOSE, Gtk.ResponseType.CLOSE)), buttons=(Gtk.STOCK_CLOSE, Gtk.ResponseType.CLOSE)),
None, _('Display Name Editor'), None) None, _('Display Name Editor'), None)
table = self.dialog._build_custom_name_ui() grid = self.dialog._build_custom_name_ui()
label = Gtk.Label(label=_("""The following keywords are replaced with the appropriate name parts: label = Gtk.Label(label=_("""The following keywords are replaced with the appropriate name parts:
<tt> <tt>
<b>Given</b> - given name (first name) <b>Surname</b> - surnames (with prefix and connectors) <b>Given</b> - given name (first name) <b>Surname</b> - surnames (with prefix and connectors)
@ -128,7 +128,7 @@ UPPERCASE keyword forces uppercase. Extra parentheses, commas are removed. Other
""")) """))
label.set_use_markup(True) label.set_use_markup(True)
self.window.vbox.pack_start(label, False, True, 0) self.window.vbox.pack_start(label, False, True, 0)
self.window.vbox.pack_start(table, True, True, 0) self.window.vbox.pack_start(grid, True, True, 0)
self.window.set_default_size(600, 550) self.window.set_default_size(600, 550)
self.window.connect('response', self.close) self.window.connect('response', self.close)
self.show() self.show()
@ -287,7 +287,7 @@ class ConfigureDialog(ManagedWindow):
""" """
self.__config.set(constant, int(obj.get_value())) self.__config.set(constant, int(obj.get_value()))
def add_checkbox(self, table, label, index, constant, start=1, stop=9, def add_checkbox(self, grid, label, index, constant, start=1, stop=9,
config=None, extra_callback=None): config=None, extra_callback=None):
if not config: if not config:
config = self.__config config = self.__config
@ -296,10 +296,10 @@ class ConfigureDialog(ManagedWindow):
checkbox.connect('toggled', self.update_checkbox, constant, config) checkbox.connect('toggled', self.update_checkbox, constant, config)
if extra_callback: if extra_callback:
checkbox.connect('toggled', extra_callback) checkbox.connect('toggled', extra_callback)
table.attach(checkbox, start, stop, index, index+1, yoptions=0) grid.attach(checkbox, start, index, stop - start, 1)
return checkbox return checkbox
def add_radiobox(self, table, label, index, constant, group, column, def add_radiobox(self, grid, label, index, constant, group, column,
config=None): config=None):
if not config: if not config:
config = self.__config config = self.__config
@ -307,19 +307,19 @@ class ConfigureDialog(ManagedWindow):
if config.get(constant) == True: if config.get(constant) == True:
radiobox.set_active(True) radiobox.set_active(True)
radiobox.connect('toggled', self.update_radiobox, constant) radiobox.connect('toggled', self.update_radiobox, constant)
table.attach(radiobox, column, column+1, index, index+1, yoptions=0) grid.attach(radiobox, column, index, 1, 1)
return radiobox return radiobox
def add_text(self, table, label, index, config=None, line_wrap=True): def add_text(self, grid, label, index, config=None, line_wrap=True):
if not config: if not config:
config = self.__config config = self.__config
text = Gtk.Label() text = Gtk.Label()
text.set_line_wrap(line_wrap) text.set_line_wrap(line_wrap)
text.set_alignment(0.,0.) text.set_alignment(0.,0.)
text.set_text(label) text.set_text(label)
table.attach(text, 1, 9, index, index+1, yoptions=Gtk.AttachOptions.SHRINK) grid.attach(text, 1, index, 8, 1)
def add_path_box(self, table, label, index, entry, path, callback_label, def add_path_box(self, grid, label, index, entry, path, callback_label,
callback_sel, config=None): callback_sel, config=None):
""" Add an entry to give in path and a select button to open a """ Add an entry to give in path and a select button to open a
dialog. dialog.
@ -341,11 +341,11 @@ class ConfigureDialog(ManagedWindow):
btn.add(image) btn.add(image)
hbox.pack_start(entry, True, True, 0) hbox.pack_start(entry, True, True, 0)
hbox.pack_start(btn, False, False, 0) hbox.pack_start(btn, False, False, 0)
table.attach(lwidget, 1, 2, index, index+1, yoptions=0, hbox.set_hexpand(True)
xoptions=Gtk.AttachOptions.FILL) grid.attach(lwidget, 1, index, 1, 1)
table.attach(hbox, 2, 3, index, index+1, yoptions=0) grid.attach(hbox, 2, index, 1, 1)
def add_entry(self, table, label, index, constant, callback=None, def add_entry(self, grid, label, index, constant, callback=None,
config=None, col_attach=0): config=None, col_attach=0):
if not config: if not config:
config = self.__config config = self.__config
@ -356,15 +356,15 @@ class ConfigureDialog(ManagedWindow):
entry = Gtk.Entry() entry = Gtk.Entry()
entry.set_text(config.get(constant)) entry.set_text(config.get(constant))
entry.connect('changed', callback, constant) entry.connect('changed', callback, constant)
entry.set_hexpand(True)
if label: if label:
table.attach(lwidget, col_attach, col_attach+1, index, index+1, yoptions=0, grid.attach(lwidget, col_attach, index, 1, 1)
xoptions=Gtk.AttachOptions.FILL) grid.attach(entry, col_attach+1, index, 1, 1)
table.attach(entry, col_attach+1, col_attach+2, index, index+1, yoptions=0)
else: else:
table.attach(entry, col_attach, col_attach+1, index, index+1, yoptions=0) grid.attach(entry, col_attach, index, 1, 1)
return entry return entry
def add_pos_int_entry(self, table, label, index, constant, callback=None, def add_pos_int_entry(self, grid, label, index, constant, callback=None,
config=None, col_attach=1, helptext=''): config=None, col_attach=1, helptext=''):
""" entry field for positive integers """ entry field for positive integers
""" """
@ -374,14 +374,13 @@ class ConfigureDialog(ManagedWindow):
entry = Gtk.Entry() entry = Gtk.Entry()
entry.set_text(str(config.get(constant))) entry.set_text(str(config.get(constant)))
entry.set_tooltip_markup(helptext) entry.set_tooltip_markup(helptext)
entry.set_hexpand(True)
if callback: if callback:
entry.connect('changed', callback, constant) entry.connect('changed', callback, constant)
table.attach(lwidget, col_attach, col_attach+1, index, index+1, grid.attach(lwidget, col_attach, index, 1, 1)
yoptions=0, xoptions=Gtk.AttachOptions.FILL) grid.attach(entry, col_attach+1, index, 1, 1)
table.attach(entry, col_attach+1, col_attach+2, index, index+1,
yoptions=0)
def add_color(self, table, label, index, constant, config=None, col=0): def add_color(self, grid, label, index, constant, config=None, col=0):
if not config: if not config:
config = self.__config config = self.__config
lwidget = BasicLabel("%s: " % label) lwidget = BasicLabel("%s: " % label)
@ -389,14 +388,14 @@ class ConfigureDialog(ManagedWindow):
color = Gdk.color_parse(hexval) color = Gdk.color_parse(hexval)
entry = Gtk.ColorButton(color=color) entry = Gtk.ColorButton(color=color)
color_hex_label = BasicLabel(hexval) color_hex_label = BasicLabel(hexval)
color_hex_label.set_hexpand(True)
entry.connect('color-set', self.update_color, constant, color_hex_label) entry.connect('color-set', self.update_color, constant, color_hex_label)
table.attach(lwidget, col, col+1, index, index+1, yoptions=0, grid.attach(lwidget, col, index, 1, 1)
xoptions=Gtk.AttachOptions.FILL) grid.attach(entry, col+1, index, 1, 1)
table.attach(entry, col+1, col+2, index, index+1, yoptions=0, xoptions=0) grid.attach(color_hex_label, col+2, index, 1, 1)
table.attach(color_hex_label, col+2, col+3, index, index+1, yoptions=0)
return entry return entry
def add_combo(self, table, label, index, constant, opts, callback=None, def add_combo(self, grid, label, index, constant, opts, callback=None,
config=None, valueactive=False, setactive=None): config=None, valueactive=False, setactive=None):
""" """
A drop-down list allowing selection from a number of fixed options. A drop-down list allowing selection from a number of fixed options.
@ -431,12 +430,12 @@ class ConfigureDialog(ManagedWindow):
else: else:
combo.set_active(setactive) combo.set_active(setactive)
combo.connect('changed', callback, constant) combo.connect('changed', callback, constant)
table.attach(lwidget, 1, 2, index, index+1, yoptions=0, combo.set_hexpand(True)
xoptions=Gtk.AttachOptions.FILL) grid.attach(lwidget, 1, index, 1, 1)
table.attach(combo, 2, 3, index, index+1, yoptions=0) grid.attach(combo, 2, index, 1, 1)
return combo return combo
def add_slider(self, table, label, index, constant, range, callback=None, def add_slider(self, grid, label, index, constant, range, callback=None,
config=None): config=None):
""" """
A slider allowing the selection of an integer within a specified range. A slider allowing the selection of an integer within a specified range.
@ -452,12 +451,11 @@ class ConfigureDialog(ManagedWindow):
slider.set_digits(0) slider.set_digits(0)
slider.set_value_pos(Gtk.PositionType.BOTTOM) slider.set_value_pos(Gtk.PositionType.BOTTOM)
slider.connect('value-changed', callback, constant) slider.connect('value-changed', callback, constant)
table.attach(lwidget, 1, 2, index, index+1, yoptions=0, grid.attach(lwidget, 1, index, 1, 1)
xoptions=Gtk.AttachOptions.FILL) grid.attach(slider, 2, index, 1, 1)
table.attach(slider, 2, 3, index, index+1, yoptions=0)
return slider return slider
def add_spinner(self, table, label, index, constant, range, callback=None, def add_spinner(self, grid, label, index, constant, range, callback=None,
config=None): config=None):
""" """
A spinner allowing the selection of an integer within a specified range. A spinner allowing the selection of an integer within a specified range.
@ -471,9 +469,9 @@ class ConfigureDialog(ManagedWindow):
adj = Gtk.Adjustment(config.get(constant), range[0], range[1], 1, 0, 0) adj = Gtk.Adjustment(config.get(constant), range[0], range[1], 1, 0, 0)
spinner = Gtk.SpinButton(adjustment=adj, climb_rate=0.0, digits=0) spinner = Gtk.SpinButton(adjustment=adj, climb_rate=0.0, digits=0)
spinner.connect('value-changed', callback, constant) spinner.connect('value-changed', callback, constant)
table.attach(lwidget, 1, 2, index, index+1, yoptions=0, spinner.set_hexpand(True)
xoptions=Gtk.AttachOptions.FILL) grid.attach(lwidget, 1, index, 1, 1)
table.attach(spinner, 2, 3, index, index+1, yoptions=0) grid.attach(spinner, 2, index, 1, 1)
return spinner return spinner
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
@ -500,115 +498,118 @@ class GrampsPreferences(ConfigureDialog):
on_close=update_constants) on_close=update_constants)
def add_researcher_panel(self, configdialog): def add_researcher_panel(self, configdialog):
table = Gtk.Table(n_rows=3, n_columns=8) grid = Gtk.Grid()
table.set_border_width(12) grid.set_border_width(12)
table.set_col_spacings(6) grid.set_column_spacing(6)
table.set_row_spacings(6) grid.set_row_spacing(6)
self.add_text(table, _('Enter your information so people can contact you when you' self.add_text(grid, _('Enter your information so people can contact you when you'
' distribute your Family Tree'), 0, line_wrap=False) ' distribute your Family Tree'), 0, line_wrap=False)
self.add_entry(table, _('Name'), 1, 'researcher.researcher-name') self.add_entry(grid, _('Name'), 1, 'researcher.researcher-name')
self.add_entry(table, _('Address'), 2, 'researcher.researcher-addr') self.add_entry(grid, _('Address'), 2, 'researcher.researcher-addr')
self.add_entry(table, _('Locality'), 3, 'researcher.researcher-locality') self.add_entry(grid, _('Locality'), 3, 'researcher.researcher-locality')
self.add_entry(table, _('City'), 4, 'researcher.researcher-city') self.add_entry(grid, _('City'), 4, 'researcher.researcher-city')
self.add_entry(table, _('State/County'), 5, 'researcher.researcher-state') self.add_entry(grid, _('State/County'), 5, 'researcher.researcher-state')
self.add_entry(table, _('Country'), 6, 'researcher.researcher-country') self.add_entry(grid, _('Country'), 6, 'researcher.researcher-country')
self.add_entry(table, _('ZIP/Postal Code'), 7, 'researcher.researcher-postal') self.add_entry(grid, _('ZIP/Postal Code'), 7, 'researcher.researcher-postal')
self.add_entry(table, _('Phone'), 8, 'researcher.researcher-phone') self.add_entry(grid, _('Phone'), 8, 'researcher.researcher-phone')
self.add_entry(table, _('Email'), 9, 'researcher.researcher-email') self.add_entry(grid, _('Email'), 9, 'researcher.researcher-email')
return _('Researcher'), table return _('Researcher'), grid
def add_prefix_panel(self, configdialog): def add_prefix_panel(self, configdialog):
""" """
Add the ID prefix tab to the preferences. Add the ID prefix tab to the preferences.
""" """
table = Gtk.Table(n_rows=3, n_columns=8) grid = Gtk.Grid()
table.set_border_width(12) grid.set_border_width(12)
table.set_col_spacings(6) grid.set_column_spacing(6)
table.set_row_spacings(6) grid.set_row_spacing(6)
self.add_entry(table, _('Person'), 0, 'preferences.iprefix', self.add_entry(grid, _('Person'), 0, 'preferences.iprefix',
self.update_idformat_entry) self.update_idformat_entry)
self.add_entry(table, _('Family'), 1, 'preferences.fprefix', self.add_entry(grid, _('Family'), 1, 'preferences.fprefix',
self.update_idformat_entry) self.update_idformat_entry)
self.add_entry(table, _('Place'), 2, 'preferences.pprefix', self.add_entry(grid, _('Place'), 2, 'preferences.pprefix',
self.update_idformat_entry) self.update_idformat_entry)
self.add_entry(table, _('Source'), 3, 'preferences.sprefix', self.add_entry(grid, _('Source'), 3, 'preferences.sprefix',
self.update_idformat_entry) self.update_idformat_entry)
self.add_entry(table, _('Citation'), 4, 'preferences.cprefix', self.add_entry(grid, _('Citation'), 4, 'preferences.cprefix',
self.update_idformat_entry) self.update_idformat_entry)
self.add_entry(table, _('Media Object'), 5, 'preferences.oprefix', self.add_entry(grid, _('Media Object'), 5, 'preferences.oprefix',
self.update_idformat_entry) self.update_idformat_entry)
self.add_entry(table, _('Event'), 6, 'preferences.eprefix', self.add_entry(grid, _('Event'), 6, 'preferences.eprefix',
self.update_idformat_entry) self.update_idformat_entry)
self.add_entry(table, _('Repository'), 7, 'preferences.rprefix', self.add_entry(grid, _('Repository'), 7, 'preferences.rprefix',
self.update_idformat_entry) self.update_idformat_entry)
self.add_entry(table, _('Note'), 8, 'preferences.nprefix', self.add_entry(grid, _('Note'), 8, 'preferences.nprefix',
self.update_idformat_entry) self.update_idformat_entry)
return _('ID Formats'), table return _('ID Formats'), grid
def add_color_panel(self, configdialog): def add_color_panel(self, configdialog):
""" """
Add the tab to set defaults colors for graph boxes Add the tab to set defaults colors for graph boxes
""" """
table = Gtk.Table(n_rows=17, n_columns=8) grid = Gtk.Grid()
self.add_text(table, _('Set the colors used for boxes in the graphical views'), grid.set_border_width(12)
grid.set_column_spacing(6)
grid.set_row_spacing(6)
self.add_text(grid, _('Set the colors used for boxes in the graphical views'),
0, line_wrap=False) 0, line_wrap=False)
self.add_color(table, _('Gender Male Alive'), 1, self.add_color(grid, _('Gender Male Alive'), 1,
'preferences.color-gender-male-alive') 'preferences.color-gender-male-alive')
self.add_color(table, _('Border Male Alive'), 2, self.add_color(grid, _('Border Male Alive'), 2,
'preferences.bordercolor-gender-male-alive') 'preferences.bordercolor-gender-male-alive')
self.add_color(table, _('Gender Male Death'), 3, self.add_color(grid, _('Gender Male Death'), 3,
'preferences.color-gender-male-death') 'preferences.color-gender-male-death')
self.add_color(table, _('Border Male Death'), 4, self.add_color(grid, _('Border Male Death'), 4,
'preferences.bordercolor-gender-male-death') 'preferences.bordercolor-gender-male-death')
self.add_color(table, _('Gender Female Alive'), 1, self.add_color(grid, _('Gender Female Alive'), 1,
'preferences.color-gender-female-alive', col=4) 'preferences.color-gender-female-alive', col=4)
self.add_color(table, _('Border Female Alive'), 2, self.add_color(grid, _('Border Female Alive'), 2,
'preferences.bordercolor-gender-female-alive', col=4) 'preferences.bordercolor-gender-female-alive', col=4)
self.add_color(table, _('Gender Female Death'), 3, self.add_color(grid, _('Gender Female Death'), 3,
'preferences.color-gender-female-death', col=4) 'preferences.color-gender-female-death', col=4)
self.add_color(table, _('Border Female Death'), 4, self.add_color(grid, _('Border Female Death'), 4,
'preferences.bordercolor-gender-female-death', col=4) 'preferences.bordercolor-gender-female-death', col=4)
## self.add_color(table, _('Gender Other Alive'), 5, ## self.add_color(grid, _('Gender Other Alive'), 5,
## 'preferences.color-gender-other-alive') ## 'preferences.color-gender-other-alive')
## self.add_color(table, _('Border Other Alive'), 6, ## self.add_color(grid, _('Border Other Alive'), 6,
## 'preferences.bordercolor-gender-other-alive') ## 'preferences.bordercolor-gender-other-alive')
## self.add_color(table, _('Gender Other Death'), 7, ## self.add_color(grid, _('Gender Other Death'), 7,
## 'preferences.color-gender-other-death') ## 'preferences.color-gender-other-death')
## self.add_color(table, _('Border Other Death'), 8, ## self.add_color(grid, _('Border Other Death'), 8,
## 'preferences.bordercolor-gender-other-death') ## 'preferences.bordercolor-gender-other-death')
self.add_color(table, _('Gender Unknown Alive'), 5, self.add_color(grid, _('Gender Unknown Alive'), 5,
'preferences.color-gender-unknown-alive', col=4) 'preferences.color-gender-unknown-alive', col=4)
self.add_color(table, _('Border Unknown Alive'), 6, self.add_color(grid, _('Border Unknown Alive'), 6,
'preferences.bordercolor-gender-unknown-alive', col=4) 'preferences.bordercolor-gender-unknown-alive', col=4)
self.add_color(table, _('Gender Unknown Death'), 7, self.add_color(grid, _('Gender Unknown Death'), 7,
'preferences.color-gender-unknown-death', col=4) 'preferences.color-gender-unknown-death', col=4)
self.add_color(table, _('Border Unknown Death'), 8, self.add_color(grid, _('Border Unknown Death'), 8,
'preferences.bordercolor-gender-unknown-death', col=4) 'preferences.bordercolor-gender-unknown-death', col=4)
return _('Colors'), table return _('Colors'), grid
def add_advanced_panel(self, configdialog): def add_advanced_panel(self, configdialog):
table = Gtk.Table(n_rows=4, n_columns=8) grid = Gtk.Grid()
table.set_border_width(12) grid.set_border_width(12)
table.set_col_spacings(6) grid.set_column_spacing(6)
table.set_row_spacings(6) grid.set_row_spacing(6)
self.add_checkbox( self.add_checkbox(
table, _('Suppress warning when adding parents to a child.'), grid, _('Suppress warning when adding parents to a child.'),
0, 'preferences.family-warn') 0, 'preferences.family-warn')
self.add_checkbox( self.add_checkbox(
table, _('Suppress warning when canceling with changed data.'), grid, _('Suppress warning when canceling with changed data.'),
1, 'interface.dont-ask') 1, 'interface.dont-ask')
self.add_checkbox( self.add_checkbox(
table, _('Suppress warning about missing researcher when' grid, _('Suppress warning about missing researcher when'
' exporting to GEDCOM.'), ' exporting to GEDCOM.'),
2, 'behavior.owner-warn') 2, 'behavior.owner-warn')
self.add_checkbox( self.add_checkbox(
table, _('Show plugin status dialog on plugin load error.'), grid, _('Show plugin status dialog on plugin load error.'),
3, 'behavior.pop-plugin-status') 3, 'behavior.pop-plugin-status')
return _('Warnings'), table return _('Warnings'), grid
def _build_name_format_model(self, active): def _build_name_format_model(self, active):
""" """
@ -801,10 +802,10 @@ class GrampsPreferences(ConfigureDialog):
UI to manage the custom name formats UI to manage the custom name formats
""" """
table = Gtk.Table(n_rows=2, n_columns=3) grid = Gtk.Grid()
table.set_border_width(6) grid.set_border_width(6)
table.set_col_spacings(6) grid.set_column_spacing(6)
table.set_row_spacings(6) grid.set_row_spacing(6)
# make a treeview for listing all the name formats # make a treeview for listing all the name formats
format_tree = Gtk.TreeView(self.fmt_model) format_tree = Gtk.TreeView(self.fmt_model)
@ -832,7 +833,9 @@ class GrampsPreferences(ConfigureDialog):
format_sw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) format_sw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
format_sw.add(format_tree) format_sw.add(format_tree)
format_sw.set_shadow_type(Gtk.ShadowType.IN) format_sw.set_shadow_type(Gtk.ShadowType.IN)
table.attach(format_sw, 0, 3, 0, 1, yoptions=Gtk.AttachOptions.FILL|Gtk.AttachOptions.EXPAND) format_sw.set_hexpand(True)
format_sw.set_vexpand(True)
grid.attach(format_sw, 0, 0, 3, 1)
# to hold the values of the selected row of the tree and the iter # to hold the values of the selected row of the tree and the iter
self.selected_fmt = () self.selected_fmt = ()
@ -849,12 +852,12 @@ class GrampsPreferences(ConfigureDialog):
self.remove_button.connect('clicked', self.cb_del_fmt_str) self.remove_button.connect('clicked', self.cb_del_fmt_str)
self.remove_button.set_sensitive(False) self.remove_button.set_sensitive(False)
table.attach(self.insert_button, 0, 1, 1, 2, yoptions=0) grid.attach(self.insert_button, 0, 1, 1, 1)
table.attach(self.remove_button, 1, 2, 1, 2, yoptions=0) grid.attach(self.remove_button, 1, 1, 1, 1)
table.attach(self.edit_button, 2, 3, 1, 2, yoptions=0) grid.attach(self.edit_button, 2, 1, 1, 1)
self.format_list = format_tree self.format_list = format_tree
self.name_column = name_column self.name_column = name_column
return table return grid
def name_changed_check(self): def name_changed_check(self):
""" """
@ -926,10 +929,10 @@ class GrampsPreferences(ConfigureDialog):
def add_formats_panel(self, configdialog): def add_formats_panel(self, configdialog):
row = 0 row = 0
table = Gtk.Table(n_rows=4, n_columns=4) grid = Gtk.Grid()
table.set_border_width(12) grid.set_border_width(12)
table.set_col_spacings(6) grid.set_column_spacing(6)
table.set_row_spacings(6) grid.set_row_spacing(6)
# Display name: # Display name:
self.examplename = Name() self.examplename = Name()
@ -974,12 +977,12 @@ class GrampsPreferences(ConfigureDialog):
btn.connect('clicked', self.cb_name_dialog) btn.connect('clicked', self.cb_name_dialog)
hbox.pack_start(self.fmt_obox, True, True, 0) hbox.pack_start(self.fmt_obox, True, True, 0)
hbox.pack_start(btn, False, False, 0) hbox.pack_start(btn, False, False, 0)
table.attach(lwidget, 0, 1, row, row+1, yoptions=0) grid.attach(lwidget, 0, row, 1, 1)
table.attach(hbox, 1, 3, row, row+1, yoptions=0) grid.attach(hbox, 1, row, 2, 1)
row += 1 row += 1
# Pa/Matronymic surname handling # Pa/Matronymic surname handling
self.add_checkbox(table, self.add_checkbox(grid,
_("Consider single pa/matronymic as surname"), _("Consider single pa/matronymic as surname"),
row, 'preferences.patronimic-surname', stop=3, row, 'preferences.patronimic-surname', stop=3,
extra_callback=self.cb_pa_sur_changed) extra_callback=self.cb_pa_sur_changed)
@ -995,8 +998,8 @@ class GrampsPreferences(ConfigureDialog):
obox.set_active(active) obox.set_active(active)
obox.connect('changed', self.date_format_changed) obox.connect('changed', self.date_format_changed)
lwidget = BasicLabel("%s: " % _('Date format')) lwidget = BasicLabel("%s: " % _('Date format'))
table.attach(lwidget, 0, 1, row, row+1, yoptions=0) grid.attach(lwidget, 0, row, 1, 1)
table.attach(obox, 1, 3, row, row+1, yoptions=0) grid.attach(obox, 1, row, 2, 1)
row += 1 row += 1
# Place format: # Place format:
@ -1009,8 +1012,8 @@ class GrampsPreferences(ConfigureDialog):
obox.set_active(active) obox.set_active(active)
obox.connect('changed', self.place_format_changed) obox.connect('changed', self.place_format_changed)
lwidget = BasicLabel("%s: " % _('Place format')) lwidget = BasicLabel("%s: " % _('Place format'))
table.attach(lwidget, 0, 1, row, row+1, yoptions=0) grid.attach(lwidget, 0, row, 1, 1)
table.attach(obox, 1, 3, row, row+1, yoptions=0) grid.attach(obox, 1, row, 2, 1)
row += 1 row += 1
# Age precision: # Age precision:
@ -1031,8 +1034,8 @@ class GrampsPreferences(ConfigureDialog):
obj.get_active() + 1)) obj.get_active() + 1))
lwidget = BasicLabel("%s: " lwidget = BasicLabel("%s: "
% _('Age display precision (requires restart)')) % _('Age display precision (requires restart)'))
table.attach(lwidget, 0, 1, row, row+1, yoptions=0) grid.attach(lwidget, 0, row, 1, 1)
table.attach(obox, 1, 3, row, row+1, yoptions=0) grid.attach(obox, 1, row, 2, 1)
row += 1 row += 1
# Calendar format on report: # Calendar format on report:
@ -1044,8 +1047,8 @@ class GrampsPreferences(ConfigureDialog):
obox.set_active(active) obox.set_active(active)
obox.connect('changed', self.date_calendar_changed) obox.connect('changed', self.date_calendar_changed)
lwidget = BasicLabel("%s: " % _('Calendar on reports')) lwidget = BasicLabel("%s: " % _('Calendar on reports'))
table.attach(lwidget, 0, 1, row, row+1, yoptions=0) grid.attach(lwidget, 0, row, 1, 1)
table.attach(obox, 1, 3, row, row+1, yoptions=0) grid.attach(obox, 1, row, 2, 1)
row += 1 row += 1
# Surname guessing: # Surname guessing:
@ -1057,8 +1060,8 @@ class GrampsPreferences(ConfigureDialog):
lambda obj: config.set('behavior.surname-guessing', lambda obj: config.set('behavior.surname-guessing',
obj.get_active())) obj.get_active()))
lwidget = BasicLabel("%s: " % _('Surname guessing')) lwidget = BasicLabel("%s: " % _('Surname guessing'))
table.attach(lwidget, 0, 1, row, row+1, yoptions=0) grid.attach(lwidget, 0, row, 1, 1)
table.attach(obox, 1, 3, row, row+1, yoptions=0) grid.attach(obox, 1, row, 2, 1)
row += 1 row += 1
# Default Family Relationship # Default Family Relationship
@ -1070,12 +1073,12 @@ class GrampsPreferences(ConfigureDialog):
lambda obj: config.set('preferences.family-relation-type', lambda obj: config.set('preferences.family-relation-type',
obj.get_active())) obj.get_active()))
lwidget = BasicLabel("%s: " % _('Default family relationship')) lwidget = BasicLabel("%s: " % _('Default family relationship'))
table.attach(lwidget, 0, 1, row, row+1, yoptions=0) grid.attach(lwidget, 0, row, 1, 1)
table.attach(obox, 1, 3, row, row+1, yoptions=0) grid.attach(obox, 1, row, 2, 1)
row += 1 row += 1
#height multiple surname table #height multiple surname table
self.add_pos_int_entry(table, self.add_pos_int_entry(grid,
_('Height multiple surname box (pixels)'), _('Height multiple surname box (pixels)'),
row, 'interface.surname-box-height', self.update_surn_height, row, 'interface.surname-box-height', self.update_surn_height,
col_attach=0) col_attach=0)
@ -1094,49 +1097,49 @@ class GrampsPreferences(ConfigureDialog):
obox.connect('changed', obox.connect('changed',
lambda obj: config.set('interface.statusbar', 2*obj.get_active())) lambda obj: config.set('interface.statusbar', 2*obj.get_active()))
lwidget = BasicLabel("%s: " % _('Status bar')) lwidget = BasicLabel("%s: " % _('Status bar'))
table.attach(lwidget, 0, 1, row, row+1, yoptions=0) grid.attach(lwidget, 0, row, 1, 1)
table.attach(obox, 1, 3, row, row+1, yoptions=0) grid.attach(obox, 1, row, 2, 1)
row += 1 row += 1
# Text in sidebar: # Text in sidebar:
self.add_checkbox(table, self.add_checkbox(grid,
_("Show text in sidebar buttons (requires restart)"), _("Show text in sidebar buttons (requires restart)"),
row, 'interface.sidebar-text', stop=3) row, 'interface.sidebar-text', stop=3)
row += 1 row += 1
# Gramplet bar close buttons: # Gramplet bar close buttons:
self.add_checkbox(table, self.add_checkbox(grid,
_("Show close button in gramplet bar tabs"), _("Show close button in gramplet bar tabs"),
row, 'interface.grampletbar-close', stop=3, row, 'interface.grampletbar-close', stop=3,
extra_callback=self.cb_grampletbar_close) extra_callback=self.cb_grampletbar_close)
row += 1 row += 1
return _('Display'), table return _('Display'), grid
def add_text_panel(self, configdialog): def add_text_panel(self, configdialog):
row = 0 row = 0
table = Gtk.Table(n_rows=6, n_columns=8) grid = Gtk.Grid()
table.set_border_width(12) grid.set_border_width(12)
table.set_col_spacings(6) grid.set_column_spacing(6)
table.set_row_spacings(6) grid.set_row_spacing(6)
self.add_entry(table, _('Missing surname'), row, self.add_entry(grid, _('Missing surname'), row,
'preferences.no-surname-text') 'preferences.no-surname-text')
row += 1 row += 1
self.add_entry(table, _('Missing given name'), row, self.add_entry(grid, _('Missing given name'), row,
'preferences.no-given-text') 'preferences.no-given-text')
row += 1 row += 1
self.add_entry(table, _('Missing record'), row, self.add_entry(grid, _('Missing record'), row,
'preferences.no-record-text') 'preferences.no-record-text')
row += 1 row += 1
self.add_entry(table, _('Private surname'), row, self.add_entry(grid, _('Private surname'), row,
'preferences.private-surname-text') 'preferences.private-surname-text')
row += 1 row += 1
self.add_entry(table, _('Private given name'), row, self.add_entry(grid, _('Private given name'), row,
'preferences.private-given-text') 'preferences.private-given-text')
row += 1 row += 1
self.add_entry(table, _('Private record'), row, self.add_entry(grid, _('Private record'), row,
'preferences.private-record-text') 'preferences.private-record-text')
row += 1 row += 1
return _('Text'), table return _('Text'), grid
def cb_name_dialog(self, obj): def cb_name_dialog(self, obj):
the_list = self.fmt_obox.get_model() the_list = self.fmt_obox.get_model()
@ -1183,33 +1186,33 @@ class GrampsPreferences(ConfigureDialog):
config.set('preferences.calendar-format-report', obj.get_active()) config.set('preferences.calendar-format-report', obj.get_active())
def add_date_panel(self, configdialog): def add_date_panel(self, configdialog):
table = Gtk.Table(n_rows=2, n_columns=7) grid = Gtk.Grid()
table.set_border_width(12) grid.set_border_width(12)
table.set_col_spacings(6) grid.set_column_spacing(6)
table.set_row_spacings(6) grid.set_row_spacing(6)
self.add_spinner(table, self.add_spinner(grid,
_('Date about range'), _('Date about range'),
0, 'behavior.date-about-range', (1, 9999)) 0, 'behavior.date-about-range', (1, 9999))
self.add_spinner(table, self.add_spinner(grid,
_('Date after range'), _('Date after range'),
1, 'behavior.date-after-range', (1, 9999)) 1, 'behavior.date-after-range', (1, 9999))
self.add_spinner(table, self.add_spinner(grid,
_('Date before range'), _('Date before range'),
2, 'behavior.date-before-range', (1, 9999)) 2, 'behavior.date-before-range', (1, 9999))
self.add_spinner(table, self.add_spinner(grid,
_('Maximum age probably alive'), _('Maximum age probably alive'),
3, 'behavior.max-age-prob-alive', (80, 140)) 3, 'behavior.max-age-prob-alive', (80, 140))
self.add_spinner(table, self.add_spinner(grid,
_('Maximum sibling age difference'), _('Maximum sibling age difference'),
4, 'behavior.max-sib-age-diff', (10, 30)) 4, 'behavior.max-sib-age-diff', (10, 30))
self.add_spinner(table, self.add_spinner(grid,
_('Minimum years between generations'), _('Minimum years between generations'),
5, 'behavior.min-generation-years', (5, 20)) 5, 'behavior.min-generation-years', (5, 20))
self.add_spinner(table, self.add_spinner(grid,
_('Average years between generations'), _('Average years between generations'),
6, 'behavior.avg-generation-gap', (10, 30)) 6, 'behavior.avg-generation-gap', (10, 30))
self.add_pos_int_entry(table, self.add_pos_int_entry(grid,
_('Markup for invalid date format'), _('Markup for invalid date format'),
7, 'preferences.invalid-date-format', 7, 'preferences.invalid-date-format',
self.update_markup_entry, self.update_markup_entry,
@ -1227,16 +1230,16 @@ class GrampsPreferences(ConfigureDialog):
'will display <u><b>Underlined bold date</b></u>.\n') 'will display <u><b>Underlined bold date</b></u>.\n')
) )
return _('Dates'), table return _('Dates'), grid
def add_behavior_panel(self, configdialog): def add_behavior_panel(self, configdialog):
table = Gtk.Table(n_rows=2, n_columns=8) grid = Gtk.Grid()
table.set_border_width(12) grid.set_border_width(12)
table.set_col_spacings(6) grid.set_column_spacing(6)
table.set_row_spacings(6) grid.set_row_spacing(6)
current_line = 0 current_line = 0
self.add_checkbox(table, self.add_checkbox(grid,
_('Add default source on GEDCOM import'), _('Add default source on GEDCOM import'),
current_line, 'preferences.default-source') current_line, 'preferences.default-source')
@ -1244,14 +1247,14 @@ class GrampsPreferences(ConfigureDialog):
checkbutton = Gtk.CheckButton(label=_("Add tag on import")) checkbutton = Gtk.CheckButton(label=_("Add tag on import"))
checkbutton.set_active(config.get('preferences.tag-on-import')) checkbutton.set_active(config.get('preferences.tag-on-import'))
checkbutton.connect("toggled", self.toggle_tag_on_import) checkbutton.connect("toggled", self.toggle_tag_on_import)
table.attach(checkbutton, 1, 2, current_line, current_line+1, yoptions=0) grid.attach(checkbutton, 1, current_line, 1, 1)
self.tag_format_entry = self.add_entry(table, None, current_line, self.tag_format_entry = self.add_entry(grid, None, current_line,
'preferences.tag-on-import-format', 'preferences.tag-on-import-format',
col_attach=2) col_attach=2)
self.tag_format_entry.set_sensitive(config.get('preferences.tag-on-import')) self.tag_format_entry.set_sensitive(config.get('preferences.tag-on-import'))
current_line += 1 current_line += 1
obj = self.add_checkbox(table, obj = self.add_checkbox(grid,
_('Enable spelling checker'), _('Enable spelling checker'),
current_line, 'behavior.spellcheck') current_line, 'behavior.spellcheck')
if not HAVE_GTKSPELL: if not HAVE_GTKSPELL:
@ -1267,23 +1270,23 @@ class GrampsPreferences(ConfigureDialog):
"%(gramps_wiki_build_spell_url)s") % spell_dict ) "%(gramps_wiki_build_spell_url)s") % spell_dict )
current_line += 1 current_line += 1
self.add_checkbox(table, self.add_checkbox(grid,
_('Display Tip of the Day'), _('Display Tip of the Day'),
current_line, 'behavior.use-tips') current_line, 'behavior.use-tips')
current_line += 1 current_line += 1
self.add_checkbox(table, self.add_checkbox(grid,
_('Remember last view displayed'), _('Remember last view displayed'),
current_line, 'preferences.use-last-view') current_line, 'preferences.use-last-view')
current_line += 1 current_line += 1
self.add_spinner(table, self.add_spinner(grid,
_('Max generations for relationships'), _('Max generations for relationships'),
current_line, 'behavior.generation-depth', (5, 50), self.update_gendepth) current_line, 'behavior.generation-depth', (5, 50), self.update_gendepth)
current_line += 1 current_line += 1
self.path_entry = Gtk.Entry() self.path_entry = Gtk.Entry()
self.add_path_box(table, self.add_path_box(grid,
_('Base path for relative media paths'), _('Base path for relative media paths'),
current_line, self.path_entry, self.dbstate.db.get_mediapath(), current_line, self.path_entry, self.dbstate.db.get_mediapath(),
self.set_mediapath, self.select_mediapath) self.set_mediapath, self.select_mediapath)
@ -1301,8 +1304,8 @@ class GrampsPreferences(ConfigureDialog):
obox.set_active(active) obox.set_active(active)
obox.connect('changed', self.check_for_updates_changed) obox.connect('changed', self.check_for_updates_changed)
lwidget = BasicLabel("%s: " % _('Check for updates')) lwidget = BasicLabel("%s: " % _('Check for updates'))
table.attach(lwidget, 1, 2, current_line, current_line+1, yoptions=0) grid.attach(lwidget, 1, current_line, 1, 1)
table.attach(obox, 2, 3, current_line, current_line+1, yoptions=0) grid.attach(obox, 2, current_line, 1, 1)
current_line += 1 current_line += 1
self.whattype_box = Gtk.ComboBoxText() self.whattype_box = Gtk.ComboBoxText()
@ -1319,11 +1322,11 @@ class GrampsPreferences(ConfigureDialog):
self.whattype_box.set_active(0) self.whattype_box.set_active(0)
self.whattype_box.connect('changed', self.check_for_type_changed) self.whattype_box.connect('changed', self.check_for_type_changed)
lwidget = BasicLabel("%s: " % _('What to check')) lwidget = BasicLabel("%s: " % _('What to check'))
table.attach(lwidget, 1, 2, current_line, current_line+1, yoptions=0) grid.attach(lwidget, 1, current_line, 1, 1)
table.attach(self.whattype_box, 2, 3, current_line, current_line+1, yoptions=0) grid.attach(self.whattype_box, 2, current_line, 1, 1)
current_line += 1 current_line += 1
self.add_entry(table, _('Where to check'), current_line, 'behavior.addons-url', col_attach=1) self.add_entry(grid, _('Where to check'), current_line, 'behavior.addons-url', col_attach=1)
current_line += 1 current_line += 1
checkbutton = Gtk.CheckButton( checkbutton = Gtk.CheckButton(
@ -1331,12 +1334,12 @@ class GrampsPreferences(ConfigureDialog):
checkbutton.set_active(config.get('behavior.do-not-show-previously-seen-updates')) checkbutton.set_active(config.get('behavior.do-not-show-previously-seen-updates'))
checkbutton.connect("toggled", self.toggle_hide_previous_addons) checkbutton.connect("toggled", self.toggle_hide_previous_addons)
table.attach(checkbutton, 0, 3, current_line, current_line+1, yoptions=0) grid.attach(checkbutton, 1, current_line, 1, 1)
button = Gtk.Button(_("Check now")) button = Gtk.Button(_("Check now"))
button.connect("clicked", self.check_for_updates) button.connect("clicked", self.check_for_updates)
table.attach(button, 3, 4, current_line, current_line+1, yoptions=0) grid.attach(button, 3, current_line, 1, 1)
return _('General'), table return _('General'), grid
def check_for_updates(self, button): def check_for_updates(self, button):
try: try:
@ -1368,26 +1371,26 @@ class GrampsPreferences(ConfigureDialog):
self.uistate.viewmanager.do_reg_plugins(self.dbstate, self.uistate) self.uistate.viewmanager.do_reg_plugins(self.dbstate, self.uistate)
def add_famtree_panel(self, configdialog): def add_famtree_panel(self, configdialog):
table = Gtk.Table(n_rows=2, n_columns=2) grid = Gtk.Grid()
table.set_border_width(12) grid.set_border_width(12)
table.set_col_spacings(6) grid.set_column_spacing(6)
table.set_row_spacings(6) grid.set_row_spacing(6)
self.dbpath_entry = Gtk.Entry() self.dbpath_entry = Gtk.Entry()
self.add_path_box(table, self.add_path_box(grid,
_('Family Tree Database path'), _('Family Tree Database path'),
0, self.dbpath_entry, config.get('behavior.database-path'), 0, self.dbpath_entry, config.get('behavior.database-path'),
self.set_dbpath, self.select_dbpath) self.set_dbpath, self.select_dbpath)
#self.add_entry(table, #self.add_entry(grid,
# _('Family Tree Database path'), # _('Family Tree Database path'),
# 0, 'behavior.database-path') # 0, 'behavior.database-path')
self.add_checkbox(table, self.add_checkbox(grid,
_('Automatically load last Family Tree'), _('Automatically load last Family Tree'),
1, 'behavior.autoload') 1, 'behavior.autoload')
return _('Family Tree'), table return _('Family Tree'), grid
def set_mediapath(self, *obj): def set_mediapath(self, *obj):
if self.path_entry.get_text().strip(): if self.path_entry.get_text().strip():

View File

@ -47,13 +47,12 @@ class SidebarFilter(DbGUIElement):
DbGUIElement.__init__(self, dbstate.db) DbGUIElement.__init__(self, dbstate.db)
self.position = 1 self.position = 1
self.vbox = Gtk.VBox() self.vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.table = Gtk.Table(n_rows=4, n_columns=11) self.grid = Gtk.Grid()
self.vbox.pack_start(self.table, False, False, 0) self.vbox.pack_start(self.grid, False, False, 0)
self.table.set_border_width(6) self.grid.set_border_width(6)
self.table.set_row_spacings(6) self.grid.set_row_spacing(6)
self.table.set_col_spacing(0, 6) self.grid.set_column_spacing(6)
self.table.set_col_spacing(1, 6)
self.apply_btn = Gtk.Button(stock=Gtk.STOCK_FIND) self.apply_btn = Gtk.Button(stock=Gtk.STOCK_FIND)
self.clear_btn = Gtk.Button() self.clear_btn = Gtk.Button()
@ -71,7 +70,7 @@ class SidebarFilter(DbGUIElement):
self.apply_btn.connect('clicked', self.clicked) self.apply_btn.connect('clicked', self.clicked)
hbox = Gtk.HBox() hbox = Gtk.Box()
hbox.show() hbox.show()
image = Gtk.Image() image = Gtk.Image()
image.set_from_stock(Gtk.STOCK_UNDO, Gtk.IconSize.BUTTON) image.set_from_stock(Gtk.STOCK_UNDO, Gtk.IconSize.BUTTON)
@ -116,7 +115,7 @@ class SidebarFilter(DbGUIElement):
pass pass
def add_regex_entry(self, widget): def add_regex_entry(self, widget):
hbox = Gtk.HBox() hbox = Gtk.Box()
hbox.pack_start(widget, False, False, 12) hbox.pack_start(widget, False, False, 12)
self.vbox.pack_start(hbox, False, False, 0) self.vbox.pack_start(hbox, False, False, 0)
@ -137,17 +136,14 @@ class SidebarFilter(DbGUIElement):
label.set_text('<b>%s</b>' % heading) label.set_text('<b>%s</b>' % heading)
label.set_use_markup(True) label.set_use_markup(True)
label.set_alignment(0, 0.5) label.set_alignment(0, 0.5)
self.table.attach(label, 1, 2, self.position, self.position+1, self.grid.attach(label, 1, self.position, 1, 1)
xoptions=Gtk.AttachOptions.FILL, yoptions=0)
self.position += 1 self.position += 1
def add_entry(self, name, widget): def add_entry(self, name, widget):
if name: if name:
self.table.attach(widgets.BasicLabel(name), self.grid.attach(widgets.BasicLabel(name), 1, self.position, 1, 1)
1, 2, self.position, self.position+1, widget.set_hexpand(True)
xoptions=Gtk.AttachOptions.FILL, yoptions=0) self.grid.attach(widget, 2, self.position, 2, 1)
self.table.attach(widget, 2, 4, self.position, self.position+1,
xoptions=Gtk.AttachOptions.FILL|Gtk.AttachOptions.EXPAND, yoptions=0)
self.position += 1 self.position += 1
def on_filters_changed(self, namespace): def on_filters_changed(self, namespace):
@ -225,7 +221,7 @@ class SidebarFilter(DbGUIElement):
""" """
Adds the text and widget to GUI, with an Edit button. Adds the text and widget to GUI, with an Edit button.
""" """
hbox = Gtk.HBox() hbox = Gtk.Box()
hbox.pack_start(widget, True, True, 0) hbox.pack_start(widget, True, True, 0)
hbox.pack_start(widgets.SimpleButton(Gtk.STOCK_EDIT, self.edit_filter), hbox.pack_start(widgets.SimpleButton(Gtk.STOCK_EDIT, self.edit_filter),
False, False, 0) False, False, 0)

View File

@ -111,7 +111,7 @@ class PluginStatus(ManagedWindow):
notebook = Gtk.Notebook() notebook = Gtk.Notebook()
#first page with all registered plugins #first page with all registered plugins
vbox_reg = Gtk.VBox() vbox_reg = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
scrolled_window_reg = Gtk.ScrolledWindow() scrolled_window_reg = Gtk.ScrolledWindow()
self.list_reg = Gtk.TreeView() self.list_reg = Gtk.TreeView()
# model: plugintype, hidden, pluginname, plugindescr, pluginid # model: plugintype, hidden, pluginname, plugindescr, pluginid
@ -162,7 +162,7 @@ class PluginStatus(ManagedWindow):
tab_label=Gtk.Label(label=_('Registered Plugins'))) tab_label=Gtk.Label(label=_('Registered Plugins')))
#second page with loaded plugins #second page with loaded plugins
vbox_loaded = Gtk.VBox() vbox_loaded = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
scrolled_window = Gtk.ScrolledWindow() scrolled_window = Gtk.ScrolledWindow()
self.list = Gtk.TreeView() self.list = Gtk.TreeView()
self.model = Gtk.ListStore(GObject.TYPE_STRING, GObject.TYPE_STRING, self.model = Gtk.ListStore(GObject.TYPE_STRING, GObject.TYPE_STRING,
@ -218,7 +218,7 @@ class PluginStatus(ManagedWindow):
tab_label=Gtk.Label(label=_('Loaded Plugins'))) tab_label=Gtk.Label(label=_('Loaded Plugins')))
#third page with method to install plugin #third page with method to install plugin
install_page = Gtk.VBox() install_page = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
scrolled_window = Gtk.ScrolledWindow() scrolled_window = Gtk.ScrolledWindow()
self.addon_list = Gtk.TreeView() self.addon_list = Gtk.TreeView()
# model: help_name, name, ptype, image, desc, use, rating, contact, download, url # model: help_name, name, ptype, image, desc, use, rating, contact, download, url
@ -249,7 +249,7 @@ class PluginStatus(ManagedWindow):
self.addon_list.append_column(col) self.addon_list.append_column(col)
self.addon_list.connect('cursor-changed', self.button_press_addon) self.addon_list.connect('cursor-changed', self.button_press_addon)
install_row = Gtk.HBox() install_row = Gtk.Box()
install_row.pack_start(Gtk.Label(label=_("Path to Addon:")), False, True, 0) install_row.pack_start(Gtk.Label(label=_("Path to Addon:")), False, True, 0)
self.install_addon_path = Gtk.Entry() self.install_addon_path = Gtk.Entry()
@ -753,12 +753,6 @@ class ToolManagedWindowBase(ManagedWindow):
self.setup_title() self.setup_title()
self.setup_header() self.setup_header()
#self.tbl = Gtk.Table(4, 4, False)
#self.tbl.set_col_spacings(12)
#self.tbl.set_row_spacings(6)
#self.tbl.set_border_width(6)
#self.col = 0
#self.window.vbox.add(self.tbl)
# Build the list of widgets that are used to extend the Options # Build the list of widgets that are used to extend the Options
# frame and to create other frames # frame and to create other frames
@ -1006,25 +1000,23 @@ class ToolManagedWindowBase(ManagedWindow):
the add_user_options task.""" the add_user_options task."""
for key in self.frame_names: for key in self.frame_names:
flist = self.frames[key] flist = self.frames[key]
table = Gtk.Table(n_rows=3, n_columns=len(flist)) grid = Gtk.Grid()
table.set_col_spacings(12) grid.set_column_spacing(12)
table.set_row_spacings(6) grid.set_row_spacing(6)
table.set_border_width(6) grid.set_border_width(6)
l = Gtk.Label(label="<b>%s</b>" % key) l = Gtk.Label(label="<b>%s</b>" % key)
l.set_use_markup(True) l.set_use_markup(True)
self.notebook.append_page(table, l) self.notebook.append_page(grid, l)
row = 0 row = 0
for (text, widget) in flist: for (text, widget) in flist:
widget.set_hexpand(True)
if text: if text:
text_widget = Gtk.Label(label='%s:' % text) text_widget = Gtk.Label(label='%s:' % text)
text_widget.set_alignment(0.0, 0.5) text_widget.set_alignment(0.0, 0.5)
table.attach(text_widget, 1, 2, row, row+1, grid.attach(text_widget, 1, row, 1, 1)
Gtk.AttachOptions.SHRINK|Gtk.AttachOptions.FILL, Gtk.AttachOptions.SHRINK) grid.attach(widget, 2, row, 1, 1)
table.attach(widget, 2, 3, row, row+1,
yoptions=Gtk.AttachOptions.SHRINK)
else: else:
table.attach(widget, 2, 3, row, row+1, grid.attach(widget, 2, row, 1, 1)
yoptions=Gtk.AttachOptions.SHRINK)
row += 1 row += 1
self.notebook.show_all() self.notebook.show_all()

View File

@ -166,7 +166,7 @@ class ExportAssistant(Gtk.Assistant, ManagedWindow) :
image = Gtk.Image() image = Gtk.Image()
image.set_from_file(SPLASH) image.set_from_file(SPLASH)
box = Gtk.VBox() box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
box.set_size_request(600, -1) # wide enough it won't have to expand box.set_size_request(600, -1) # wide enough it won't have to expand
box.pack_start(image, False, False, 5) box.pack_start(image, False, False, 5)
box.pack_start(label, False, False, 5) box.pack_start(label, False, False, 5)
@ -183,18 +183,18 @@ class ExportAssistant(Gtk.Assistant, ManagedWindow) :
"""Create the export type page. """Create the export type page.
A Title label. A Title label.
A table of format radio buttons and their descriptions. A grid of format radio buttons and their descriptions.
""" """
self.format_buttons = [] self.format_buttons = []
box = Gtk.VBox() box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
box.set_border_width(12) box.set_border_width(12)
box.set_spacing(12) box.set_spacing(12)
table = Gtk.Table(n_rows=2*len(self.__exporters), n_columns=2) grid = Gtk.Grid()
table.set_row_spacings(6) grid.set_row_spacings(6)
table.set_col_spacings(6) grid.set_col_spacings(6)
button = None button = None
recent_type = config.get('behavior.recent-export-type') recent_type = config.get('behavior.recent-export-type')
@ -209,12 +209,12 @@ class ExportAssistant(Gtk.Assistant, ManagedWindow) :
button = Gtk.RadioButton.new_with_mnemonic_from_widget(button, title) button = Gtk.RadioButton.new_with_mnemonic_from_widget(button, title)
button.set_tooltip_text(description) button.set_tooltip_text(description)
self.format_buttons.append(button) self.format_buttons.append(button)
table.attach(button, 0, 2, 2*ix, 2*ix+1) grid.attach(button, 0, 2*ix, 2, 1)
if ix == recent_type: if ix == recent_type:
button.set_active(True) button.set_active(True)
ix += 1 ix += 1
box.pack_start(table, False, False, 0) box.pack_start(grid, False, False, 0)
page = box page = box
@ -228,7 +228,7 @@ class ExportAssistant(Gtk.Assistant, ManagedWindow) :
def create_page_options(self): def create_page_options(self):
# as we do not know yet what to show, we create an empty page # as we do not know yet what to show, we create an empty page
page = Gtk.VBox() page = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
page.set_border_width(12) page.set_border_width(12)
page.set_spacing(12) page.set_spacing(12)
@ -340,7 +340,7 @@ class ExportAssistant(Gtk.Assistant, ManagedWindow) :
image = Gtk.Image() image = Gtk.Image()
image.set_from_file(SPLASH) image.set_from_file(SPLASH)
box = Gtk.VBox() box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
box.set_border_width(12) box.set_border_width(12)
box.set_spacing(6) box.set_spacing(6)
box.pack_start(image, False, False, 5) box.pack_start(image, False, False, 5)
@ -356,7 +356,7 @@ class ExportAssistant(Gtk.Assistant, ManagedWindow) :
# Construct summary page # Construct summary page
# As this is the last page needs to be of page_type # As this is the last page needs to be of page_type
# Gtk.AssistantPageType.CONFIRM or Gtk.AssistantPageType.SUMMARY # Gtk.AssistantPageType.CONFIRM or Gtk.AssistantPageType.SUMMARY
vbox = Gtk.VBox() vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
vbox.set_border_width(12) vbox.set_border_width(12)
vbox.set_spacing(6) vbox.set_spacing(6)

View File

@ -137,12 +137,12 @@ class WriterOptionBox(object):
self.parse_options() self.parse_options()
def get_option_box(self): def get_option_box(self):
"""Build up a Gtk.Table that contains the standard options.""" """Build up a Gtk.Box that contains the standard options."""
from gi.repository import Gtk from gi.repository import Gtk
from gi.repository import Pango from gi.repository import Pango
widget = Gtk.VBox() widget = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
full_database_row = Gtk.HBox() full_database_row = Gtk.Box()
full_database_row.pack_start(Gtk.Label(_("Unfiltered Family Tree:")), True, True, 0) full_database_row.pack_start(Gtk.Label(_("Unfiltered Family Tree:")), True, True, 0)
people_count = len(self.dbstate.db.get_person_handles()) people_count = len(self.dbstate.db.get_person_handles())
# translators: leave all/any {...} untranslated # translators: leave all/any {...} untranslated
@ -154,7 +154,7 @@ class WriterOptionBox(object):
button.connect("clicked", self.show_preview_data) button.connect("clicked", self.show_preview_data)
button.proxy_name = "unfiltered" button.proxy_name = "unfiltered"
self.preview_proxy_button["unfiltered"] = button self.preview_proxy_button["unfiltered"] = button
self.spacer = Gtk.HBox() self.spacer = Gtk.Box()
full_database_row.pack_end(self.spacer, False, True, 0) full_database_row.pack_end(self.spacer, False, True, 0)
full_database_row.pack_end(button, False, True, 0) full_database_row.pack_end(button, False, True, 0)
@ -175,7 +175,7 @@ class WriterOptionBox(object):
widget.pack_start(frame, False, True, 0) widget.pack_start(frame, False, True, 0)
row += 1 row += 1
hbox = Gtk.HBox() hbox = Gtk.Box()
self.advanced_button = Gtk.Button(_("Change order")) self.advanced_button = Gtk.Button(_("Change order"))
self.advanced_button.set_size_request(150, -1) self.advanced_button.set_size_request(150, -1)
self.proxy_options_showing = False self.proxy_options_showing = False
@ -266,7 +266,7 @@ class WriterOptionBox(object):
label.set_size_request(150, -1) label.set_size_request(150, -1)
label.set_use_underline(True) label.set_use_underline(True)
label.set_mnemonic_widget(self.filter_obj) label.set_mnemonic_widget(self.filter_obj)
box = Gtk.HBox() box = Gtk.Box()
box.pack_start(label, False, True, 0) box.pack_start(label, False, True, 0)
box.pack_start(self.filter_obj, True, True, 0) box.pack_start(self.filter_obj, True, True, 0)
box.pack_start( box.pack_start(
@ -283,7 +283,7 @@ class WriterOptionBox(object):
label_note.set_size_request(150, -1) label_note.set_size_request(150, -1)
label_note.set_use_underline(True) label_note.set_use_underline(True)
label_note.set_mnemonic_widget(self.filter_note) label_note.set_mnemonic_widget(self.filter_note)
box = Gtk.HBox() box = Gtk.Box()
box.pack_start(label_note, False, True, 0) box.pack_start(label_note, False, True, 0)
box.pack_start(self.filter_note, True, True, 0) box.pack_start(self.filter_note, True, True, 0)
box.pack_start( box.pack_start(
@ -296,7 +296,7 @@ class WriterOptionBox(object):
label = Gtk.Label(label=_("Privacy Filter") + ":") label = Gtk.Label(label=_("Privacy Filter") + ":")
label.set_alignment(0, 0.5) label.set_alignment(0, 0.5)
label.set_size_request(150, -1) label.set_size_request(150, -1)
box = Gtk.HBox() box = Gtk.Box()
box.pack_start(label, False, True, 0) box.pack_start(label, False, True, 0)
box.add(self.private_check) box.add(self.private_check)
button.set_tooltip_text(_("Click to see preview after privacy filter")) button.set_tooltip_text(_("Click to see preview after privacy filter"))
@ -305,7 +305,7 @@ class WriterOptionBox(object):
label = Gtk.Label(label=_("Living Filter") + ":") label = Gtk.Label(label=_("Living Filter") + ":")
label.set_alignment(0, 0.5) label.set_alignment(0, 0.5)
label.set_size_request(150, -1) label.set_size_request(150, -1)
box = Gtk.HBox() box = Gtk.Box()
box.pack_start(label, False, True, 0) box.pack_start(label, False, True, 0)
self.restrict_option = Gtk.ComboBox() self.restrict_option = Gtk.ComboBox()
box.add(self.restrict_option) box.add(self.restrict_option)
@ -316,7 +316,7 @@ class WriterOptionBox(object):
label = Gtk.Label(label=_('Reference Filter') + ": ") label = Gtk.Label(label=_('Reference Filter') + ": ")
label.set_alignment(0, 0.5) label.set_alignment(0, 0.5)
label.set_size_request(150, -1) label.set_size_request(150, -1)
box = Gtk.HBox() box = Gtk.Box()
box.pack_start(label, False, True, 0) box.pack_start(label, False, True, 0)
box.pack_start(self.reference_filter, True, True, 0) box.pack_start(self.reference_filter, True, True, 0)
button.set_tooltip_text(_("Click to see preview after reference filter")) button.set_tooltip_text(_("Click to see preview after reference filter"))
@ -324,9 +324,9 @@ class WriterOptionBox(object):
raise AttributeError("Unknown proxy '%s'" % proxy_name) raise AttributeError("Unknown proxy '%s'" % proxy_name)
frame = Gtk.Frame() frame = Gtk.Frame()
hbox = Gtk.HBox() hbox = Gtk.Box()
frame.add(hbox) frame.add(hbox)
vbox = Gtk.HBox() vbox = Gtk.Box()
self.vbox_n.append(vbox) self.vbox_n.append(vbox)
up = Gtk.Button() up = Gtk.Button()
up.connect("clicked", self.swap) up.connect("clicked", self.swap)

View File

@ -132,8 +132,8 @@ class DocReportDialog(ReportDialog):
else: else:
self.html_label = Gtk.Label(label='<b>%s</b>' % _("HTML Options")) self.html_label = Gtk.Label(label='<b>%s</b>' % _("HTML Options"))
self.html_label.set_use_markup(True) self.html_label.set_use_markup(True)
self.notebook.insert_page(self.html_table, self.html_label, 0) self.notebook.insert_page(self.html_grid, self.html_label, 0)
self.html_table.show_all() self.html_grid.show_all()
if preserve_tab: if preserve_tab:
self.notebook.set_current_page(old_page) self.notebook.set_current_page(old_page)
self.firstpage_added = True self.firstpage_added = True
@ -169,16 +169,15 @@ class DocReportDialog(ReportDialog):
self.format_menu.connect('changed', self.doc_type_changed) self.format_menu.connect('changed', self.doc_type_changed)
label = Gtk.Label(label="%s:" % _("Output Format")) label = Gtk.Label(label="%s:" % _("Output Format"))
label.set_alignment(0.0, 0.5) label.set_alignment(0.0, 0.5)
self.tbl.attach(label, 1, 2, self.row, self.row+1, Gtk.AttachOptions.SHRINK|Gtk.AttachOptions.FILL) self.grid.attach(label, 1, self.row, 1, 1)
self.tbl.attach(self.format_menu, 2, 4, self.row, self.row+1, self.format_menu.set_hexpand(True)
yoptions=Gtk.AttachOptions.SHRINK) self.grid.attach(self.format_menu, 2, self.row, 2, 1)
self.row += 1 self.row += 1
self.open_with_app = Gtk.CheckButton(label=_("Open with default viewer")) self.open_with_app = Gtk.CheckButton(label=_("Open with default viewer"))
self.open_with_app.set_active( self.open_with_app.set_active(
config.get('interface.open-with-default-viewer')) config.get('interface.open-with-default-viewer'))
self.tbl.attach(self.open_with_app, 2, 4, self.row, self.row+1, self.grid.attach(self.open_with_app, 2, self.row, 2, 1)
yoptions=Gtk.AttachOptions.SHRINK)
self.row += 1 self.row += 1
ext = self.format_menu.get_active_plugin().get_extension() ext = self.format_menu.get_active_plugin().get_extension()
@ -209,17 +208,17 @@ class DocReportDialog(ReportDialog):
this function is to grab a pointer for later use in the parse this function is to grab a pointer for later use in the parse
html frame function.""" html frame function."""
self.html_table = Gtk.Table(n_rows=3, n_columns=3) self.html_grid = Gtk.Grid()
self.html_table.set_col_spacings(12) self.html_grid.set_column_spacing(12)
self.html_table.set_row_spacings(6) self.html_grid.set_row_spacing(6)
self.html_table.set_border_width(0) self.html_grid.set_border_width(6)
label = Gtk.Label(label="%s:" % _("CSS file")) label = Gtk.Label(label="%s:" % _("CSS file"))
label.set_alignment(0.0,0.5) label.set_alignment(0.0,0.5)
self.html_table.attach(label, 1, 2, 1, 2, Gtk.AttachOptions.SHRINK|Gtk.AttachOptions.FILL, self.html_grid.attach(label, 1, 1, 1, 1)
yoptions=Gtk.AttachOptions.SHRINK)
self.css_combo = Gtk.ComboBoxText() self.css_combo = Gtk.ComboBoxText()
self.css_combo.set_hexpand(True)
css_filename = self.options.handler.get_css_filename() css_filename = self.options.handler.get_css_filename()
active_index = 0 active_index = 0
@ -234,7 +233,7 @@ class DocReportDialog(ReportDialog):
active_index = index active_index = index
index += 1 index += 1
self.html_table.attach(self.css_combo,2,3,1,2, yoptions=Gtk.AttachOptions.SHRINK) self.html_grid.attach(self.css_combo, 2, 1, 1, 1)
self.css_combo.set_active(active_index) self.css_combo.set_active(active_index)
def parse_format_frame(self): def parse_format_frame(self):

View File

@ -173,10 +173,10 @@ class ReportDialog(ManagedWindow):
self.setup_title() self.setup_title()
self.setup_header() self.setup_header()
self.tbl = Gtk.Table(n_rows=4, n_columns=4, homogeneous=False) self.grid = Gtk.Grid()
self.tbl.set_col_spacings(12) self.grid.set_column_spacing(12)
self.tbl.set_row_spacings(6) self.grid.set_row_spacing(6)
self.tbl.set_border_width(6) self.grid.set_border_width(6)
self.row = 0 self.row = 0
# Build the list of widgets that are used to extend the Options # Build the list of widgets that are used to extend the Options
@ -204,10 +204,10 @@ class ReportDialog(ManagedWindow):
try: try:
#assume a vbox or hbox #assume a vbox or hbox
self.window.vbox.pack_start(self.tbl, expand=True, fill=True, padding=0) self.window.vbox.pack_start(self.grid, expand=True, fill=True, padding=0)
except: except:
#general container instead: #general container instead:
self.window.vbox.add(self.tbl) self.window.vbox.add(self.grid)
self.show() self.show()
def get_title(self): def get_title(self):
@ -321,14 +321,13 @@ class ReportDialog(ManagedWindow):
label.set_alignment(0.0, 0.5) label.set_alignment(0.0, 0.5)
self.style_menu = StyleComboBox() self.style_menu = StyleComboBox()
self.style_menu.set_hexpand(True)
self.style_button = Gtk.Button("%s..." % _("Style Editor")) self.style_button = Gtk.Button("%s..." % _("Style Editor"))
self.style_button.connect('clicked', self.on_style_edit_clicked) self.style_button.connect('clicked', self.on_style_edit_clicked)
self.tbl.attach(label, 1, 2, self.row, self.row+1, Gtk.AttachOptions.SHRINK|Gtk.AttachOptions.FILL) self.grid.attach(label, 1, self.row, 1, 1)
self.tbl.attach(self.style_menu, 2, 3, self.row, self.row+1, self.grid.attach(self.style_menu, 2, self.row, 1, 1)
yoptions=Gtk.AttachOptions.SHRINK) self.grid.attach(self.style_button, 3, self.row, 1, 1)
self.tbl.attach(self.style_button, 3, 4, self.row, self.row+1,
xoptions=Gtk.AttachOptions.SHRINK|Gtk.AttachOptions.FILL, yoptions=Gtk.AttachOptions.SHRINK)
self.row += 1 self.row += 1
# Build the initial list of available styles sets. This # Build the initial list of available styles sets. This
@ -356,60 +355,54 @@ class ReportDialog(ManagedWindow):
if max_rows == 0: if max_rows == 0:
return return
table = Gtk.Table(n_rows=3, n_columns=max_rows+1) grid = Gtk.Grid()
table.set_col_spacings(12) grid.set_border_width(6)
table.set_row_spacings(6) grid.set_column_spacing(12)
grid.set_row_spacing(6)
label = Gtk.Label(label="<b>%s</b>" % _("Report Options")) label = Gtk.Label(label="<b>%s</b>" % _("Report Options"))
label.set_alignment(0.0, 0.5) label.set_alignment(0.0, 0.5)
label.set_use_markup(True) label.set_use_markup(True)
table.set_border_width(6) self.notebook.append_page(grid, label)
self.notebook.append_page(table, label)
row += 1
# Setup requested widgets # Setup requested widgets
for (text, widget) in self.widgets: for (text, widget) in self.widgets:
widget.set_hexpand(True)
if text: if text:
text_widget = Gtk.Label(label="%s:" % text) text_widget = Gtk.Label(label="%s:" % text)
text_widget.set_alignment(0.0, 0.0) text_widget.set_alignment(0.0, 0.0)
table.attach(text_widget, 1, 2, row, row+1, grid.attach(text_widget, 1, row, 1, 1)
Gtk.AttachOptions.SHRINK|Gtk.AttachOptions.FILL, Gtk.AttachOptions.SHRINK) grid.attach(widget, 2, row, 1, 1)
table.attach(widget, 2, 3, row, row+1,
yoptions=Gtk.AttachOptions.SHRINK)
else: else:
table.attach(widget, 2, 3, row, row+1, grid.attach(widget, 2, row, 1, 1)
yoptions=Gtk.AttachOptions.SHRINK)
row += 1 row += 1
def setup_other_frames(self): def setup_other_frames(self):
from gramps.gui.plug._guioptions import GuiTextOption from gramps.gui.plug._guioptions import GuiTextOption
for key in self.frame_names: for key in self.frame_names:
flist = self.frames[key] flist = self.frames[key]
table = Gtk.Table(n_rows=3, n_columns=len(flist)) grid = Gtk.Grid()
table.set_col_spacings(12) grid.set_column_spacing(12)
table.set_row_spacings(6) grid.set_row_spacing(6)
table.set_border_width(6) grid.set_border_width(6)
l = Gtk.Label(label="<b>%s</b>" % _(key)) l = Gtk.Label(label="<b>%s</b>" % _(key))
l.set_use_markup(True) l.set_use_markup(True)
self.notebook.append_page(table, l) self.notebook.append_page(grid, l)
row = 0 row = 0
for (text, widget) in flist: for (text, widget) in flist:
widget.set_hexpand(True)
if text: if text:
text_widget = Gtk.Label(label='%s:' % text) text_widget = Gtk.Label(label='%s:' % text)
text_widget.set_alignment(0.0, 0.5) text_widget.set_alignment(0.0, 0.5)
table.attach(text_widget, 1, 2, row, row+1, grid.attach(text_widget, 1, row, 1, 1)
Gtk.AttachOptions.SHRINK|Gtk.AttachOptions.FILL, Gtk.AttachOptions.SHRINK)
if isinstance(widget, GuiTextOption): if isinstance(widget, GuiTextOption):
table.attach(widget, 2, 3, row, row+1, grid.attach(widget, 2, row, 1, 1)
yoptions=Gtk.AttachOptions.EXPAND|Gtk.AttachOptions.FILL)
else: else:
table.attach(widget, 2, 3, row, row+1, grid.attach(widget, 2, row, 1, 1)
yoptions=Gtk.AttachOptions.SHRINK)
else: else:
table.attach(widget, 2, 3, row, row+1, grid.attach(widget, 2, row, 1, 1)
yoptions=Gtk.AttachOptions.SHRINK)
row += 1 row += 1
#------------------------------------------------------------------------ #------------------------------------------------------------------------
@ -459,8 +452,8 @@ class ReportDialog(ManagedWindow):
label = Gtk.Label(label="<b>%s</b>" % _('Document Options')) label = Gtk.Label(label="<b>%s</b>" % _('Document Options'))
label.set_use_markup(1) label.set_use_markup(1)
label.set_alignment(0.0, 0.5) label.set_alignment(0.0, 0.5)
self.tbl.set_border_width(12) self.grid.set_border_width(12)
self.tbl.attach(label, 0, 4, self.row, self.row+1, Gtk.AttachOptions.FILL) self.grid.attach(label, 0, self.row, 4, 1)
self.row += 1 self.row += 1
def setup_target_frame(self): def setup_target_frame(self):
@ -474,10 +467,9 @@ class ReportDialog(ManagedWindow):
self.doc_label = Gtk.Label(label="%s:" % _("Filename")) self.doc_label = Gtk.Label(label="%s:" % _("Filename"))
self.doc_label.set_alignment(0.0, 0.5) self.doc_label.set_alignment(0.0, 0.5)
self.tbl.attach(self.doc_label, 1, 2, self.row, self.row+1, self.grid.attach(self.doc_label, 1, self.row, 1, 1)
xoptions=Gtk.AttachOptions.SHRINK|Gtk.AttachOptions.FILL,yoptions=Gtk.AttachOptions.SHRINK) self.target_fileentry.set_hexpand(True)
self.tbl.attach(self.target_fileentry, 2, 4, self.row, self.row+1, self.grid.attach(self.target_fileentry, 2, self.row, 2, 1)
xoptions=Gtk.AttachOptions.EXPAND|Gtk.AttachOptions.FILL,yoptions=Gtk.AttachOptions.SHRINK)
self.row += 1 self.row += 1
#------------------------------------------------------------------------ #------------------------------------------------------------------------
@ -594,7 +586,7 @@ class ReportDialog(ManagedWindow):
def setup_doc_options_frame(self): def setup_doc_options_frame(self):
if self.doc_widgets: if self.doc_widgets:
for option_widget in self.doc_widgets: for option_widget in self.doc_widgets:
self.tbl.remove(option_widget) self.grid.remove(option_widget)
self.doc_widgets = [] self.doc_widgets = []
self.doc_options = None self.doc_options = None
@ -613,11 +605,9 @@ class ReportDialog(ManagedWindow):
if has_label: if has_label:
widget_text = Gtk.Label('%s:' % option.get_label()) widget_text = Gtk.Label('%s:' % option.get_label())
widget_text.set_alignment(0.0, 0.0) widget_text.set_alignment(0.0, 0.0)
self.tbl.attach(widget_text, 1, 2, self.row, self.row+1, self.grid.attach(widget_text, 1, self.row, 1, 1)
Gtk.AttachOptions.SHRINK|Gtk.AttachOptions.FILL, Gtk.AttachOptions.SHRINK)
self.doc_widgets.append(widget_text) self.doc_widgets.append(widget_text)
self.tbl.attach(widget, 2, 4, self.row, self.row+1, self.grid.attach(widget, 2, self.row, 2, 1)
yoptions=Gtk.AttachOptions.SHRINK)
self.doc_widgets.append(widget) self.doc_widgets.append(widget)
self.row += 1 self.row += 1

View File

@ -563,10 +563,12 @@ class GuiGramplet(object):
# END WORKAROUND # END WORKAROUND
if len(self.pui.option_order) == 0: return if len(self.pui.option_order) == 0: return
frame = Gtk.Frame() frame = Gtk.Frame()
topbox = Gtk.VBox(homogeneous=False) topbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
hbox = Gtk.HBox(homogeneous=False, spacing=5) hbox = Gtk.Box(spacing=5)
labels = Gtk.VBox(homogeneous=True) labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL,
options = Gtk.VBox(homogeneous=True) homogeneous=True)
options = Gtk.Box(orientation=Gtk.Orientation.VERTICAL,
homogeneous=True)
hbox.pack_start(labels, False, True, 0) hbox.pack_start(labels, False, True, 0)
hbox.pack_start(options, True, True, 0) hbox.pack_start(options, True, True, 0)
topbox.pack_start(hbox, False, False, 0) topbox.pack_start(hbox, False, False, 0)
@ -996,7 +998,7 @@ class GrampletPane(Gtk.ScrolledWindow):
self.set_tooltip_text(msg) self.set_tooltip_text(msg)
self.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) self.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
self.eventb = Gtk.EventBox() self.eventb = Gtk.EventBox()
self.hbox = Gtk.HBox(homogeneous=True) self.hbox = Gtk.Box(homogeneous=True)
self.eventb.add(self.hbox) self.eventb.add(self.hbox)
self.add_with_viewport(self.eventb) self.add_with_viewport(self.eventb)
self.set_kinetic_scrolling(True) self.set_kinetic_scrolling(True)
@ -1017,7 +1019,7 @@ class GrampletPane(Gtk.ScrolledWindow):
# Create the columns: # Create the columns:
self.columns = [] self.columns = []
for i in range(self.column_count): for i in range(self.column_count):
self.columns.append(Gtk.VBox()) self.columns.append(Gtk.Box(orientation=Gtk.Orientation.VERTICAL))
self.hbox.pack_start(self.columns[-1], True, True, 0) self.hbox.pack_start(self.columns[-1], True, True, 0)
# Load the gramplets # Load the gramplets
self.gramplet_map = {} # title->gramplet self.gramplet_map = {} # title->gramplet
@ -1334,7 +1336,7 @@ class GrampletPane(Gtk.ScrolledWindow):
self.column_count = num self.column_count = num
self.columns = [] self.columns = []
for i in range(self.column_count): for i in range(self.column_count):
self.columns.append(Gtk.VBox()) self.columns.append(Gtk.Box(orientation=Gtk.Orientation.VERTICAL))
self.columns[-1].show() self.columns[-1].show()
self.hbox.pack_start(self.columns[-1], True, True, 0) self.hbox.pack_start(self.columns[-1], True, True, 0)
# place the gramplets back in the new columns # place the gramplets back in the new columns
@ -1517,23 +1519,23 @@ class GrampletPane(Gtk.ScrolledWindow):
""" """
Function that builds the widget in the configuration dialog Function that builds the widget in the configuration dialog
""" """
table = Gtk.Table(n_rows=3, n_columns=2) grid = Gtk.Grid()
table.set_border_width(12) grid.set_border_width(12)
table.set_col_spacings(6) grid.set_column_spacing(6)
table.set_row_spacings(6) grid.set_row_spacing(6)
self._config.register('Gramplet View Options.column_count', self._config.register('Gramplet View Options.column_count',
int, int,
self.get_columns, # pane self.get_columns, # pane
self.set_columns) # pane self.set_columns) # pane
configdialog.add_pos_int_entry(table, configdialog.add_pos_int_entry(grid,
_('Number of Columns'), _('Number of Columns'),
0, 0,
'Gramplet View Options.column_count', 'Gramplet View Options.column_count',
self._config.set, self._config.set,
config=self._config) config=self._config)
return _('Gramplet Layout'), table return _('Gramplet Layout'), grid
def build_panel(self, gramplet): def build_panel(self, gramplet):
self._config.register("%s.title" % gramplet.title, self._config.register("%s.title" % gramplet.title,
@ -1550,39 +1552,39 @@ class GrampletPane(Gtk.ScrolledWindow):
bool, gramplet.get_expand, gramplet.set_expand) bool, gramplet.get_expand, gramplet.set_expand)
def gramplet_panel(configdialog): def gramplet_panel(configdialog):
configdialog.window.set_size_request(600, -1) configdialog.window.set_size_request(600, -1)
table = Gtk.Table(n_rows=3, n_columns=2) grid = Gtk.Grid()
table.set_border_width(12) grid.set_border_width(12)
table.set_col_spacings(6) grid.set_column_spacing(6)
table.set_row_spacings(6) grid.set_row_spacing(6)
# Title: # Title:
configdialog.add_entry(table, configdialog.add_entry(grid,
_('Title'), _('Title'),
0, 0,
"%s.title" % gramplet.title, "%s.title" % gramplet.title,
self._config.set, self._config.set,
config=self._config) config=self._config)
# Expand to max height # Expand to max height
configdialog.add_checkbox(table, configdialog.add_checkbox(grid,
_("Use maximum height available"), _("Use maximum height available"),
1, 1,
"%s.expand" % gramplet.title, "%s.expand" % gramplet.title,
config=self._config) config=self._config)
# Height # Height
configdialog.add_pos_int_entry(table, configdialog.add_pos_int_entry(grid,
_('Height if not maximized'), _('Height if not maximized'),
2, 2,
"%s.height" % gramplet.title, "%s.height" % gramplet.title,
self._config.set, self._config.set,
config=self._config) config=self._config)
# Detached height # Detached height
configdialog.add_pos_int_entry(table, configdialog.add_pos_int_entry(grid,
_('Detached width'), _('Detached width'),
3, 3,
"%s.detached_width" % gramplet.title, "%s.detached_width" % gramplet.title,
self._config.set, self._config.set,
config=self._config) config=self._config)
# Detached width # Detached width
configdialog.add_pos_int_entry(table, configdialog.add_pos_int_entry(grid,
_('Detached height'), _('Detached height'),
4, 4,
"%s.detached_height" % gramplet.title, "%s.detached_height" % gramplet.title,
@ -1591,8 +1593,8 @@ class GrampletPane(Gtk.ScrolledWindow):
# Options: # Options:
options = gramplet.make_gui_options() options = gramplet.make_gui_options()
if options: if options:
table.attach(options, 1, 4, 5, 6, yoptions=0) grid.attach(options, 1, 5, 3, 1)
return gramplet.title, table return gramplet.title, grid
return gramplet_panel return gramplet_panel
class Configuration(object): class Configuration(object):

View File

@ -44,16 +44,17 @@ class PersonDetails(Gramplet):
""" """
Build the GUI interface. Build the GUI interface.
""" """
self.top = Gtk.HBox() self.top = Gtk.Box()
vbox = Gtk.VBox() vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.photo = Photo(self.uistate.screen_height() < 1000) self.photo = Photo(self.uistate.screen_height() < 1000)
self.photo.show() self.photo.show()
self.name = Gtk.Label() self.name = Gtk.Label()
self.name.set_alignment(0, 0) self.name.set_alignment(0, 0)
self.name.modify_font(Pango.FontDescription('sans bold 12')) self.name.modify_font(Pango.FontDescription('sans bold 12'))
vbox.pack_start(self.name, fill=True, expand=False, padding=7) vbox.pack_start(self.name, fill=True, expand=False, padding=7)
self.table = Gtk.Table(n_rows=1, n_columns=2) self.grid = Gtk.Grid(orientation=Gtk.Orientation.VERTICAL)
vbox.pack_start(self.table, fill=True, expand=False, padding=5) self.grid.set_column_spacing(10)
vbox.pack_start(self.grid, fill=True, expand=False, padding=5)
vbox.show_all() vbox.show_all()
self.top.pack_start(self.photo, fill=True, expand=False, padding=5) self.top.pack_start(self.photo, fill=True, expand=False, padding=5)
self.top.pack_start(vbox, fill=True, expand=True, padding=10) self.top.pack_start(vbox, fill=True, expand=True, padding=10)
@ -69,19 +70,14 @@ class PersonDetails(Gramplet):
value = Gtk.Label(label=value) value = Gtk.Label(label=value)
value.set_alignment(0, 0) value.set_alignment(0, 0)
value.show() value.show()
rows = self.table.get_property('n-rows') self.grid.add(label)
rows += 1 self.grid.attach_next_to(value, label, Gtk.PositionType.RIGHT, 1, 1)
self.table.resize(rows, 2)
self.table.attach(label, 0, 1, rows, rows + 1, xoptions=Gtk.AttachOptions.FILL,
xpadding=10)
self.table.attach(value, 1, 2, rows, rows + 1)
def clear_table(self): def clear_grid(self):
""" """
Remove all the rows from the table. Remove all the rows from the grid.
""" """
list(map(self.table.remove, self.table.get_children())) list(map(self.grid.remove, self.grid.get_children()))
self.table.resize(1, 2)
def db_changed(self): def db_changed(self):
self.dbstate.db.connect('person-update', self.update) self.dbstate.db.connect('person-update', self.update)
@ -118,7 +114,7 @@ class PersonDetails(Gramplet):
""" """
self.load_person_image(active_person) self.load_person_image(active_person)
self.name.set_text(name_displayer.display(active_person)) self.name.set_text(name_displayer.display(active_person))
self.clear_table() self.clear_grid()
self.display_alternate_names(active_person) self.display_alternate_names(active_person)
self.display_parents(active_person) self.display_parents(active_person)
self.display_separator() self.display_separator()
@ -138,7 +134,7 @@ class PersonDetails(Gramplet):
self.photo.set_image(None) self.photo.set_image(None)
self.photo.set_uistate(None, None) self.photo.set_uistate(None, None)
self.name.set_text(_('No active person')) self.name.set_text(_('No active person'))
self.clear_table() self.clear_grid()
def display_separator(self): def display_separator(self):
""" """
@ -147,10 +143,7 @@ class PersonDetails(Gramplet):
label = Gtk.Label(label='') label = Gtk.Label(label='')
label.modify_font(Pango.FontDescription('sans 4')) label.modify_font(Pango.FontDescription('sans 4'))
label.show() label.show()
rows = self.table.get_property('n-rows') self.grid.add(label)
rows += 1
self.table.resize(rows, 2)
self.table.attach(label, 0, 1, rows, rows + 1, xoptions=Gtk.AttachOptions.FILL)
def display_alternate_names(self, active_person): def display_alternate_names(self, active_person):
""" """

View File

@ -40,15 +40,16 @@ class PlaceDetails(Gramplet):
""" """
Build the GUI interface. Build the GUI interface.
""" """
self.top = Gtk.HBox() self.top = Gtk.Box()
vbox = Gtk.VBox() vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.photo = Photo(self.uistate.screen_height() < 1000) self.photo = Photo(self.uistate.screen_height() < 1000)
self.title = Gtk.Label() self.title = Gtk.Label()
self.title.set_alignment(0, 0) self.title.set_alignment(0, 0)
self.title.modify_font(Pango.FontDescription('sans bold 12')) self.title.modify_font(Pango.FontDescription('sans bold 12'))
vbox.pack_start(self.title, False, True, 7) vbox.pack_start(self.title, False, True, 7)
self.table = Gtk.Table(n_rows=1, n_columns=2) self.grid = Gtk.Grid(orientation=Gtk.Orientation.VERTICAL)
vbox.pack_start(self.table, False, True, 0) self.grid.set_column_spacing(10)
vbox.pack_start(self.grid, False, True, 0)
self.top.pack_start(self.photo, False, True, 5) self.top.pack_start(self.photo, False, True, 5)
self.top.pack_start(vbox, False, True, 10) self.top.pack_start(vbox, False, True, 10)
self.top.show_all() self.top.show_all()
@ -64,19 +65,14 @@ class PlaceDetails(Gramplet):
value = Gtk.Label(label=value) value = Gtk.Label(label=value)
value.set_alignment(0, 0) value.set_alignment(0, 0)
value.show() value.show()
rows = self.table.get_property('n-rows') self.grid.add(label)
rows += 1 self.grid.attach_next_to(value, label, Gtk.PositionType.RIGHT, 1, 1)
self.table.resize(rows, 2)
self.table.attach(label, 0, 1, rows, rows + 1, xoptions=Gtk.AttachOptions.FILL,
xpadding=10)
self.table.attach(value, 1, 2, rows, rows + 1)
def clear_table(self): def clear_grid(self):
""" """
Remove all the rows from the table. Remove all the rows from the grid.
""" """
list(map(self.table.remove, self.table.get_children())) list(map(self.grid.remove, self.grid.get_children()))
self.table.resize(1, 2)
def db_changed(self): def db_changed(self):
self.dbstate.db.connect('place-update', self.update) self.dbstate.db.connect('place-update', self.update)
@ -113,7 +109,7 @@ class PlaceDetails(Gramplet):
title = place_displayer.display(self.dbstate.db, place) title = place_displayer.display(self.dbstate.db, place)
self.title.set_text(title) self.title.set_text(title)
self.clear_table() self.clear_grid()
self.add_row(_('Name'), place.get_name()) self.add_row(_('Name'), place.get_name())
self.add_row(_('Type'), place.get_type()) self.add_row(_('Type'), place.get_type())
self.display_separator() self.display_separator()
@ -142,7 +138,7 @@ class PlaceDetails(Gramplet):
self.photo.set_image(None) self.photo.set_image(None)
self.photo.set_uistate(None, None) self.photo.set_uistate(None, None)
self.title.set_text('') self.title.set_text('')
self.clear_table() self.clear_grid()
def display_separator(self): def display_separator(self):
""" """
@ -151,10 +147,7 @@ class PlaceDetails(Gramplet):
label = Gtk.Label(label='') label = Gtk.Label(label='')
label.modify_font(Pango.FontDescription('sans 4')) label.modify_font(Pango.FontDescription('sans 4'))
label.show() label.show()
rows = self.table.get_property('n-rows') self.grid.add(label)
rows += 1
self.table.resize(rows, 2)
self.table.attach(label, 0, 1, rows, rows + 1, xoptions=Gtk.AttachOptions.FILL)
def load_place_image(self, place): def load_place_image(self, place):
""" """

View File

@ -37,14 +37,15 @@ class RepositoryDetails(Gramplet):
""" """
Build the GUI interface. Build the GUI interface.
""" """
self.top = Gtk.HBox() self.top = Gtk.Box()
vbox = Gtk.VBox() vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.name = Gtk.Label() self.name = Gtk.Label()
self.name.set_alignment(0, 0) self.name.set_alignment(0, 0)
self.name.modify_font(Pango.FontDescription('sans bold 12')) self.name.modify_font(Pango.FontDescription('sans bold 12'))
vbox.pack_start(self.name, fill=True, expand=False, padding=7) vbox.pack_start(self.name, fill=True, expand=False, padding=7)
self.table = Gtk.Table(n_rows=1, n_columns=2) self.grid = Gtk.Grid(orientation=Gtk.Orientation.VERTICAL)
vbox.pack_start(self.table, fill=True, expand=False, padding=0) self.grid.set_column_spacing(10)
vbox.pack_start(self.grid, fill=True, expand=False, padding=0)
self.top.pack_start(vbox, fill=True, expand=False, padding=10) self.top.pack_start(vbox, fill=True, expand=False, padding=10)
self.top.show_all() self.top.show_all()
return self.top return self.top
@ -59,19 +60,14 @@ class RepositoryDetails(Gramplet):
value = Gtk.Label(label=value) value = Gtk.Label(label=value)
value.set_alignment(0, 0) value.set_alignment(0, 0)
value.show() value.show()
rows = self.table.get_property('n-rows') self.grid.add(label)
rows += 1 self.grid.attach_next_to(value, label, Gtk.PositionType.RIGHT, 1, 1)
self.table.resize(rows, 2)
self.table.attach(label, 0, 1, rows, rows + 1,
xoptions=Gtk.AttachOptions.FILL, xpadding=10)
self.table.attach(value, 1, 2, rows, rows + 1)
def clear_table(self): def clear_grid(self):
""" """
Remove all the rows from the table. Remove all the rows from the grid.
""" """
list(map(self.table.remove, self.table.get_children())) list(map(self.grid.remove, self.grid.get_children()))
self.table.resize(1, 2)
def db_changed(self): def db_changed(self):
self.dbstate.db.connect('repository-update', self.update) self.dbstate.db.connect('repository-update', self.update)
@ -106,7 +102,7 @@ class RepositoryDetails(Gramplet):
""" """
self.name.set_text(repo.get_name()) self.name.set_text(repo.get_name())
self.clear_table() self.clear_grid()
address_list = repo.get_address_list() address_list = repo.get_address_list()
if len(address_list) > 0: if len(address_list) > 0:
self.display_address(address_list[0]) self.display_address(address_list[0])
@ -140,7 +136,7 @@ class RepositoryDetails(Gramplet):
Display empty details when no repository is selected. Display empty details when no repository is selected.
""" """
self.name.set_text('') self.name.set_text('')
self.clear_table() self.clear_grid()
def display_separator(self): def display_separator(self):
""" """
@ -149,8 +145,4 @@ class RepositoryDetails(Gramplet):
label = Gtk.Label(label='') label = Gtk.Label(label='')
label.modify_font(Pango.FontDescription('sans 4')) label.modify_font(Pango.FontDescription('sans 4'))
label.show() label.show()
rows = self.table.get_property('n-rows') self.grid.add(label)
rows += 1
self.table.resize(rows, 2)
self.table.attach(label, 0, 1, rows, rows + 1,
xoptions=Gtk.AttachOptions.FILL)

View File

@ -1040,12 +1040,12 @@ class GeoGraphyView(OsmGps, NavigationView):
Add specific entry to the preference menu. Add specific entry to the preference menu.
Must be done in the associated view. Must be done in the associated view.
""" """
table = Gtk.Table(n_rows=2, n_columns=2) grid = Gtk.Grid()
table.set_border_width(12) grid.set_border_width(12)
table.set_col_spacings(6) grid.set_column_spacing(6)
table.set_row_spacings(6) grid.set_row_spacing(6)
configdialog.add_text(table, _('Nothing for this view.'), 0) configdialog.add_text(grid, _('Nothing for this view.'), 0)
return _('Specific parameters'), table return _('Specific parameters'), grid
def map_options(self, configdialog): def map_options(self, configdialog):
""" """
@ -1057,26 +1057,26 @@ class GeoGraphyView(OsmGps, NavigationView):
config.get('geography.zoom_when_center')) config.get('geography.zoom_when_center'))
self._config.set('geography.max_places', self._config.set('geography.max_places',
self._config.get('geography.max_places')) self._config.get('geography.max_places'))
table = Gtk.Table(n_rows=1, n_columns=1) grid = Gtk.Grid()
table.set_border_width(12) grid.set_border_width(12)
table.set_col_spacings(6) grid.set_column_spacing(6)
table.set_row_spacings(6) grid.set_row_spacing(6)
configdialog.add_text(table, configdialog.add_text(grid,
_('Where to save the tiles for offline mode.'), _('Where to save the tiles for offline mode.'),
0, line_wrap=False) 0, line_wrap=False)
configdialog.add_entry(table, '', configdialog.add_entry(grid, '',
1, 'geography.path') 1, 'geography.path')
configdialog.add_text(table, configdialog.add_text(grid,
_('If you have no more space in your file system. ' _('If you have no more space in your file system. '
'You can remove all tiles placed in the above path.\n' 'You can remove all tiles placed in the above path.\n'
'Be careful! If you have no internet, you\'ll get no map.'), 'Be careful! If you have no internet, you\'ll get no map.'),
2, line_wrap=False) 2, line_wrap=False)
configdialog.add_slider(table, configdialog.add_slider(grid,
_('Zoom used when centering'), _('Zoom used when centering'),
3, 'geography.zoom_when_center', 3, 'geography.zoom_when_center',
(2, 16)) (2, 16))
configdialog.add_slider(table, configdialog.add_slider(grid,
_('The maximum number of places to show'), _('The maximum number of places to show'),
4, 'geography.max_places', 4, 'geography.max_places',
(1000, 10000)) (1000, 10000))
return _('The map'), table return _('The map'), grid

View File

@ -196,12 +196,12 @@ class MediaMan(tool.Tool):
# Assistant pages # Assistant pages
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class IntroductionPage(Gtk.VBox): class IntroductionPage(Gtk.Box):
""" """
A page containing introductory text. A page containing introductory text.
""" """
def __init__(self): def __init__(self):
GObject.GObject.__init__(self) Gtk.Box.__init__(self, orientation=Gtk.Orientation.VERTICAL)
# Using set_page_side_image causes window sizing problems, so put the # Using set_page_side_image causes window sizing problems, so put the
# image in the main page instead. # image in the main page instead.
@ -243,20 +243,20 @@ class IntroductionPage(Gtk.VBox):
) % { 'bold_start' : '<b>' , ) % { 'bold_start' : '<b>' ,
'bold_end' : '</b>' } 'bold_end' : '</b>' }
class SelectionPage(Gtk.VBox): class SelectionPage(Gtk.Box):
""" """
A page with the radio buttons for every available batch op. A page with the radio buttons for every available batch op.
""" """
def __init__(self, batch_ops): def __init__(self, batch_ops):
GObject.GObject.__init__(self) Gtk.Box.__init__(self, orientation=Gtk.Orientation.VERTICAL)
self.batch_op_buttons = [] self.batch_op_buttons = []
self.set_spacing(12) self.set_spacing(12)
table = Gtk.Table(n_rows=2 * len(batch_ops), n_columns=2) grid = Gtk.Grid()
table.set_row_spacings(6) grid.set_row_spacing(6)
table.set_col_spacings(6) grid.set_column_spacing(6)
button = None button = None
for index in range(len(batch_ops)): for index in range(len(batch_ops)):
@ -266,9 +266,9 @@ class SelectionPage(Gtk.VBox):
button = Gtk.RadioButton.new_with_mnemonic_from_widget(button, title) button = Gtk.RadioButton.new_with_mnemonic_from_widget(button, title)
button.set_tooltip_text(description) button.set_tooltip_text(description)
self.batch_op_buttons.append(button) self.batch_op_buttons.append(button)
table.attach(button, 0, 2, 2 * index, 2 * index + 1, yoptions=0) grid.attach(button, 0, 2 * index, 2, 1)
self.add(table) self.add(grid)
def get_index(self): def get_index(self):
""" """
@ -282,12 +282,12 @@ class SelectionPage(Gtk.VBox):
else: else:
return 0 return 0
class SettingsPage(Gtk.VBox): class SettingsPage(Gtk.Box):
""" """
An extra page with the settings specific for the chosen batch-op. An extra page with the settings specific for the chosen batch-op.
""" """
def __init__(self, batch_ops, assistant): def __init__(self, batch_ops, assistant):
GObject.GObject.__init__(self) Gtk.Box.__init__(self, orientation=Gtk.Orientation.VERTICAL)
self.assistant = assistant self.assistant = assistant
self.batch_ops = batch_ops self.batch_ops = batch_ops
@ -307,13 +307,13 @@ class SettingsPage(Gtk.VBox):
self.assistant.set_page_title(self, '') self.assistant.set_page_title(self, '')
return False return False
class ConfirmationPage(Gtk.VBox): class ConfirmationPage(Gtk.Box):
""" """
A page to display the summary of the proposed action, as well as the A page to display the summary of the proposed action, as well as the
list of affected paths. list of affected paths.
""" """
def __init__(self, batch_ops): def __init__(self, batch_ops):
GObject.GObject.__init__(self) Gtk.Box.__init__(self, orientation=Gtk.Orientation.VERTICAL)
self.batch_ops = batch_ops self.batch_ops = batch_ops
@ -356,13 +356,13 @@ class ConfirmationPage(Gtk.VBox):
for path in path_list: for path in path_list:
self.path_model.append(row=[path]) self.path_model.append(row=[path])
class ConclusionPage(Gtk.VBox): class ConclusionPage(Gtk.Box):
""" """
A page to display the summary of the proposed action, as well as the A page to display the summary of the proposed action, as well as the
list of affected paths. list of affected paths.
""" """
def __init__(self, assistant): def __init__(self, assistant):
GObject.GObject.__init__(self) Gtk.Box.__init__(self, orientation=Gtk.Orientation.VERTICAL)
self.assistant = assistant self.assistant = assistant
@ -485,32 +485,34 @@ class PathChange(BatchOp):
def build_config(self): def build_config(self):
title = _("Replace substring settings") title = _("Replace substring settings")
box = Gtk.VBox() box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
box.set_spacing(12) box.set_spacing(12)
table = Gtk.Table(n_rows=2, n_columns=2) grid = Gtk.Grid()
table.set_row_spacings(6) grid.set_row_spacing(6)
table.set_col_spacings(6) grid.set_column_spacing(6)
self.from_entry = Gtk.Entry() self.from_entry = Gtk.Entry()
table.attach(self.from_entry, 1, 2, 0, 1, yoptions=0) self.from_entry.set_hexpand(True)
grid.attach(self.from_entry, 1, 0, 1, 1)
from_label = Gtk.Label(label=_('_Replace:')) from_label = Gtk.Label(label=_('_Replace:'))
from_label.set_use_underline(True) from_label.set_use_underline(True)
from_label.set_alignment(0, 0.5) from_label.set_alignment(0, 0.5)
from_label.set_mnemonic_widget(self.from_entry) from_label.set_mnemonic_widget(self.from_entry)
table.attach(from_label, 0, 1, 0, 1, xoptions=0, yoptions=0) grid.attach(from_label, 0, 0, 1, 1)
self.to_entry = Gtk.Entry() self.to_entry = Gtk.Entry()
table.attach(self.to_entry, 1, 2, 1, 2, yoptions=0) self.to_entry.set_hexpand(True)
grid.attach(self.to_entry, 1, 1, 1, 1)
to_label = Gtk.Label(label=_('_With:')) to_label = Gtk.Label(label=_('_With:'))
to_label.set_use_underline(True) to_label.set_use_underline(True)
to_label.set_alignment(0, 0.5) to_label.set_alignment(0, 0.5)
to_label.set_mnemonic_widget(self.to_entry) to_label.set_mnemonic_widget(self.to_entry)
table.attach(to_label, 0, 1, 1, 2, xoptions=0, yoptions=0) grid.attach(to_label, 0, 1, 1, 1)
box.add(table) box.add(grid)
return (title, box) return (title, box)

View File

@ -266,15 +266,15 @@ class FanChartDescView(fanchartdesc.FanChartDescGrampsGUI, NavigationView):
Function that builds the widget in the configuration dialog Function that builds the widget in the configuration dialog
""" """
nrentry = 8 nrentry = 8
table = Gtk.Table(n_rows=6, n_columns=3) grid = Gtk.Grid()
table.set_border_width(12) grid.set_border_width(12)
table.set_col_spacings(6) grid.set_column_spacing(6)
table.set_row_spacings(6) grid.set_row_spacing(6)
configdialog.add_spinner(table, _("Max generations"), 0, configdialog.add_spinner(grid, _("Max generations"), 0,
'interface.fanview-maxgen', (1, 11), 'interface.fanview-maxgen', (1, 11),
callback=self.cb_update_maxgen) callback=self.cb_update_maxgen)
configdialog.add_combo(table, configdialog.add_combo(grid,
_('Text Font'), _('Text Font'),
1, 'interface.fanview-font', 1, 'interface.fanview-font',
self.allfonts, callback=self.cb_update_font, valueactive=True) self.allfonts, callback=self.cb_update_font, valueactive=True)
@ -295,7 +295,7 @@ class FanChartDescView(fanchartdesc.FanChartDescGrampsGUI, NavigationView):
if curval == nr: if curval == nr:
break break
nrval += 1 nrval += 1
configdialog.add_combo(table, configdialog.add_combo(grid,
_('Background'), _('Background'),
2, 'interface.fanview-background', 2, 'interface.fanview-background',
backgrvals, backgrvals,
@ -303,21 +303,21 @@ class FanChartDescView(fanchartdesc.FanChartDescGrampsGUI, NavigationView):
setactive=nrval setactive=nrval
) )
#colors, stored as hex values #colors, stored as hex values
configdialog.add_color(table, _('Start gradient/Main color'), 3, configdialog.add_color(grid, _('Start gradient/Main color'), 3,
'interface.color-start-grad', col=1) 'interface.color-start-grad', col=1)
configdialog.add_color(table, _('End gradient/2nd color'), 4, configdialog.add_color(grid, _('End gradient/2nd color'), 4,
'interface.color-end-grad', col=1) 'interface.color-end-grad', col=1)
configdialog.add_color(table, _('Color for duplicates'), 5, configdialog.add_color(grid, _('Color for duplicates'), 5,
'interface.duplicate-color', col=1) 'interface.duplicate-color', col=1)
# form of the fan # form of the fan
configdialog.add_combo(table, _('Fan chart type'), 6, configdialog.add_combo(grid, _('Fan chart type'), 6,
'interface.fanview-form', 'interface.fanview-form',
((fanchart.FORM_CIRCLE, _('Full Circle')), ((fanchart.FORM_CIRCLE, _('Full Circle')),
(fanchart.FORM_HALFCIRCLE, _('Half Circle')), (fanchart.FORM_HALFCIRCLE, _('Half Circle')),
(fanchart.FORM_QUADRANT, _('Quadrant'))), (fanchart.FORM_QUADRANT, _('Quadrant'))),
callback=self.cb_update_form) callback=self.cb_update_form)
# algo for the fan angle distribution # algo for the fan angle distribution
configdialog.add_combo(table, _('Fan chart distribution'), 7, configdialog.add_combo(grid, _('Fan chart distribution'), 7,
'interface.angle-algorithm', 'interface.angle-algorithm',
((fanchartdesc.ANGLE_CHEQUI, ((fanchartdesc.ANGLE_CHEQUI,
_('Homogeneous children distribution')), _('Homogeneous children distribution')),
@ -326,7 +326,7 @@ class FanChartDescView(fanchartdesc.FanChartDescGrampsGUI, NavigationView):
), ),
callback=self.cb_update_anglealgo) callback=self.cb_update_anglealgo)
return _('Layout'), table return _('Layout'), grid
def config_connect(self): def config_connect(self):
""" """

View File

@ -264,15 +264,15 @@ class FanChartView(fanchart.FanChartGrampsGUI, NavigationView):
Function that builds the widget in the configuration dialog Function that builds the widget in the configuration dialog
""" """
nrentry = 7 nrentry = 7
table = Gtk.Table(n_rows=6, n_columns=3) grid = Gtk.Grid()
table.set_border_width(12) grid.set_border_width(12)
table.set_col_spacings(6) grid.set_column_spacing(6)
table.set_row_spacings(6) grid.set_row_spacing(6)
configdialog.add_spinner(table, _("Max generations"), 0, configdialog.add_spinner(grid, _("Max generations"), 0,
'interface.fanview-maxgen', (1, 11), 'interface.fanview-maxgen', (1, 11),
callback=self.cb_update_maxgen) callback=self.cb_update_maxgen)
configdialog.add_combo(table, configdialog.add_combo(grid,
_('Text Font'), _('Text Font'),
1, 'interface.fanview-font', 1, 'interface.fanview-font',
self.allfonts, callback=self.cb_update_font, valueactive=True) self.allfonts, callback=self.cb_update_font, valueactive=True)
@ -293,26 +293,26 @@ class FanChartView(fanchart.FanChartGrampsGUI, NavigationView):
if curval == nr: if curval == nr:
break break
nrval += 1 nrval += 1
configdialog.add_combo(table, configdialog.add_combo(grid,
_('Background'), _('Background'),
2, 'interface.fanview-background', 2, 'interface.fanview-background',
backgrvals, backgrvals,
callback=self.cb_update_background, valueactive=False, setactive=nrval callback=self.cb_update_background, valueactive=False, setactive=nrval
) )
#colors, stored as hex values #colors, stored as hex values
configdialog.add_color(table, _('Start gradient/Main color'), 3, configdialog.add_color(grid, _('Start gradient/Main color'), 3,
'interface.color-start-grad', col=1) 'interface.color-start-grad', col=1)
configdialog.add_color(table, _('End gradient/2nd color'), 4, configdialog.add_color(grid, _('End gradient/2nd color'), 4,
'interface.color-end-grad', col=1) 'interface.color-end-grad', col=1)
# form of the fan # form of the fan
configdialog.add_combo(table, _('Fan chart type'), 5, configdialog.add_combo(grid, _('Fan chart type'), 5,
'interface.fanview-form', 'interface.fanview-form',
((0, _('Full Circle')), (1,_('Half Circle')), ((0, _('Full Circle')), (1,_('Half Circle')),
(2, _('Quadrant'))), (2, _('Quadrant'))),
callback=self.cb_update_form) callback=self.cb_update_form)
# options users should not change: # options users should not change:
configdialog.add_checkbox(table, configdialog.add_checkbox(grid,
_('Show children ring'), _('Show children ring'),
nrentry-1, 'interface.fanview-childrenring') nrentry-1, 'interface.fanview-childrenring')
# options we don't show on the dialog # options we don't show on the dialog
@ -320,7 +320,7 @@ class FanChartView(fanchart.FanChartGrampsGUI, NavigationView):
## _('Allow radial text'), ## _('Allow radial text'),
## ??, 'interface.fanview-radialtext') ## ??, 'interface.fanview-radialtext')
return _('Layout'), table return _('Layout'), grid
def config_connect(self): def config_connect(self):
""" """

View File

@ -565,11 +565,11 @@ class GeoClose(GeoGraphyView):
Add specific entry to the preference menu. Add specific entry to the preference menu.
Must be done in the associated view. Must be done in the associated view.
""" """
table = Gtk.Table(n_rows=2, n_columns=2) grid = Gtk.Grid()
table.set_border_width(12) grid.set_border_width(12)
table.set_col_spacings(6) grid.set_column_spacing(6)
table.set_row_spacings(6) grid.set_row_spacing(6)
configdialog.add_text(table, configdialog.add_text(grid,
_('The meeting zone probability radius.\n' _('The meeting zone probability radius.\n'
'The colored zone is approximative.\n' 'The colored zone is approximative.\n'
'The meeting zone is only shown for the reference person.\n' 'The meeting zone is only shown for the reference person.\n'
@ -577,11 +577,11 @@ class GeoClose(GeoGraphyView):
'The value 1 means about 4.6 miles or 7.5 kms.\n' 'The value 1 means about 4.6 miles or 7.5 kms.\n'
'The value is in tenth of degree.'), 'The value is in tenth of degree.'),
1, line_wrap=False) 1, line_wrap=False)
self.config_meeting_slider = configdialog.add_slider(table, self.config_meeting_slider = configdialog.add_slider(grid,
"", "",
2, 'geography.maximum_meeting_zone', 2, 'geography.maximum_meeting_zone',
(1, 9)) (1, 9))
return _('The selection parameters'), table return _('The selection parameters'), grid
def config_connect(self): def config_connect(self):
""" """

View File

@ -708,11 +708,11 @@ class GeoFamClose(GeoGraphyView):
Add specific entry to the preference menu. Add specific entry to the preference menu.
Must be done in the associated view. Must be done in the associated view.
""" """
table = Gtk.Table(n_rows=2, n_columns=2) grid = Gtk.Grid()
table.set_border_width(12) grid.set_border_width(12)
table.set_col_spacings(6) grid.set_column_spacing(6)
table.set_row_spacings(6) grid.set_row_spacing(6)
configdialog.add_text(table, configdialog.add_text(grid,
_('The meeting zone probability radius.\n' _('The meeting zone probability radius.\n'
'The colored zone is approximative.\n' 'The colored zone is approximative.\n'
'The meeting zone is only shown for the reference family.\n' 'The meeting zone is only shown for the reference family.\n'
@ -720,11 +720,11 @@ class GeoFamClose(GeoGraphyView):
'The value 1 means about 4.6 miles or 7.5 kms.\n' 'The value 1 means about 4.6 miles or 7.5 kms.\n'
'The value is in tenth of degree.'), 'The value is in tenth of degree.'),
1, line_wrap=False) 1, line_wrap=False)
self.config_meeting_slider = configdialog.add_slider(table, self.config_meeting_slider = configdialog.add_slider(grid,
"", "",
2, 'geography.maximum_meeting_zone', 2, 'geography.maximum_meeting_zone',
(1, 9)) (1, 9))
return _('The selection parameters'), table return _('The selection parameters'), grid
def config_connect(self): def config_connect(self):
""" """

View File

@ -633,25 +633,25 @@ class GeoMoves(GeoGraphyView):
Add specific entry to the preference menu. Add specific entry to the preference menu.
Must be done in the associated view. Must be done in the associated view.
""" """
table = Gtk.Table(n_rows=2, n_columns=2) grid = Gtk.Grid()
table.set_border_width(12) grid.set_border_width(12)
table.set_col_spacings(6) grid.set_column_spacing(6)
table.set_row_spacings(6) grid.set_row_spacing(6)
configdialog.add_text(table, configdialog.add_text(grid,
_('The maximum number of generations.\n'), _('The maximum number of generations.\n'),
1, line_wrap=False) 1, line_wrap=False)
configdialog.add_slider(table, configdialog.add_slider(grid,
"", "",
2, 'geography.maximum_generations', 2, 'geography.maximum_generations',
(1, 20)) (1, 20))
configdialog.add_text(table, configdialog.add_text(grid,
_('Time in milliseconds between drawing two generations.\n'), _('Time in milliseconds between drawing two generations.\n'),
3, line_wrap=False) 3, line_wrap=False)
configdialog.add_slider(table, configdialog.add_slider(grid,
"", "",
4, 'geography.generation_interval', 4, 'geography.generation_interval',
(500, 3000)) (500, 3000))
return _('The parameters for moves'), table return _('The parameters for moves'), grid
def config_connect(self): def config_connect(self):
""" """

View File

@ -514,30 +514,30 @@ class GeoPerson(GeoGraphyView):
Add specific entry to the preference menu. Add specific entry to the preference menu.
Must be done in the associated view. Must be done in the associated view.
""" """
table = Gtk.Table(n_rows=2, n_columns=2) grid = Gtk.Grid()
table.set_border_width(12) grid.set_border_width(12)
table.set_col_spacings(6) grid.set_column_spacing(6)
table.set_row_spacings(6) grid.set_row_spacing(6)
configdialog.add_text(table, configdialog.add_text(grid,
_('Animation speed in milliseconds (big value means slower)'), _('Animation speed in milliseconds (big value means slower)'),
1, line_wrap=False) 1, line_wrap=False)
configdialog.add_slider(table, configdialog.add_slider(grid,
"", "",
2, 'geography.speed', 2, 'geography.speed',
(100, 1000)) (100, 1000))
configdialog.add_text(table, configdialog.add_text(grid,
_('How many steps between two markers when we are on large move ?'), _('How many steps between two markers when we are on large move ?'),
3, line_wrap=False) 3, line_wrap=False)
configdialog.add_slider(table, configdialog.add_slider(grid,
"", "",
4, 'geography.steps', 4, 'geography.steps',
(10, 100)) (10, 100))
configdialog.add_text(table, configdialog.add_text(grid,
_('The minimum latitude/longitude to select large move.\n' _('The minimum latitude/longitude to select large move.\n'
'The value is in tenth of degree.'), 'The value is in tenth of degree.'),
5, line_wrap=False) 5, line_wrap=False)
configdialog.add_slider(table, configdialog.add_slider(grid,
"", "",
6, 'geography.maximum_lon_lat', 6, 'geography.maximum_lon_lat',
(5, 50)) (5, 50))
return _('The animation parameters'), table return _('The animation parameters'), grid

View File

@ -329,7 +329,7 @@ class HtmlView(NavigationView):
self.renderer = None self.renderer = None
self.urlfield = "" self.urlfield = ""
self.htmlfile = "" self.htmlfile = ""
self.filter = Gtk.HBox() self.filter = Gtk.Box()
self.table = "" self.table = ""
self.browser = NOWEB self.browser = NOWEB
#self.bootstrap_handler = None #self.bootstrap_handler = None
@ -344,16 +344,14 @@ class HtmlView(NavigationView):
contains the interface. This containter will be inserted into contains the interface. This containter will be inserted into
a Gtk.Notebook page. a Gtk.Notebook page.
""" """
self.box = Gtk.VBox(homogeneous=False, spacing=4) self.box = Gtk.VBox(spacing=4)
#top widget at the top #top widget at the top
self.box.pack_start(self.top_widget(), False, False, 0 ) self.box.pack_start(self.top_widget(), False, False, 0 )
#web page under it in a scrolled window #web page under it in a scrolled window
#self.table = Gtk.Table(1, 1, False)
self.toolkit = TOOLKIT = get_toolkits() self.toolkit = TOOLKIT = get_toolkits()
self.renderer = RendererWebkit() self.renderer = RendererWebkit()
self.frames = Gtk.HBox(homogeneous=False, spacing=4) self.frames = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=4)
frame = Gtk.ScrolledWindow(hadjustment=None, frame = Gtk.ScrolledWindow(hadjustment=None, vadjustment=None)
vadjustment=None)
frame.set_shadow_type(Gtk.ShadowType.NONE) frame.set_shadow_type(Gtk.ShadowType.NONE)
frame.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) frame.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
frame.add(self.renderer.get_window()) frame.add(self.renderer.get_window())
@ -375,7 +373,7 @@ class HtmlView(NavigationView):
""" """
The default class gives a widget where user can type an url The default class gives a widget where user can type an url
""" """
hbox = Gtk.HBox(homogeneous=False, spacing=4) hbox = Gtk.Box(spacing=4)
self.urlfield = Gtk.Entry() self.urlfield = Gtk.Entry()
self.urlfield.set_text(config.get("htmlview.start-url")) self.urlfield.set_text(config.get("htmlview.start-url"))
self.urlfield.connect('activate', self._on_activate) self.urlfield.connect('activate', self._on_activate)

View File

@ -1994,37 +1994,37 @@ class PedigreeView(NavigationView):
""" """
Function that builds the widget in the configuration dialog Function that builds the widget in the configuration dialog
""" """
table = Gtk.Table(n_rows=7, n_columns=2) grid = Gtk.Grid()
table.set_border_width(12) grid.set_border_width(12)
table.set_col_spacings(6) grid.set_column_spacing(6)
table.set_row_spacings(6) grid.set_row_spacing(6)
configdialog.add_checkbox(table, configdialog.add_checkbox(grid,
_('Show images'), _('Show images'),
0, 'interface.pedview-show-images') 0, 'interface.pedview-show-images')
configdialog.add_checkbox(table, configdialog.add_checkbox(grid,
_('Show marriage data'), _('Show marriage data'),
1, 'interface.pedview-show-marriage') 1, 'interface.pedview-show-marriage')
configdialog.add_checkbox(table, configdialog.add_checkbox(grid,
_('Show unknown people'), _('Show unknown people'),
2, 'interface.pedview-show-unknown-people') 2, 'interface.pedview-show-unknown-people')
configdialog.add_combo(table, configdialog.add_combo(grid,
_('Tree style'), _('Tree style'),
4, 'interface.pedview-layout', 4, 'interface.pedview-layout',
((0, _('Standard')), ((0, _('Standard')),
(1, _('Compact')), (1, _('Compact')),
(2, _('Expanded'))), (2, _('Expanded'))),
callback=self.cb_update_layout) callback=self.cb_update_layout)
configdialog.add_combo(table, configdialog.add_combo(grid,
_('Tree direction'), _('Tree direction'),
5, 'interface.pedview-tree-direction', 5, 'interface.pedview-tree-direction',
((0, _('Vertical (↓)')), ((0, _('Vertical (↓)')),
(1, _('Vertical (↑)')), (1, _('Vertical (↑)')),
(2, _('Horizontal (→)')), (2, _('Horizontal (→)')),
(3, _('Horizontal (←)')))) (3, _('Horizontal (←)'))))
self.config_size_slider = configdialog.add_slider(table, self.config_size_slider = configdialog.add_slider(grid,
_('Tree size'), _('Tree size'),
6, 'interface.pedview-tree-size', 6, 'interface.pedview-tree-size',
(2, 9)) (2, 9))
return _('Layout'), table return _('Layout'), grid

View File

@ -123,21 +123,6 @@ _SPACE = Gdk.keyval_from_name("space")
_LEFT_BUTTON = 1 _LEFT_BUTTON = 1
_RIGHT_BUTTON = 3 _RIGHT_BUTTON = 3
class AttachList(object):
def __init__(self):
self.list = []
self.max_x = 0
self.max_y = 0
def attach(self, widget, x0, x1, y0, y1, xoptions=Gtk.AttachOptions.EXPAND|Gtk.AttachOptions.FILL,
yoptions=Gtk.AttachOptions.EXPAND|Gtk.AttachOptions.FILL):
assert(widget)
assert(x1>x0)
self.list.append((widget, x0, x1, y0, y1, xoptions, yoptions))
self.max_x = max(self.max_x, x1)
self.max_y = max(self.max_y, y1)
class RelationshipView(NavigationView): class RelationshipView(NavigationView):
""" """
View showing a textual representation of the relationships of the View showing a textual representation of the relationships of the
@ -314,13 +299,13 @@ class RelationshipView(NavigationView):
Build the widget that contains the view, see Build the widget that contains the view, see
:class:`~gui.views.pageview.PageView :class:`~gui.views.pageview.PageView
""" """
container = Gtk.VBox() container = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
container.set_border_width(12) container.set_border_width(12)
self.vbox = Gtk.VBox() self.vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.vbox.show() self.vbox.show()
self.header = Gtk.VBox() self.header = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.header.show() self.header.show()
self.child = None self.child = None
@ -335,7 +320,8 @@ class RelationshipView(NavigationView):
self.color = Gdk.RGBA() self.color = Gdk.RGBA()
self.color.parse("White") self.color.parse("White")
self.scroll.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) self.scroll.set_policy(Gtk.PolicyType.AUTOMATIC,
Gtk.PolicyType.AUTOMATIC)
self.scroll.show() self.scroll.show()
vp = Gtk.Viewport() vp = Gtk.Viewport()
@ -347,8 +333,8 @@ class RelationshipView(NavigationView):
container.set_spacing(6) container.set_spacing(6)
container.pack_start(self.header, False, False, 0) container.pack_start(self.header, False, False, 0)
container.pack_start(Gtk.HSeparator(), False, False, 0) container.pack_start(Gtk.Separator(), False, False, 0)
container.add(self.scroll) container.pack_start(self.scroll, True, True, 0)
container.show_all() container.show_all()
return container return container
@ -526,7 +512,10 @@ class RelationshipView(NavigationView):
self.write_title(person) self.write_title(person)
self.attach = AttachList() self.child = Gtk.Grid()
self.child.set_border_width(12)
self.child.set_column_spacing(12)
self.child.set_row_spacing(0)
self.row = 0 self.row = 0
family_handle_list = person.get_parent_family_handle_list() family_handle_list = person.get_parent_family_handle_list()
@ -551,39 +540,6 @@ class RelationshipView(NavigationView):
if family_handle: if family_handle:
self.write_family(family_handle, person) self.write_family(family_handle, person)
self.row = 0
# Here it is necessary to beat GTK into submission. For some
# bizzare reason, if you have an empty column that is spanned,
# you lose the appropriate FILL handling. So, we need to see if
# column 3 is unused (usually if there is no siblings or children.
# If so, we need to subtract one index of each x coord > 3.
found = False
for d in self.attach.list:
if d[1] == 4 or d[2] == 4:
found = True
if found:
cols = self.attach.max_x
else:
cols = self.attach.max_x-1
self.child = Gtk.Table(n_rows=self.attach.max_y, n_columns=cols)
self.child.set_border_width(12)
self.child.set_col_spacings(12)
self.child.set_row_spacings(0)
for d in self.attach.list:
x0 = d[1]
x1 = d[2]
if not found:
if x0 > 4:
x0 -= 1
if x1 > 4:
x1 -= 1
self.child.attach(d[0], x0, x1, d[3], d[4], d[5], d[6])
self.child.show_all() self.child.show_all()
self.vbox.pack_start(self.child, False, True, 0) self.vbox.pack_start(self.child, False, True, 0)
@ -600,9 +556,9 @@ class RelationshipView(NavigationView):
def write_title(self, person): def write_title(self, person):
list(map(self.header.remove, self.header.get_children())) list(map(self.header.remove, self.header.get_children()))
table = Gtk.Table(n_rows=2, n_columns=3) grid = Gtk.Grid()
table.set_col_spacings(12) grid.set_column_spacing(12)
table.set_row_spacings(0) grid.set_row_spacing(0)
# name and edit button # name and edit button
name = name_displayer.display(person) name = name_displayer.display(person)
@ -622,23 +578,23 @@ class RelationshipView(NavigationView):
hbox = widgets.LinkBox(label, button) hbox = widgets.LinkBox(label, button)
eventbox.add(hbox) eventbox.add(hbox)
table.attach(eventbox, 0, 2, 0, 1) grid.attach(eventbox, 0, 0, 2, 1)
eventbox = Gtk.EventBox() eventbox = Gtk.EventBox()
if self.use_shade: if self.use_shade:
eventbox.override_background_color(Gtk.StateType.NORMAL, self.color) eventbox.override_background_color(Gtk.StateType.NORMAL, self.color)
table.attach(eventbox, 1, 2, 1, 2) grid.attach(eventbox, 1, 1, 1, 1)
subtbl = Gtk.Table(n_rows=3, n_columns=3) subgrid = Gtk.Grid()
subtbl.set_col_spacings(12) subgrid.set_column_spacing(12)
subtbl.set_row_spacings(0) subgrid.set_row_spacing(0)
eventbox.add(subtbl) eventbox.add(subgrid)
self._set_draggable_person(eventbox, person.get_handle()) self._set_draggable_person(eventbox, person.get_handle())
# GRAMPS ID # GRAMPS ID
subtbl.attach(widgets.BasicLabel("%s:" % _('ID')), subgrid.attach(widgets.BasicLabel("%s:" % _('ID')), 1, 0, 1, 1)
1, 2, 0, 1, xoptions=Gtk.AttachOptions.FILL, yoptions=0) label = widgets.BasicLabel(person.gramps_id)
subtbl.attach(widgets.BasicLabel(person.gramps_id), label.set_hexpand(True)
2, 3, 0, 1, yoptions=0) subgrid.attach(label, 2, 0, 1, 1)
# Birth event. # Birth event.
birth = get_birth_or_fallback(self.dbstate.db, person) birth = get_birth_or_fallback(self.dbstate.db, person)
@ -647,10 +603,8 @@ class RelationshipView(NavigationView):
else: else:
birth_title = _("Birth") birth_title = _("Birth")
subtbl.attach(widgets.BasicLabel("%s:" % birth_title), subgrid.attach(widgets.BasicLabel("%s:" % birth_title), 1, 1, 1, 1)
1, 2, 1, 2, xoptions=Gtk.AttachOptions.FILL, yoptions=0) subgrid.attach(widgets.BasicLabel(self.format_event(birth)), 2, 1, 1, 1)
subtbl.attach(widgets.BasicLabel(self.format_event(birth)),
2, 3, 1, 2, yoptions=0)
death = get_death_or_fallback(self.dbstate.db, person) death = get_death_or_fallback(self.dbstate.db, person)
if death: if death:
@ -666,36 +620,35 @@ class RelationshipView(NavigationView):
death_date = death.get_date_object() death_date = death.get_date_object()
if (death_date and death_date.get_valid()): if (death_date and death_date.get_valid()):
age = death_date - birth_date age = death_date - birth_date
subtbl.attach(widgets.BasicLabel("%s:" % death_title), subgrid.attach(widgets.BasicLabel("%s:" % death_title),
1, 2, 2, 3, xoptions=Gtk.AttachOptions.FILL, yoptions=0) 1, 2, 1, 1)
subtbl.attach(widgets.BasicLabel("%s (%s)" % subgrid.attach(widgets.BasicLabel("%s (%s)" %
(self.format_event(death), age), (self.format_event(death), age),
Pango.EllipsizeMode.END), Pango.EllipsizeMode.END),
2, 3, 2, 3, yoptions=0) 2, 2, 1, 1)
showed_death = True showed_death = True
if not showed_death: if not showed_death:
age = Today() - birth_date age = Today() - birth_date
if probably_alive(person, self.dbstate.db): if probably_alive(person, self.dbstate.db):
subtbl.attach(widgets.BasicLabel("%s:" % _("Alive")), subgrid.attach(widgets.BasicLabel("%s:" % _("Alive")),
1, 2, 2, 3, xoptions=Gtk.AttachOptions.FILL, yoptions=0) 1, 2, 1, 1)
subtbl.attach(widgets.BasicLabel("(%s)" % age, Pango.EllipsizeMode.END), subgrid.attach(widgets.BasicLabel("(%s)" % age, Pango.EllipsizeMode.END),
2, 3, 2, 3, yoptions=0) 2, 2, 1, 1)
else: subgrid.attach(widgets.BasicLabel("%s:" % _("Death")),
subtbl.attach(widgets.BasicLabel("%s:" % _("Death")), 1, 2, 1, 1)
1, 2, 2, 3, xoptions=Gtk.AttachOptions.FILL, yoptions=0) subgrid.attach(widgets.BasicLabel("%s (%s)" % (_("unknown"), age),
subtbl.attach(widgets.BasicLabel("%s (%s)" % (_("unknown"), age),
Pango.EllipsizeMode.END), Pango.EllipsizeMode.END),
2, 3, 2, 3, yoptions=0) 2, 2, 1, 1)
showed_death = True showed_death = True
if not showed_death: if not showed_death:
subtbl.attach(widgets.BasicLabel("%s:" % death_title), subgrid.attach(widgets.BasicLabel("%s:" % death_title),
1, 2, 2, 3, xoptions=Gtk.AttachOptions.FILL, yoptions=0) 1, 2, 1, 1)
subtbl.attach(widgets.BasicLabel(self.format_event(death)), subgrid.attach(widgets.BasicLabel(self.format_event(death)),
2, 3, 2, 3, yoptions=0) 2, 2, 1, 1)
mbox = Gtk.HBox() mbox = Gtk.Box()
mbox.add(table) mbox.add(grid)
# image # image
image_list = person.get_media_list() image_list = person.get_media_list()
@ -779,12 +732,10 @@ class RelationshipView(NavigationView):
return '' return ''
def write_person_data(self, title, data): def write_person_data(self, title, data):
self.attach.attach(widgets.BasicLabel(title), _ALABEL_START, self.child.attach(widgets.BasicLabel(title), _ALABEL_START, self.row,
_ALABEL_STOP, self.row, self.row+1, _ALABEL_STOP-_ALABEL_START, 1)
xoptions=Gtk.AttachOptions.FILL|Gtk.AttachOptions.SHRINK) self.child.attach(widgets.BasicLabel(data), _ADATA_START, self.row,
self.attach.attach(widgets.BasicLabel(data), _ADATA_STOP-_ADATA_START, 1)
_ADATA_START, _ADATA_STOP,
self.row, self.row+1)
self.row += 1 self.row += 1
def write_label(self, title, family, is_parent, person = None): def write_label(self, title, family, is_parent, person = None):
@ -794,7 +745,7 @@ class RelationshipView(NavigationView):
(collapse/expand arrow, Parents/Family title label, Family gramps_id, and add-choose-edit-delete buttons) (collapse/expand arrow, Parents/Family title label, Family gramps_id, and add-choose-edit-delete buttons)
""" """
msg = '<span style="italic" weight="heavy">%s</span>' % cgi.escape(title) msg = '<span style="italic" weight="heavy">%s</span>' % cgi.escape(title)
hbox = Gtk.HBox() hbox = Gtk.Box()
label = widgets.MarkupLabel(msg, x_align=1) label = widgets.MarkupLabel(msg, x_align=1)
# Draw the collapse/expand button: # Draw the collapse/expand button:
if family is not None: if family is not None:
@ -816,9 +767,8 @@ class RelationshipView(NavigationView):
if family is not None: if family is not None:
self._set_draggable_family(eventbox, family.handle) self._set_draggable_family(eventbox, family.handle)
eventbox.add(hbox) eventbox.add(hbox)
self.attach.attach(eventbox, self.child.attach(eventbox, _LABEL_START, self.row,
_LABEL_START, _LABEL_STOP, _LABEL_STOP-_LABEL_START, 1)
self.row, self.row+1, Gtk.AttachOptions.SHRINK|Gtk.AttachOptions.FILL)
if family: if family:
value = family.gramps_id value = family.gramps_id
@ -828,16 +778,16 @@ class RelationshipView(NavigationView):
if family is not None: if family is not None:
self._set_draggable_family(eventbox, family.handle) self._set_draggable_family(eventbox, family.handle)
eventbox.add(widgets.BasicLabel(value)) eventbox.add(widgets.BasicLabel(value))
self.attach.attach(eventbox, self.child.attach(eventbox, _DATA_START, self.row,
_DATA_START, _DATA_STOP, _DATA_STOP-_DATA_START, 1)
self.row, self.row+1, Gtk.AttachOptions.SHRINK|Gtk.AttachOptions.FILL)
if family and self.check_collapsed(person.handle, family.handle): if family and self.check_collapsed(person.handle, family.handle):
# show family names later # show family names later
pass pass
else: else:
hbox = Gtk.HBox() hbox = Gtk.Box()
hbox.set_spacing(12) hbox.set_spacing(12)
hbox.set_hexpand(True)
if is_parent: if is_parent:
call_fcn = self.add_parent_family call_fcn = self.add_parent_family
del_fcn = self.delete_parent_family del_fcn = self.delete_parent_family
@ -888,7 +838,8 @@ class RelationshipView(NavigationView):
if family is not None: if family is not None:
self._set_draggable_family(eventbox, family.handle) self._set_draggable_family(eventbox, family.handle)
eventbox.add(hbox) eventbox.add(hbox)
self.attach.attach(eventbox, _BTN_START, _BTN_STOP, self.row, self.row+1) self.child.attach(eventbox, _BTN_START, self.row,
_BTN_STOP-_BTN_START, 1)
self.row += 1 self.row += 1
###################################################################### ######################################################################
@ -931,9 +882,8 @@ class RelationshipView(NavigationView):
if self.use_shade: if self.use_shade:
eventbox.override_background_color(Gtk.StateType.NORMAL, self.color) eventbox.override_background_color(Gtk.StateType.NORMAL, self.color)
eventbox.add(box) eventbox.add(box)
self.attach.attach( self.child.attach(eventbox, _PDATA_START, self.row,
eventbox, _PDATA_START, _PDATA_STOP, _PDATA_STOP-_PDATA_START, 1)
self.row, self.row+1)
self.row += 1 # now advance it self.row += 1 # now advance it
else: else:
self.write_label("%s:" % _('Parents'), family, True, person) self.write_label("%s:" % _('Parents'), family, True, person)
@ -942,7 +892,7 @@ class RelationshipView(NavigationView):
if self.show_siblings: if self.show_siblings:
active = self.get_active() active = self.get_active()
hbox = Gtk.HBox() hbox = Gtk.Box()
if self.check_collapsed(person.handle, "SIBLINGS"): if self.check_collapsed(person.handle, "SIBLINGS"):
arrow = widgets.ExpandCollapseArrow(True, arrow = widgets.ExpandCollapseArrow(True,
self.expand_collapse_press, self.expand_collapse_press,
@ -954,13 +904,11 @@ class RelationshipView(NavigationView):
hbox.pack_start(arrow, False, True, 0) hbox.pack_start(arrow, False, True, 0)
label_cell = self.build_label_cell(_('Siblings')) label_cell = self.build_label_cell(_('Siblings'))
hbox.pack_start(label_cell, True, True, 0) hbox.pack_start(label_cell, True, True, 0)
self.attach.attach( self.child.attach(hbox, _CLABEL_START-1, self.row,
hbox, _CLABEL_START-1, _CLABEL_STOP-1, self.row, _CLABEL_STOP-_CLABEL_START, 1)
self.row+1, xoptions=Gtk.AttachOptions.FILL|Gtk.AttachOptions.SHRINK,
yoptions=Gtk.AttachOptions.FILL)
if self.check_collapsed(person.handle, "SIBLINGS"): if self.check_collapsed(person.handle, "SIBLINGS"):
hbox = Gtk.HBox() hbox = Gtk.Box()
child_list = [ref.ref for ref in family.get_child_ref_list() child_list = [ref.ref for ref in family.get_child_ref_list()
if ref.ref != active] if ref.ref != active]
if child_list: if child_list:
@ -988,12 +936,11 @@ class RelationshipView(NavigationView):
if self.use_shade: if self.use_shade:
eventbox.override_background_color(Gtk.StateType.NORMAL, self.color) eventbox.override_background_color(Gtk.StateType.NORMAL, self.color)
eventbox.add(box) eventbox.add(box)
self.attach.attach( self.child.attach(eventbox, _PDATA_START, self.row,
eventbox, _PDATA_START, _PDATA_STOP, _PDATA_STOP-_PDATA_START, 1)
self.row, self.row+1)
self.row += 1 # now advance it self.row += 1 # now advance it
else: else:
hbox = Gtk.HBox() hbox = Gtk.Box()
addchild = widgets.IconButton(self.add_child_to_fam, addchild = widgets.IconButton(self.add_child_to_fam,
family.handle, family.handle,
Gtk.STOCK_ADD) Gtk.STOCK_ADD)
@ -1005,13 +952,10 @@ class RelationshipView(NavigationView):
hbox.pack_start(addchild, False, True, 0) hbox.pack_start(addchild, False, True, 0)
hbox.pack_start(selchild, False, True, 0) hbox.pack_start(selchild, False, True, 0)
self.attach.attach( self.child.attach(hbox, _CLABEL_START, self.row,
hbox, _CLABEL_START, _CLABEL_STOP, self.row, _CLABEL_STOP-_CLABEL_START, 1)
self.row+1, xoptions=Gtk.AttachOptions.FILL|Gtk.AttachOptions.SHRINK,
yoptions=Gtk.AttachOptions.FILL)
self.row += 1 self.row += 1
vbox = Gtk.VBox() vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
i = 1 i = 1
child_list = [ref.ref for ref in family.get_child_ref_list()] child_list = [ref.ref for ref in family.get_child_ref_list()]
for child_handle in child_list: for child_handle in child_list:
@ -1022,44 +966,44 @@ class RelationshipView(NavigationView):
if self.use_shade: if self.use_shade:
eventbox.override_background_color(Gtk.StateType.NORMAL, self.color) eventbox.override_background_color(Gtk.StateType.NORMAL, self.color)
eventbox.add(vbox) eventbox.add(vbox)
self.attach.attach( self.child.attach(eventbox, _CDATA_START-1, self.row,
eventbox, _CDATA_START-1, _CDATA_STOP, self.row, _CDATA_STOP-_CDATA_START+1, 1)
self.row+1)
self.row += 1 self.row += 1
def get_people_box(self, *handles, **kwargs): def get_people_box(self, *handles, **kwargs):
vbox = Gtk.HBox() hbox = Gtk.Box()
initial_name = True initial_name = True
for handle in handles: for handle in handles:
if not initial_name: if not initial_name:
link_label = Gtk.Label(label=" %s " % _('and')) link_label = Gtk.Label(label=" %s " % _('and'))
link_label.show() link_label.show()
vbox.pack_start(link_label, False, True, 0) hbox.pack_start(link_label, False, True, 0)
initial_name = False initial_name = False
if handle: if handle:
name = self.get_name(handle, True) name = self.get_name(handle, True)
link_label = widgets.LinkLabel(name, self._button_press, link_label = widgets.LinkLabel(name, self._button_press,
handle, theme=self.theme) handle, theme=self.theme)
if self.use_shade: if self.use_shade:
link_label.override_background_color(Gtk.StateType.NORMAL, self.color) link_label.override_background_color(Gtk.StateType.NORMAL,
self.color)
if self._config.get('preferences.releditbtn'): if self._config.get('preferences.releditbtn'):
button = widgets.IconButton(self.edit_button_press, button = widgets.IconButton(self.edit_button_press,
handle) handle)
button.set_tooltip_text(_('Edit %s') % name[0]) button.set_tooltip_text(_('Edit %s') % name[0])
else: else:
button = None button = None
vbox.pack_start(widgets.LinkBox(link_label, button), hbox.pack_start(widgets.LinkBox(link_label, button),
False, True, 0) False, True, 0)
else: else:
link_label = Gtk.Label(label=_('Unknown')) link_label = Gtk.Label(label=_('Unknown'))
link_label.show() link_label.show()
vbox.pack_start(link_label, False, True, 0) hbox.pack_start(link_label, False, True, 0)
if "post_msg" in kwargs and kwargs["post_msg"]: if "post_msg" in kwargs and kwargs["post_msg"]:
link_label = Gtk.Label(label=kwargs["post_msg"]) link_label = Gtk.Label(label=kwargs["post_msg"])
link_label.show() link_label.show()
vbox.pack_start(link_label, False, True, 0) hbox.pack_start(link_label, False, True, 0)
return vbox return hbox
def write_person(self, title, handle): def write_person(self, title, handle):
""" """
@ -1081,11 +1025,10 @@ class RelationshipView(NavigationView):
if handle is not None: if handle is not None:
self._set_draggable_person(eventbox, handle) self._set_draggable_person(eventbox, handle)
eventbox.add(label) eventbox.add(label)
self.attach.attach(eventbox, _PLABEL_START, _PLABEL_STOP, self.row, self.child.attach(eventbox, _PLABEL_START, self.row,
self.row+1, xoptions=Gtk.AttachOptions.FILL|Gtk.AttachOptions.SHRINK, _PLABEL_STOP-_PLABEL_START, 1)
yoptions=Gtk.AttachOptions.FILL|Gtk.AttachOptions.SHRINK)
vbox = Gtk.VBox() vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
eventbox = Gtk.EventBox() eventbox = Gtk.EventBox()
if handle: if handle:
name = self.get_name(handle, True) name = self.get_name(handle, True)
@ -1124,8 +1067,8 @@ class RelationshipView(NavigationView):
eventbox.override_background_color(Gtk.StateType.NORMAL, self.color) eventbox.override_background_color(Gtk.StateType.NORMAL, self.color)
eventbox.add(vbox) eventbox.add(vbox)
self.attach.attach(eventbox, _PDATA_START, _PDATA_STOP, self.child.attach(eventbox, _PDATA_START, self.row,
self.row, self.row+1) _PDATA_STOP-_PDATA_START, 1)
self.row += 1 self.row += 1
return vbox return vbox
@ -1188,7 +1131,7 @@ class RelationshipView(NavigationView):
ev.set_visible_window(False) ev.set_visible_window(False)
if handle: if handle:
self._set_draggable_person(ev, handle) self._set_draggable_person(ev, handle)
vbox = Gtk.VBox() vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
ev.add(vbox) ev.add(vbox)
if not child_should_be_linked: if not child_should_be_linked:
@ -1232,7 +1175,7 @@ class RelationshipView(NavigationView):
else: else:
button = None button = None
hbox = Gtk.HBox() hbox = Gtk.Box()
l = widgets.BasicLabel("%d." % index) l = widgets.BasicLabel("%d." % index)
l.set_width_chars(3) l.set_width_chars(3)
l.set_alignment(1.0, 0.5) l.set_alignment(1.0, 0.5)
@ -1447,9 +1390,8 @@ class RelationshipView(NavigationView):
if self.use_shade: if self.use_shade:
eventbox.override_background_color(Gtk.StateType.NORMAL, self.color) eventbox.override_background_color(Gtk.StateType.NORMAL, self.color)
eventbox.add(box) eventbox.add(box)
self.attach.attach( self.child.attach(eventbox, _PDATA_START, self.row,
eventbox, _PDATA_START, _PDATA_STOP, _PDATA_STOP-_PDATA_START, 1)
self.row, self.row+1)
self.row += 1 # now advance it self.row += 1 # now advance it
else: else:
# show "V Family: ..." and the rest # show "V Family: ..." and the rest
@ -1461,7 +1403,7 @@ class RelationshipView(NavigationView):
if not self.write_relationship_events(box, family): if not self.write_relationship_events(box, family):
self.write_relationship(box, family) self.write_relationship(box, family)
hbox = Gtk.HBox() hbox = Gtk.Box()
if self.check_collapsed(family.handle, "CHILDREN"): if self.check_collapsed(family.handle, "CHILDREN"):
arrow = widgets.ExpandCollapseArrow(True, arrow = widgets.ExpandCollapseArrow(True,
self.expand_collapse_press, self.expand_collapse_press,
@ -1473,13 +1415,11 @@ class RelationshipView(NavigationView):
hbox.pack_start(arrow, False, True, 0) hbox.pack_start(arrow, False, True, 0)
label_cell = self.build_label_cell(_('Children')) label_cell = self.build_label_cell(_('Children'))
hbox.pack_start(label_cell, True, True, 0) hbox.pack_start(label_cell, True, True, 0)
self.attach.attach( self.child.attach(hbox, _CLABEL_START-1, self.row,
hbox, _CLABEL_START-1, _CLABEL_STOP-1, self.row, _CLABEL_STOP-_CLABEL_START, 1)
self.row+1, xoptions=Gtk.AttachOptions.FILL|Gtk.AttachOptions.SHRINK,
yoptions=Gtk.AttachOptions.FILL)
if self.check_collapsed(family.handle, "CHILDREN"): if self.check_collapsed(family.handle, "CHILDREN"):
hbox = Gtk.HBox() hbox = Gtk.Box()
child_list = family.get_child_ref_list() child_list = family.get_child_ref_list()
if child_list: if child_list:
count = len(child_list) count = len(child_list)
@ -1497,12 +1437,11 @@ class RelationshipView(NavigationView):
if self.use_shade: if self.use_shade:
eventbox.override_background_color(Gtk.StateType.NORMAL, self.color) eventbox.override_background_color(Gtk.StateType.NORMAL, self.color)
eventbox.add(box) eventbox.add(box)
self.attach.attach( self.child.attach(eventbox, _PDATA_START, self.row,
eventbox, _PDATA_START, _PDATA_STOP, _PDATA_STOP-_PDATA_START, 1)
self.row, self.row+1)
self.row += 1 # now advance it self.row += 1 # now advance it
else: else:
hbox = Gtk.HBox() hbox = Gtk.Box()
addchild = widgets.IconButton(self.add_child_to_fam, addchild = widgets.IconButton(self.add_child_to_fam,
family.handle, family.handle,
Gtk.STOCK_ADD) Gtk.STOCK_ADD)
@ -1513,12 +1452,10 @@ class RelationshipView(NavigationView):
selchild.set_tooltip_text(_('Add existing child to family')) selchild.set_tooltip_text(_('Add existing child to family'))
hbox.pack_start(addchild, False, True, 0) hbox.pack_start(addchild, False, True, 0)
hbox.pack_start(selchild, False, True, 0) hbox.pack_start(selchild, False, True, 0)
self.attach.attach( self.child.attach(hbox, _CLABEL_START, self.row,
hbox, _CLABEL_START, _CLABEL_STOP, self.row, _CLABEL_STOP-_CLABEL_START, 1)
self.row+1, xoptions=Gtk.AttachOptions.FILL|Gtk.AttachOptions.SHRINK,
yoptions=Gtk.AttachOptions.FILL)
vbox = Gtk.VBox() vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
i = 1 i = 1
child_list = family.get_child_ref_list() child_list = family.get_child_ref_list()
for child_ref in child_list: for child_ref in child_list:
@ -1530,9 +1467,8 @@ class RelationshipView(NavigationView):
if self.use_shade: if self.use_shade:
eventbox.override_background_color(Gtk.StateType.NORMAL, self.color) eventbox.override_background_color(Gtk.StateType.NORMAL, self.color)
eventbox.add(vbox) eventbox.add(vbox)
self.attach.attach( self.child.attach(eventbox, _CDATA_START-1, self.row,
eventbox, _CDATA_START-1, _CDATA_STOP, self.row, _CDATA_STOP-_CDATA_START+1, 1)
self.row+1)
self.row += 1 self.row += 1
def edit_button_press(self, obj, event, handle): def edit_button_press(self, obj, event, handle):
@ -1749,41 +1685,41 @@ class RelationshipView(NavigationView):
""" """
Function that builds the widget in the configuration dialog Function that builds the widget in the configuration dialog
""" """
table = Gtk.Table(n_rows=3, n_columns=2) grid = Gtk.Grid()
table.set_border_width(12) grid.set_border_width(12)
table.set_col_spacings(6) grid.set_column_spacing(6)
table.set_row_spacings(6) grid.set_row_spacing(6)
configdialog.add_checkbox(table, configdialog.add_checkbox(grid,
_('Use shading'), _('Use shading'),
0, 'preferences.relation-shade') 0, 'preferences.relation-shade')
configdialog.add_checkbox(table, configdialog.add_checkbox(grid,
_('Display edit buttons'), _('Display edit buttons'),
1, 'preferences.releditbtn') 1, 'preferences.releditbtn')
checkbox = Gtk.CheckButton(label=_('View links as website links')) checkbox = Gtk.CheckButton(label=_('View links as website links'))
theme = self._config.get('preferences.relation-display-theme') theme = self._config.get('preferences.relation-display-theme')
checkbox.set_active(theme == 'WEBPAGE') checkbox.set_active(theme == 'WEBPAGE')
checkbox.connect('toggled', self._config_update_theme) checkbox.connect('toggled', self._config_update_theme)
table.attach(checkbox, 1, 9, 2, 3, yoptions=0) grid.attach(checkbox, 1, 2, 8, 1)
return _('Layout'), table return _('Layout'), grid
def content_panel(self, configdialog): def content_panel(self, configdialog):
""" """
Function that builds the widget in the configuration dialog Function that builds the widget in the configuration dialog
""" """
table = Gtk.Table(n_rows=2, n_columns=2) grid = Gtk.Grid()
table.set_border_width(12) grid.set_border_width(12)
table.set_col_spacings(6) grid.set_column_spacing(6)
table.set_row_spacings(6) grid.set_row_spacing(6)
configdialog.add_checkbox(table, configdialog.add_checkbox(grid,
_('Show Details'), _('Show Details'),
0, 'preferences.family-details') 0, 'preferences.family-details')
configdialog.add_checkbox(table, configdialog.add_checkbox(grid,
_('Show Siblings'), _('Show Siblings'),
1, 'preferences.family-siblings') 1, 'preferences.family-siblings')
return _('Content'), table return _('Content'), grid
def _config_update_theme(self, obj): def _config_update_theme(self, obj):
""" """