From 91ef04776632fefd50f7e64fbae6457cac2e879f Mon Sep 17 00:00:00 2001 From: Josip Date: Thu, 3 Apr 2014 00:10:19 +0200 Subject: [PATCH] Yet more fix of PyGObject-3.11 DeprecationWarning --- gramps/gen/plug/_gramplet.py | 4 ++-- gramps/gui/editors/displaytabs/backrefmodel.py | 2 +- gramps/gui/views/pageview.py | 2 +- gramps/gui/widgets/grampletpane.py | 6 +++--- gramps/gui/widgets/validatedmaskedentry.py | 4 ++-- gramps/plugins/gramplet/calendargramplet.py | 2 +- gramps/plugins/gramplet/gallery.py | 2 +- gramps/plugins/gramplet/notes.py | 2 +- gramps/plugins/gramplet/todo.py | 4 ++-- gramps/plugins/gramplet/todogramplet.py | 2 +- gramps/plugins/lib/maps/osmgps.py | 2 +- gramps/plugins/view/htmlrenderer.py | 6 +++--- 12 files changed, 19 insertions(+), 19 deletions(-) diff --git a/gramps/gen/plug/_gramplet.py b/gramps/gen/plug/_gramplet.py index 3e0eccd85..1410808c2 100644 --- a/gramps/gen/plug/_gramplet.py +++ b/gramps/gen/plug/_gramplet.py @@ -380,10 +380,10 @@ class Gramplet(object): """ Force the generator to stop running. """ - from gi.repository import GObject + from gi.repository import GLib self._pause = True if self._idle_id != 0: - GObject.source_remove(self._idle_id) + GLib.source_remove(self._idle_id) self._idle_id = 0 def _db_changed(self, db): diff --git a/gramps/gui/editors/displaytabs/backrefmodel.py b/gramps/gui/editors/displaytabs/backrefmodel.py index 2ab8bf11a..be090b112 100644 --- a/gramps/gui/editors/displaytabs/backrefmodel.py +++ b/gramps/gui/editors/displaytabs/backrefmodel.py @@ -63,7 +63,7 @@ class BackRefModel(Gtk.ListStore): self.idle = GLib.idle_add(self.load_model().__next__) def destroy(self): - GObject.source_remove(self.idle) + GLib.source_remove(self.idle) def load_model(self): """ diff --git a/gramps/gui/views/pageview.py b/gramps/gui/views/pageview.py index 01d8a895d..db23fd006 100644 --- a/gramps/gui/views/pageview.py +++ b/gramps/gui/views/pageview.py @@ -628,7 +628,7 @@ class DummyPage(PageView): PageView.__init__(self, title, pdata, dbstate, uistate) def build_widget(self): - box = Gtk.VBox(False, 1) + box = Gtk.VBox(homogeneous=False, spacing=1) #top widget at the top box.pack_start(Gtk.Label(label=_('View %(name)s: %(msg)s') % { 'name': self.title, diff --git a/gramps/gui/widgets/grampletpane.py b/gramps/gui/widgets/grampletpane.py index 34ed815d3..b1ff582ac 100644 --- a/gramps/gui/widgets/grampletpane.py +++ b/gramps/gui/widgets/grampletpane.py @@ -558,9 +558,9 @@ class GuiGramplet(object): if len(self.pui.option_order) == 0: return frame = Gtk.Frame() topbox = Gtk.VBox(homogeneous=False) - hbox = Gtk.HBox(False, 5) - labels = Gtk.VBox(True) - options = Gtk.VBox(True) + hbox = Gtk.HBox(homogeneous=False, spacing=5) + labels = Gtk.VBox(homogeneous=True) + options = Gtk.VBox(homogeneous=True) hbox.pack_start(labels, False, True, 0) hbox.pack_start(options, True, True, 0) topbox.pack_start(hbox, False, False, 0) diff --git a/gramps/gui/widgets/validatedmaskedentry.py b/gramps/gui/widgets/validatedmaskedentry.py index 98cb3b8a5..60b3f3ba0 100644 --- a/gramps/gui/widgets/validatedmaskedentry.py +++ b/gramps/gui/widgets/validatedmaskedentry.py @@ -177,10 +177,10 @@ class FadeOut(GObject.GObject): """Stops the fadeout and restores the background color""" ##_LOG.debug('Stopping') if self._background_timeout_id != -1: - GObject.source_remove(self._background_timeout_id) + GLib.source_remove(self._background_timeout_id) self._background_timeout_id = -1 if self._countdown_timeout_id != -1: - GObject.source_remove(self._countdown_timeout_id) + GLib.source_remove(self._countdown_timeout_id) self._countdown_timeout_id = -1 self._widget.update_background(self._start_color, unset=True) diff --git a/gramps/plugins/gramplet/calendargramplet.py b/gramps/plugins/gramplet/calendargramplet.py index 74e26ff04..2593d10e2 100644 --- a/gramps/plugins/gramplet/calendargramplet.py +++ b/gramps/plugins/gramplet/calendargramplet.py @@ -43,7 +43,7 @@ class CalendarGramplet(Gramplet): self.gui.calendar.set_display_options( Gtk.CalendarDisplayOptions.SHOW_HEADING) self.gui.get_container_widget().remove(self.gui.textview) - vbox = Gtk.VBox(False, 0) + vbox = Gtk.VBox(homogeneous=False, spacing=0) vbox.pack_start(self.gui.calendar, False, False, 0) self.gui.get_container_widget().add_with_viewport(vbox) vbox.show_all() diff --git a/gramps/plugins/gramplet/gallery.py b/gramps/plugins/gramplet/gallery.py index 9d825edd8..f8be7916e 100644 --- a/gramps/plugins/gramplet/gallery.py +++ b/gramps/plugins/gramplet/gallery.py @@ -39,7 +39,7 @@ class Gallery(Gramplet): Build the GUI interface. """ self.image_list = [] - self.top = Gtk.HBox(False, 3) + self.top = Gtk.HBox(homogeneous=False, spacing=3) return self.top def clear_images(self): diff --git a/gramps/plugins/gramplet/notes.py b/gramps/plugins/gramplet/notes.py index af18bbdac..cd9ce363f 100644 --- a/gramps/plugins/gramplet/notes.py +++ b/gramps/plugins/gramplet/notes.py @@ -42,7 +42,7 @@ class Notes(Gramplet): """ Build the GUI interface. """ - top = Gtk.VBox(False) + top = Gtk.VBox(homogeneous=False) hbox = Gtk.HBox() self.left = SimpleButton(Gtk.STOCK_GO_BACK, self.left_clicked) diff --git a/gramps/plugins/gramplet/todo.py b/gramps/plugins/gramplet/todo.py index ba763afdc..d90fbba21 100644 --- a/gramps/plugins/gramplet/todo.py +++ b/gramps/plugins/gramplet/todo.py @@ -42,7 +42,7 @@ class ToDo(Gramplet): """ Build the GUI interface. """ - top = Gtk.VBox(False) + top = Gtk.VBox(homogeneous=False) hbox = Gtk.HBox() self.left = SimpleButton(Gtk.STOCK_GO_BACK, self.left_clicked) @@ -51,7 +51,7 @@ class ToDo(Gramplet): hbox.pack_start(self.left, False, False, 0) self.right = SimpleButton(Gtk.STOCK_GO_FORWARD, self.right_clicked) self.right.set_tooltip_text(_('Next To Do note')) - self.right.set_sensitive(False) + self.right.set_sensitive(homogeneous=False) hbox.pack_start(self.right, False, False, 0) self.edit = SimpleButton(Gtk.STOCK_EDIT, self.edit_clicked) self.edit.set_tooltip_text(_('Edit the selected To Do note')) diff --git a/gramps/plugins/gramplet/todogramplet.py b/gramps/plugins/gramplet/todogramplet.py index d70b06693..48f5a2fe7 100644 --- a/gramps/plugins/gramplet/todogramplet.py +++ b/gramps/plugins/gramplet/todogramplet.py @@ -45,7 +45,7 @@ class ToDoGramplet(Gramplet): """ Build the GUI interface. """ - top = Gtk.VBox(False) + top = Gtk.VBox(homogeneous=False) hbox = Gtk.HBox() self.left = SimpleButton(Gtk.STOCK_GO_BACK, self.left_clicked) diff --git a/gramps/plugins/lib/maps/osmgps.py b/gramps/plugins/lib/maps/osmgps.py index 1aee2462e..1c18370eb 100644 --- a/gramps/plugins/lib/maps/osmgps.py +++ b/gramps/plugins/lib/maps/osmgps.py @@ -102,7 +102,7 @@ class OsmGps(): """ create the vbox """ - self.vbox = Gtk.VBox(False, 0) + self.vbox = Gtk.VBox(homogeneous=False, spacing=0) cache_path = config.get('geography.path') if not os.path.isdir(cache_path): try: diff --git a/gramps/plugins/view/htmlrenderer.py b/gramps/plugins/view/htmlrenderer.py index da522c538..7251b6938 100644 --- a/gramps/plugins/view/htmlrenderer.py +++ b/gramps/plugins/view/htmlrenderer.py @@ -346,14 +346,14 @@ class HtmlView(NavigationView): contains the interface. This containter will be inserted into a Gtk.Notebook page. """ - self.box = Gtk.VBox(False, 4) + self.box = Gtk.VBox(homogeneous=False, spacing=4) #top widget at the top self.box.pack_start(self.top_widget(), False, False, 0 ) #web page under it in a scrolled window #self.table = Gtk.Table(1, 1, False) self.toolkit = TOOLKIT = get_toolkits() self.renderer = RendererWebkit() - self.frames = Gtk.HBox(False, 4) + self.frames = Gtk.HBox(homogeneous=False, spacing=4) frame = Gtk.ScrolledWindow(hadjustment=None, vadjustment=None) frame.set_shadow_type(Gtk.ShadowType.NONE) @@ -377,7 +377,7 @@ class HtmlView(NavigationView): """ The default class gives a widget where user can type an url """ - hbox = Gtk.HBox(False, 4) + hbox = Gtk.HBox(homogeneous=False, spacing=4) self.urlfield = Gtk.Entry() self.urlfield.set_text(config.get("htmlview.start-url")) self.urlfield.connect('activate', self._on_activate)