diff --git a/gramps/gen/plug/_gramplet.py b/gramps/gen/plug/_gramplet.py index c040bae7d..994e29fa7 100644 --- a/gramps/gen/plug/_gramplet.py +++ b/gramps/gen/plug/_gramplet.py @@ -309,8 +309,12 @@ class Gramplet(object): self.interrupt() self._generator = self.main() self._pause = False - self._idle_id = GLib.idle_add(self._updater, + if GObject.pygobject_version < (3,16,0): + self._idle_id = GLib.idle_add(self._updater, priority=GObject.PRIORITY_LOW - 10) + else: + self._idle_id = GLib.idle_add(self._updater, + priority=GLib.PRIORITY_LOW - 10) def _updater(self): """ @@ -364,8 +368,12 @@ class Gramplet(object): """ from gi.repository import GObject, GLib self._pause = False - self._idle_id = GLib.idle_add(self._updater, + if GObject.pygobject_version < (3,16,0): + self._idle_id = GLib.idle_add(self._updater, priority=GObject.PRIORITY_LOW - 10) + else: + self._idle_id = GLib.idle_add(self._updater, + priority=GLib.PRIORITY_LOW - 10) def update_all(self, *args): """ diff --git a/gramps/gui/viewmanager.py b/gramps/gui/viewmanager.py index b0790c9b1..c6cced9d8 100644 --- a/gramps/gui/viewmanager.py +++ b/gramps/gui/viewmanager.py @@ -358,7 +358,8 @@ class ViewManager(CLIManager): self.window = Gtk.Window() self.window.set_icon_from_file(ICON) - self.window.set_has_resize_grip(True) + if Gtk.get_minor_version() < 14: + self.window.set_has_resize_grip(True) self.window.set_default_size(width, height) vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) diff --git a/gramps/gui/widgets/expandcollapsearrow.py b/gramps/gui/widgets/expandcollapsearrow.py index 9bfb524aa..c36cc6809 100644 --- a/gramps/gui/widgets/expandcollapsearrow.py +++ b/gramps/gui/widgets/expandcollapsearrow.py @@ -47,7 +47,11 @@ from gramps.gen.constfunc import has_display # #------------------------------------------------------------------------- if has_display(): - HAND_CURSOR = Gdk.Cursor.new(Gdk.CursorType.HAND2) + if Gtk.get_minor_version() < 16: + HAND_CURSOR = Gdk.Cursor.new(Gdk.CursorType.HAND2) + else: + HAND_CURSOR = Gdk.Cursor.new_for_display(Gdk.Display.get_default(), + Gdk.CursorType.HAND2) #------------------------------------------------------------------------- # diff --git a/gramps/gui/widgets/grabbers.py b/gramps/gui/widgets/grabbers.py index 3f0242084..70018293b 100644 --- a/gramps/gui/widgets/grabbers.py +++ b/gramps/gui/widgets/grabbers.py @@ -197,14 +197,32 @@ GRABBERS_SWITCH = [ # cursors try: - CURSOR_UPPER = Gdk.Cursor.new(Gdk.CursorType.TOP_SIDE) - CURSOR_LOWER = Gdk.Cursor.new(Gdk.CursorType.BOTTOM_SIDE) - CURSOR_LEFT = Gdk.Cursor.new(Gdk.CursorType.LEFT_SIDE) - CURSOR_RIGHT = Gdk.Cursor.new(Gdk.CursorType.RIGHT_SIDE) - CURSOR_UPPER_LEFT = Gdk.Cursor.new(Gdk.CursorType.TOP_LEFT_CORNER) - CURSOR_UPPER_RIGHT = Gdk.Cursor.new(Gdk.CursorType.TOP_RIGHT_CORNER) - CURSOR_LOWER_LEFT = Gdk.Cursor.new(Gdk.CursorType.BOTTOM_LEFT_CORNER) - CURSOR_LOWER_RIGHT = Gdk.Cursor.new(Gdk.CursorType.BOTTOM_RIGHT_CORNER) + if Gtk.get_minor_version() < 16: + CURSOR_UPPER = Gdk.Cursor.new(Gdk.CursorType.TOP_SIDE) + CURSOR_LOWER = Gdk.Cursor.new(Gdk.CursorType.BOTTOM_SIDE) + CURSOR_LEFT = Gdk.Cursor.new(Gdk.CursorType.LEFT_SIDE) + CURSOR_RIGHT = Gdk.Cursor.new(Gdk.CursorType.RIGHT_SIDE) + CURSOR_UPPER_LEFT = Gdk.Cursor.new(Gdk.CursorType.TOP_LEFT_CORNER) + CURSOR_UPPER_RIGHT = Gdk.Cursor.new(Gdk.CursorType.TOP_RIGHT_CORNER) + CURSOR_LOWER_LEFT = Gdk.Cursor.new(Gdk.CursorType.BOTTOM_LEFT_CORNER) + CURSOR_LOWER_RIGHT = Gdk.Cursor.new(Gdk.CursorType.BOTTOM_RIGHT_CORNER) + else: + CURSOR_UPPER = Gdk.Cursor.new_for_display(Gdk.Display.get_default(), + Gdk.CursorType.TOP_SIDE) + CURSOR_LOWER = Gdk.Cursor.new_for_display(Gdk.Display.get_default(), + Gdk.CursorType.BOTTOM_SIDE) + CURSOR_LEFT = Gdk.Cursor.new_for_display(Gdk.Display.get_default(), + Gdk.CursorType.LEFT_SIDE) + CURSOR_RIGHT = Gdk.Cursor.new_for_display(Gdk.Display.get_default(), + Gdk.CursorType.RIGHT_SIDE) + CURSOR_UPPER_LEFT = Gdk.Cursor.new_for_display(Gdk.Display.get_default(), + Gdk.CursorType.TOP_LEFT_CORNER) + CURSOR_UPPER_RIGHT = Gdk.Cursor.new_for_display(Gdk.Display.get_default(), + Gdk.CursorType.TOP_RIGHT_CORNER) + CURSOR_LOWER_LEFT = Gdk.Cursor.new_for_display(Gdk.Display.get_default(), + Gdk.CursorType.BOTTOM_LEFT_CORNER) + CURSOR_LOWER_RIGHT = Gdk.Cursor.new_for_display(Gdk.Display.get_default(), + Gdk.CursorType.BOTTOM_RIGHT_CORNER) except: CURSOR_UPPER = None CURSOR_LOWER = None diff --git a/gramps/gui/widgets/labels.py b/gramps/gui/widgets/labels.py index 76f9dc597..e10201a3e 100644 --- a/gramps/gui/widgets/labels.py +++ b/gramps/gui/widgets/labels.py @@ -57,7 +57,11 @@ from ..utils import rgb_to_hex # #------------------------------------------------------------------------- if has_display(): - HAND_CURSOR = Gdk.Cursor.new(Gdk.CursorType.HAND2) + if Gtk.get_minor_version() < 16: + HAND_CURSOR = Gdk.Cursor.new(Gdk.CursorType.HAND2) + else: + HAND_CURSOR = Gdk.Cursor.new_for_display(Gdk.Display.get_default(), + Gdk.CursorType.HAND2) #------------------------------------------------------------------------- # diff --git a/gramps/gui/widgets/selectionwidget.py b/gramps/gui/widgets/selectionwidget.py index 37faff741..fe6b07c38 100644 --- a/gramps/gui/widgets/selectionwidget.py +++ b/gramps/gui/widgets/selectionwidget.py @@ -171,14 +171,14 @@ class SelectionWidget(Gtk.ScrolledWindow): """ __gsignals__ = { - "region-modified": (GObject.SIGNAL_RUN_FIRST, None, ()), - "region-created": (GObject.SIGNAL_RUN_FIRST, None, ()), - "region-selected": (GObject.SIGNAL_RUN_FIRST, None, ()), - "selection-cleared": (GObject.SIGNAL_RUN_FIRST, None, ()), - "right-button-clicked": (GObject.SIGNAL_RUN_FIRST, None, ()), - "zoomed-in": (GObject.SIGNAL_RUN_FIRST, None, ()), - "zoomed-out": (GObject.SIGNAL_RUN_FIRST, None, ()) - } + "region-modified": (GObject.SignalFlags.RUN_FIRST, None, ()), + "region-created": (GObject.SignalFlags.RUN_FIRST, None, ()), + "region-selected": (GObject.SignalFlags.RUN_FIRST, None, ()), + "selection-cleared": (GObject.SignalFlags.RUN_FIRST, None, ()), + "right-button-clicked": (GObject.SignalFlags.RUN_FIRST, None, ()), + "zoomed-in": (GObject.SignalFlags.RUN_FIRST, None, ()), + "zoomed-out": (GObject.SignalFlags.RUN_FIRST, None, ()) + } def __init__(self): """ diff --git a/gramps/gui/widgets/validatedmaskedentry.py b/gramps/gui/widgets/validatedmaskedentry.py index 0099601ea..5362f823d 100644 --- a/gramps/gui/widgets/validatedmaskedentry.py +++ b/gramps/gui/widgets/validatedmaskedentry.py @@ -1116,16 +1116,21 @@ class ValidatableMaskedEntry(MaskedEntry): 'changed': 'override', } + if GLib.MINOR_VERSION < 42: + __gparam = GObject.PARAM_READWRITE + else: + __gparam = GObject.ParamFlags.READWRITE + __gproperties__ = { 'data-type': (GObject.TYPE_PYOBJECT, 'Data Type of the widget', 'Type object', - GObject.PARAM_READWRITE), + __gparam), 'mandatory': (GObject.TYPE_BOOLEAN, 'Mandatory', 'Mandatory', False, - GObject.PARAM_READWRITE), + __gparam), } # FIXME put the data type support back