More fix of PyGObject-3.11 DeprecationWarning

This commit is contained in:
Josip 2014-04-02 22:04:33 +02:00
parent 6b160a09ff
commit 2fbf9ff0f9
58 changed files with 145 additions and 131 deletions

View File

@ -294,7 +294,7 @@ class ConfigureDialog(ManagedWindow):
config=None, extra_callback=None): config=None, extra_callback=None):
if not config: if not config:
config = self.__config config = self.__config
checkbox = Gtk.CheckButton(label) checkbox = Gtk.CheckButton(label=label)
checkbox.set_active(config.get(constant)) checkbox.set_active(config.get(constant))
checkbox.connect('toggled', self.update_checkbox, constant, config) checkbox.connect('toggled', self.update_checkbox, constant, config)
if extra_callback: if extra_callback:
@ -503,7 +503,7 @@ 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(3, 8) table = Gtk.Table(n_rows=3, n_columns=8)
table.set_border_width(12) table.set_border_width(12)
table.set_col_spacings(6) table.set_col_spacings(6)
table.set_row_spacings(6) table.set_row_spacings(6)
@ -524,7 +524,7 @@ class GrampsPreferences(ConfigureDialog):
""" """
Add the ID prefix tab to the preferences. Add the ID prefix tab to the preferences.
""" """
table = Gtk.Table(3, 8) table = Gtk.Table(n_rows=3, n_columns=8)
table.set_border_width(12) table.set_border_width(12)
table.set_col_spacings(6) table.set_col_spacings(6)
table.set_row_spacings(6) table.set_row_spacings(6)
@ -552,7 +552,7 @@ class GrampsPreferences(ConfigureDialog):
""" """
Add the tab to set defaults colors for graph boxes Add the tab to set defaults colors for graph boxes
""" """
table = Gtk.Table(17, 8) table = Gtk.Table(n_rows=17, n_columns=8)
self.add_text(table, _('Set the colors used for boxes in the graphical views'), self.add_text(table, _('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(table, _('Gender Male Alive'), 1,
@ -590,7 +590,7 @@ class GrampsPreferences(ConfigureDialog):
return _('Colors'), table return _('Colors'), table
def add_advanced_panel(self, configdialog): def add_advanced_panel(self, configdialog):
table = Gtk.Table(4, 8) table = Gtk.Table(n_rows=4, n_columns=8)
table.set_border_width(12) table.set_border_width(12)
table.set_col_spacings(6) table.set_col_spacings(6)
table.set_row_spacings(6) table.set_row_spacings(6)
@ -804,7 +804,7 @@ class GrampsPreferences(ConfigureDialog):
UI to manage the custom name formats UI to manage the custom name formats
""" """
table = Gtk.Table(2, 3) table = Gtk.Table(n_rows=2, n_columns=3)
table.set_border_width(6) table.set_border_width(6)
table.set_col_spacings(6) table.set_col_spacings(6)
table.set_row_spacings(6) table.set_row_spacings(6)
@ -929,7 +929,7 @@ class GrampsPreferences(ConfigureDialog):
def add_formats_panel(self, configdialog): def add_formats_panel(self, configdialog):
row = 0 row = 0
table = Gtk.Table(4, 4) table = Gtk.Table(n_rows=4, n_columns=4)
table.set_border_width(12) table.set_border_width(12)
table.set_col_spacings(6) table.set_col_spacings(6)
table.set_row_spacings(6) table.set_row_spacings(6)
@ -1103,7 +1103,7 @@ class GrampsPreferences(ConfigureDialog):
def add_text_panel(self, configdialog): def add_text_panel(self, configdialog):
row = 0 row = 0
table = Gtk.Table(6, 8) table = Gtk.Table(n_rows=6, n_columns=8)
table.set_border_width(12) table.set_border_width(12)
table.set_col_spacings(6) table.set_col_spacings(6)
table.set_row_spacings(6) table.set_row_spacings(6)
@ -1166,7 +1166,7 @@ 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(2, 7) table = Gtk.Table(n_rows=2, n_columns=7)
table.set_border_width(12) table.set_border_width(12)
table.set_col_spacings(6) table.set_col_spacings(6)
table.set_row_spacings(6) table.set_row_spacings(6)
@ -1213,7 +1213,7 @@ class GrampsPreferences(ConfigureDialog):
return _('Dates'), table return _('Dates'), table
def add_behavior_panel(self, configdialog): def add_behavior_panel(self, configdialog):
table = Gtk.Table(2, 8) table = Gtk.Table(n_rows=2, n_columns=8)
table.set_border_width(12) table.set_border_width(12)
table.set_col_spacings(6) table.set_col_spacings(6)
table.set_row_spacings(6) table.set_row_spacings(6)
@ -1224,7 +1224,7 @@ class GrampsPreferences(ConfigureDialog):
current_line, 'preferences.default-source') current_line, 'preferences.default-source')
current_line += 1 current_line += 1
checkbutton = Gtk.CheckButton(_("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) table.attach(checkbutton, 1, 2, current_line, current_line+1, yoptions=0)
@ -1306,7 +1306,7 @@ class GrampsPreferences(ConfigureDialog):
current_line += 1 current_line += 1
checkbutton = Gtk.CheckButton( checkbutton = Gtk.CheckButton(
_("Do not ask about previously notified addons")) label=_("Do not ask about previously notified addons"))
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)
@ -1346,7 +1346,7 @@ 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(2, 2) table = Gtk.Table(n_rows=2, n_columns=2)
table.set_border_width(12) table.set_border_width(12)
table.set_col_spacings(6) table.set_col_spacings(6)
table.set_row_spacings(6) table.set_row_spacings(6)

View File

@ -53,6 +53,7 @@ _LOG = logging.getLogger(".DisplayState")
from gi.repository import Gdk from gi.repository import Gdk
from gi.repository import Gtk from gi.repository import Gtk
from gi.repository import GObject from gi.repository import GObject
from gi.repository import GLib
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -259,7 +260,7 @@ import os
class RecentDocsMenu(object): class RecentDocsMenu(object):
def __init__(self, uistate, state, fileopen): def __init__(self, uistate, state, fileopen):
self.action_group = Gtk.ActionGroup('RecentFiles') self.action_group = Gtk.ActionGroup(name='RecentFiles')
self.active = DISABLED self.active = DISABLED
self.uistate = uistate self.uistate = uistate
self.uimanager = uistate.uimanager self.uimanager = uistate.uimanager
@ -280,7 +281,7 @@ class RecentDocsMenu(object):
if self.active != DISABLED: if self.active != DISABLED:
self.uimanager.remove_ui(self.active) self.uimanager.remove_ui(self.active)
self.uimanager.remove_action_group(self.action_group) self.uimanager.remove_action_group(self.action_group)
self.action_group = Gtk.ActionGroup('RecentFiles') self.action_group = Gtk.ActionGroup(name='RecentFiles')
self.active = DISABLED self.active = DISABLED
actions = [] actions = []
@ -335,7 +336,7 @@ class WarnHandler(RotateHandler):
def emit(self, record): def emit(self, record):
if self.timer is None: if self.timer is None:
#check every 3 minutes if warn button can disappear #check every 3 minutes if warn button can disappear
self.timer = GObject.timeout_add(3*60*1000, self._check_clear) self.timer = GLib.timeout_add(3*60*1000, self._check_clear)
RotateHandler.emit(self, record) RotateHandler.emit(self, record)
self.button.show() self.button.show()
@ -557,7 +558,7 @@ class DisplayState(Callback):
def push_message(self, dbstate, text): def push_message(self, dbstate, text):
self.status_text(text) self.status_text(text)
GObject.timeout_add(5000, self.modify_statusbar, dbstate) GLib.timeout_add(5000, self.modify_statusbar, dbstate)
def show_filter_results(self, dbstate, matched, total): def show_filter_results(self, dbstate, matched, total):
#nav_type = self.viewmanager.active_page.navigation_type() #nav_type = self.viewmanager.active_page.navigation_type()

View File

@ -662,8 +662,8 @@ class EditPerson(EditPrimary):
Override from base class, the menuitems and actiongroups for the top Override from base class, the menuitems and actiongroups for the top
of context menu. of context menu.
""" """
self.all_action = Gtk.ActionGroup("/PersonAll") self.all_action = Gtk.ActionGroup(name="/PersonAll")
self.home_action = Gtk.ActionGroup("/PersonHome") self.home_action = Gtk.ActionGroup(name="/PersonHome")
self.track_ref_for_deletion("all_action") self.track_ref_for_deletion("all_action")
self.track_ref_for_deletion("home_action") self.track_ref_for_deletion("home_action")

View File

@ -314,7 +314,7 @@ class EditPrimary(ManagedWindow, DbGUIElement):
(ui_qr, reportactions) = create_quickreport_menu(self.QR_CATEGORY, (ui_qr, reportactions) = create_quickreport_menu(self.QR_CATEGORY,
self.dbstate, self.uistate, self.dbstate, self.uistate,
self.obj.get_handle()) self.obj.get_handle())
self.report_action = Gtk.ActionGroup("/PersonReport") self.report_action = Gtk.ActionGroup(name="/PersonReport")
self.report_action.add_actions(reportactions) self.report_action.add_actions(reportactions)
self.report_action.set_visible(True) self.report_action.set_visible(True)
self.popupmanager.insert_action_group(self.report_action, -1) self.popupmanager.insert_action_group(self.report_action, -1)

View File

@ -498,9 +498,9 @@ class EditRule(ManagedWindow):
the_map[class_obj] = c the_map[class_obj] = c
# Only add a table with parameters if there are any parameters # Only add a table with parameters if there are any parameters
if arglist: if arglist:
table = Gtk.Table(3, len(arglist)) table = Gtk.Table(n_rows=3, n_columns=len(arglist))
else: else:
table = Gtk.Table(1, 1) table = Gtk.Table(n_rows=1, n_columns=1)
table.set_border_width(6) table.set_border_width(6)
table.set_col_spacings(6) table.set_col_spacings(6)
table.set_row_spacings(6) table.set_row_spacings(6)
@ -597,7 +597,7 @@ class EditRule(ManagedWindow):
use_regex = None use_regex = None
if class_obj.allow_regex: if class_obj.allow_regex:
use_regex = Gtk.CheckButton(_('Use regular expressions')) use_regex = Gtk.CheckButton(label=_('Use regular expressions'))
tip = _('Interpret the contents of string fields as regular ' tip = _('Interpret the contents of string fields as regular '
'expressions.\n' 'expressions.\n'
'A decimal point will match any character. ' 'A decimal point will match any character. '

View File

@ -78,7 +78,7 @@ class CitationSidebarFilter(SidebarFilter):
self.filter_note = Gtk.Entry() self.filter_note = Gtk.Entry()
self.filter_regex = Gtk.CheckButton(_('Use regular expressions')) self.filter_regex = Gtk.CheckButton(label=_('Use regular expressions'))
self.tag = Gtk.ComboBox() self.tag = Gtk.ComboBox()
self.generic = Gtk.ComboBox() self.generic = Gtk.ComboBox()

View File

@ -75,7 +75,7 @@ class EventSidebarFilter(SidebarFilter):
self.filter_place = widgets.BasicEntry() self.filter_place = widgets.BasicEntry()
self.filter_note = widgets.BasicEntry() self.filter_note = widgets.BasicEntry()
self.filter_regex = Gtk.CheckButton(_('Use regular expressions')) self.filter_regex = Gtk.CheckButton(label=_('Use regular expressions'))
self.tag = Gtk.ComboBox() self.tag = Gtk.ComboBox()
self.generic = Gtk.ComboBox() self.generic = Gtk.ComboBox()

View File

@ -87,7 +87,7 @@ class FamilySidebarFilter(SidebarFilter):
self.filter_note = widgets.BasicEntry() self.filter_note = widgets.BasicEntry()
self.filter_regex = Gtk.CheckButton(_('Use regular expressions')) self.filter_regex = Gtk.CheckButton(label=_('Use regular expressions'))
self.tag = Gtk.ComboBox() self.tag = Gtk.ComboBox()
self.generic = Gtk.ComboBox() self.generic = Gtk.ComboBox()

View File

@ -66,7 +66,7 @@ class MediaSidebarFilter(SidebarFilter):
self.filter_date = widgets.DateEntry(uistate, []) self.filter_date = widgets.DateEntry(uistate, [])
self.filter_note = widgets.BasicEntry() self.filter_note = widgets.BasicEntry()
self.filter_regex = Gtk.CheckButton(_('Use regular expressions')) self.filter_regex = Gtk.CheckButton(label=_('Use regular expressions'))
self.tag = Gtk.ComboBox() self.tag = Gtk.ComboBox()
self.generic = Gtk.ComboBox() self.generic = Gtk.ComboBox()

View File

@ -71,7 +71,7 @@ class NoteSidebarFilter(SidebarFilter):
self.note.set_type, self.note.set_type,
self.note.get_type) self.note.get_type)
self.filter_regex = Gtk.CheckButton(_('Use regular expressions')) self.filter_regex = Gtk.CheckButton(label=_('Use regular expressions'))
self.tag = Gtk.ComboBox() self.tag = Gtk.ComboBox()
self.generic = Gtk.ComboBox() self.generic = Gtk.ComboBox()

View File

@ -92,7 +92,7 @@ class PersonSidebarFilter(SidebarFilter):
[ _('any'), _('male'), _('female'), _('unknown') ])) [ _('any'), _('male'), _('female'), _('unknown') ]))
self.filter_gender.set_active(0) self.filter_gender.set_active(0)
self.filter_regex = Gtk.CheckButton(_('Use regular expressions')) self.filter_regex = Gtk.CheckButton(label=_('Use regular expressions'))
self.tag = Gtk.ComboBox() self.tag = Gtk.ComboBox()
self.generic = Gtk.ComboBox() self.generic = Gtk.ComboBox()

