diff options
author | Xan Lopez <xlopez@igalia.com> | 2011-06-25 10:16:47 +0800 |
---|---|---|
committer | Xan Lopez <xlopez@igalia.com> | 2011-06-25 10:16:47 +0800 |
commit | 81b7d6c3ece40c5b42f253834e25bd71f45382b0 (patch) | |
tree | 1757d2085cc63f2757987f513d47fc2d733119db /src/popup-commands.c | |
parent | 4a0ffa6fab9d64452e56504826f844f92a09c758 (diff) | |
download | gsoc2013-epiphany-81b7d6c3ece40c5b42f253834e25bd71f45382b0.tar gsoc2013-epiphany-81b7d6c3ece40c5b42f253834e25bd71f45382b0.tar.gz gsoc2013-epiphany-81b7d6c3ece40c5b42f253834e25bd71f45382b0.tar.bz2 gsoc2013-epiphany-81b7d6c3ece40c5b42f253834e25bd71f45382b0.tar.lz gsoc2013-epiphany-81b7d6c3ece40c5b42f253834e25bd71f45382b0.tar.xz gsoc2013-epiphany-81b7d6c3ece40c5b42f253834e25bd71f45382b0.tar.zst gsoc2013-epiphany-81b7d6c3ece40c5b42f253834e25bd71f45382b0.zip |
popup-commands: make 'Use picture as background' work again
Things are done differently in GNOME3.
Bug #647604
Diffstat (limited to 'src/popup-commands.c')
-rw-r--r-- | src/popup-commands.c | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/src/popup-commands.c b/src/popup-commands.c index 14867c411..d12e05ed7 100644 --- a/src/popup-commands.c +++ b/src/popup-commands.c @@ -26,6 +26,7 @@ #include "ephy-embed-container.h" #include "ephy-embed-utils.h" #include "ephy-prefs.h" +#include "ephy-settings.h" #include "ephy-file-helpers.h" #include "ephy-file-chooser.h" #include "ephy-bookmarks-ui.h" @@ -296,32 +297,16 @@ popup_cmd_save_image_as (GtkAction *action, window, TRUE, "image-uri"); } -#define GNOME_APPEARANCE_PROPERTIES "gnome-appearance-properties.desktop" - static void background_download_completed (EphyDownload *download, GtkWidget *window) { - char *bg; - guint32 user_time; - - user_time = ephy_download_get_start_time (download); + const char *uri; + GSettings *settings; - bg = g_filename_from_uri (ephy_download_get_destination_uri (download), NULL, NULL); - - /* open the Appearance Properties capplet on the Background tab */ - if (!ephy_file_launch_desktop_file (GNOME_APPEARANCE_PROPERTIES, bg, user_time, window)) - { - /* Fallback for <= 2.18 desktop: try to open the "Background Properties" capplet */ - if (!ephy_file_launch_desktop_file ("background.desktop", bg, user_time, window)) - { - /* If the above try didn't work, then we try the Fedora name. - * This is a fix for #387206, but is actually a workaround for - * bugzilla.redhat.com #201867 */ - ephy_file_launch_desktop_file ("gnome-background.desktop", bg, user_time, window); - } - } - g_free (bg); + uri = ephy_download_get_destination_uri (download); + settings = ephy_settings_get ("org.gnome.desktop.background"); + g_settings_set_string (settings, "picture-uri", uri); } void @@ -345,7 +330,7 @@ popup_cmd_set_image_as_background (GtkAction *action, base = g_path_get_basename (location); base_converted = g_filename_from_utf8 (base, -1, NULL, NULL, NULL); - dest = g_build_filename (ephy_dot_dir (), base_converted, NULL); + dest = g_build_filename (g_get_home_dir (), "Pictures", base_converted, NULL); dest_uri = g_filename_to_uri (dest, NULL, NULL); ephy_download_set_destination_uri (download, dest_uri); |