mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
[GTK3] Fix path chooser warnings and errors
This commit is contained in:
parent
2e88fa1dfc
commit
13e1fa355d
1 changed files with 8 additions and 1 deletions
|
@ -11,6 +11,7 @@
|
||||||
from __future__ import division, print_function, unicode_literals
|
from __future__ import division, print_function, unicode_literals
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import warnings
|
||||||
|
|
||||||
# FIXME: use this as fallback to get_introspection_module?
|
# FIXME: use this as fallback to get_introspection_module?
|
||||||
# from gi.importer import modules
|
# from gi.importer import modules
|
||||||
|
@ -21,6 +22,11 @@ from gi.repository.GObject import SignalFlags
|
||||||
from deluge.common import PY2, resource_filename
|
from deluge.common import PY2, resource_filename
|
||||||
from deluge.path_chooser_common import get_completion_paths
|
from deluge.path_chooser_common import get_completion_paths
|
||||||
|
|
||||||
|
# Filter the pygobject signal warning:
|
||||||
|
# g_value_get_int: assertion 'G_VALUE_HOLDS_INT (value)' failed.
|
||||||
|
# See: https://gitlab.gnome.org/GNOME/pygobject/issues/12
|
||||||
|
warnings.filterwarnings('ignore', '.*g_value_get_int.*G_VALUE_HOLDS_INT.*', Warning)
|
||||||
|
|
||||||
|
|
||||||
def is_ascii_value(keyval, ascii_key):
|
def is_ascii_value(keyval, ascii_key):
|
||||||
try:
|
try:
|
||||||
|
@ -969,7 +975,7 @@ class PathCompletionPopup(CompletionList, PathChooserPopup):
|
||||||
Handles scroll events from the treeview
|
Handles scroll events from the treeview
|
||||||
|
|
||||||
"""
|
"""
|
||||||
x, y, state = event.window.get_pointer()
|
x, y = event.window.get_pointer()
|
||||||
self.handle_list_scroll(
|
self.handle_list_scroll(
|
||||||
_next=event.direction == Gdk.ScrollDirection.DOWN,
|
_next=event.direction == Gdk.ScrollDirection.DOWN,
|
||||||
set_entry=widget != self.treeview,
|
set_entry=widget != self.treeview,
|
||||||
|
@ -1392,6 +1398,7 @@ class PathChooserComboBox(GtkGI.Box, StoredValuesPopup, GObject.GObject):
|
||||||
self.emit('text-changed', self.get_text())
|
self.emit('text-changed', self.get_text())
|
||||||
|
|
||||||
def _on_entry_text_focus_out_event(self, widget, event):
|
def _on_entry_text_focus_out_event(self, widget, event):
|
||||||
|
# FIXME: This causes text to be deselected on right-click.
|
||||||
# Update text on the button label
|
# Update text on the button label
|
||||||
self.set_text(self.get_text())
|
self.set_text(self.get_text())
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue