Adapt to upstream app.settings changes
This commit is contained in:
@@ -96,16 +96,16 @@ class ClickableNicknames(GajimPlugin):
|
||||
|
||||
# Remove Space
|
||||
nickname = nickname[:-1]
|
||||
nickname = nickname.rstrip(app.config.get('after_nickname'))
|
||||
nickname = nickname.rstrip(app.settings.get('after_nickname'))
|
||||
# Remove direction mark
|
||||
nickname = nickname[:-1]
|
||||
nickname = nickname.lstrip(app.config.get('before_nickname'))
|
||||
nickname = nickname.lstrip(app.settings.get('before_nickname'))
|
||||
|
||||
message_input.grab_focus()
|
||||
if not message_input.has_text():
|
||||
# There is no text add refer char
|
||||
nickname = '%s%s ' % (nickname,
|
||||
app.config.get('gc_refer_to_nick_char'))
|
||||
app.settings.get('gc_refer_to_nick_char'))
|
||||
else:
|
||||
input_buffer = message_input.get_buffer()
|
||||
start, end = input_buffer.get_bounds()
|
||||
|
||||
@@ -76,8 +76,8 @@ class KeyStore:
|
||||
|
||||
def _migrate_v1_store(self):
|
||||
keys = {}
|
||||
attached_keys = app.config.get_per(
|
||||
'accounts', self._account, 'attached_gpg_keys')
|
||||
attached_keys = app.settings.get_account_setting(
|
||||
self._account, 'attached_gpg_keys')
|
||||
if not attached_keys:
|
||||
return
|
||||
attached_keys = attached_keys.split()
|
||||
@@ -88,13 +88,14 @@ class KeyStore:
|
||||
for jid, key_id in keys.items():
|
||||
self._set_contact_key_data_nosync(jid, (key_id, ''))
|
||||
|
||||
own_key_id = app.config.get_per('accounts', self._account, 'keyid')
|
||||
own_key_user = app.config.get_per('accounts', self._account, 'keyname')
|
||||
own_key_id = app.settings.get_account_setting(self._account, 'keyid')
|
||||
own_key_user = app.settings.get_account_setting(
|
||||
self._account, 'keyname')
|
||||
if own_key_id:
|
||||
self._set_own_key_data_nosync((own_key_id, own_key_user))
|
||||
|
||||
attached_keys = app.config.set_per(
|
||||
'accounts', self._account, 'attached_gpg_keys', '')
|
||||
attached_keys = app.settings.set_account_setting(
|
||||
self._account, 'attached_gpg_keys', '')
|
||||
self._log.info('Migration from store v1 was successful')
|
||||
|
||||
def _migrate_v2_store(self):
|
||||
|
||||
@@ -99,11 +99,11 @@ class SetLocationPlugin(GajimPlugin):
|
||||
if account is None:
|
||||
# Set geo for all accounts
|
||||
for acct in app.connections:
|
||||
if app.config.get_per('accounts', acct, 'publish_location'):
|
||||
if app.settings.get_account_setting(acct, 'publish_location'):
|
||||
app.connections[acct].get_module('UserLocation').set_location(
|
||||
LocationData(**data))
|
||||
|
||||
elif app.config.get_per('accounts', account, 'publish_location'):
|
||||
elif app.settings.get_account_setting(account, 'publish_location'):
|
||||
app.connections[account].get_module('UserLocation').set_location(
|
||||
LocationData(**data))
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ class UrlImagePreviewPlugin(GajimPlugin):
|
||||
if GLib.mkdir_with_parents(str(self._thumb_dir), 0o700) != 0:
|
||||
log.error('Failed to create: %s', self._thumb_dir)
|
||||
|
||||
if app.config.get('use_kib_mib'):
|
||||
if app.settings.get('use_kib_mib'):
|
||||
self._units = GLib.FormatSizeFlags.IEC_UNITS
|
||||
else:
|
||||
self._units = GLib.FormatSizeFlags.DEFAULT
|
||||
@@ -698,7 +698,7 @@ class UrlImagePreviewPlugin(GajimPlugin):
|
||||
return
|
||||
|
||||
FileSaveDialog(on_ok,
|
||||
path=app.config.get('last_save_dir'),
|
||||
path=app.settings.get('last_save_dir'),
|
||||
file_name=preview.filename,
|
||||
transient_for=app.app.get_active_window())
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ class Whiteboard(object):
|
||||
def _on_export_button_clicked(self, widget):
|
||||
SvgSaveDialog(self.image.export_svg,
|
||||
file_name=_('whiteboard.svg'),
|
||||
path=app.config.get('last_save_dir'),
|
||||
path=app.settings.get('last_save_dir'),
|
||||
transient_for=app.app.get_active_window())
|
||||
|
||||
def item_created(self, canvas, item, model):
|
||||
|
||||
Reference in New Issue
Block a user