Philipp Hörist pushed to branch master at gajim / gajim
Commits: 49780177 by lovetox at 2020-08-23T11:45:06+02:00 Remove subscribe_nick config option
- - - - - e466e5a4 by lovetox at 2020-08-23T11:50:23+02:00 Merge subscribe settings
- - - - - 54f99da5 by lovetox at 2020-08-23T12:46:59+02:00 Accounts: Make more settings available
- - - - -
3 changed files:
- gajim/common/config.py - gajim/common/helpers.py - gajim/gtk/accounts.py
Changes:
===================================== gajim/common/config.py ===================================== @@ -277,7 +277,7 @@ class Config: 'keyid': [opt_str, '', '', True], 'keyname': [opt_str, '', '', True], 'use_plain_connection': [opt_bool, False, _('Use an unencrypted connection to the server')], - 'action_when_plain_connection': [opt_str, 'warn', _('Show a warning dialog before sending password on an plaintext connection. Can be 'warn', or 'none'.')], + 'confirm_unencrypted_connection': [opt_bool, True], 'use_custom_host': [opt_bool, False, '', True], 'custom_port': [opt_int, 5222, '', True], 'custom_host': [opt_str, '', '', True], @@ -304,11 +304,7 @@ class Config: 'answer_receipts': [opt_bool, True, _('If enabled, Gajim will answer to message receipt requests.')], 'publish_tune': [opt_bool, False], 'publish_location': [opt_bool, False], - 'subscribe_mood': [opt_bool, True], - 'subscribe_activity': [opt_bool, True], - 'subscribe_tune': [opt_bool, True], - 'subscribe_nick': [opt_bool, True], - 'subscribe_location': [opt_bool, True], + 'request_user_data': [opt_bool, True], 'ignore_unknown_contacts': [opt_bool, False], 'send_os_info': [opt_bool, True, _('Allow Gajim to send information about the operating system you are running.')], 'send_time_info': [opt_bool, True, _('Allow Gajim to send your local time.')],
===================================== gajim/common/helpers.py ===================================== @@ -802,16 +802,14 @@ def get_current_show(account):
def get_optional_features(account): features = [] - if app.config.get_per('accounts', account, 'subscribe_mood'): + if app.config.get_per('accounts', account, 'request_user_data'): features.append(Namespace.MOOD + '+notify') - if app.config.get_per('accounts', account, 'subscribe_activity'): features.append(Namespace.ACTIVITY + '+notify') - if app.config.get_per('accounts', account, 'subscribe_tune'): features.append(Namespace.TUNE + '+notify') - if app.config.get_per('accounts', account, 'subscribe_nick'): - features.append(Namespace.NICK + '+notify') - if app.config.get_per('accounts', account, 'subscribe_location'): features.append(Namespace.LOCATION + '+notify') + + features.append(Namespace.NICK + '+notify') + if app.connections[account].get_module('Bookmarks').using_bookmark_2: features.append(Namespace.BOOKMARKS_2 + '+notify') elif app.connections[account].get_module('Bookmarks').using_bookmark_1: @@ -1395,7 +1393,7 @@ def get_custom_host(account):
def warn_about_plain_connection(account, connection_types): warn = app.config.get_per( - 'accounts', account, 'action_when_plain_connection') == 'warn' + 'accounts', account, 'confirm_unencrypted_connection') for type_ in connection_types: if type_.is_plain and warn: return True
===================================== gajim/gtk/accounts.py ===================================== @@ -309,6 +309,7 @@ class AccountSubMenu(Gtk.ListBox): if account != 'Local': self.add(PageMenuItem('privacy', _('Privacy'))) self.add(PageMenuItem('connection', _('Connection'))) + self.add(PageMenuItem('advanced', _('Advanced'))) self.add(RemoveMenuItem())
@property @@ -400,6 +401,8 @@ class PageMenuItem(MenuItem): icon = 'preferences-system-privacy-symbolic' elif name == 'connection': icon = 'preferences-system-network-symbolic' + elif name == 'advanced': + icon = 'preferences-other-symbolic' else: icon = 'dialog-error-symbolic'
@@ -422,6 +425,7 @@ class Account: self._settings.add_page(GeneralPage(account)) self._settings.add_page(ConnectionPage(account)) self._settings.add_page(PrivacyPage(account)) + self._settings.add_page(AdvancedPage(account))
self._account_row = AccountRow(account) self._menu.add_account(self._account_row) @@ -675,6 +679,10 @@ class PrivacyPage(GenericSettingPage): desc=_('Ignore everything from contacts not in your ' 'Roster')),
+ Setting(SettingKind.SWITCH, _('Send Message Receipts'), + SettingType.ACCOUNT_CONFIG, 'answer_receipts', + desc=_('Tell your contacts if you received a message')), + ] GenericSettingPage.__init__(self, account, settings)
@@ -698,8 +706,42 @@ class ConnectionPage(GenericSettingPage):
Setting(SettingKind.PRIORITY, _('Priority'), SettingType.DIALOG, props={'dialog': PriorityDialog}), + + Setting(SettingKind.SWITCH, _('Use Unencrypted Connection'), + SettingType.ACCOUNT_CONFIG, 'use_plain_connection', + desc=_('Use an unencrypted connection to the server')), + + Setting(SettingKind.SWITCH, _('Confirm Unencrypted Connection'), + SettingType.ACCOUNT_CONFIG, + 'confirm_unencrypted_connection', + desc=_('Show a confirmation dialog before connecting ' + 'unencrypted')), ] + GenericSettingPage.__init__(self, account, settings) +
+class AdvancedPage(GenericSettingPage): + + name = 'advanced' + + def __init__(self, account): + + settings = [ + Setting(SettingKind.SWITCH, _('Contact Information'), + SettingType.ACCOUNT_CONFIG, 'request_user_data', + desc=_('Request contact information ' + '(Mood, Activity, Tune, Location)')), + + Setting(SettingKind.SWITCH, _('Accept all Contact Requests'), + SettingType.ACCOUNT_CONFIG, 'autoauth', + desc=_('Automatically accept all contact requests')), + + Setting(SettingKind.COMBO, _('Filetransfer Preference'), + SettingType.ACCOUNT_CONFIG, 'filetransfer_preference', + props={'combo_items': ['httpupload', 'jingle']}, + desc=_('Preferred file transfer mechanism for ' + 'file drag&drop on a chat window')) + ] GenericSettingPage.__init__(self, account, settings)
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/e8cf6a27e80fc9260b38638cbff16d70...