View File

@ -73,7 +73,7 @@ class PlaceSidebarFilter(SidebarFilter):
self.filter_parish = widgets.BasicEntry() self.filter_parish = widgets.BasicEntry()
self.filter_note = widgets.BasicEntry() self.filter_note = widgets.BasicEntry()
self.filter_regex = Gtk.CheckButton(_('Use regular expressions')) self.filter_regex = Gtk.CheckButton(label=_('Use regular expressions'))
self.tag = Gtk.ComboBox() self.tag = Gtk.ComboBox()
self.generic = Gtk.ComboBox() self.generic = Gtk.ComboBox()

View File

@ -74,7 +74,7 @@ class RepoSidebarFilter(SidebarFilter):
self.filter_note = widgets.BasicEntry() self.filter_note = widgets.BasicEntry()
self.filter_regex = Gtk.CheckButton(_('Use regular expressions')) self.filter_regex = Gtk.CheckButton(label=_('Use regular expressions'))
self.tag = Gtk.ComboBox() self.tag = Gtk.ComboBox()
self.generic = Gtk.ComboBox() self.generic = Gtk.ComboBox()

View File

@ -50,7 +50,7 @@ class SidebarFilter(DbGUIElement):
self.position = 1 self.position = 1
self.vbox = Gtk.VBox() self.vbox = Gtk.VBox()
self.table = Gtk.Table(4, 11) self.table = Gtk.Table(n_rows=4, n_columns=11)
self.vbox.pack_start(self.table, False, False, 0) self.vbox.pack_start(self.table, False, False, 0)
self.table.set_border_width(6) self.table.set_border_width(6)
self.table.set_row_spacings(6) self.table.set_row_spacings(6)

View File

