diff --git a/src/common/config.py b/src/common/config.py index f32bf8f92..ae6fb285c 100644 --- a/src/common/config.py +++ b/src/common/config.py @@ -221,6 +221,7 @@ class Config: 'ctrl_tab_go_to_next_composing': [opt_bool, True, _('Ctrl-Tab go to next composing tab when none is unread.')], 'confirm_metacontacts': [ opt_str, '', _('Should we show the confirm metacontacts creation dialog or not? Empty string means we never show the dialog.')], 'enable_negative_priority': [ opt_bool, False, _('If True, you will be able to set a negative priority to your account in account modification window. BE CAREFULL, when you are logged in with a negative priority, you will NOT receive any message from your server.')], + 'use_gnomekeyring': [opt_bool, True, _('If True, Gajim will use Gnome Keyring (if available) to store account passwords.')], } __options_per_key = { diff --git a/src/common/passwords.py b/src/common/passwords.py index a38c04692..5d556b6a8 100644 --- a/src/common/passwords.py +++ b/src/common/passwords.py @@ -18,17 +18,19 @@ import gobject from common import gajim -try: - import gnomekeyring -except ImportError: - USER_HAS_GNOMEKEYRING = False - USER_USES_GNOMEKEYRING = False -else: - USER_HAS_GNOMEKEYRING = True - if gnomekeyring.is_available(): - USER_USES_GNOMEKEYRING = True +USER_HAS_GNOMEKEYRING = False +USER_USES_GNOMEKEYRING = False +if gajim.config.get('use_gnomekeyring'): + try: + import gnomekeyring + except ImportError: + pass else: - USER_USES_GNOMEKEYRING = False + USER_HAS_GNOMEKEYRING = True + if gnomekeyring.is_available(): + USER_USES_GNOMEKEYRING = True + else: + USER_USES_GNOMEKEYRING = False class PasswordStorage(object): def get_password(self, account_name):