Skip to content

Commit

Permalink
Clear up deprecations
Browse files Browse the repository at this point in the history
Clean up various deprecations raised by the test cases.
  • Loading branch information
Davidy22 committed Apr 19, 2022
1 parent 08f32aa commit a05cac5
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 16 deletions.
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
7 changes: 4 additions & 3 deletions guake/notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,19 @@ 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,
(),
)


self.scroll_callback = NotebookScrollCallback(self)
self.add_events(Gdk.EventMask.SCROLL_MASK)
self.connect("scroll-event", self.scroll_callback.on_scroll)
Expand Down Expand Up @@ -511,7 +512,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

0 comments on commit a05cac5

Please sign in to comment.