From 2fbf9ff0f9e2023edec51a8708ae9003ac7228f7 Mon Sep 17 00:00:00 2001 From: Josip Date: Wed, 2 Apr 2014 22:04:33 +0200 Subject: [PATCH] More fix of PyGObject-3.11 DeprecationWarning --- gramps/gui/configure.py | 26 +++++++++---------- gramps/gui/displaystate.py | 9 ++++--- gramps/gui/editors/editperson.py | 4 +-- gramps/gui/editors/editprimary.py | 2 +- gramps/gui/editors/filtereditor.py | 6 ++--- .../filters/sidebar/_citationsidebarfilter.py | 2 +- .../filters/sidebar/_eventsidebarfilter.py | 2 +- .../filters/sidebar/_familysidebarfilter.py | 2 +- .../filters/sidebar/_mediasidebarfilter.py | 2 +- .../gui/filters/sidebar/_notesidebarfilter.py | 2 +- .../filters/sidebar/_personsidebarfilter.py | 2 +- .../filters/sidebar/_placesidebarfilter.py | 2 +- .../gui/filters/sidebar/_reposidebarfilter.py | 2 +- gramps/gui/filters/sidebar/_sidebarfilter.py | 2 +- .../filters/sidebar/_sourcesidebarfilter.py | 2 +- gramps/gui/grampsgui.py | 7 ++--- gramps/gui/managedwindow.py | 4 +-- gramps/gui/navigator.py | 5 ++-- gramps/gui/plug/_guioptions.py | 2 +- gramps/gui/plug/_windows.py | 2 +- gramps/gui/plug/export/_exportassistant.py | 2 +- gramps/gui/plug/quick/_quicktable.py | 4 +-- gramps/gui/plug/report/_docreportdialog.py | 4 +-- .../gui/plug/report/_graphvizreportdialog.py | 2 +- gramps/gui/plug/report/_reportdialog.py | 6 ++--- gramps/gui/viewmanager.py | 10 +++---- gramps/gui/views/bookmarks.py | 4 +-- gramps/gui/views/listview.py | 2 +- gramps/gui/views/navigationview.py | 10 +++---- gramps/gui/views/pageview.py | 2 +- gramps/gui/views/tags.py | 4 +-- gramps/gui/widgets/expandcollapsearrow.py | 6 +++-- gramps/gui/widgets/grampletbar.py | 3 ++- gramps/gui/widgets/grampletpane.py | 6 ++--- gramps/gui/widgets/styledtexteditor.py | 9 ++++--- gramps/gui/widgets/validatedmaskedentry.py | 6 ++--- gramps/plugins/export/exportcsv.py | 8 +++--- gramps/plugins/gramplet/persondetails.py | 2 +- gramps/plugins/gramplet/placedetails.py | 2 +- gramps/plugins/gramplet/repositorydetails.py | 2 +- gramps/plugins/gramplet/welcomegramplet.py | 2 +- gramps/plugins/lib/libpersonview.py | 4 +-- gramps/plugins/lib/maps/geography.py | 4 +-- gramps/plugins/sidebar/dropdownsidebar.py | 3 ++- gramps/plugins/tool/mediamanager.py | 4 +-- gramps/plugins/tool/testcasegenerator.py | 14 +++++----- gramps/plugins/view/citationlistview.py | 4 +-- gramps/plugins/view/citationtreeview.py | 4 +-- gramps/plugins/view/familyview.py | 2 +- gramps/plugins/view/fanchartdescview.py | 5 ++-- gramps/plugins/view/fanchartview.py | 5 ++-- gramps/plugins/view/geoclose.py | 4 +-- gramps/plugins/view/geofamclose.py | 2 +- gramps/plugins/view/geomoves.py | 2 +- gramps/plugins/view/geoperson.py | 2 +- gramps/plugins/view/htmlrenderer.py | 7 ++--- gramps/plugins/view/pedigreeview.py | 8 +++--- gramps/plugins/view/relview.py | 19 +++++++------- 58 files changed, 145 insertions(+), 131 deletions(-) diff --git a/gramps/gui/configure.py b/gramps/gui/configure.py index f564dc76b..9933919b4 100644 --- a/gramps/gui/configure.py +++ b/gramps/gui/configure.py @@ -294,7 +294,7 @@ class ConfigureDialog(ManagedWindow): config=None, extra_callback=None): if not config: config = self.__config - checkbox = Gtk.CheckButton(label) + checkbox = Gtk.CheckButton(label=label) checkbox.set_active(config.get(constant)) checkbox.connect('toggled', self.update_checkbox, constant, config) if extra_callback: @@ -503,7 +503,7 @@ class GrampsPreferences(ConfigureDialog): on_close=update_constants) 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_col_spacings(6) table.set_row_spacings(6) @@ -524,7 +524,7 @@ class GrampsPreferences(ConfigureDialog): """ 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_col_spacings(6) table.set_row_spacings(6) @@ -552,7 +552,7 @@ class GrampsPreferences(ConfigureDialog): """ 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'), 0, line_wrap=False) self.add_color(table, _('Gender Male Alive'), 1, @@ -590,7 +590,7 @@ class GrampsPreferences(ConfigureDialog): return _('Colors'), table 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_col_spacings(6) table.set_row_spacings(6) @@ -804,7 +804,7 @@ class GrampsPreferences(ConfigureDialog): 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_col_spacings(6) table.set_row_spacings(6) @@ -929,7 +929,7 @@ class GrampsPreferences(ConfigureDialog): def add_formats_panel(self, configdialog): row = 0 - table = Gtk.Table(4, 4) + table = Gtk.Table(n_rows=4, n_columns=4) table.set_border_width(12) table.set_col_spacings(6) table.set_row_spacings(6) @@ -1103,7 +1103,7 @@ class GrampsPreferences(ConfigureDialog): def add_text_panel(self, configdialog): row = 0 - table = Gtk.Table(6, 8) + table = Gtk.Table(n_rows=6, n_columns=8) table.set_border_width(12) table.set_col_spacings(6) table.set_row_spacings(6) @@ -1166,7 +1166,7 @@ class GrampsPreferences(ConfigureDialog): config.set('preferences.calendar-format-report', obj.get_active()) 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_col_spacings(6) table.set_row_spacings(6) @@ -1213,7 +1213,7 @@ class GrampsPreferences(ConfigureDialog): return _('Dates'), table 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_col_spacings(6) table.set_row_spacings(6) @@ -1224,7 +1224,7 @@ class GrampsPreferences(ConfigureDialog): current_line, 'preferences.default-source') 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.connect("toggled", self.toggle_tag_on_import) table.attach(checkbutton, 1, 2, current_line, current_line+1, yoptions=0) @@ -1306,7 +1306,7 @@ class GrampsPreferences(ConfigureDialog): current_line += 1 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.connect("toggled", self.toggle_hide_previous_addons) @@ -1346,7 +1346,7 @@ class GrampsPreferences(ConfigureDialog): self.uistate.viewmanager.do_reg_plugins(self.dbstate, self.uistate) 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_col_spacings(6) table.set_row_spacings(6) diff --git a/gramps/gui/displaystate.py b/gramps/gui/displaystate.py index 2e9d631a3..cc649ff29 100644 --- a/gramps/gui/displaystate.py +++ b/gramps/gui/displaystate.py @@ -53,6 +53,7 @@ _LOG = logging.getLogger(".DisplayState") from gi.repository import Gdk from gi.repository import Gtk from gi.repository import GObject +from gi.repository import GLib #------------------------------------------------------------------------- # @@ -259,7 +260,7 @@ import os class RecentDocsMenu(object): def __init__(self, uistate, state, fileopen): - self.action_group = Gtk.ActionGroup('RecentFiles') + self.action_group = Gtk.ActionGroup(name='RecentFiles') self.active = DISABLED self.uistate = uistate self.uimanager = uistate.uimanager @@ -280,7 +281,7 @@ class RecentDocsMenu(object): if self.active != DISABLED: self.uimanager.remove_ui(self.active) self.uimanager.remove_action_group(self.action_group) - self.action_group = Gtk.ActionGroup('RecentFiles') + self.action_group = Gtk.ActionGroup(name='RecentFiles') self.active = DISABLED actions = [] @@ -335,7 +336,7 @@ class WarnHandler(RotateHandler): def emit(self, record): if self.timer is None: #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) self.button.show() @@ -557,7 +558,7 @@ class DisplayState(Callback): def push_message(self, dbstate, 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): #nav_type = self.viewmanager.active_page.navigation_type() diff --git a/gramps/gui/editors/editperson.py b/gramps/gui/editors/editperson.py index 032adb412..26dfc4def 100644 --- a/gramps/gui/editors/editperson.py +++ b/gramps/gui/editors/editperson.py @@ -662,8 +662,8 @@ class EditPerson(EditPrimary): Override from base class, the menuitems and actiongroups for the top of context menu. """ - self.all_action = Gtk.ActionGroup("/PersonAll") - self.home_action = Gtk.ActionGroup("/PersonHome") + self.all_action = Gtk.ActionGroup(name="/PersonAll") + self.home_action = Gtk.ActionGroup(name="/PersonHome") self.track_ref_for_deletion("all_action") self.track_ref_for_deletion("home_action") diff --git a/gramps/gui/editors/editprimary.py b/gramps/gui/editors/editprimary.py index 463a873ef..93003cb4e 100644 --- a/gramps/gui/editors/editprimary.py +++ b/gramps/gui/editors/editprimary.py @@ -314,7 +314,7 @@ class EditPrimary(ManagedWindow, DbGUIElement): (ui_qr, reportactions) = create_quickreport_menu(self.QR_CATEGORY, self.dbstate, self.uistate, 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.set_visible(True) self.popupmanager.insert_action_group(self.report_action, -1) diff --git a/gramps/gui/editors/filtereditor.py b/gramps/gui/editors/filtereditor.py index 1270b9227..b6bba4ae4 100644 --- a/gramps/gui/editors/filtereditor.py +++ b/gramps/gui/editors/filtereditor.py @@ -498,9 +498,9 @@ class EditRule(ManagedWindow): the_map[class_obj] = c # Only add a table with parameters if there are any parameters if arglist: - table = Gtk.Table(3, len(arglist)) + table = Gtk.Table(n_rows=3, n_columns=len(arglist)) else: - table = Gtk.Table(1, 1) + table = Gtk.Table(n_rows=1, n_columns=1) table.set_border_width(6) table.set_col_spacings(6) table.set_row_spacings(6) @@ -597,7 +597,7 @@ class EditRule(ManagedWindow): use_regex = None 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 ' 'expressions.\n' 'A decimal point will match any character. ' diff --git a/gramps/gui/filters/sidebar/_citationsidebarfilter.py b/gramps/gui/filters/sidebar/_citationsidebarfilter.py index f05ba950a..d5b9a9210 100644 --- a/gramps/gui/filters/sidebar/_citationsidebarfilter.py +++ b/gramps/gui/filters/sidebar/_citationsidebarfilter.py @@ -78,7 +78,7 @@ class CitationSidebarFilter(SidebarFilter): 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.generic = Gtk.ComboBox() diff --git a/gramps/gui/filters/sidebar/_eventsidebarfilter.py b/gramps/gui/filters/sidebar/_eventsidebarfilter.py index 7ec480d35..75c03c29d 100644 --- a/gramps/gui/filters/sidebar/_eventsidebarfilter.py +++ b/gramps/gui/filters/sidebar/_eventsidebarfilter.py @@ -75,7 +75,7 @@ class EventSidebarFilter(SidebarFilter): self.filter_place = 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.generic = Gtk.ComboBox() diff --git a/gramps/gui/filters/sidebar/_familysidebarfilter.py b/gramps/gui/filters/sidebar/_familysidebarfilter.py index 15951b3b9..0f471c678 100644 --- a/gramps/gui/filters/sidebar/_familysidebarfilter.py +++ b/gramps/gui/filters/sidebar/_familysidebarfilter.py @@ -87,7 +87,7 @@ class FamilySidebarFilter(SidebarFilter): 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.generic = Gtk.ComboBox() diff --git a/gramps/gui/filters/sidebar/_mediasidebarfilter.py b/gramps/gui/filters/sidebar/_mediasidebarfilter.py index be6a6a7e9..34adbcbce 100644 --- a/gramps/gui/filters/sidebar/_mediasidebarfilter.py +++ b/gramps/gui/filters/sidebar/_mediasidebarfilter.py @@ -66,7 +66,7 @@ class MediaSidebarFilter(SidebarFilter): self.filter_date = widgets.DateEntry(uistate, []) 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.generic = Gtk.ComboBox() diff --git a/gramps/gui/filters/sidebar/_notesidebarfilter.py b/gramps/gui/filters/sidebar/_notesidebarfilter.py index 6b9420df4..7749bcd11 100644 --- a/gramps/gui/filters/sidebar/_notesidebarfilter.py +++ b/gramps/gui/filters/sidebar/_notesidebarfilter.py @@ -71,7 +71,7 @@ class NoteSidebarFilter(SidebarFilter): self.note.set_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.generic = Gtk.ComboBox() diff --git a/gramps/gui/filters/sidebar/_personsidebarfilter.py b/gramps/gui/filters/sidebar/_personsidebarfilter.py index 2613058c2..1b457d1f2 100644 --- a/gramps/gui/filters/sidebar/_personsidebarfilter.py +++ b/gramps/gui/filters/sidebar/_personsidebarfilter.py @@ -92,7 +92,7 @@ class PersonSidebarFilter(SidebarFilter): [ _('any'), _('male'), _('female'), _('unknown') ])) 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.generic = Gtk.ComboBox() diff --git a/gramps/gui/filters/sidebar/_placesidebarfilter.py b/gramps/gui/filters/sidebar/_placesidebarfilter.py index 5fe675972..acd373c60 100644 --- a/gramps/gui/filters/sidebar/_placesidebarfilter.py +++ b/gramps/gui/filters/sidebar/_placesidebarfilter.py @@ -73,7 +73,7 @@ class PlaceSidebarFilter(SidebarFilter): self.filter_parish = 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.generic = Gtk.ComboBox() diff --git a/gramps/gui/filters/sidebar/_reposidebarfilter.py b/gramps/gui/filters/sidebar/_reposidebarfilter.py index 6c53d20ac..ee917d0c9 100644 --- a/gramps/gui/filters/sidebar/_reposidebarfilter.py +++ b/gramps/gui/filters/sidebar/_reposidebarfilter.py @@ -74,7 +74,7 @@ class RepoSidebarFilter(SidebarFilter): 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.generic = Gtk.ComboBox() diff --git a/gramps/gui/filters/sidebar/_sidebarfilter.py b/gramps/gui/filters/sidebar/_sidebarfilter.py index 2b310cbe0..41654b4fb 100644 --- a/gramps/gui/filters/sidebar/_sidebarfilter.py +++ b/gramps/gui/filters/sidebar/_sidebarfilter.py @@ -50,7 +50,7 @@ class SidebarFilter(DbGUIElement): self.position = 1 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.table.set_border_width(6) self.table.set_row_spacings(6) diff --git a/gramps/gui/filters/sidebar/_sourcesidebarfilter.py b/gramps/gui/filters/sidebar/_sourcesidebarfilter.py index 7af1a19c1..a693b148a 100644 --- a/gramps/gui/filters/sidebar/_sourcesidebarfilter.py +++ b/gramps/gui/filters/sidebar/_sourcesidebarfilter.py @@ -65,7 +65,7 @@ class SourceSidebarFilter(SidebarFilter): self.filter_pub = 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.generic = Gtk.ComboBox() diff --git a/gramps/gui/grampsgui.py b/gramps/gui/grampsgui.py index bed648b44..b12b6b251 100644 --- a/gramps/gui/grampsgui.py +++ b/gramps/gui/grampsgui.py @@ -65,7 +65,7 @@ except: if not PYGOBJ_ERR: try: - from gi.repository import GObject + from gi.repository import GObject, GLib if not GObject.pygobject_version >= MIN_PYGOBJECT_VERSION : PYGOBJ_ERR = True except: @@ -410,9 +410,10 @@ def __startgramps(errors, argparser): def startgtkloop(errors, argparser): """ 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")): Gtk.AccelMap.load(os.path.join(DATA_DIR, "gramps.accel")) Gtk.main() diff --git a/gramps/gui/managedwindow.py b/gramps/gui/managedwindow.py index e26e4e68a..bbe4ad649 100644 --- a/gramps/gui/managedwindow.py +++ b/gramps/gui/managedwindow.py @@ -114,7 +114,7 @@ class GrampsWindowManager(object): self.uimanager = uimanager self.window_tree = [] self.id2item = {} - self.action_group = Gtk.ActionGroup('WindowManger') + self.action_group = Gtk.ActionGroup(name='WindowManger') self.active = DISABLED self.ui = _win_top + _win_btm @@ -292,7 +292,7 @@ class GrampsWindowManager(object): self.uimanager.remove_ui(self.active) self.uimanager.remove_action_group(self.action_group) - self.action_group = Gtk.ActionGroup('WindowManger') + self.action_group = Gtk.ActionGroup(name='WindowManger') action_data = [] data = StringIO() diff --git a/gramps/gui/navigator.py b/gramps/gui/navigator.py index 15caf2a84..2512f66b5 100644 --- a/gramps/gui/navigator.py +++ b/gramps/gui/navigator.py @@ -103,7 +103,8 @@ class Navigator(object): self.select_button.set_relief(Gtk.ReliefStyle.NONE) select_hbox = Gtk.HBox() 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_end(arrow, False, True, 0) self.select_button.add(select_hbox) @@ -227,7 +228,7 @@ class Navigator(object): list(map(uimanager.remove_ui, self.merge_ids)) 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.view_toggle_actions[cat_num], value=view_num, on_change=self.cb_view_clicked, user_data=cat_num) diff --git a/gramps/gui/plug/_guioptions.py b/gramps/gui/plug/_guioptions.py index 01266d2a7..09cfb8f6f 100644 --- a/gramps/gui/plug/_guioptions.py +++ b/gramps/gui/plug/_guioptions.py @@ -1813,7 +1813,7 @@ class GuiBooleanListOption(Gtk.HBox): this_column_counter = 0 ncolumn = 0 for description in option.get_descriptions(): - button = Gtk.CheckButton(description) + button = Gtk.CheckButton(label=description) self.__cbutton.append(button) if counter < len(default): if default[counter] == 'True': diff --git a/gramps/gui/plug/_windows.py b/gramps/gui/plug/_windows.py index a7cf36190..656753eff 100644 --- a/gramps/gui/plug/_windows.py +++ b/gramps/gui/plug/_windows.py @@ -1006,7 +1006,7 @@ class ToolManagedWindowBase(ManagedWindow): the add_user_options task.""" for key in self.frame_names: 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_row_spacings(6) table.set_border_width(6) diff --git a/gramps/gui/plug/export/_exportassistant.py b/gramps/gui/plug/export/_exportassistant.py index 0e9b43029..82b8df276 100644 --- a/gramps/gui/plug/export/_exportassistant.py +++ b/gramps/gui/plug/export/_exportassistant.py @@ -192,7 +192,7 @@ class ExportAssistant(Gtk.Assistant, ManagedWindow) : box.set_border_width(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_col_spacings(6) diff --git a/gramps/gui/plug/quick/_quicktable.py b/gramps/gui/plug/quick/_quicktable.py index be90a237e..24dba4740 100644 --- a/gramps/gui/plug/quick/_quicktable.py +++ b/gramps/gui/plug/quick/_quicktable.py @@ -301,12 +301,12 @@ class QuickTable(SimpleTable): if isinstance(handle, list): handle = handle[0] 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, # then you'll crash Python: #self.simpledoc.doc.uistate.set_active(handle, '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 False # didn't handle event diff --git a/gramps/gui/plug/report/_docreportdialog.py b/gramps/gui/plug/report/_docreportdialog.py index 4fc5e935c..de80271d7 100644 --- a/gramps/gui/plug/report/_docreportdialog.py +++ b/gramps/gui/plug/report/_docreportdialog.py @@ -176,7 +176,7 @@ class DocReportDialog(ReportDialog): yoptions=Gtk.AttachOptions.SHRINK) 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( config.get('interface.open-with-default-viewer')) 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 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_row_spacings(6) self.html_table.set_border_width(0) diff --git a/gramps/gui/plug/report/_graphvizreportdialog.py b/gramps/gui/plug/report/_graphvizreportdialog.py index 569f44db4..8dd7ebc12 100644 --- a/gramps/gui/plug/report/_graphvizreportdialog.py +++ b/gramps/gui/plug/report/_graphvizreportdialog.py @@ -155,7 +155,7 @@ class GraphvizReportDialog(ReportDialog): yoptions=Gtk.AttachOptions.SHRINK) 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( config.get('interface.open-with-default-viewer')) self.tbl.attach(self.open_with_app, 2, 4, self.row, self.row+1, diff --git a/gramps/gui/plug/report/_reportdialog.py b/gramps/gui/plug/report/_reportdialog.py index 24a521c90..47520ceda 100644 --- a/gramps/gui/plug/report/_reportdialog.py +++ b/gramps/gui/plug/report/_reportdialog.py @@ -176,7 +176,7 @@ class ReportDialog(ManagedWindow): self.setup_title() 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_row_spacings(6) self.tbl.set_border_width(6) @@ -359,7 +359,7 @@ class ReportDialog(ManagedWindow): if max_rows == 0: 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_row_spacings(6) @@ -389,7 +389,7 @@ class ReportDialog(ManagedWindow): from gramps.gui.plug._guioptions import GuiTextOption for key in self.frame_names: 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_row_spacings(6) table.set_border_width(6) diff --git a/gramps/gui/viewmanager.py b/gramps/gui/viewmanager.py index 1cc402df6..19e36c9d8 100644 --- a/gramps/gui/viewmanager.py +++ b/gramps/gui/viewmanager.py @@ -803,7 +803,7 @@ class ViewManager(CLIManager): """ Initialize an action group for the UIManager """ - new_group = Gtk.ActionGroup(name) + new_group = Gtk.ActionGroup(name=name) new_group.add_actions(actions) if toggles: new_group.add_toggle_actions(toggles) @@ -1162,7 +1162,7 @@ class ViewManager(CLIManager): Change the UNDO label """ self.uimanager.remove_action_group(self.undoactions) - self.undoactions = Gtk.ActionGroup('Undo') + self.undoactions = Gtk.ActionGroup(name='Undo') if label: self.undoactions.add_actions([ ('Undo', Gtk.STOCK_UNDO, label, 'z', None, self.undo)]) @@ -1178,7 +1178,7 @@ class ViewManager(CLIManager): Change the REDO label """ self.uimanager.remove_action_group(self.redoactions) - self.redoactions = Gtk.ActionGroup('Redo') + self.redoactions = Gtk.ActionGroup(name='Redo') if label: self.redoactions.add_actions([ ('Redo', Gtk.STOCK_REDO, label, 'z', @@ -1461,7 +1461,7 @@ class ViewManager(CLIManager): if self.toolactions: self.uistate.uimanager.remove_action_group(self.toolactions) 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( 'ToolsMenu', tool_menu_list, tool.tool_categories, make_plugin_callback) @@ -1477,7 +1477,7 @@ class ViewManager(CLIManager): if self.reportactions: self.uistate.uimanager.remove_action_group(self.reportactions) 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( 'ReportsMenu', report_menu_list, standalone_categories, make_plugin_callback) diff --git a/gramps/gui/views/bookmarks.py b/gramps/gui/views/bookmarks.py index 837381f64..d141b41c4 100644 --- a/gramps/gui/views/bookmarks.py +++ b/gramps/gui/views/bookmarks.py @@ -96,7 +96,7 @@ class Bookmarks : self.bookmarks = None self.update_bookmarks() self.active = DISABLED - self.action_group = Gtk.ActionGroup('Bookmarks') + self.action_group = Gtk.ActionGroup(name='Bookmarks') self.connect_signals() self.dbstate.connect('database-changed', self.db_changed) @@ -138,7 +138,7 @@ class Bookmarks : if self.active != DISABLED: self.uistate.uimanager.remove_ui(self.active) 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.active = DISABLED diff --git a/gramps/gui/views/listview.py b/gramps/gui/views/listview.py index fc2aa3827..ab33a70af 100644 --- a/gramps/gui/views/listview.py +++ b/gramps/gui/views/listview.py @@ -209,7 +209,7 @@ class ListView(NavigationView): 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([ ('Add', Gtk.STOCK_ADD, _("_Add..."), "Insert", self.ADD_MSG, self.add), diff --git a/gramps/gui/views/navigationview.py b/gramps/gui/views/navigationview.py index 9259d2adf..22810aa7a 100644 --- a/gramps/gui/views/navigationview.py +++ b/gramps/gui/views/navigationview.py @@ -267,7 +267,7 @@ class NavigationView(PageView): """ 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([ ('AddBook', 'gramps-bookmark-new', _('_Add Bookmark'), 'd', None, self.add_bookmark), @@ -287,7 +287,7 @@ class NavigationView(PageView): Define the navigation menu actions. """ # 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([ ('Forward', Gtk.STOCK_GO_FORWARD, _("_Forward"), "%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 - self.back_action = Gtk.ActionGroup(self.title + '/Backward') + self.back_action = Gtk.ActionGroup(name=self.title + '/Backward') self.back_action.add_actions([ ('Back', Gtk.STOCK_GO_BACK, _("_Back"), "%sLeft" % mod_key(), _("Go to the previous object in the history"), @@ -306,7 +306,7 @@ class NavigationView(PageView): accel="%sHome" % mod_key(), 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([ ('SetActive', Gtk.STOCK_HOME, _("Set _Home Person"), None, None, self.set_default_person), @@ -451,7 +451,7 @@ class NavigationView(PageView): "%s%d" % (mod_key(), index), None, 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_enable() diff --git a/gramps/gui/views/pageview.py b/gramps/gui/views/pageview.py index a239032e6..01d8a895d 100644 --- a/gramps/gui/views/pageview.py +++ b/gramps/gui/views/pageview.py @@ -420,7 +420,7 @@ class PageView(DbGUIElement): and self.action_toggle_list. The user should define these in self.define_actions """ - self.action_group = Gtk.ActionGroup(self.title) + self.action_group = Gtk.ActionGroup(name=self.title) if len(self.action_list) > 0: self.action_group.add_actions(self.action_list) if len(self.action_toggle_list) > 0: diff --git a/gramps/gui/views/tags.py b/gramps/gui/views/tags.py index b91e290e0..66937009e 100644 --- a/gramps/gui/views/tags.py +++ b/gramps/gui/views/tags.py @@ -206,7 +206,7 @@ class Tags(DbGUIElement): if self.db is None: self.tag_ui = '' - self.tag_action = Gtk.ActionGroup('Tag') + self.tag_action = Gtk.ActionGroup(name='Tag') return tag_menu = '' @@ -227,7 +227,7 @@ class Tags(DbGUIElement): actions.append(('TagButton', 'gramps-tag', _('Tag'), None, _('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) def cb_tag_button(self, action): diff --git a/gramps/gui/widgets/expandcollapsearrow.py b/gramps/gui/widgets/expandcollapsearrow.py index 4b24e6162..e578488c8 100644 --- a/gramps/gui/widgets/expandcollapsearrow.py +++ b/gramps/gui/widgets/expandcollapsearrow.py @@ -83,10 +83,12 @@ class ExpandCollapseArrow(Gtk.EventBox): """ GObject.GObject.__init__(self) 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")) 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.add(self.arrow) self.connect('button-press-event', onbuttonpress, pair) diff --git a/gramps/gui/widgets/grampletbar.py b/gramps/gui/widgets/grampletbar.py index 61d30e06d..b3392f6f4 100644 --- a/gramps/gui/widgets/grampletbar.py +++ b/gramps/gui/widgets/grampletbar.py @@ -114,7 +114,8 @@ class GrampletBar(Gtk.Notebook): book_button = Gtk.Button() 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() box.add(arrow) box.show() diff --git a/gramps/gui/widgets/grampletpane.py b/gramps/gui/widgets/grampletpane.py index cb5c6800e..34ed815d3 100644 --- a/gramps/gui/widgets/grampletpane.py +++ b/gramps/gui/widgets/grampletpane.py @@ -557,7 +557,7 @@ class GuiGramplet(object): # END WORKAROUND if len(self.pui.option_order) == 0: return frame = Gtk.Frame() - topbox = Gtk.VBox(False) + topbox = Gtk.VBox(homogeneous=False) hbox = Gtk.HBox(False, 5) labels = Gtk.VBox(True) options = Gtk.VBox(True) @@ -1510,7 +1510,7 @@ class GrampletPane(Gtk.ScrolledWindow): """ 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_col_spacings(6) table.set_row_spacings(6) @@ -1543,7 +1543,7 @@ class GrampletPane(Gtk.ScrolledWindow): bool, gramplet.get_expand, gramplet.set_expand) def gramplet_panel(configdialog): 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_col_spacings(6) table.set_row_spacings(6) diff --git a/gramps/gui/widgets/styledtexteditor.py b/gramps/gui/widgets/styledtexteditor.py index 19c1a3baf..bcb6da777 100644 --- a/gramps/gui/widgets/styledtexteditor.py +++ b/gramps/gui/widgets/styledtexteditor.py @@ -526,12 +526,13 @@ class StyledTextEditor(Gtk.TextView): } # 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.undo_action = Gtk.Action("Undo", _('Undo'), _('Undo'), - Gtk.STOCK_UNDO) + self.undo_action = Gtk.Action(name="Undo", label=_('Undo'), + tooltip=_('Undo'), + stock_id=Gtk.STOCK_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) self.redo_action.connect('activate', self.redo) self.action_group.add_action(self.undo_action) diff --git a/gramps/gui/widgets/validatedmaskedentry.py b/gramps/gui/widgets/validatedmaskedentry.py index 5ab8602c9..98cb3b8a5 100644 --- a/gramps/gui/widgets/validatedmaskedentry.py +++ b/gramps/gui/widgets/validatedmaskedentry.py @@ -146,7 +146,7 @@ class FadeOut(GObject.GObject): else: func = generator.__next__ 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 def start(self, color): @@ -168,7 +168,7 @@ class FadeOut(GObject.GObject): self._start_color = color ##_LOG.debug('start: Scheduling') - self._countdown_timeout_id = GObject.timeout_add( + self._countdown_timeout_id = GLib.timeout_add( FadeOut.COMPLAIN_DELAY, self._start_merging) return True @@ -1178,7 +1178,7 @@ class ValidatableMaskedEntry(MaskedEntry): def do_changed(self): block_changed = getattr(self, '_block_changed', True) if block_changed: - self.emit_stop_by_name('changed') + self.stop_emission_by_name('changed') return self.emit('content-changed') self.validate() diff --git a/gramps/plugins/export/exportcsv.py b/gramps/plugins/export/exportcsv.py index b56e21950..bce895f7a 100644 --- a/gramps/plugins/export/exportcsv.py +++ b/gramps/plugins/export/exportcsv.py @@ -206,10 +206,10 @@ class CSVWriterOptionBox(WriterOptionBox): from gi.repository import Gtk option_box = WriterOptionBox.get_option_box(self) - self.include_individuals_check = Gtk.CheckButton(_("Include people")) - self.include_marriages_check = Gtk.CheckButton(_("Include marriages")) - self.include_children_check = Gtk.CheckButton(_("Include children")) - self.translate_headers_check = Gtk.CheckButton(_("Translate headers")) + self.include_individuals_check = Gtk.CheckButton(label=_("Include people")) + self.include_marriages_check = Gtk.CheckButton(label=_("Include marriages")) + self.include_children_check = Gtk.CheckButton(label=_("Include children")) + self.translate_headers_check = Gtk.CheckButton(label=_("Translate headers")) self.include_individuals_check.set_active(1) self.include_marriages_check.set_active(1) diff --git a/gramps/plugins/gramplet/persondetails.py b/gramps/plugins/gramplet/persondetails.py index 774cb481e..2be88e93f 100644 --- a/gramps/plugins/gramplet/persondetails.py +++ b/gramps/plugins/gramplet/persondetails.py @@ -53,7 +53,7 @@ class PersonDetails(Gramplet): self.name.set_alignment(0, 0) self.name.modify_font(Pango.FontDescription('sans bold 12')) 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.show_all() self.top.pack_start(self.photo, fill=True, expand=False, padding=5) diff --git a/gramps/plugins/gramplet/placedetails.py b/gramps/plugins/gramplet/placedetails.py index 6baa85ee8..48f03a1a1 100644 --- a/gramps/plugins/gramplet/placedetails.py +++ b/gramps/plugins/gramplet/placedetails.py @@ -49,7 +49,7 @@ class PlaceDetails(Gramplet): self.title.set_alignment(0, 0) self.title.modify_font(Pango.FontDescription('sans bold 12')) 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) self.top.pack_start(self.photo, False, True, 5) self.top.pack_start(vbox, False, True, 10) diff --git a/gramps/plugins/gramplet/repositorydetails.py b/gramps/plugins/gramplet/repositorydetails.py index f33fe3d86..b90f6666b 100644 --- a/gramps/plugins/gramplet/repositorydetails.py +++ b/gramps/plugins/gramplet/repositorydetails.py @@ -45,7 +45,7 @@ class RepositoryDetails(Gramplet): self.name.set_alignment(0, 0) self.name.modify_font(Pango.FontDescription('sans bold 12')) 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) self.top.pack_start(vbox, fill=True, expand=False, padding=10) self.top.show_all() diff --git a/gramps/plugins/gramplet/welcomegramplet.py b/gramps/plugins/gramplet/welcomegramplet.py index 7a74a80e4..f44bb5ccb 100644 --- a/gramps/plugins/gramplet/welcomegramplet.py +++ b/gramps/plugins/gramplet/welcomegramplet.py @@ -83,7 +83,7 @@ class WelcomeGramplet(Gramplet): """ Build the GUI interface. """ - top = Gtk.VBox(False) + top = Gtk.VBox(homogeneous=False) scrolledwindow = Gtk.ScrolledWindow() scrolledwindow.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) diff --git a/gramps/plugins/lib/libpersonview.py b/gramps/plugins/lib/libpersonview.py index d0f81b1e8..554bc43fc 100644 --- a/gramps/plugins/lib/libpersonview.py +++ b/gramps/plugins/lib/libpersonview.py @@ -338,8 +338,8 @@ class BasePersonView(ListView): ListView.define_actions(self) - self.all_action = Gtk.ActionGroup(self.title + "/PersonAll") - self.edit_action = Gtk.ActionGroup(self.title + "/PersonEdit") + self.all_action = Gtk.ActionGroup(name=self.title + "/PersonAll") + self.edit_action = Gtk.ActionGroup(name=self.title + "/PersonEdit") self.all_action.add_actions([ ('FilterEdit', None, _('Person Filter Editor'), None, None, diff --git a/gramps/plugins/lib/maps/geography.py b/gramps/plugins/lib/maps/geography.py index 242528335..599311007 100644 --- a/gramps/plugins/lib/maps/geography.py +++ b/gramps/plugins/lib/maps/geography.py @@ -1040,7 +1040,7 @@ class GeoGraphyView(OsmGps, NavigationView): Add specific entry to the preference menu. 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_col_spacings(6) table.set_row_spacings(6) @@ -1057,7 +1057,7 @@ class GeoGraphyView(OsmGps, NavigationView): config.get('geography.zoom_when_center')) self._config.set('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_col_spacings(6) table.set_row_spacings(6) diff --git a/gramps/plugins/sidebar/dropdownsidebar.py b/gramps/plugins/sidebar/dropdownsidebar.py index ab0437873..dc4f67a0b 100644 --- a/gramps/plugins/sidebar/dropdownsidebar.py +++ b/gramps/plugins/sidebar/dropdownsidebar.py @@ -154,7 +154,8 @@ class DropdownSidebar(BaseSidebar): dropdown = Gtk.Button() dropdown.set_relief(Gtk.ReliefStyle.NONE) 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.connect('clicked', self.__view_clicked, cat_num) dropdown.set_tooltip_text(_('Click to select a view')) diff --git a/gramps/plugins/tool/mediamanager.py b/gramps/plugins/tool/mediamanager.py index 8d8ac322e..237715b06 100644 --- a/gramps/plugins/tool/mediamanager.py +++ b/gramps/plugins/tool/mediamanager.py @@ -251,7 +251,7 @@ class SelectionPage(Gtk.VBox): 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_col_spacings(6) @@ -485,7 +485,7 @@ class PathChange(BatchOp): box = Gtk.VBox() 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_col_spacings(6) diff --git a/gramps/plugins/tool/testcasegenerator.py b/gramps/plugins/tool/testcasegenerator.py index b3e4f3411..aab934184 100644 --- a/gramps/plugins/tool/testcasegenerator.py +++ b/gramps/plugins/tool/testcasegenerator.py @@ -201,33 +201,33 @@ class TestcaseGenerator(tool.BatchTool): label.set_use_markup(True) 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")) self.check_lowlevel.set_active( self.options.handler.options_dict['lowlevel']) 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.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.connect('clicked', self.on_dummy_data_clicked) 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.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.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.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.top.vbox.pack_start(self.check_linebreak,0,0,5) diff --git a/gramps/plugins/view/citationlistview.py b/gramps/plugins/view/citationlistview.py index 3acab27d3..460cc3582 100644 --- a/gramps/plugins/view/citationlistview.py +++ b/gramps/plugins/view/citationlistview.py @@ -176,8 +176,8 @@ class CitationListView(ListView): """ ListView.define_actions(self) - self.all_action = Gtk.ActionGroup(self.title + "/CitationAll") - self.edit_action = Gtk.ActionGroup(self.title + "/CitationEdit") + self.all_action = Gtk.ActionGroup(name=self.title + "/CitationAll") + self.edit_action = Gtk.ActionGroup(name=self.title + "/CitationEdit") self._add_action('FilterEdit', None, _('Citation Filter Editor'), callback=self.filter_editor,) diff --git a/gramps/plugins/view/citationtreeview.py b/gramps/plugins/view/citationtreeview.py index c4364ff4b..13bfada8b 100644 --- a/gramps/plugins/view/citationtreeview.py +++ b/gramps/plugins/view/citationtreeview.py @@ -284,8 +284,8 @@ class CitationTreeView(ListView): tip=self.ADD_CITATION_MSG, callback=self.share) - self.all_action = Gtk.ActionGroup(self.title + "/CitationAll") - self.edit_action = Gtk.ActionGroup(self.title + "/CitationEdit") + self.all_action = Gtk.ActionGroup(name=self.title + "/CitationAll") + self.edit_action = Gtk.ActionGroup(name=self.title + "/CitationEdit") self._add_action('FilterEdit', None, _('Citation Filter Editor'), callback=self.filter_editor,) diff --git a/gramps/plugins/view/familyview.py b/gramps/plugins/view/familyview.py index f981bf80d..7e0e57600 100644 --- a/gramps/plugins/view/familyview.py +++ b/gramps/plugins/view/familyview.py @@ -202,7 +202,7 @@ class FamilyView(ListView): self._add_action('FilterEdit', None, _('Family 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([ ('MakeFatherActive', Gtk.STOCK_APPLY, _("Make Father Active Person"), None, None, self._make_father_active), diff --git a/gramps/plugins/view/fanchartdescview.py b/gramps/plugins/view/fanchartdescview.py index 1fbbcb15f..76a727c87 100644 --- a/gramps/plugins/view/fanchartdescview.py +++ b/gramps/plugins/view/fanchartdescview.py @@ -101,7 +101,8 @@ class FanChartDescView(fanchartdesc.FanChartDescGrampsGUI, NavigationView): def build_widget(self): self.set_fan(fanchartdesc.FanChartDescWidget(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, Gtk.PolicyType.AUTOMATIC) self.fan.show_all() @@ -267,7 +268,7 @@ class FanChartDescView(fanchartdesc.FanChartDescGrampsGUI, NavigationView): Function that builds the widget in the configuration dialog """ nrentry = 8 - table = Gtk.Table(6, 3) + table = Gtk.Table(n_rows=6, n_columns=3) table.set_border_width(12) table.set_col_spacings(6) table.set_row_spacings(6) diff --git a/gramps/plugins/view/fanchartview.py b/gramps/plugins/view/fanchartview.py index 006bf4e19..11cac693d 100644 --- a/gramps/plugins/view/fanchartview.py +++ b/gramps/plugins/view/fanchartview.py @@ -99,7 +99,8 @@ class FanChartView(fanchart.FanChartGrampsGUI, NavigationView): def build_widget(self): 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, Gtk.PolicyType.AUTOMATIC) self.fan.show_all() @@ -265,7 +266,7 @@ class FanChartView(fanchart.FanChartGrampsGUI, NavigationView): Function that builds the widget in the configuration dialog """ nrentry = 7 - table = Gtk.Table(6, 3) + table = Gtk.Table(n_rows=6, n_columns=3) table.set_border_width(12) table.set_col_spacings(6) table.set_row_spacings(6) diff --git a/gramps/plugins/view/geoclose.py b/gramps/plugins/view/geoclose.py index 68063ab8e..251ffc2d7 100644 --- a/gramps/plugins/view/geoclose.py +++ b/gramps/plugins/view/geoclose.py @@ -282,7 +282,7 @@ class GeoClose(GeoGraphyView): NavigationView.define_actions(self) 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([ ('RefPerson', 'gramps-person', _('reference _Person'), None , _("Select the person which is the reference for life ways"), @@ -566,7 +566,7 @@ class GeoClose(GeoGraphyView): Add specific entry to the preference menu. 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_col_spacings(6) table.set_row_spacings(6) diff --git a/gramps/plugins/view/geofamclose.py b/gramps/plugins/view/geofamclose.py index 763c5ba37..f83cce719 100644 --- a/gramps/plugins/view/geofamclose.py +++ b/gramps/plugins/view/geofamclose.py @@ -709,7 +709,7 @@ class GeoFamClose(GeoGraphyView): Add specific entry to the preference menu. 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_col_spacings(6) table.set_row_spacings(6) diff --git a/gramps/plugins/view/geomoves.py b/gramps/plugins/view/geomoves.py index b74998863..97ec2c8ed 100644 --- a/gramps/plugins/view/geomoves.py +++ b/gramps/plugins/view/geomoves.py @@ -634,7 +634,7 @@ class GeoMoves(GeoGraphyView): Add specific entry to the preference menu. 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_col_spacings(6) table.set_row_spacings(6) diff --git a/gramps/plugins/view/geoperson.py b/gramps/plugins/view/geoperson.py index e8a3c030e..0ea36cf19 100644 --- a/gramps/plugins/view/geoperson.py +++ b/gramps/plugins/view/geoperson.py @@ -515,7 +515,7 @@ class GeoPerson(GeoGraphyView): Add specific entry to the preference menu. 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_col_spacings(6) table.set_row_spacings(6) diff --git a/gramps/plugins/view/htmlrenderer.py b/gramps/plugins/view/htmlrenderer.py index 7b71df4ea..da522c538 100644 --- a/gramps/plugins/view/htmlrenderer.py +++ b/gramps/plugins/view/htmlrenderer.py @@ -354,7 +354,8 @@ class HtmlView(NavigationView): self.toolkit = TOOLKIT = get_toolkits() self.renderer = RendererWebkit() 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_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) frame.add(self.renderer.get_window()) @@ -485,7 +486,7 @@ class HtmlView(NavigationView): accel doesn't work in webkit and gtkmozembed ! 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([ ('Back', Gtk.STOCK_GO_BACK, _("_Back"), "Left", _("Go to the previous page in the history"), @@ -493,7 +494,7 @@ class HtmlView(NavigationView): ]) self._add_action_group(self.back_action) # 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([ ('Forward', Gtk.STOCK_GO_FORWARD, _("_Forward"), "Right", _("Go to the next page in the history"), diff --git a/gramps/plugins/view/pedigreeview.py b/gramps/plugins/view/pedigreeview.py index 36d5b020c..5943abc9d 100644 --- a/gramps/plugins/view/pedigreeview.py +++ b/gramps/plugins/view/pedigreeview.py @@ -587,7 +587,8 @@ class PedigreeView(NavigationView): contains the interface. This containter will be inserted into 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, Gtk.PolicyType.AUTOMATIC) self.scrolledwindow.add_events(Gdk.EventMask.SCROLL_MASK) @@ -1195,7 +1196,8 @@ class PedigreeView(NavigationView): except KeyError: # fill unused cells 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_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.NEVER) frame.add_with_viewport(label) @@ -1995,7 +1997,7 @@ class PedigreeView(NavigationView): """ 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_col_spacings(6) table.set_row_spacings(6) diff --git a/gramps/plugins/view/relview.py b/gramps/plugins/view/relview.py index dc5ae024d..9dfffce20 100644 --- a/gramps/plugins/view/relview.py +++ b/gramps/plugins/view/relview.py @@ -404,13 +404,13 @@ class RelationshipView(NavigationView): def 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([ ('ChangeOrder', Gtk.STOCK_SORT_ASCENDING, _('_Reorder'), None , _("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([ ('Edit', Gtk.STOCK_EDIT, _('Edit...'), "Return", _("Edit the active person"), self.edit_active), @@ -563,7 +563,7 @@ class RelationshipView(NavigationView): else: 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_col_spacings(12) self.child.set_row_spacings(0) @@ -594,7 +594,7 @@ class RelationshipView(NavigationView): def write_title(self, person): 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_row_spacings(0) @@ -618,7 +618,7 @@ class RelationshipView(NavigationView): if self.use_shade: eventbox.override_background_color(Gtk.StateType.NORMAL, self.color) 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_row_spacings(0) eventbox.add(subtbl) @@ -792,7 +792,8 @@ class RelationshipView(NavigationView): self.expand_collapse_press, (person, family.handle)) 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(label, True, True, 0) self.attach.attach(hbox, @@ -1654,7 +1655,7 @@ class RelationshipView(NavigationView): """ 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_col_spacings(6) table.set_row_spacings(6) @@ -1665,7 +1666,7 @@ class RelationshipView(NavigationView): configdialog.add_checkbox(table, _('Display edit buttons'), 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') checkbox.set_active(theme == 'WEBPAGE') checkbox.connect('toggled', self._config_update_theme) @@ -1677,7 +1678,7 @@ class RelationshipView(NavigationView): """ 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_col_spacings(6) table.set_row_spacings(6)