Daniel Brötzmann pushed to branch master at gajim / gajim
Commits:
9e861b2f by wurstsalat at 2024-06-01T17:33:07+02:00
fix: Preview: Catch permissions related exceptions when trying to save as
- - - - -
1 changed file:
- gajim/gtk/main.py
Changes:
=====================================
gajim/gtk/main.py
=====================================
@@ -647,7 +647,16 @@ def _on_ok(paths: list[str]) -> None:
transient_for=self)
return
- shutil.copyfile(preview.orig_path, target_path)
+ try:
+ shutil.copyfile(preview.orig_path, target_path)
+ except PermissionError as e:
+ ErrorDialog(
+ _('Could not save file'),
+ _('You do not have permissions for this directory.\n'
+ 'Error: %s.') % e,
+ transient_for=self)
+ return
+
app.settings.set('last_save_dir', str(target_path.parent))
if not preview.orig_exists:
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/9e861b2f3aab2976a2dbe5cefcf2db149f9b4388
--
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/9e861b2f3aab2976a2dbe5cefcf2db149f9b4388
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]