diff --git a/src/common/config.py b/src/common/config.py index c9e308a42..e46b20b10 100644 --- a/src/common/config.py +++ b/src/common/config.py @@ -314,6 +314,7 @@ class Config: 'remember_opened_chat_controls': [ opt_bool, True, _('If enabled, Gajim will reopen chat windows that were opened last time Gajim was closed.')], 'positive_184_ack': [ opt_bool, False, _('If enabled, Gajim will show an icon to show that sent message has been received by your contact')], 'show_avatar_in_tabs': [ opt_bool, False, _('Show a mini avatar in chat window tabs and in window icon')], + 'use_keyring': [opt_bool, True, _('If True, Gajim will use the Systems Keyring to store account passwords.')], }, {}) __options_per_key = { diff --git a/src/common/passwords.py b/src/common/passwords.py index 7f297b0c5..8bd690140 100644 --- a/src/common/passwords.py +++ b/src/common/passwords.py @@ -140,19 +140,22 @@ def get_storage(): global storage if storage is None: # None is only in first time get_storage is called global Secret - try: - gi.require_version('Secret', '1') - gir = __import__('gi.repository', globals(), locals(), - ['Secret'], 0) - Secret = gir.Secret - except (ValueError, AttributeError): - pass - try: - if os.name != 'nt': - storage = SecretPasswordStorage() - else: - storage = SecretWindowsPasswordStorage() - except Exception: + if gajim.config.get('use_keyring'): + try: + gi.require_version('Secret', '1') + gir = __import__('gi.repository', globals(), locals(), + ['Secret'], 0) + Secret = gir.Secret + except (ValueError, AttributeError): + pass + try: + if os.name != 'nt': + storage = SecretPasswordStorage() + else: + storage = SecretWindowsPasswordStorage() + except Exception: + storage = SimplePasswordStorage() + else: storage = SimplePasswordStorage() return storage