From b851177f6a07d8bdb892523ce3f08904e720a99e Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Sun, 30 Aug 2015 23:23:10 +0200 Subject: [PATCH] specify module version before importing --- src/chat_control.py | 1 + src/gtkgui_helpers.py | 3 ++- src/gtkspell.py | 1 + src/gui_interface.py | 19 ++++++++++--------- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/chat_control.py b/src/chat_control.py index 4ad5967b8..7f58bb7bd 100644 --- a/src/chat_control.py +++ b/src/chat_control.py @@ -29,6 +29,7 @@ import os import time +gi.require_version('GdkX11', '3.0') from gi.repository import GdkX11 from gi.repository import Gtk from gi.repository import Gdk diff --git a/src/gtkgui_helpers.py b/src/gtkgui_helpers.py index 7c7a504b5..81f77ac07 100644 --- a/src/gtkgui_helpers.py +++ b/src/gtkgui_helpers.py @@ -177,11 +177,12 @@ def get_default_font(): Xfce and last KDE it returns None on failure or else a string 'Font Size' """ try: + gi.require_version('GConf', '2.0') from gi.repository import GConf client = GConf.Client.get_default() value = client.get_string("/desktop/gnome/interface/font_name") return value.decode("utf8") - except ImportError: + except ValueError: pass # try to get Xfce default font diff --git a/src/gtkspell.py b/src/gtkspell.py index dcffed0d2..b1b01fb34 100644 --- a/src/gtkspell.py +++ b/src/gtkspell.py @@ -18,6 +18,7 @@ ## along with Gajim. If not, see . from gi.repository import Gtk +gi.require_version('GtkSpell', '3.0') from gi.repository import GtkSpell def ensure_attached(func): diff --git a/src/gui_interface.py b/src/gui_interface.py index 652e7c13a..723437943 100644 --- a/src/gui_interface.py +++ b/src/gui_interface.py @@ -2779,15 +2779,16 @@ class Interface: gajim.ZEROCONF_ACC_NAME = account break # Is gnome configured to activate row on single click ? - try: - from gi.repository import GConf - client = GConf.Client.get_default() - click_policy = client.get_string( - '/apps/nautilus/preferences/click_policy') - if click_policy == 'single': - gajim.single_click = True - except Exception: - pass +# try: +# gi.require_version('GConf', '2.0') +# from gi.repository import GConf +# client = GConf.Client.get_default() +# click_policy = client.get_string( +# '/apps/nautilus/preferences/click_policy') +# if click_policy == 'single': +# gajim.single_click = True +# except Exception: +# pass # add default status messages if there is not in the config file if len(gajim.config.get_per('statusmsg')) == 0: default = gajim.config.statusmsg_default