Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear up deprecations #2075

Merged
merged 1 commit into from
Apr 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions guake/boxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ def set_terminal(self, terminal):
def add_scroll_bar(self):
"""Packs the scrollbar."""
adj = self.terminal.get_vadjustment()
self.scroll = Gtk.VScrollbar(adj)
self.scroll = Gtk.Scrollbar.new(Gtk.Orientation.VERTICAL, adj)
self.scroll.show()
self.pack_start(self.scroll, False, False, 0)

Expand Down Expand Up @@ -636,8 +636,8 @@ class TabLabelEventBox(Gtk.EventBox):
def __init__(self, notebook, text, settings):
super().__init__()
self.notebook = notebook
self.box = Gtk.Box(Gtk.Orientation.HORIZONTAL, 0, visible=True)
self.label = Gtk.Label(text, visible=True)
self.box = Gtk.Box(homogeneous=Gtk.Orientation.HORIZONTAL, spacing=0, visible=True)
self.label = Gtk.Label(label=text, visible=True)
self.close_button = Gtk.Button(
image=Gtk.Image.new_from_icon_name("window-close", Gtk.IconSize.MENU),
relief=Gtk.ReliefStyle.NONE,
Expand Down
4 changes: 2 additions & 2 deletions guake/gsettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ def default_font_toggled(self, settings, key, user_data):
"""
font_name = None
if settings.get_boolean(key):
gio_settings = Gio.Settings("org.gnome.desktop.interface")
gio_settings = Gio.Settings(schema="org.gnome.desktop.interface")
font_name = gio_settings.get_string("monospace-font-name")
else:
font_name = self.settings.styleFont.get_string("style")
Expand Down Expand Up @@ -378,7 +378,7 @@ def fstyle_changed(self, settings, key, user_data):
terminals = self.guake.notebook_manager.iter_terminals()

if self.settings.general.get_boolean("use-default-font"):
gio_settings = Gio.Settings("org.gnome.desktop.interface")
gio_settings = Gio.Settings(schema="org.gnome.desktop.interface")
font_name = gio_settings.get_string("monospace-font-name")
else:
font_name = settings.get_string(key)
Expand Down
7 changes: 2 additions & 5 deletions guake/guake_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
gi.require_version("Gdk", "3.0")
gi.require_version("Keybinder", "3.0")
from gi.repository import GLib
from gi.repository import GObject
from gi.repository import Gdk
from gi.repository import Gio
from gi.repository import Gtk
Expand Down Expand Up @@ -86,10 +85,8 @@
# Disable find feature until python-vte hasn't been updated
enable_find = False

GObject.threads_init()

# Setting gobject program name
GObject.set_prgname(NAME)
GLib.set_prgname(NAME)

GDK_WINDOW_STATE_WITHDRAWN = 1
GDK_WINDOW_STATE_ICONIFIED = 2
Expand Down Expand Up @@ -308,7 +305,7 @@ def update_visual(self, user_data=None):
self.hide()
self.show()
else:
log.warn("System doesn't support transparency")
log.warning("System doesn't support transparency")
self.window.transparency = False
self.window.set_visual(screen.get_system_visual())

Expand Down
2 changes: 1 addition & 1 deletion guake/keybindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def reload_global(self, settings, key, user_data):
filename,
)
elif key == "show-focus" and not self.guake.hotkeys.bind(value, self.guake.show_focus):
log.warn("can't bind show-focus key")
log.warning("can't bind show-focus key")

def activate(self, window, event):
"""If keystroke matches a key binding, activate keybinding. Otherwise, allow
Expand Down
6 changes: 3 additions & 3 deletions guake/notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ def __init__(self, *args, **kwargs):
GObject.signal_new(
"terminal-spawned",
TerminalNotebook,
GObject.SIGNAL_RUN_LAST,
GObject.SignalFlags.RUN_LAST,
GObject.TYPE_NONE,
(GObject.TYPE_PYOBJECT, GObject.TYPE_INT),
)
GObject.signal_new(
"page-deleted",
TerminalNotebook,
GObject.SIGNAL_RUN_LAST,
GObject.SignalFlags.RUN_LAST,
GObject.TYPE_NONE,
(),
)
Expand Down Expand Up @@ -511,7 +511,7 @@ def __init__(
GObject.signal_new(
"notebook-created",
self,
GObject.SIGNAL_RUN_LAST,
GObject.SignalFlags.RUN_LAST,
GObject.TYPE_NONE,
(GObject.TYPE_PYOBJECT, GObject.TYPE_INT),
)
Expand Down
4 changes: 2 additions & 2 deletions guake/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,13 +230,13 @@ def add_matches(self):
tag = self.match_add_regex(
Vte.Regex.new_for_match(expr, len(expr), VTE_REGEX_FLAGS), 0
)
self.match_set_cursor_type(tag, Gdk.CursorType.HAND2)
self.match_set_cursor_name(tag, "hand")

for _useless, match, _otheruseless in QUICK_OPEN_MATCHERS:
tag = self.match_add_regex(
Vte.Regex.new_for_match(match, len(match), VTE_REGEX_FLAGS), 0
)
self.match_set_cursor_type(tag, Gdk.CursorType.HAND2)
self.match_set_cursor_name(tag, "hand")
except (
GLib.Error,
AttributeError,
Expand Down