Commit b7ca7c20 authored by Philipp Hörist's avatar Philipp Hörist

Profile: Fix privacy switch inital state

parent 022275e8
Pipeline #7736 failed with stages
in 4 minutes and 31 seconds
This diff is collapsed.
......@@ -125,14 +125,14 @@ def _on_access_model_received(self, task):
access_model = result == 'open'
if namespace == Namespace.VCARD4_PUBSUB:
self._ui.vcard_access.set_active(access_model)
self._set_vcard_access_switch(access_model)
else:
if self._avatar_nick_public is None:
self._avatar_nick_public = access_model
else:
self._avatar_nick_public = (self._avatar_nick_public and
self._avatar_nick_public = (self._avatar_nick_public or
access_model)
self._ui.avatar_nick_access.set_active(self._avatar_nick_public)
self._set_avatar_nick_access_switch(self._avatar_nick_public)
def _on_vcard_received(self, task):
try:
......@@ -324,13 +324,22 @@ def _on_update_avatar(self, _button):
self._ui.remove_avatar_button.show()
self._ui.profile_stack.set_visible_child_name('profile')
def _access_switch_toggled(self, *args):
avatar_nick_access = self._ui.avatar_nick_access.get_active()
vcard_access = self._ui.vcard_access.get_active()
self._ui.avatar_nick_access_label.set_text(
_('Everyone') if avatar_nick_access else _('Contacts'))
def _set_vcard_access_switch(self, state):
self._ui.vcard_access.set_active(state)
self._ui.vcard_access_label.set_text(
_('Everyone') if vcard_access else _('Contacts'))
_('Everyone') if state else _('Contacts'))
def _set_avatar_nick_access_switch(self, state):
self._ui.avatar_nick_access.set_active(state)
self._ui.avatar_nick_access_label.set_text(
_('Everyone') if state else _('Contacts'))
def _access_switch_toggled(self, *args):
state = self._ui.vcard_access.get_active()
self._set_vcard_access_switch(state)
state = self._ui.avatar_nick_access.get_active()
self._set_avatar_nick_access_switch(state)
def _on_save_finished(self, task):
try:
......
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