diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2024-07-06 21:08:16 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2024-07-06 21:08:16 +0200 |
commit | 80aa3fe15f6346102c29b9c4236fe1e89c283d3b (patch) | |
tree | ce74f3643b6d3e03050df0940e484d12235f9949 /src/DesktopIntegration.vala | |
parent | 79a133306dee3c727edf09655767987ec11e2c4f (diff) | |
parent | df7f03cb7f772b9a87896bfa189bccd4068d1963 (diff) |
Merge branch 'release/debian/0.32.7-1'debian/0.32.7-1
Diffstat (limited to 'src/DesktopIntegration.vala')
-rw-r--r-- | src/DesktopIntegration.vala | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/DesktopIntegration.vala b/src/DesktopIntegration.vala index 754d9a1..d29e0f7 100644 --- a/src/DesktopIntegration.vala +++ b/src/DesktopIntegration.vala @@ -105,13 +105,13 @@ public async void files_send_to(File[] files) { } AppWindow.get_instance().set_busy_cursor(); - try{ - var portal = new Xdp.Portal(); + try { + var portal = new Xdp.Portal.initable_new(); // Use empty list for addresses instead of null to word around bug in xdg-desktop-portal-gtk yield portal.compose_email(parent, {null}, null, null, _("Send files per Mail: ") + file_names.str, null, file_paths, Xdp.EmailFlags.NONE, null); - } catch (Error e){ + } catch (Error e) { // Translators: The first %s is the name of the file, the second %s is the reason why it could not be sent AppWindow.error_message(_("Unable to send file %s, %s").printf( file_names.str, e.message)); @@ -175,12 +175,16 @@ public void set_background(Photo photo, bool desktop, bool screensaver) { } var parent = Xdp.parent_new_gtk(AppWindow.get_instance()); - var portal = new Xdp.Portal(); Xdp.WallpaperFlags flags = Xdp.WallpaperFlags.PREVIEW; if (desktop) flags |= Xdp.WallpaperFlags.BACKGROUND; if (screensaver) flags |= Xdp.WallpaperFlags.LOCKSCREEN; - portal.set_wallpaper.begin(parent, save_as.get_uri(), flags, null); + try { + var portal = new Xdp.Portal.initable_new(); + portal.set_wallpaper.begin(parent, save_as.get_uri(), flags, null); + } catch (Error err) { + AppWindow.error_message(_("Unable to set background: %s").printf(err.message)); + } GLib.FileUtils.chmod(save_as.get_parse_name(), 0644); } @@ -313,12 +317,16 @@ private void on_desktop_slideshow_exported(Exporter exporter, bool is_cancelled) } var parent = Xdp.parent_new_gtk(AppWindow.get_instance()); - var portal = new Xdp.Portal(); Xdp.WallpaperFlags flags = Xdp.WallpaperFlags.PREVIEW; if (set_desktop_background) flags |= Xdp.WallpaperFlags.BACKGROUND; if (set_screensaver) flags |= Xdp.WallpaperFlags.LOCKSCREEN; - portal.set_wallpaper.begin(parent, xml_file.get_uri(), flags, null); + try { + var portal = new Xdp.Portal.initable_new(); + portal.set_wallpaper.begin(parent, xml_file.get_uri(), flags, null); + } catch (Error err) { + AppWindow.error_message(_("Unable to set background: %s").printf(err.message)); + } } } |