Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Georg Pfuetzenreuter
gajim
Commits
b7ca7c20
Commit
b7ca7c20
authored
May 04, 2021
by
Philipp Hörist
Browse files
Profile: Fix privacy switch inital state
parent
022275e8
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
gajim/data/gui/profile.ui
View file @
b7ca7c20
This diff is collapsed.
Click to expand it.
gajim/gtk/profile.py
View file @
b7ca7c20
...
...
@@ -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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment