add shortcut for /usr/share/backgrounds to background file chooser and
2007-11-18 Jens Granseuer <jensgr@gmx.net> * appearance-desktop.c: (desktop_init): add shortcut for /usr/share/backgrounds to background file chooser and also consider it when setting the initial directory (bug #497807) svn path=/trunk/; revision=8289
This commit is contained in:
parent
a49486ebd6
commit
25e6047256
2 changed files with 18 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
|||
2007-11-18 Jens Granseuer <jensgr@gmx.net>
|
||||
|
||||
* appearance-desktop.c: (desktop_init): add shortcut for
|
||||
/usr/share/backgrounds to background file chooser and also consider it
|
||||
when setting the initial directory (bug #497807)
|
||||
|
||||
2007-11-11 Jens Granseuer <jensgr@gmx.net>
|
||||
|
||||
* appearance-style.c: (changed_on_disk_cb):
|
||||
|
|
|
@ -944,6 +944,7 @@ desktop_init (AppearanceData *data,
|
|||
GtkCellRenderer *cr;
|
||||
GtkFileFilter *filter;
|
||||
const gchar *pictures;
|
||||
const gchar *start_dir;
|
||||
|
||||
g_object_set (gtk_settings_get_default (), "gtk-tooltip-timeout", 500, NULL);
|
||||
|
||||
|
@ -1077,12 +1078,22 @@ desktop_init (AppearanceData *data,
|
|||
gtk_file_chooser_set_select_multiple (data->wp_filesel, TRUE);
|
||||
gtk_file_chooser_set_use_preview_label (data->wp_filesel, FALSE);
|
||||
|
||||
start_dir = g_get_home_dir ();
|
||||
|
||||
if (g_file_test ("/usr/share/backgrounds", G_FILE_TEST_IS_DIR)) {
|
||||
gtk_file_chooser_add_shortcut_folder (data->wp_filesel,
|
||||
"/usr/share/backgrounds", NULL);
|
||||
start_dir = "/usr/share/backgrounds";
|
||||
}
|
||||
|
||||
pictures = g_get_user_special_dir (G_USER_DIRECTORY_PICTURES);
|
||||
if (pictures != NULL && g_file_test (pictures, G_FILE_TEST_IS_DIR)) {
|
||||
gtk_file_chooser_add_shortcut_folder (data->wp_filesel, pictures, NULL);
|
||||
gtk_file_chooser_set_current_folder (data->wp_filesel, pictures);
|
||||
start_dir = pictures;
|
||||
}
|
||||
|
||||
gtk_file_chooser_set_current_folder (data->wp_filesel, start_dir);
|
||||
|
||||
filter = gtk_file_filter_new ();
|
||||
gtk_file_filter_add_pixbuf_formats (filter);
|
||||
gtk_file_filter_set_name (filter, _("Images"));
|
||||
|
|
Loading…
Add table
Reference in a new issue