linuxmint / blueberry

A Bluetooth configuration tool
GNU General Public License v3.0
176 stars 51 forks source link

Fix PyGIDeprecationWarnings #51

Closed FriedrichFroebel closed 6 years ago

FriedrichFroebel commented 6 years ago

Running blueberry currently raises some deprecation warnings when the latest pygobject module is installed:

/usr/lib/blueberry/blueberry.py:26: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "type" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
  self.window = Gtk.Window(Gtk.WindowType.TOPLEVEL)
/usr/lib/blueberry/blueberry.py:106: PyGIDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "schema" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
  self.settings = Gio.Settings("org.blueberry")
/usr/lib/blueberry/blueberry.py:224: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
  label = Gtk.Label(message)
/usr/lib/blueberry/rfkillMagic.py:111: PyGIDeprecationWarning: GObject.idle_add is deprecated; use GLib.idle_add instead
  GObject.idle_add(self.output_callback)
/usr/lib/blueberry/BlueberrySettingsWidgets.py:35: PyGTKDeprecationWarning: Initializer is relying on deprecated non-standard defaults. Please update to explicitly use: mode=<enum GTK_SIZE_GROUP_VERTICAL of type Gtk.SizeGroupMode> See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
  self.size_group = Gtk.SizeGroup()
/usr/lib/blueberry/blueberry.py:157: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
  row = SettingsRow(Gtk.Label(_("Name")), self.adapter_name_entry)
/usr/lib/blueberry/blueberry.py:165: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
  row = SettingsRow(Gtk.Label(_("Receive files from remote devices")), self.obex_switch)
/usr/lib/blueberry/blueberry.py:173: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
  section.add_row(SettingsRow(Gtk.Label(_("Show a tray icon")), self.tray_switch))

The given PR performs the changes proposed by the deprecation warnings. (I only left out the one in /usr/lib/blueberry/BlueberrySettingsWidgets.py:35 as I do not know what should be the right thing to do there.)