summaryrefslogtreecommitdiff
path: root/src/DesktopIntegration.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2014-09-23 09:36:56 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2014-09-23 09:36:56 +0200
commit8004f1a7ad3cc6a3659517f3374bdf1b63416b24 (patch)
treeb7b82cc6e01cd47d22f660e25508a7d8d555dc89 /src/DesktopIntegration.vala
parent28c68a75acac7ac3ce7fb169bc6aa65e16551c53 (diff)
parent566dc060676b41e1e58a446b7dcc4159e242fee6 (diff)
Merge tag 'upstream/0.20.0'
Upstream version 0.20.0
Diffstat (limited to 'src/DesktopIntegration.vala')
-rw-r--r--src/DesktopIntegration.vala25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/DesktopIntegration.vala b/src/DesktopIntegration.vala
index ebdc45e..9978803 100644
--- a/src/DesktopIntegration.vala
+++ b/src/DesktopIntegration.vala
@@ -16,6 +16,9 @@ private ExporterUI desktop_slideshow_exporter = null;
private double desktop_slideshow_transition = 0.0;
private double desktop_slideshow_duration = 0.0;
+private bool set_desktop_background = false;
+private bool set_screensaver = false;
+
public void init() {
if (init_count++ != 0)
return;
@@ -152,7 +155,7 @@ private void on_send_to_export_completed(Exporter exporter, bool is_cancelled) {
send_to_exporter = null;
}
-public void set_background(Photo photo) {
+public void set_background(Photo photo, bool desktop, bool screensaver) {
// attempt to set the wallpaper to the photo's native format, but if not writeable, go to the
// system default
PhotoFileFormat file_format = photo.get_best_export_file_format();
@@ -174,7 +177,12 @@ public void set_background(Photo photo) {
return;
}
- Config.Facade.get_instance().set_desktop_background(save_as.get_path());
+ if (desktop) {
+ Config.Facade.get_instance().set_desktop_background(save_as.get_path());
+ }
+ if (screensaver) {
+ Config.Facade.get_instance().set_screensaver(save_as.get_path());
+ }
GLib.FileUtils.chmod(save_as.get_parse_name(), 0644);
}
@@ -254,10 +262,14 @@ private class BackgroundSlideshowXMLBuilder {
}
}
-public void set_background_slideshow(Gee.Collection<Photo> photos, double duration, double transition) {
+public void set_background_slideshow(Gee.Collection<Photo> photos, double duration, double transition,
+ bool desktop_background, bool screensaver) {
if (desktop_slideshow_exporter != null)
return;
+ set_desktop_background = desktop_background;
+ set_screensaver = screensaver;
+
File wallpaper_dir = AppDirs.get_data_subdir("wallpaper");
Gee.Set<string> exceptions = new Gee.HashSet<string>();
@@ -302,7 +314,12 @@ private void on_desktop_slideshow_exported(Exporter exporter, bool is_cancelled)
return;
}
- Config.Facade.get_instance().set_desktop_background(xml_file.get_path());
+ if (set_desktop_background) {
+ Config.Facade.get_instance().set_desktop_background(xml_file.get_path());
+ }
+ if (set_screensaver) {
+ Config.Facade.get_instance().set_screensaver(xml_file.get_path());
+ }
}
}