diff options
author | Felix Riemann <friemann@gnome.org> | 2009-07-24 12:31:47 +0200 |
---|---|---|
committer | Felix Riemann <friemann@gnome.org> | 2009-07-24 12:45:19 +0200 |
commit | 80cc24682e6da921d73ca6b71d517938eaf34649 (patch) | |
tree | fcd0028dbd23750cb57704de19f1b5feb3f7a5f6 | |
parent | 994f74bf891b639d3a5f53b11e9d113694e3d674 (diff) | |
download | eog-80cc24682e6da921d73ca6b71d517938eaf34649.tar.gz |
Bug 589151 – Let filechooser fall back to user's pictures folder
Add a (for now) hidden option to have the filechooser show the user's
picture folder ($XDG_PICTURES_DIR) when no image is loaded in the
current window. If the folder had not been set up it will fall back to
show the currrent working directory. The option has been enabled by
default as it seems to be useful on the average desktop system.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | data/eog.schemas.in | 11 | ||||
-rw-r--r-- | src/eog-config-keys.h | 1 | ||||
-rw-r--r-- | src/eog-window.c | 14 |
4 files changed, 34 insertions, 0 deletions
@@ -1,3 +1,11 @@ +2009-07-24 Felix Riemann <friemann@gnome.org> + + * data/eog.schemas.in: + * src/eog-config-keys.h: + * src/eog-window.c (eog_window_cmd_file_open): + Add and enable option to have the filechooser show the user's + picture folder when no image is loaded. Fixes bug #589151. + 2009-07-23 Claudio Saavedra <csaavedra@igalia.com> * src/eog-thumb-view.c: (eog_thumb_view_init): Do not check for diff --git a/data/eog.schemas.in b/data/eog.schemas.in index 7fff4c50..6f4615cf 100644 --- a/data/eog.schemas.in +++ b/data/eog.schemas.in @@ -231,6 +231,17 @@ </schema> <schema> + <key>/schemas/apps/eog/ui/filechooser_xdg_fallback</key> + <applyto>/apps/eog/ui/filechooser_xdg_fallback</applyto> + <owner>eog</owner> + <type>bool</type> + <default>1</default> + <locale name="C"> + <short>Whether the filechooser should show the user's pictures folder if no images are loaded.</short> + <long>If activated and no image is loaded in the active window, the filechooser will display the user's pictures folder using the XDG special user directories. If deactivated or the pictures folder has not been set up it will show the current working directory</long> + </schema> + + <schema> <key>/schemas/apps/eog/plugins/active_plugins</key> <applyto>/apps/eog/plugins/active_plugins</applyto> <owner>eog</owner> diff --git a/src/eog-config-keys.h b/src/eog-config-keys.h index f4da0342..b66f797a 100644 --- a/src/eog-config-keys.h +++ b/src/eog-config-keys.h @@ -53,6 +53,7 @@ #define EOG_CONF_UI_SIDEBAR "/apps/eog/ui/sidebar" #define EOG_CONF_UI_SCROLL_BUTTONS "/apps/eog/ui/scroll_buttons" #define EOG_CONF_UI_DISABLE_TRASH_CONFIRMATION "/apps/eog/ui/disable_trash_confirmation" +#define EOG_CONF_UI_FILECHOOSER_XDG_FALLBACK "/apps/eog/ui/filechooser_xdg_fallback" #define EOG_CONF_PLUGINS_ACTIVE_PLUGINS "/apps/eog/plugins/active_plugins" diff --git a/src/eog-window.c b/src/eog-window.c index 709e4df1..b9ae5066 100644 --- a/src/eog-window.c +++ b/src/eog-window.c @@ -2365,6 +2365,20 @@ eog_window_cmd_file_open (GtkAction *action, gpointer user_data) g_free (file_uri); g_free (dir_uri); g_object_unref (current); + } else { + /* If desired by the user, + fallback to the XDG_PICTURES_DIR (if available) */ + const gchar *pics_dir; + gboolean use_fallback; + + use_fallback = gconf_client_get_bool (priv->client, + EOG_CONF_UI_FILECHOOSER_XDG_FALLBACK, + NULL); + pics_dir = g_get_user_special_dir (G_USER_DIRECTORY_PICTURES); + if (use_fallback && pics_dir) { + gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dlg), + pics_dir); + } } g_signal_connect (dlg, "response", |