Newer
Older
SettingsDialog.__init__(self, parent, _('Priority'),
# Update priority
if self.account not in app.connections:
return
client = app.get_client(self.account)
show = client.status
status = client.status_message
client.change_status(show, status)
def __init__(self, account: str, parent: Gtk.Window) -> None:
type_values = ('START TLS', 'DIRECT TLS', 'PLAIN')
Setting(SettingKind.SWITCH,
_('Enable'),
Setting(SettingKind.ENTRY,
_('Hostname'),
SettingType.ACCOUNT_CONFIG,
'custom_host',
bind='account::use_custom_host'),
Setting(SettingKind.SPIN,
_('Port'),
SettingType.ACCOUNT_CONFIG,
'custom_port',
bind='account::use_custom_host',
props={'range_': (0, 65535)},),
Setting(SettingKind.COMBO,
_('Type'),
SettingType.ACCOUNT_CONFIG,
'custom_type',
bind='account::use_custom_host',
props={'combo_items': type_values}),
SettingsDialog.__init__(self, parent, _('Connection Settings'),
def __init__(self, account: str, parent: Gtk.Window) -> None:
Setting(SettingKind.FILECHOOSER,
_('Client Certificate'),
SettingType.ACCOUNT_CONFIG,
'client_cert',
props={'filefilter': (_('PKCS12 Files'), '*.p12')}),
Setting(SettingKind.SWITCH,
_('Encrypted Certificate'),
SettingType.ACCOUNT_CONFIG,
'client_cert_encrypted'),
SettingsDialog.__init__(self, parent, _('Certificate Settings'),
def __init__(self, account: str, parent: Gtk.Window) -> None:
Setting(SettingKind.ENTRY,
_('Password'),
SettingType.ACCOUNT_CONFIG,
'password',
Setting(SettingKind.SWITCH,
_('Save Password'),
SettingType.ACCOUNT_CONFIG,
'savepass',
enabled_func=(lambda: not app.settings.get('use_keyring')
or passwords.KEYRING_AVAILABLE)),
Setting(SettingKind.CHANGEPASSWORD,
_('Change Password'),
SettingType.DIALOG,
callback=self.on_password_change,
Setting(SettingKind.SWITCH,
_('Use GSSAPI'),
SettingType.ACCOUNT_CONFIG,
'enable_gssapi'),
SettingsDialog.__init__(self, parent, _('Login Settings'),
def on_password_change(self, new_password: str, _data: Any) -> None:
passwords.save_password(self.account, new_password)
savepass = app.settings.get_account_setting(self.account, 'savepass')