@ -65,7 +65,7 @@ class SourceSidebarFilter(SidebarFilter):
self.filter_pub = widgets.BasicEntry() self.filter_pub = widgets.BasicEntry()
self.filter_note = widgets.BasicEntry() self.filter_note = widgets.BasicEntry()
self.filter_regex = Gtk.CheckButton(_('Use regular expressions')) self.filter_regex = Gtk.CheckButton(label=_('Use regular expressions'))
self.tag = Gtk.ComboBox() self.tag = Gtk.ComboBox()
self.generic = Gtk.ComboBox() self.generic = Gtk.ComboBox()

View File

@ -65,7 +65,7 @@ except:
if not PYGOBJ_ERR: if not PYGOBJ_ERR:
try: try:
from gi.repository import GObject from gi.repository import GObject, GLib
if not GObject.pygobject_version >= MIN_PYGOBJECT_VERSION : if not GObject.pygobject_version >= MIN_PYGOBJECT_VERSION :
PYGOBJ_ERR = True PYGOBJ_ERR = True
except: except:
@ -410,9 +410,10 @@ def __startgramps(errors, argparser):
def startgtkloop(errors, argparser): def startgtkloop(errors, argparser):
""" We start the gtk loop and run the function to start up GRAMPS """ We start the gtk loop and run the function to start up GRAMPS
""" """
GObject.threads_init() if GObject.pygobject_version < (3, 10, 2):
GObject.threads_init()
GObject.timeout_add(100, __startgramps, errors, argparser, priority=100) GLib.timeout_add(100, __startgramps, errors, argparser, priority=100)
if os.path.exists(os.path.join(DATA_DIR, "gramps.accel")): if os.path.exists(os.path.join(DATA_DIR, "gramps.accel")):
Gtk.AccelMap.load(os.path.join(DATA_DIR, "gramps.accel")) Gtk.AccelMap.load(os.path.join(DATA_DIR, "gramps.accel"))
Gtk.main() Gtk.main()

View File

@ -114,7 +114,7 @@ class GrampsWindowManager(object):
self.uimanager = uimanager self.uimanager = uimanager
self.window_tree = [] self.window_tree = []
self.id2item = {} self.id2item = {}
self.action_group = Gtk.ActionGroup('WindowManger') self.action_group = Gtk.ActionGroup(name='WindowManger')
self.active = DISABLED self.active = DISABLED
self.ui = _win_top + _win_btm self.ui = _win_top + _win_btm
@ -292,7 +292,7 @@ class GrampsWindowManager(object):
self.uimanager.remove_ui(self.active) self.uimanager.remove_ui(self.active)
self.uimanager.remove_action_group(self.action_group) self.uimanager.remove_action_group(self.action_group)
self.action_group = Gtk.ActionGroup('WindowManger') self.action_group = Gtk.ActionGroup(name='WindowManger')
action_data = [] action_data = []
data = StringIO() data = StringIO()

View File

@ -103,7 +103,8 @@ class Navigator(object):
self.select_button.set_relief(Gtk.ReliefStyle.NONE) self.select_button.set_relief(Gtk.ReliefStyle.NONE)
select_hbox = Gtk.HBox() select_hbox = Gtk.HBox()
self.title_label = Gtk.Label(label='') self.title_label = Gtk.Label(label='')
arrow = Gtk.Arrow(Gtk.ArrowType.DOWN, Gtk.ShadowType.NONE) arrow = Gtk.Arrow(arrow_type=Gtk.ArrowType.DOWN,
shadow_type=Gtk.ShadowType.NONE)
select_hbox.pack_start(self.title_label, False, True, 0) select_hbox.pack_start(self.title_label, False, True, 0)
select_hbox.pack_end(arrow, False, True, 0) select_hbox.pack_end(arrow, False, True, 0)
self.select_button.add(select_hbox) self.select_button.add(select_hbox)
@ -227,7 +228,7 @@ class Navigator(object):
list(map(uimanager.remove_ui, self.merge_ids)) list(map(uimanager.remove_ui, self.merge_ids))
if cat_num in self.ui_category: if cat_num in self.ui_category:
self.cat_view_group = Gtk.ActionGroup('viewmenu') self.cat_view_group = Gtk.ActionGroup(name='viewmenu')
self.cat_view_group.add_radio_actions( self.cat_view_group.add_radio_actions(
self.view_toggle_actions[cat_num], value=view_num, self.view_toggle_actions[cat_num], value=view_num,
on_change=self.cb_view_clicked, user_data=cat_num) on_change=self.cb_view_clicked, user_data=cat_num)

View File

@ -1813,7 +1813,7 @@ class GuiBooleanListOption(Gtk.HBox):
this_column_counter = 0 this_column_counter = 0
ncolumn = 0 ncolumn = 0
for description in option.get_descriptions(): for description in option.get_descriptions():
button = Gtk.CheckButton(description) button = Gtk.CheckButton(label=description)
self.__cbutton.append(button) self.__cbutton.append(button)
if counter < len(default): if counter < len(default):
if default[counter] == 'True': if default[counter] == 'True':

View File

@ -1006,7 +1006,7 @@ 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(3, len(flist)) table = Gtk.Table(n_rows=3, n_columns=len(flist))
table.set_col_spacings(12) table.set_col_spacings(12)
table.set_row_spacings(6) table.set_row_spacings(6)
table.set_border_width(6) table.set_border_width(6)

View File

@ -192,7 +192,7 @@ class ExportAssistant(Gtk.Assistant, ManagedWindow) :
box.set_border_width(12) box.set_border_width(12)
box.set_spacing(12) box.set_spacing(12)
table = Gtk.Table(2*len(self.__exporters),2) table = Gtk.Table(n_rows=2*len(self.__exporters), n_columns=2)
table.set_row_spacings(6) table.set_row_spacings(6)
table.set_col_spacings(6) table.set_col_spacings(6)

View File

@ -301,12 +301,12 @@ class QuickTable(SimpleTable):
if isinstance(handle, list): if isinstance(handle, list):
handle = handle[0] handle = handle[0]
if objclass == 'Person': if objclass == 'Person':
from gi.repository import GObject from gi.repository import GLib
# If you emmit the signal here and it causes this table to be deleted, # If you emmit the signal here and it causes this table to be deleted,
# then you'll crash Python: # then you'll crash Python:
#self.simpledoc.doc.uistate.set_active(handle, 'Person') #self.simpledoc.doc.uistate.set_active(handle, 'Person')
# So, let's return from this, then change the active person: # So, let's return from this, then change the active person:
return GObject.timeout_add(100, self.simpledoc.doc.uistate.set_active, handle, 'Person') return GLib.timeout_add(100, self.simpledoc.doc.uistate.set_active, handle, 'Person')
return True return True
return False # didn't handle event return False # didn't handle event

View File

@ -176,7 +176,7 @@ class DocReportDialog(ReportDialog):
yoptions=Gtk.AttachOptions.SHRINK) yoptions=Gtk.AttachOptions.SHRINK)
self.row += 1 self.row += 1
self.open_with_app = Gtk.CheckButton(_("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.tbl.attach(self.open_with_app, 2, 4, self.row, self.row+1,
@ -211,7 +211,7 @@ 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(3,3) self.html_table = Gtk.Table(n_rows=3, n_columns=3)
self.html_table.set_col_spacings(12) self.html_table.set_col_spacings(12)
self.html_table.set_row_spacings(6) self.html_table.set_row_spacings(6)
self.html_table.set_border_width(0) self.html_table.set_border_width(0)

View File

@ -155,7 +155,7 @@ class GraphvizReportDialog(ReportDialog):
yoptions=Gtk.AttachOptions.SHRINK) yoptions=Gtk.AttachOptions.SHRINK)
self.row += 1 self.row += 1
self.open_with_app = Gtk.CheckButton(_("Open with default viewer")) self.open_with_app = Gtk.CheckButton(build=_("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.tbl.attach(self.open_with_app, 2, 4, self.row, self.row+1,

View File

@ -176,7 +176,7 @@ class ReportDialog(ManagedWindow):
self.setup_title() self.setup_title()
self.setup_header() self.setup_header()
self.tbl = Gtk.Table(4, 4, False) self.tbl = Gtk.Table(n_rows=4, n_columns=4, homogeneous=False)
self.tbl.set_col_spacings(12) self.tbl.set_col_spacings(12)
self.tbl.set_row_spacings(6) self.tbl.set_row_spacings(6)
self.tbl.set_border_width(6) self.tbl.set_border_width(6)
@ -359,7 +359,7 @@ class ReportDialog(ManagedWindow):
if max_rows == 0: if max_rows == 0:
return return
table = Gtk.Table(3, max_rows+1) table = Gtk.Table(n_rows=3, n_columns=max_rows+1)
table.set_col_spacings(12) table.set_col_spacings(12)
table.set_row_spacings(6) table.set_row_spacings(6)
@ -389,7 +389,7 @@ class ReportDialog(ManagedWindow):
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(3, len(flist)) table = Gtk.Table(n_rows=3, n_columns=len(flist))
table.set_col_spacings(12) table.set_col_spacings(12)
table.set_row_spacings(6) table.set_row_spacings(6)
table.set_border_width(6) table.set_border_width(6)

View File

@ -803,7 +803,7 @@ class ViewManager(CLIManager):
""" """
Initialize an action group for the UIManager Initialize an action group for the UIManager
""" """
new_group = Gtk.ActionGroup(name) new_group = Gtk.ActionGroup(name=name)
new_group.add_actions(actions) new_group.add_actions(actions)
if toggles: if toggles:
new_group.add_toggle_actions(toggles) new_group.add_toggle_actions(toggles)
@ -1162,7 +1162,7 @@ class ViewManager(CLIManager):
Change the UNDO label Change the UNDO label
""" """
self.uimanager.remove_action_group(self.undoactions) self.uimanager.remove_action_group(self.undoactions)
self.undoactions = Gtk.ActionGroup('Undo') self.undoactions = Gtk.ActionGroup(name='Undo')
if label: if label:
self.undoactions.add_actions([ self.undoactions.add_actions([
('Undo', Gtk.STOCK_UNDO, label, '<PRIMARY>z', None, self.undo)]) ('Undo', Gtk.STOCK_UNDO, label, '<PRIMARY>z', None, self.undo)])
@ -1178,7 +1178,7 @@ class ViewManager(CLIManager):
Change the REDO label Change the REDO label
""" """
self.uimanager.remove_action_group(self.redoactions) self.uimanager.remove_action_group(self.redoactions)
self.redoactions = Gtk.ActionGroup('Redo') self.redoactions = Gtk.ActionGroup(name='Redo')
if label: if label:
self.redoactions.add_actions([ self.redoactions.add_actions([
('Redo', Gtk.STOCK_REDO, label, '<shift><PRIMARY>z', ('Redo', Gtk.STOCK_REDO, label, '<shift><PRIMARY>z',
@ -1461,7 +1461,7 @@ class ViewManager(CLIManager):
if self.toolactions: if self.toolactions:
self.uistate.uimanager.remove_action_group(self.toolactions) self.uistate.uimanager.remove_action_group(self.toolactions)
self.uistate.uimanager.remove_ui(self.tool_menu_ui_id) self.uistate.uimanager.remove_ui(self.tool_menu_ui_id)
self.toolactions = Gtk.ActionGroup('ToolWindow') self.toolactions = Gtk.ActionGroup(name='ToolWindow')
(uidef, actions) = self.build_plugin_menu( (uidef, actions) = self.build_plugin_menu(
'ToolsMenu', tool_menu_list, tool.tool_categories, 'ToolsMenu', tool_menu_list, tool.tool_categories,
make_plugin_callback) make_plugin_callback)
@ -1477,7 +1477,7 @@ class ViewManager(CLIManager):
if self.reportactions: if self.reportactions:
self.uistate.uimanager.remove_action_group(self.reportactions) self.uistate.uimanager.remove_action_group(self.reportactions)
self.uistate.uimanager.remove_ui(self.report_menu_ui_id) self.uistate.uimanager.remove_ui(self.report_menu_ui_id)
self.reportactions = Gtk.ActionGroup('ReportWindow') self.reportactions = Gtk.ActionGroup(name='ReportWindow')
(uidef, actions) = self.build_plugin_menu( (uidef, actions) = self.build_plugin_menu(
'ReportsMenu', report_menu_list, standalone_categories, 'ReportsMenu', report_menu_list, standalone_categories,
make_plugin_callback) make_plugin_callback)

View File

@ -96,7 +96,7 @@ class Bookmarks :
self.bookmarks = None self.bookmarks = None
self.update_bookmarks() self.update_bookmarks()
self.active = DISABLED self.active = DISABLED
self.action_group = Gtk.ActionGroup('Bookmarks') self.action_group = Gtk.ActionGroup(name='Bookmarks')
self.connect_signals() self.connect_signals()
self.dbstate.connect('database-changed', self.db_changed) self.dbstate.connect('database-changed', self.db_changed)
@ -138,7 +138,7 @@ class Bookmarks :
if self.active != DISABLED: if self.active != DISABLED:
self.uistate.uimanager.remove_ui(self.active) self.uistate.uimanager.remove_ui(self.active)
self.uistate.uimanager.remove_action_group(self.action_group) self.uistate.uimanager.remove_action_group(self.action_group)
self.action_group = Gtk.ActionGroup('Bookmarks') self.action_group = Gtk.ActionGroup(name='Bookmarks')
self.uistate.uimanager.ensure_update() self.uistate.uimanager.ensure_update()
self.active = DISABLED self.active = DISABLED

View File

@ -209,7 +209,7 @@ class ListView(NavigationView):
NavigationView.define_actions(self) NavigationView.define_actions(self)
self.edit_action = Gtk.ActionGroup(self.title + '/ChangeOrder') self.edit_action = Gtk.ActionGroup(name=self.title + '/ChangeOrder')
self.edit_action.add_actions([ self.edit_action.add_actions([
('Add', Gtk.STOCK_ADD, _("_Add..."), "<PRIMARY>Insert", ('Add', Gtk.STOCK_ADD, _("_Add..."), "<PRIMARY>Insert",
self.ADD_MSG, self.add), self.ADD_MSG, self.add),

View File

@ -267,7 +267,7 @@ class NavigationView(PageView):
""" """
Define the bookmark menu actions. Define the bookmark menu actions.
""" """
self.book_action = Gtk.ActionGroup(self.title + '/Bookmark') self.book_action = Gtk.ActionGroup(name=self.title + '/Bookmark')
self.book_action.add_actions([ self.book_action.add_actions([
('AddBook', 'gramps-bookmark-new', _('_Add Bookmark'), ('AddBook', 'gramps-bookmark-new', _('_Add Bookmark'),
'<PRIMARY>d', None, self.add_bookmark), '<PRIMARY>d', None, self.add_bookmark),
@ -287,7 +287,7 @@ class NavigationView(PageView):
Define the navigation menu actions. Define the navigation menu actions.
""" """
# add the Forward action group to handle the Forward button # add the Forward action group to handle the Forward button
self.fwd_action = Gtk.ActionGroup(self.title + '/Forward') self.fwd_action = Gtk.ActionGroup(name=self.title + '/Forward')
self.fwd_action.add_actions([ self.fwd_action.add_actions([
('Forward', Gtk.STOCK_GO_FORWARD, _("_Forward"), ('Forward', Gtk.STOCK_GO_FORWARD, _("_Forward"),
"%sRight" % mod_key(), _("Go to the next object in the history"), "%sRight" % mod_key(), _("Go to the next object in the history"),
@ -295,7 +295,7 @@ class NavigationView(PageView):
]) ])
# add the Backward action group to handle the Forward button # add the Backward action group to handle the Forward button
self.back_action = Gtk.ActionGroup(self.title + '/Backward') self.back_action = Gtk.ActionGroup(name=self.title + '/Backward')
self.back_action.add_actions([ self.back_action.add_actions([
('Back', Gtk.STOCK_GO_BACK, _("_Back"), ('Back', Gtk.STOCK_GO_BACK, _("_Back"),
"%sLeft" % mod_key(), _("Go to the previous object in the history"), "%sLeft" % mod_key(), _("Go to the previous object in the history"),
@ -306,7 +306,7 @@ class NavigationView(PageView):
accel="%sHome" % mod_key(), accel="%sHome" % mod_key(),
tip=_("Go to the default person"), callback=self.home) tip=_("Go to the default person"), callback=self.home)
self.other_action = Gtk.ActionGroup(self.title + '/PersonOther') self.other_action = Gtk.ActionGroup(name=self.title + '/PersonOther')
self.other_action.add_actions([ self.other_action.add_actions([
('SetActive', Gtk.STOCK_HOME, _("Set _Home Person"), None, ('SetActive', Gtk.STOCK_HOME, _("Set _Home Person"), None,
None, self.set_default_person), None, self.set_default_person),
@ -451,7 +451,7 @@ class NavigationView(PageView):
"%s%d" % (mod_key(), index), None, "%s%d" % (mod_key(), index), None,
make_callback(hobj.push, handle))) make_callback(hobj.push, handle)))
self.mru_action = Gtk.ActionGroup(self.title + '/MRU') self.mru_action = Gtk.ActionGroup(name=self.title + '/MRU')
self.mru_action.add_actions(data) self.mru_action.add_actions(data)
self.mru_enable() self.mru_enable()

View File

@ -420,7 +420,7 @@ class PageView(DbGUIElement):
and self.action_toggle_list. The user should define these in and self.action_toggle_list. The user should define these in
self.define_actions self.define_actions
""" """
self.action_group = Gtk.ActionGroup(self.title) self.action_group = Gtk.ActionGroup(name=self.title)
if len(self.action_list) > 0: if len(self.action_list) > 0:
self.action_group.add_actions(self.action_list) self.action_group.add_actions(self.action_list)
if len(self.action_toggle_list) > 0: if len(self.action_toggle_list) > 0:

View File

@ -206,7 +206,7 @@ class Tags(DbGUIElement):
if self.db is None: if self.db is None:
self.tag_ui = '' self.tag_ui = ''
self.tag_action = Gtk.ActionGroup('Tag') self.tag_action = Gtk.ActionGroup(name='Tag')
return return
tag_menu = '<menuitem action="NewTag"/>' tag_menu = '<menuitem action="NewTag"/>'
@ -227,7 +227,7 @@ class Tags(DbGUIElement):
actions.append(('TagButton', 'gramps-tag', _('Tag'), None, actions.append(('TagButton', 'gramps-tag', _('Tag'), None,
_('Tag selected rows'), self.cb_tag_button)) _('Tag selected rows'), self.cb_tag_button))
self.tag_action = Gtk.ActionGroup('Tag') self.tag_action = Gtk.ActionGroup(name='Tag')
self.tag_action.add_actions(actions) self.tag_action.add_actions(actions)
def cb_tag_button(self, action): def cb_tag_button(self, action):

View File

@ -83,10 +83,12 @@ class ExpandCollapseArrow(Gtk.EventBox):
""" """
GObject.GObject.__init__(self) GObject.GObject.__init__(self)
if collapsed : if collapsed :
self.arrow = Gtk.Arrow(Gtk.ArrowType.RIGHT, Gtk.ShadowType.OUT) self.arrow = Gtk.Arrow(arrow_type=Gtk.ArrowType.RIGHT,
shadow_type=Gtk.ShadowType.OUT)
self.set_tooltip_text(_("Expand this section")) self.set_tooltip_text(_("Expand this section"))
else: else:
self.arrow = Gtk.Arrow(Gtk.ArrowType.DOWN, Gtk.ShadowType.OUT) self.arrow = Gtk.Arrow(arrow_type=Gtk.ArrowType.DOWN,
shadow_type=Gtk.ShadowType.OUT)
self.set_tooltip_text(_("Collapse this section")) self.set_tooltip_text(_("Collapse this section"))
self.add(self.arrow) self.add(self.arrow)
self.connect('button-press-event', onbuttonpress, pair) self.connect('button-press-event', onbuttonpress, pair)

View File

@ -114,7 +114,8 @@ class GrampletBar(Gtk.Notebook):
book_button = Gtk.Button() book_button = Gtk.Button()
box = Gtk.VBox() # Arrow is too small unless in a Vbox box = Gtk.VBox() # Arrow is too small unless in a Vbox
arrow = Gtk.Arrow(Gtk.ArrowType.DOWN, Gtk.ShadowType.NONE) arrow = Gtk.Arrow(arrow_type=Gtk.ArrowType.DOWN,
shadow_type=Gtk.ShadowType.NONE)
arrow.show() arrow.show()
box.add(arrow) box.add(arrow)
box.show() box.show()

View File

@ -557,7 +557,7 @@ 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(False) topbox = Gtk.VBox(homogeneous=False)
hbox = Gtk.HBox(False, 5) hbox = Gtk.HBox(False, 5)
labels = Gtk.VBox(True) labels = Gtk.VBox(True)
options = Gtk.VBox(True) options = Gtk.VBox(True)
@ -1510,7 +1510,7 @@ 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(3, 2) table = Gtk.Table(n_rows=3, n_columns=2)
table.set_border_width(12) table.set_border_width(12)
table.set_col_spacings(6) table.set_col_spacings(6)
table.set_row_spacings(6) table.set_row_spacings(6)
@ -1543,7 +1543,7 @@ 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(3, 2) table = Gtk.Table(n_rows=3, n_columns=2)
table.set_border_width(12) table.set_border_width(12)
table.set_col_spacings(6) table.set_col_spacings(6)
table.set_row_spacings(6) table.set_row_spacings(6)

View File

@ -526,12 +526,13 @@ class StyledTextEditor(Gtk.TextView):
} }
# create the action group and insert all the actions # create the action group and insert all the actions
self.action_group = Gtk.ActionGroup('Format') self.action_group = Gtk.ActionGroup(name='Format')
self.action_group.add_toggle_actions(format_toggle_actions) self.action_group.add_toggle_actions(format_toggle_actions)
self.undo_action = Gtk.Action("Undo", _('Undo'), _('Undo'), self.undo_action = Gtk.Action(name="Undo", label=_('Undo'),
Gtk.STOCK_UNDO) tooltip=_('Undo'),
stock_id=Gtk.STOCK_UNDO)
self.undo_action.connect('activate', self.undo) self.undo_action.connect('activate', self.undo)
self.redo_action = Gtk.Action("Redo", _('Redo'), _('Redo'), self.redo_action = Gtk.Action.new("Redo", _('Redo'), _('Redo'),
Gtk.STOCK_REDO) Gtk.STOCK_REDO)
self.redo_action.connect('activate', self.redo) self.redo_action.connect('activate', self.redo)
self.action_group.add_action(self.undo_action) self.action_group.add_action(self.undo_action)

View File

@ -146,7 +146,7 @@ class FadeOut(GObject.GObject):
else: else:
func = generator.__next__ func = generator.__next__
self._background_timeout_id = ( self._background_timeout_id = (
GObject.timeout_add(FadeOut.MERGE_COLORS_DELAY, func)) GLib.timeout_add(FadeOut.MERGE_COLORS_DELAY, func))
self._countdown_timeout_id = -1 self._countdown_timeout_id = -1
def start(self, color): def start(self, color):
@ -168,7 +168,7 @@ class FadeOut(GObject.GObject):
self._start_color = color self._start_color = color
##_LOG.debug('start: Scheduling') ##_LOG.debug('start: Scheduling')
self._countdown_timeout_id = GObject.timeout_add( self._countdown_timeout_id = GLib.timeout_add(
FadeOut.COMPLAIN_DELAY, self._start_merging) FadeOut.COMPLAIN_DELAY, self._start_merging)
return True return True
@ -1178,7 +1178,7 @@ class ValidatableMaskedEntry(MaskedEntry):
def do_changed(self): def do_changed(self):
block_changed = getattr(self, '_block_changed', True) block_changed = getattr(self, '_block_changed', True)
if block_changed: if block_changed:
self.emit_stop_by_name('changed') self.stop_emission_by_name('changed')
return return
self.emit('content-changed') self.emit('content-changed')
self.validate() self.validate()

View File

@ -206,10 +206,10 @@ class CSVWriterOptionBox(WriterOptionBox):
from gi.repository import Gtk from gi.repository import Gtk
option_box = WriterOptionBox.get_option_box(self) option_box = WriterOptionBox.get_option_box(self)
self.include_individuals_check = Gtk.CheckButton(_("Include people")) self.include_individuals_check = Gtk.CheckButton(label=_("Include people"))
self.include_marriages_check = Gtk.CheckButton(_("Include marriages")) self.include_marriages_check = Gtk.CheckButton(label=_("Include marriages"))
self.include_children_check = Gtk.CheckButton(_("Include children")) self.include_children_check = Gtk.CheckButton(label=_("Include children"))
self.translate_headers_check = Gtk.CheckButton(_("Translate headers")) self.translate_headers_check = Gtk.CheckButton(label=_("Translate headers"))
self.include_individuals_check.set_active(1) self.include_individuals_check.set_active(1)
self.include_marriages_check.set_active(1) self.include_marriages_check.set_active(1)

View File

@ -53,7 +53,7 @@ class PersonDetails(Gramplet):
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(1, 2) self.table = Gtk.Table(n_rows=1, n_columns=2)
vbox.pack_start(self.table, fill=True, expand=False, padding=5) vbox.pack_start(self.table, 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)

View File

@ -49,7 +49,7 @@ class PlaceDetails(Gramplet):
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(1, 2) self.table = Gtk.Table(n_rows=1, n_columns=2)
vbox.pack_start(self.table, False, True, 0) vbox.pack_start(self.table, 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)

View File

@ -45,7 +45,7 @@ class RepositoryDetails(Gramplet):
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(1, 2) self.table = Gtk.Table(n_rows=1, n_columns=2)
vbox.pack_start(self.table, fill=True, expand=False, padding=0) vbox.pack_start(self.table, 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()

View File

@ -83,7 +83,7 @@ class WelcomeGramplet(Gramplet):
""" """
Build the GUI interface. Build the GUI interface.
""" """
top = Gtk.VBox(False) top = Gtk.VBox(homogeneous=False)
scrolledwindow = Gtk.ScrolledWindow() scrolledwindow = Gtk.ScrolledWindow()
scrolledwindow.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) scrolledwindow.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)

View File

@ -338,8 +338,8 @@ class BasePersonView(ListView):
ListView.define_actions(self) ListView.define_actions(self)
self.all_action = Gtk.ActionGroup(self.title + "/PersonAll") self.all_action = Gtk.ActionGroup(name=self.title + "/PersonAll")
self.edit_action = Gtk.ActionGroup(self.title + "/PersonEdit") self.edit_action = Gtk.ActionGroup(name=self.title + "/PersonEdit")
self.all_action.add_actions([ self.all_action.add_actions([
('FilterEdit', None, _('Person Filter Editor'), None, None, ('FilterEdit', None, _('Person Filter Editor'), None, None,

View File

@ -1040,7 +1040,7 @@ 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(2, 2) table = Gtk.Table(n_rows=2, n_columns=2)
table.set_border_width(12) table.set_border_width(12)
table.set_col_spacings(6) table.set_col_spacings(6)
table.set_row_spacings(6) table.set_row_spacings(6)
@ -1057,7 +1057,7 @@ 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(1, 1) table = Gtk.Table(n_rows=1, n_columns=1)
table.set_border_width(12) table.set_border_width(12)
table.set_col_spacings(6) table.set_col_spacings(6)
table.set_row_spacings(6) table.set_row_spacings(6)

View File

@ -154,7 +154,8 @@ class DropdownSidebar(BaseSidebar):
dropdown = Gtk.Button() dropdown = Gtk.Button()
dropdown.set_relief(Gtk.ReliefStyle.NONE) dropdown.set_relief(Gtk.ReliefStyle.NONE)
dropdown.set_alignment(0.5, 0.5) dropdown.set_alignment(0.5, 0.5)
arrow = Gtk.Arrow(Gtk.ArrowType.DOWN, Gtk.ShadowType.NONE) arrow = Gtk.Arrow(arrow_type=Gtk.ArrowType.DOWN,
shadow_type=Gtk.ShadowType.NONE)
dropdown.add(arrow) dropdown.add(arrow)
dropdown.connect('clicked', self.__view_clicked, cat_num) dropdown.connect('clicked', self.__view_clicked, cat_num)
dropdown.set_tooltip_text(_('Click to select a view')) dropdown.set_tooltip_text(_('Click to select a view'))

View File

@ -251,7 +251,7 @@ class SelectionPage(Gtk.VBox):
self.set_spacing(12) self.set_spacing(12)
table = Gtk.Table(2 * len(batch_ops), 2) table = Gtk.Table(n_rows=2 * len(batch_ops), n_columns=2)
table.set_row_spacings(6) table.set_row_spacings(6)
table.set_col_spacings(6) table.set_col_spacings(6)
@ -485,7 +485,7 @@ class PathChange(BatchOp):
box = Gtk.VBox() box = Gtk.VBox()
box.set_spacing(12) box.set_spacing(12)
table = Gtk.Table(2, 2) table = Gtk.Table(n_rows=2, n_columns=2)
table.set_row_spacings(6) table.set_row_spacings(6)
table.set_col_spacings(6) table.set_col_spacings(6)

View File

@ -201,33 +201,33 @@ class TestcaseGenerator(tool.BatchTool):
label.set_use_markup(True) label.set_use_markup(True)
self.top.vbox.pack_start(label,0,0,5) self.top.vbox.pack_start(label,0,0,5)
self.check_lowlevel = Gtk.CheckButton( _("Generate low level database " self.check_lowlevel = Gtk.CheckButton(label=_("Generate low level database "
"errors\nCorrection needs database reload")) "errors\nCorrection needs database reload"))
self.check_lowlevel.set_active( self.options.handler.options_dict['lowlevel']) self.check_lowlevel.set_active( self.options.handler.options_dict['lowlevel'])
self.top.vbox.pack_start(self.check_lowlevel,0,0,5) self.top.vbox.pack_start(self.check_lowlevel,0,0,5)
self.check_bugs = Gtk.CheckButton( _("Generate database errors")) self.check_bugs = Gtk.CheckButton(label=_("Generate database errors"))
self.check_bugs.set_active( self.options.handler.options_dict['bugs']) self.check_bugs.set_active( self.options.handler.options_dict['bugs'])
self.top.vbox.pack_start(self.check_bugs,0,0,5) self.top.vbox.pack_start(self.check_bugs,0,0,5)
self.check_persons = Gtk.CheckButton( _("Generate dummy data")) self.check_persons = Gtk.CheckButton(label=_("Generate dummy data"))
self.check_persons.set_active( self.options.handler.options_dict['persons']) self.check_persons.set_active( self.options.handler.options_dict['persons'])
self.check_persons.connect('clicked', self.on_dummy_data_clicked) self.check_persons.connect('clicked', self.on_dummy_data_clicked)
self.top.vbox.pack_start(self.check_persons,0,0,5) self.top.vbox.pack_start(self.check_persons,0,0,5)
self.check_longnames = Gtk.CheckButton( _("Generate long names")) self.check_longnames = Gtk.CheckButton(label=_("Generate long names"))
self.check_longnames.set_active( self.options.handler.options_dict['long_names']) self.check_longnames.set_active( self.options.handler.options_dict['long_names'])
self.top.vbox.pack_start(self.check_longnames,0,0,5) self.top.vbox.pack_start(self.check_longnames,0,0,5)
self.check_specialchars = Gtk.CheckButton( _("Add special characters")) self.check_specialchars = Gtk.CheckButton(label=_("Add special characters"))
self.check_specialchars.set_active( self.options.handler.options_dict['specialchars']) self.check_specialchars.set_active( self.options.handler.options_dict['specialchars'])
self.top.vbox.pack_start(self.check_specialchars,0,0,5) self.top.vbox.pack_start(self.check_specialchars,0,0,5)
self.check_serial = Gtk.CheckButton( _("Add serial number")) self.check_serial = Gtk.CheckButton(label=_("Add serial number"))
self.check_serial.set_active( self.options.handler.options_dict['add_serial']) self.check_serial.set_active( self.options.handler.options_dict['add_serial'])
self.top.vbox.pack_start(self.check_serial,0,0,5) self.top.vbox.pack_start(self.check_serial,0,0,5)
self.check_linebreak = Gtk.CheckButton( _("Add line break")) self.check_linebreak = Gtk.CheckButton(label=_("Add line break"))
self.check_linebreak.set_active( self.options.handler.options_dict['add_linebreak']) self.check_linebreak.set_active( self.options.handler.options_dict['add_linebreak'])
self.top.vbox.pack_start(self.check_linebreak,0,0,5) self.top.vbox.pack_start(self.check_linebreak,0,0,5)

View File

@ -176,8 +176,8 @@ class CitationListView(ListView):
""" """
ListView.define_actions(self) ListView.define_actions(self)
self.all_action = Gtk.ActionGroup(self.title + "/CitationAll") self.all_action = Gtk.ActionGroup(name=self.title + "/CitationAll")
self.edit_action = Gtk.ActionGroup(self.title + "/CitationEdit") self.edit_action = Gtk.ActionGroup(name=self.title + "/CitationEdit")
self._add_action('FilterEdit', None, _('Citation Filter Editor'), self._add_action('FilterEdit', None, _('Citation Filter Editor'),
callback=self.filter_editor,) callback=self.filter_editor,)

View File

@ -284,8 +284,8 @@ class CitationTreeView(ListView):
tip=self.ADD_CITATION_MSG, tip=self.ADD_CITATION_MSG,
callback=self.share) callback=self.share)
self.all_action = Gtk.ActionGroup(self.title + "/CitationAll") self.all_action = Gtk.ActionGroup(name=self.title + "/CitationAll")
self.edit_action = Gtk.ActionGroup(self.title + "/CitationEdit") self.edit_action = Gtk.ActionGroup(name=self.title + "/CitationEdit")
self._add_action('FilterEdit', None, _('Citation Filter Editor'), self._add_action('FilterEdit', None, _('Citation Filter Editor'),
callback=self.filter_editor,) callback=self.filter_editor,)

View File

@ -202,7 +202,7 @@ class FamilyView(ListView):
self._add_action('FilterEdit', None, _('Family Filter Editor'), self._add_action('FilterEdit', None, _('Family Filter Editor'),
callback=self.filter_editor,) callback=self.filter_editor,)
self.all_action = Gtk.ActionGroup(self.title + "/FamilyAll") self.all_action = Gtk.ActionGroup(name=self.title + "/FamilyAll")
self.all_action.add_actions([ self.all_action.add_actions([
('MakeFatherActive', Gtk.STOCK_APPLY, _("Make Father Active Person"), ('MakeFatherActive', Gtk.STOCK_APPLY, _("Make Father Active Person"),
None, None, self._make_father_active), None, None, self._make_father_active),

View File

@ -101,7 +101,8 @@ class FanChartDescView(fanchartdesc.FanChartDescGrampsGUI, NavigationView):
def build_widget(self): def build_widget(self):
self.set_fan(fanchartdesc.FanChartDescWidget(self.dbstate, self.uistate, self.set_fan(fanchartdesc.FanChartDescWidget(self.dbstate, self.uistate,
self.on_popup)) self.on_popup))
self.scrolledwindow = Gtk.ScrolledWindow(None, None) self.scrolledwindow = Gtk.ScrolledWindow(hadjustment=None,
vadjustment=None)
self.scrolledwindow.set_policy(Gtk.PolicyType.AUTOMATIC, self.scrolledwindow.set_policy(Gtk.PolicyType.AUTOMATIC,
Gtk.PolicyType.AUTOMATIC) Gtk.PolicyType.AUTOMATIC)
self.fan.show_all() self.fan.show_all()
@ -267,7 +268,7 @@ 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(6, 3) table = Gtk.Table(n_rows=6, n_columns=3)
table.set_border_width(12) table.set_border_width(12)
table.set_col_spacings(6) table.set_col_spacings(6)
table.set_row_spacings(6) table.set_row_spacings(6)

View File

@ -99,7 +99,8 @@ class FanChartView(fanchart.FanChartGrampsGUI, NavigationView):
def build_widget(self): def build_widget(self):
self.set_fan(fanchart.FanChartWidget(self.dbstate, self.uistate, self.on_popup)) self.set_fan(fanchart.FanChartWidget(self.dbstate, self.uistate, self.on_popup))
self.scrolledwindow = Gtk.ScrolledWindow(None, None) self.scrolledwindow = Gtk.ScrolledWindow(hadjustment=None,
vadjustment=None)
self.scrolledwindow.set_policy(Gtk.PolicyType.AUTOMATIC, self.scrolledwindow.set_policy(Gtk.PolicyType.AUTOMATIC,
Gtk.PolicyType.AUTOMATIC) Gtk.PolicyType.AUTOMATIC)
self.fan.show_all() self.fan.show_all()
@ -265,7 +266,7 @@ 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(6, 3) table = Gtk.Table(n_rows=6, n_columns=3)
table.set_border_width(12) table.set_border_width(12)
table.set_col_spacings(6) table.set_col_spacings(6)
table.set_row_spacings(6) table.set_row_spacings(6)

View File

@ -282,7 +282,7 @@ class GeoClose(GeoGraphyView):
NavigationView.define_actions(self) NavigationView.define_actions(self)
self.define_print_actions() self.define_print_actions()
self.ref_person = Gtk.ActionGroup(self.title + '/Selection') self.ref_person = Gtk.ActionGroup(name=self.title + '/Selection')
self.ref_person.add_actions([ self.ref_person.add_actions([
('RefPerson', 'gramps-person', _('reference _Person'), None , ('RefPerson', 'gramps-person', _('reference _Person'), None ,
_("Select the person which is the reference for life ways"), _("Select the person which is the reference for life ways"),
@ -566,7 +566,7 @@ 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(2, 2) table = Gtk.Table(n_rows=2, n_columns=2)
table.set_border_width(12) table.set_border_width(12)
table.set_col_spacings(6) table.set_col_spacings(6)
table.set_row_spacings(6) table.set_row_spacings(6)

View File

@ -709,7 +709,7 @@ 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(2, 2) table = Gtk.Table(n_rows=2, n_columns=2)
table.set_border_width(12) table.set_border_width(12)
table.set_col_spacings(6) table.set_col_spacings(6)
table.set_row_spacings(6) table.set_row_spacings(6)

View File

@ -634,7 +634,7 @@ 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(2, 2) table = Gtk.Table(n_rows=2, n_columns=2)
table.set_border_width(12) table.set_border_width(12)
table.set_col_spacings(6) table.set_col_spacings(6)
table.set_row_spacings(6) table.set_row_spacings(6)

View File

@ -515,7 +515,7 @@ 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(2, 2) table = Gtk.Table(n_rows=2, n_columns=2)
table.set_border_width(12) table.set_border_width(12)
table.set_col_spacings(6) table.set_col_spacings(6)
table.set_row_spacings(6) table.set_row_spacings(6)

View File

@ -354,7 +354,8 @@ class HtmlView(NavigationView):
self.toolkit = TOOLKIT = get_toolkits() self.toolkit = TOOLKIT = get_toolkits()
self.renderer = RendererWebkit() self.renderer = RendererWebkit()
self.frames = Gtk.HBox(False, 4) self.frames = Gtk.HBox(False, 4)
frame = Gtk.ScrolledWindow(None, None) frame = Gtk.ScrolledWindow(hadjustment=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())
@ -485,7 +486,7 @@ class HtmlView(NavigationView):
accel doesn't work in webkit and gtkmozembed ! accel doesn't work in webkit and gtkmozembed !
we must do that ... we must do that ...
""" """
self.back_action = Gtk.ActionGroup(self.title + '/Back') self.back_action = Gtk.ActionGroup(name=self.title + '/Back')
self.back_action.add_actions([ self.back_action.add_actions([
('Back', Gtk.STOCK_GO_BACK, _("_Back"), ('Back', Gtk.STOCK_GO_BACK, _("_Back"),
"<ALT>Left", _("Go to the previous page in the history"), "<ALT>Left", _("Go to the previous page in the history"),
@ -493,7 +494,7 @@ class HtmlView(NavigationView):
]) ])
self._add_action_group(self.back_action) self._add_action_group(self.back_action)
# add the Forward action to handle the Forward button # add the Forward action to handle the Forward button
self.forward_action = Gtk.ActionGroup(self.title + '/Forward') self.forward_action = Gtk.ActionGroup(name=self.title + '/Forward')
self.forward_action.add_actions([ self.forward_action.add_actions([
('Forward', Gtk.STOCK_GO_FORWARD, _("_Forward"), ('Forward', Gtk.STOCK_GO_FORWARD, _("_Forward"),
"<ALT>Right", _("Go to the next page in the history"), "<ALT>Right", _("Go to the next page in the history"),

View File

@ -587,7 +587,8 @@ class PedigreeView(NavigationView):
contains the interface. This containter will be inserted into contains the interface. This containter will be inserted into
a Gtk.ScrolledWindow page. a Gtk.ScrolledWindow page.
""" """
self.scrolledwindow = Gtk.ScrolledWindow(None, None) self.scrolledwindow = Gtk.ScrolledWindow(hadjustment=None,
vadjustment=None)
self.scrolledwindow.set_policy(Gtk.PolicyType.AUTOMATIC, self.scrolledwindow.set_policy(Gtk.PolicyType.AUTOMATIC,
Gtk.PolicyType.AUTOMATIC) Gtk.PolicyType.AUTOMATIC)
self.scrolledwindow.add_events(Gdk.EventMask.SCROLL_MASK) self.scrolledwindow.add_events(Gdk.EventMask.SCROLL_MASK)
@ -1195,7 +1196,8 @@ class PedigreeView(NavigationView):
except KeyError: except KeyError:
# fill unused cells # fill unused cells
label = Gtk.Label(label="%d,%d"%(x_pos, y_pos)) label = Gtk.Label(label="%d,%d"%(x_pos, y_pos))
frame = Gtk.ScrolledWindow(None, None) frame = Gtk.ScrolledWindow(hadjustment=None,
vadjustment=None)
frame.set_shadow_type(Gtk.ShadowType.NONE) frame.set_shadow_type(Gtk.ShadowType.NONE)
frame.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.NEVER) frame.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.NEVER)
frame.add_with_viewport(label) frame.add_with_viewport(label)
@ -1995,7 +1997,7 @@ class PedigreeView(NavigationView):
""" """
Function that builds the widget in the configuration dialog Function that builds the widget in the configuration dialog
""" """
table = Gtk.Table(7, 2) table = Gtk.Table(n_rows=7, n_columns=2)
table.set_border_width(12) table.set_border_width(12)
table.set_col_spacings(6) table.set_col_spacings(6)
table.set_row_spacings(6) table.set_row_spacings(6)

View File

@ -404,13 +404,13 @@ class RelationshipView(NavigationView):
def define_actions(self): def define_actions(self):
NavigationView.define_actions(self) NavigationView.define_actions(self)
self.order_action = Gtk.ActionGroup(self.title + '/ChangeOrder') self.order_action = Gtk.ActionGroup(name=self.title + '/ChangeOrder')
self.order_action.add_actions([ self.order_action.add_actions([
('ChangeOrder', Gtk.STOCK_SORT_ASCENDING, _('_Reorder'), None , ('ChangeOrder', Gtk.STOCK_SORT_ASCENDING, _('_Reorder'), None ,
_("Change order of parents and families"), self.reorder), _("Change order of parents and families"), self.reorder),
]) ])
self.family_action = Gtk.ActionGroup(self.title + '/Family') self.family_action = Gtk.ActionGroup(name=self.title + '/Family')
self.family_action.add_actions([ self.family_action.add_actions([
('Edit', Gtk.STOCK_EDIT, _('Edit...'), "<PRIMARY>Return", ('Edit', Gtk.STOCK_EDIT, _('Edit...'), "<PRIMARY>Return",
_("Edit the active person"), self.edit_active), _("Edit the active person"), self.edit_active),
@ -563,7 +563,7 @@ class RelationshipView(NavigationView):
else: else:
cols = self.attach.max_x-1 cols = self.attach.max_x-1
self.child = Gtk.Table(self.attach.max_y, cols) self.child = Gtk.Table(n_rows=self.attach.max_y, n_columns=cols)
self.child.set_border_width(12) self.child.set_border_width(12)
self.child.set_col_spacings(12) self.child.set_col_spacings(12)
self.child.set_row_spacings(0) self.child.set_row_spacings(0)
@ -594,7 +594,7 @@ 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(2, 3) table = Gtk.Table(n_rows=2, n_columns=3)
table.set_col_spacings(12) table.set_col_spacings(12)
table.set_row_spacings(0) table.set_row_spacings(0)
@ -618,7 +618,7 @@ 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)
table.attach(eventbox, 1, 2, 1, 2) table.attach(eventbox, 1, 2, 1, 2)
subtbl = Gtk.Table(3, 3) subtbl = Gtk.Table(n_rows=3, n_columns=3)
subtbl.set_col_spacings(12) subtbl.set_col_spacings(12)
subtbl.set_row_spacings(0) subtbl.set_row_spacings(0)
eventbox.add(subtbl) eventbox.add(subtbl)
@ -792,7 +792,8 @@ class RelationshipView(NavigationView):
self.expand_collapse_press, self.expand_collapse_press,
(person, family.handle)) (person, family.handle))
else : else :
arrow = Gtk.Arrow(Gtk.ArrowType.RIGHT, Gtk.ShadowType.OUT) arrow = Gtk.Arrow(arrow_type=Gtk.ArrowType.RIGHT,
shadow_type=Gtk.ShadowType.OUT)
hbox.pack_start(arrow, False, True, 0) hbox.pack_start(arrow, False, True, 0)
hbox.pack_start(label, True, True, 0) hbox.pack_start(label, True, True, 0)
self.attach.attach(hbox, self.attach.attach(hbox,
@ -1654,7 +1655,7 @@ class RelationshipView(NavigationView):
""" """
Function that builds the widget in the configuration dialog Function that builds the widget in the configuration dialog
""" """
table = Gtk.Table(3, 2) table = Gtk.Table(n_rows=3, n_columns=2)
table.set_border_width(12) table.set_border_width(12)
table.set_col_spacings(6) table.set_col_spacings(6)
table.set_row_spacings(6) table.set_row_spacings(6)
@ -1665,7 +1666,7 @@ class RelationshipView(NavigationView):
configdialog.add_checkbox(table, configdialog.add_checkbox(table,
_('Display edit buttons'), _('Display edit buttons'),
1, 'preferences.releditbtn') 1, 'preferences.releditbtn')
checkbox = Gtk.CheckButton(_('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)
@ -1677,7 +1678,7 @@ class RelationshipView(NavigationView):
""" """
Function that builds the widget in the configuration dialog Function that builds the widget in the configuration dialog
""" """
table = Gtk.Table(2, 2) table = Gtk.Table(n_rows=2, n_columns=2)
table.set_border_width(12) table.set_border_width(12)
table.set_col_spacings(6) table.set_col_spacings(6)
table.set_row_spacings(6) table.set_row_spacings(6)