Verified Commit d6151d5d authored by André's avatar André
Browse files

Enable "save password" only if password is storable

parent 7d68c50f
Pipeline #8133 passed with stages
in 7 minutes and 17 seconds
...@@ -1005,7 +1005,8 @@ def __init__(self, account, parent): ...@@ -1005,7 +1005,8 @@ def __init__(self, account, parent):
bind='account::savepass'), bind='account::savepass'),
Setting(SettingKind.SWITCH, _('Save Password'), Setting(SettingKind.SWITCH, _('Save Password'),
SettingType.ACCOUNT_CONFIG, 'savepass'), SettingType.ACCOUNT_CONFIG, 'savepass',
enabled_func=lambda: not app.settings.get('use_keyring') or passwords.KEYRING_AVAILABLE),
Setting(SettingKind.CHANGEPASSWORD, _('Change Password'), Setting(SettingKind.CHANGEPASSWORD, _('Change Password'),
SettingType.DIALOG, callback=self.on_password_change, SettingType.DIALOG, callback=self.on_password_change,
......
...@@ -54,6 +54,7 @@ ...@@ -54,6 +54,7 @@
from gajim.common.dbus import location from gajim.common.dbus import location
from gajim.common.dbus import logind from gajim.common.dbus import logind
from gajim.common.dbus import music_track from gajim.common.dbus import music_track
from gajim.common.passwords import KEYRING_AVAILABLE
from gajim import gui_menu_builder from gajim import gui_menu_builder
from gajim.dialog_messages import get_dialog from gajim.dialog_messages import get_dialog
...@@ -470,6 +471,8 @@ def on_cancel(): ...@@ -470,6 +471,8 @@ def on_cancel():
self.pass_dialog[account] = PassphraseDialog( self.pass_dialog[account] = PassphraseDialog(
_('Password Required'), text, _('Save password'), ok_handler=on_ok, _('Password Required'), text, _('Save password'), ok_handler=on_ok,
cancel_handler=on_cancel) cancel_handler=on_cancel)
sensitive = not app.settings.get('use_keyring') or KEYRING_AVAILABLE
self.pass_dialog[account]._ui.save_passphrase_checkbutton.set_sensitive(sensitive)
def handle_event_roster_info(self, obj): def handle_event_roster_info(self, obj):
#('ROSTER_INFO', account, (jid, name, sub, ask, groups)) #('ROSTER_INFO', account, (jid, name, sub, ask, groups))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment