[gnome-control-center] background: Allow adding multiple images
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] background: Allow adding multiple images
- Date: Fri, 8 Apr 2011 12:42:10 +0000 (UTC)
commit 58e4fab6bed1ed4bfe69824341d7b5f434b9aadf
Author: Bastien Nocera <hadess hadess net>
Date: Fri Apr 8 13:41:05 2011 +0100
background: Allow adding multiple images
https://bugzilla.gnome.org/show_bug.cgi?id=647053
panels/background/cc-background-panel.c | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/panels/background/cc-background-panel.c b/panels/background/cc-background-panel.c
index 42b37cc..2ba9c56 100644
--- a/panels/background/cc-background-panel.c
+++ b/panels/background/cc-background-panel.c
@@ -857,7 +857,7 @@ file_chooser_response (GtkDialog *chooser,
gint response,
CcBackgroundPanel *panel)
{
- char *uri;
+ GSList *selected, *l;
if (response != GTK_RESPONSE_ACCEPT)
{
@@ -865,11 +865,16 @@ file_chooser_response (GtkDialog *chooser,
return;
}
- uri = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (chooser));
+ selected = gtk_file_chooser_get_uris (GTK_FILE_CHOOSER (chooser));
gtk_widget_destroy (GTK_WIDGET (chooser));
- add_custom_wallpaper (panel, uri);
- g_free (uri);
+ for (l = selected; l != NULL; l = l->next)
+ {
+ char *uri = l->data;
+ add_custom_wallpaper (panel, uri);
+ g_free (uri);
+ }
+ g_slist_free (selected);
}
static void
@@ -962,6 +967,7 @@ add_button_clicked (GtkButton *button,
GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
NULL);
gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (chooser), filter);
+ gtk_file_chooser_set_select_multiple (GTK_FILE_CHOOSER (chooser), TRUE);
gtk_window_set_modal (GTK_WINDOW (chooser), TRUE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]