Add an Apply button
2006-01-26 Rodney Dawes <dobey@novell.com> * gnome-background-properties.glade: Add an Apply button * gnome-wp-capplet.[ch]: Replace old_filename with an old_item struct (gnome_wp_props_wp_set): Set the filename key to empty string when setting the background to "No Wallpaper" (gnome_wp_props_revert): New method to revert changes in the dialog when the Cancel button is clicked (gnome_wp_main_quit): Free the old_item structure (wallpaper_properties_clicked): Handle the Apply button Handle closing the dialog for OK separately from Cancel/delete_event Revert the settings when Cancel or wm "x" or ESC are clicked (gnome_wp_load_stuffs): Set the old_item to the currently selected background setting, whether it be an image or "No Wallpaper" * gnome-wp-info.c (gnome_wp_info_dup): If info is NULL, just return NULL rather than trying to access members of an empty struct * gnome-wp-item.[ch] (gnome_wp_item_dup): New method to create a duplicate and newly allocated GnomeWPItem structure Fixes #327335
This commit is contained in:
parent
cbc6eb679e
commit
f69be2bd96
7 changed files with 144 additions and 8 deletions
|
@ -109,6 +109,44 @@ void gnome_wp_item_free (GnomeWPItem * item) {
|
|||
item = NULL;
|
||||
}
|
||||
|
||||
GnomeWPItem * gnome_wp_item_dup (GnomeWPItem * item) {
|
||||
GnomeWPItem * new_item;
|
||||
GdkColor color1, color2;
|
||||
|
||||
if (item == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
new_item = g_new0 (GnomeWPItem, 1);
|
||||
|
||||
new_item->name = g_strdup (item->name);
|
||||
new_item->filename = g_strdup (item->filename);
|
||||
new_item->description = g_strdup (item->description);
|
||||
new_item->imguri = g_strdup (item->imguri);
|
||||
new_item->options = g_strdup (item->options);
|
||||
new_item->shade_type = g_strdup (item->shade_type);
|
||||
|
||||
new_item->pri_color = g_strdup (item->pri_color);
|
||||
new_item->sec_color = g_strdup (item->sec_color);
|
||||
|
||||
gdk_color_parse (item->pri_color, &color1);
|
||||
gdk_color_parse (item->sec_color, &color2);
|
||||
|
||||
item->pcolor = gdk_color_copy (&color1);
|
||||
item->scolor = gdk_color_copy (&color2);
|
||||
|
||||
new_item->fileinfo = gnome_wp_info_dup (item->fileinfo);
|
||||
new_item->uriinfo = gnome_wp_info_dup (item->uriinfo);
|
||||
|
||||
new_item->rowref = gtk_tree_row_reference_copy (item->rowref);
|
||||
|
||||
new_item->deleted = item->deleted;
|
||||
new_item->width = item->width;
|
||||
new_item->height = item->height;
|
||||
|
||||
return new_item;
|
||||
}
|
||||
|
||||
static void collect_save_options (GdkPixbuf * pixbuf,
|
||||
gchar *** keys,
|
||||
gchar *** vals,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue