Commit 2a139da2 authored by Dominique Leuenberger's avatar Dominique Leuenberger Committed by Rui Matos

PyGTKDeprecationWarning: Using positional arguments with the GObject...

PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated.

PyGTKDeprecationWarning: Using positional arguments with the GObject
constructor has been deprecated. Please specify keywords for label or
use a class specific constructor. See:
https://wiki.gnome.org/PyGObject/InitializerDeprecations

https://bugzilla.gnome.org/show_bug.cgi?id=725926
parent 6c05bebb
......@@ -122,9 +122,9 @@ class GSettingsSetting(Gio.Settings):
raise GSettingsMissingError(schema_name)
if schema_path is None:
Gio.Settings.__init__(self, schema_name)
Gio.Settings.__init__(self, schema=schema_name)
else:
Gio.Settings.__init__(self, schema_name, path=schema_path)
Gio.Settings.__init__(self, schema=schema_name, path=schema_path)
else:
GioSSS = Gio.SettingsSchemaSource
schema_source = GioSSS.new_from_directory(schema_dir,
......
......@@ -105,7 +105,7 @@ class _ShellExtensionTweak(Gtk.ListBoxRow, Tweak):
btn.connect("clicked", self._on_configure_clicked, uuid)
self.hbox.pack_start(btn, False, False, 0)
btn = Gtk.Button(_("Remove"))
btn = Gtk.Button(label=_("Remove"))
btn.props.vexpand = False
btn.props.valign = Gtk.Align.CENTER
btn.set_sensitive(False)
......
......@@ -123,12 +123,12 @@ class _StartupTweak(Gtk.ListBoxRow, Tweak):
else:
img = None #attach_next_to treats this correctly
lbl = Gtk.Label(df.get_name(), xalign=0.0)
lbl = Gtk.Label(label=df.get_name(), xalign=0.0)
grid.attach_next_to(lbl,img,Gtk.PositionType.RIGHT,1,1)
lbl.props.hexpand = True
lbl.props.halign = Gtk.Align.START
btn = Gtk.Button(_("Remove"))
btn = Gtk.Button(label=_("Remove"))
grid.attach_next_to(btn,lbl,Gtk.PositionType.RIGHT,1,1)
btn.props.vexpand = False
btn.props.valign = Gtk.Align.CENTER
......@@ -148,7 +148,7 @@ class AddStartupTweak(Gtk.ListBoxRow, Tweak):
_("Add a new application to be run at startup"),
**options)
self.btn = Gtk.Button("")
self.btn = Gtk.Button(label="")
self.btn.get_style_context().remove_class("button")
img = Gtk.Image()
img.set_from_icon_name("list-add-symbolic", Gtk.IconSize.BUTTON)
......
......@@ -36,7 +36,7 @@ class Window(Gtk.ApplicationWindow):
self.set_position(Gtk.WindowPosition.CENTER)
self.set_icon_name("gnome-tweak-tool")
self.hsize_group = Gtk.SizeGroup(Gtk.SizeGroupMode.HORIZONTAL)
self.hsize_group = Gtk.SizeGroup(mode=Gtk.SizeGroupMode.HORIZONTAL)
main_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
left_box = self.sidebar()
......@@ -78,7 +78,7 @@ class Window(Gtk.ApplicationWindow):
right_header.props.decoration_layout = ":" + tokens[1]
left_header.props.decoration_layout = tokens[0]
self.title = Gtk.Label("")
self.title = Gtk.Label(label="")
self.title.get_style_context().add_class("title")
right_header.set_custom_title(self.title)
......@@ -91,7 +91,7 @@ class Window(Gtk.ApplicationWindow):
self.button.get_style_context().add_class("image-button")
left_header.pack_start(self.button)
lbl = Gtk.Label(_("Tweaks"))
lbl = Gtk.Label(label=_("Tweaks"))
lbl.get_style_context().add_class("title")
left_header.set_custom_title(lbl)
......@@ -155,7 +155,7 @@ class Window(Gtk.ApplicationWindow):
def load_model_data(self):
def _make_items_listbox(text):
lbl = Gtk.Label(text, xalign=0.0)
lbl = Gtk.Label(label=text, xalign=0.0)
lbl.set_name('row')
row = Gtk.ListBoxRow()
row.get_style_context().add_class("tweak-category")
......
......@@ -240,7 +240,7 @@ class XSettingsOverrides:
}
def __init__(self):
self._settings = Gio.Settings('org.gnome.settings-daemon.plugins.xsettings')
self._settings = Gio.Settings(schema='org.gnome.settings-daemon.plugins.xsettings')
self._variant = self._settings.get_value("overrides")
def _dup_variant_as_dict(self):
......
......@@ -56,7 +56,7 @@ def build_label_beside_widget(txt, *widget, **kwargs):
hbox = Gtk.HBox()
hbox.props.spacing = UI_BOX_SPACING
lbl = Gtk.Label(txt)
lbl = Gtk.Label(label=txt)
lbl.props.ellipsize = Pango.EllipsizeMode.END
lbl.props.xalign = 0.0
lbl.set_has_tooltip(True)
......@@ -140,7 +140,7 @@ def adjust_schema_for_overrides(originalSchema, key, options):
overridesSchema = "org.gnome.shell.overrides"
overridesFile = "org.gnome.shell.gschema.xml"
if (key in Gio.Settings(overridesSchema).list_keys()):
if (key in Gio.Settings(schema=overridesSchema).list_keys()):
options['schema_filename'] = overridesFile
return overridesSchema
return originalSchema
......@@ -311,7 +311,7 @@ class GSettingsSpinButtonTweak(Gtk.Box, _GSettingsTweak, _DependableMixin):
#returned variant is range:(min, max)
_min, _max = self.settings.get_range(key_name)[1]
adjustment = Gtk.Adjustment(0, _min, _max, options.get('adjustment_step', 1))
adjustment = Gtk.Adjustment(value=0, lower=_min, upper=_max, step_increment=options.get('adjustment_step', 1))
w = Gtk.SpinButton()
w.set_adjustment(adjustment)
w.set_digits(options.get('digits', 0))
......@@ -483,7 +483,7 @@ class DarkThemeSwitcher(Gtk.Box, Tweak):
hbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
hbox.props.spacing = UI_BOX_SPACING
lbl = Gtk.Label(title)
lbl = Gtk.Label(label=title)
lbl.props.ellipsize = Pango.EllipsizeMode.END
lbl.props.xalign = 0.0
hbox.pack_start(lbl, True, True, 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment