Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
gajim
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
209
Issues
209
List
Boards
Labels
Service Desk
Milestones
Merge Requests
21
Merge Requests
21
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gajim
gajim
Commits
b543f1ab
Commit
b543f1ab
authored
Feb 17, 2021
by
Philipp Hörist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Profile: Show error if avatar upload fails
parent
d58d6126
Pipeline
#7363
passed with stages
in 7 minutes and 8 seconds
Changes
1
Pipelines
4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
2 deletions
+26
-2
gajim/gtk/profile.py
gajim/gtk/profile.py
+26
-2
No files found.
gajim/gtk/profile.py
View file @
b543f1ab
...
...
@@ -236,8 +236,10 @@ def _on_save_clicked(self, _widget):
else
:
# Only update avatar if it changed
con
.
get_module
(
'UserAvatar'
).
set_avatar
(
self
.
_new_avatar
,
public
=
public
)
con
.
get_module
(
'UserAvatar'
).
set_avatar
(
self
.
_new_avatar
,
public
=
public
,
callback
=
self
.
_on_set_avatar
)
nick
=
GLib
.
markup_escape_text
(
self
.
_ui
.
nickname_entry
.
get_text
())
con
.
get_module
(
'UserNickname'
).
set_nickname
(
nick
,
public
=
public
)
...
...
@@ -247,6 +249,28 @@ def _on_save_clicked(self, _widget):
self
.
account
,
'name'
)
app
.
nicks
[
self
.
account
]
=
nick
def
_on_set_avatar
(
self
,
task
):
try
:
task
.
finish
()
except
StanzaError
as
error
:
if
self
.
_new_avatar
is
None
:
# Trying to remove the avatar but the node does not exist
if
error
.
condition
==
'item-not-found'
:
return
title
=
_
(
'Error while uploading avatar'
)
text
=
error
.
get_text
()
if
(
error
.
condition
==
'not-acceptable'
and
error
.
app_condition
==
'payload-too-big'
):
text
=
_
(
'Avatar file size too big'
)
ErrorDialog
(
title
,
text
)
self
.
_ui
.
avatar_image
.
set_from_surface
(
self
.
_current_avatar
)
self
.
_new_avatar
=
False
return
def
_on_remove_avatar
(
self
,
_button
):
contact
=
app
.
contacts
.
create_contact
(
self
.
_jid
,
self
.
account
)
scale
=
self
.
get_scale_factor
()
...
...
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