Commit graph

22 commits

Author SHA1 Message Date
Rodney Dawes
f69be2bd96 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
2006-01-27 03:01:58 +00:00
Rodney Dawes
569023b7b9 Update Copyright notice to include 2006 year
2006-01-14  Rodney Dawes  <dobey@novell.com>

	* *.[ch]: Update Copyright notice to include 2006 year

	* gnome-background-properties.glade: Change the main dialog to use
	explicit apply with OK and Cancel buttons
	Remove the icons from the "Add Wallpaper" and "Remove" buttons

	* gnome-wp-capplet.c (gnome_wp_props_wp_set): Add a new retval boolean
	so that we can return whether or not we are trying to set the wallpaper
	to the same image filename as before
	Remove all the UI updating code from here
	Fix a potential leak of the GConfChangeSet object
	(gnome_wp_props_wp_selected): Update the UI whenever a different
	wallpaper is selected in the list
	Remove the timeout to update gconf, as we are using explicit apply now
	(gnome_wp_main_quit): Free the old_filename variable
	Update the indentation style to match the rest of the code
	(wallpaper_properties_clicked): Handle setting the gconf keys when the
	OK button is clicked, and fall through to the cancel/close code
	(gnome_wp_scale_type_changed, gnome_wp_shade_type_changed):
	Don't set the gconf strings from here, only update when OK is clicked
	(gnome_wp_color_changed): Don't update gconf strings here
	Don't generate miniature icon thumbnails for the drop-down menu
	(gnome_wp_remove_wallpaper): Don't need to remove the idle id any more
	(gnome_wp_load_stuffs): Set the old_filename variable to the current
	setting that is stored in gconf for the wallpaper filename
	(gnome_wp_delay_changed): Remove this unused method
	(gnome_wp_icon_theme_changed): Don't need to update the icons in the
	drop-down menu here, as they are being removed
	(set_accessible_name): Don't need this any longer, as the drop-down
	menu items are now standard label menu items, and don't have icons
	(wallpaper_properties_init): No longer need the key repeat delay
	Fix some style issues with the glade_xml_get_widget calls
	Replace the menu items in the option menus with standard label items

	* gnome-wp-capplet.h (_GnomeWPCapplet): Remove the no longer needed
	Widget variables for updating the drop-down menu icons
	Remove the no longer needed delay and idleid variables
	Add an old_filename variable to compare against when OK is clicked

	Also should fix #316697
2006-01-14 20:53:58 +00:00
Alan Swanson
9c27b0926f Check for the scale type being zoom in the config, to set the option menu
2006-01-14  Alan Swanson <swanson@ukfsn.org>

	* gnome-wp-capplet.c (gnome_wp_option_menu_set): Check for the scale
	type being zoom in the config, to set the option menu
	(gnome_wp_scale_type_changed): Update the options for zoom type
	(gnome_wp_icon_theme_changed): Update the zoom icon in the menu
	(wallpaper_properties_init): Add an item for Zoom to the scaling menu

	* gnome-wp-capplet.h (_GnomeWPCapplet): Add a widget for the zoom item
	(GnomeWPScaleType): Add an enumeration for the zoom type

	* gnome-wp-item.c (gnome_wp_item_get_thumbnail): Add the code to
	generate a proper thumbnail for the new zoom option

	Fixes #105231
2006-01-14 16:10:24 +00:00
Rodney Dawes
95aec817a6 Remove utf8 validate check (gnome_wp_props_wp_set): If the filename we
2005-10-01  Rodney Dawes  <dobey@novell.com>

	* gnome-wp-capplet.c (gnome_wp_add_image): Remove utf8 validate check
	(gnome_wp_props_wp_set): If the filename we have for the image is not
	valid utf8, convert it to utf8 before setting the key in gconf
	(gnome_wp_load_stuffs, gnome_wp_file_changed): Make sure that the
	filename is valid utf8 and the file exists with utf8 encoding, or fall
	back to filename encoding as specified by the user with glib's
	environment variables

	* gnome-wpitem.c (gnome_wp_item_new): Make sure that the name field
	is always utf8 for displaying to the user with the tree view

	* gnome-wp-xml.c (gnome_wp_xml_load_xml): Make sure that the
	filename is valid utf8 and the file exists with utf8 encoding, or fall
	back to filename encoding as specified by the user with glib's
	environment variables
	(gnome_wp_xml_save_list): If the filename is not valid utf8, then
	convert to utf8 for storing in the XML file

	Fixes #168604
2005-10-01 21:29:39 +00:00
Rodney Dawes
422dd268e6 Fix some memory leaks by using a separate variable to store the escaped
2005-07-10  Rodney Dawes  <dobey@novell.com>

	* gnome-wp-info.c (gnome_wp_info_new): Fix some memory leaks by using
	a separate variable to store the escaped path, and md5sum

	* gnome-wp-item.c (gnome_wp_item_get_thumbnail): Fix a couple of
	memory leaks by using a separate variable to store the escaped path
	Don't unref the pixbuf from the thumbnail generation, and then try
	to load it again after saving
2005-07-10 15:58:14 +00:00
Rodney Dawes
05b1c2f1a3 Update Copyright to include current year
2005-02-26  Rodney Dawes  <dobey@novell.com>

	* *.[ch]: Update Copyright to include current year
2005-02-26 19:15:58 +00:00
Rodney Dawes
bdd4d0142e Add %F to Exec command line
2005-01-08  Rodney Dawes  <dobey@novell.com>

	* background.desktop.in.in: Add %F to Exec command line

	* gnome-wp-capplet.[ch] (gnome_wp_remove_wp): Check that the tree path
	is not NULL before removing items from the list store
	(gnome_wp_load_stuffs): Don't duplicate the code from
	gnome_wp_add_image/gnome_wp_capplet_scroll_to_item  here
	Load any images we were passed on the command line, and free the
	GSList that they were stored in after doing so
	(gnome_wp_file_changed): Clean up to just call gnome_wp_add_image and
	gnome_wp_capplet_scroll_to_item rather than duplicating the code
	(wallpaper_properties_init): Take a poptContext argument now
	Parse the poptContext into a GSList for loading the images from
	(main): Use a clearer variable name for the GnomeProgram object
	Get the poptContext from the GnomeProgram object and pass it through
	to wallpaper_properties_init

	Fixes #120720
2005-01-09 03:53:35 +00:00
Rodney Dawes
abc91a9a24 Fix the ngettext calling bit to actually work, and move the %d into the
2004-12-11  Rodney Dawes  <dobey@novell.com>

	* gnome-wp-item.c (gnome_wp_item_update_description):
	Fix the ngettext calling bit to actually work, and move the %d into
	the format string for g_strdup_print, so we don't say "%d pixels"
2004-12-11 20:31:40 +00:00
Rodney Dawes
418952b21a Change the description to use "W pixels x H pixels" and ngettext for each
2004-12-10  Rodney Dawes  <dobey@novell.com>

	* gnome-wp-item.c (gnome_wp_item_update_description):
	Change the description to use "W pixels x H pixels" and ngettext for
	each individual part, instead of just "W x H pixels" (#151425)

	* gnome-wp-xml.c (gnome_wp_xml_load_xml): Don't duplicate check to
	make sure that the root element is not NULL
2004-12-11 03:52:09 +00:00
Rodney Dawes
5ce9fb8666 Use g_markup_printf_escaped () to fill in the description
2004-10-14  Rodney Dawes  <dobey@novell.com>

	* gnome-wp-item.c (gnome_wp_item_update_description):
	Use g_markup_printf_escaped () to fill in the description

	Fixes #155184
2004-10-14 14:55:24 +00:00
Rodney Dawes
170a52c503 Unescape the filename so that we can laod the thumbnail and set the gconf
2004-09-29  Rodney Dawes  <dobey@novell.com>

	* gnome-wp-item.c (gnome_wp_item_new): Unescape the filename so that
	we can laod the thumbnail and set the gconf key properly

	Fixes #154003
2004-09-29 18:12:08 +00:00
Rodney Dawes
1be7aa7de7 Check that the colors aren't NULL before calling gdk_color_free
2004-09-22  Rodney Dawes  <dobey@novell.com>

	* gnome-wp-item.c (gnome_wp_item_free):
	Check that the colors aren't NULL before calling gdk_color_free

	* gnome-wp-xml.c (gnome_wp_xml_load_xml):
	Check that the item isn't already listed, before we try to add
	the wallpaper to the list
	(gnome_wp_xml_load_list): Load XML files from the correct directory
2004-09-22 15:07:01 +00:00
Rodney Dawes
d4b9a45a00 Add "W x H pixels" to description, and remove file size Mark the
2004-08-15  Rodney Dawes  <dobey@novell.com>

	* gnome-wp-item.c (gnome_wp_item_update_description):
	Add "W x H pixels" to description, and remove file size
	Mark the description string for translation as well
2004-08-15 19:07:34 +00:00
Rodney Dawes
64837f243f Check that item->fileinfo is not NULL, before trying to use a string
2004-07-15  Rodney Dawes  <dobey@novell.com>

	* gnome-wp-item.c (gnome_wp_item_new):
	Check that item->fileinfo is not NULL, before trying to use a
	string variable inside the struct for a strncmp

	Fixes #147373
2004-07-15 13:58:51 +00:00
Rodney Dawes
4d87d80f3e Update copyright info to have correct years (2003-2004)
2004-06-28  Rodney Dawes  <dobey@novell.com>

	* *.[ch]: Update copyright info to have correct years (2003-2004)

	* gnome-wp-capplet.c (gnome_wp_capplet_scroll_to_item):
	Abstract this code out so that we don't have to duplicated it every
	time we want to scroll to a particular item in the list

	(gnome_wp_add_image): Update this to return the new item that we
	created, and don't scroll to or set as the wallpaper, every time we
	call this function
	Use the new gnome_wp_item_new () call to create items

	(gnome_wp_add_images): Change the API to not use the files argument
	any longer, as we don't need it without the GTK+ 2.2 compat code
	Add all the items to the list and select the last one when finished

	(gnome_wp_file_open_dialog): Update to not pass in the files argument
	to gnome_wp_add_images () and free the GSList of filenames

	(bg_add_multiple_files): merge this code into the normal callback for
	when images are dragged to the dialog

	(bg_properties_dragged_image): Don't check if the list is more than
	1 or not here, and always call gnome_wp_add_images () with the full
	list that we are given
	Convert the GList of GnomeVFSURIs that we get from gnome-vfs to a
	GSList of char * uris to pass into gnome_wp_add_images ()

	(gnome_wp_load_stuffs, gnome_wp_file_changed):
	Use the new gnome_wp_capplet_scroll_to_item () and gnome_wp_item_new ()
	API calls instead of duplicating code

	* gnome-wp-capplet.h: Remove the GConf key path defines from here

	* gnome-wp-item.[ch]: Add the gnome_wp_item_new () call to create the
	GnomeWPItem structure for storing wallpapers in

	* gnome-wp-utils.h: Put the GConf key path defines in here

	* gnome-wp-xml.c (gnome_wp_load_legacy): Use the gnome_wp_item_new ()
	call to create items from the old legacy (XD2 capplet) list file
2004-06-28 18:51:21 +00:00
Rodney Dawes
00006d7745 Regenerate the thumbnail in the list when we change scaling type now
2004-04-05  Rodney Dawes  <dobey@ximian.com>

	* gnome-wp-capplet.c (gnome_wp_scale_type_changed): Regenerate the
	thumbnail in the list when we change scaling type now
	(wallpaper_properties_init): Add GtkFileFilter support (needs love)
	TreeView is buggy, so we need to not set the vertical-separator
	style property for it
	* gnome-wp-item.c: Include <config.h> and <gnome.h> here
	(collect_save_options): Add a function to set all of the pixbuf options
	for the thumbnail pixbuf properly, so we can save them back out
	(gnome_wp_item_get_thumbnail): Fix up the code to
	generate the thumbnails for the list a bit, so that we have sexy
	thumbnails that look exactly like how the image would, on-screen
	Initialize all of the width/height variables to 0
	Add a new pixbuf variable for loading the original image to get the
	dimensions of it, so we can do thumbnailing more properly
	Use a LIST_IMAGE_WIDTH define, for the width of the images in the list
	Just return the bgpixbuf if we are creating the "No Wallpaper" thumb
	Save the thumbnail back out with the dimensions for the original image
	If our image is smaller than the list thumbnail, then just use 1.0 as
	the ratio for scaling the image for tiling/etc...
	Use the new API to do scaling inside the center/tile functions
	Reload the thumbnail pixbuf after generating it with the thumbnail
	system, so that we get all of the pixbuf options set correctly
	* gnome-wp-item.h (GnomeWPItem): store the original image's width
	and height in the item, so we can avoid reopening the original image
	every time we generate the thumbnail, on systems where the thumbnail
	doesn't contain the appropriate information
	* gnome-wp-utils.c (gnome_wp_pixbuf_tile):
	(gnome_wp_pixbuf_center): Add API to do the scaling inside these calls

	Fixes #136691
2004-04-05 21:32:02 +00:00
Rodney Dawes
e7928dbfa4 Split out real image adding code into a separate call
2004-02-29  Rodney Dawes  <dobey@ximian.com>

	* gnome-wp-capplet.c (gnome_wp_add_image): Split out real image adding
	code into a separate call
	(gnome_wp_add_images):
	(gnome_wp_file_open_dialog):
	(gnome_wp_properties_init): Add support for GtkFileChooser (#135317)
	(bg_properties_dragged_image): Fix re-addition of deleted images
	* gnome-wp-capplet.h: Store the filesel widget in GnomeWPCapplet
	* gnome-wp-item.c: Fix warning about gnome_vfs_mime_get_description

	Fixes #135317
2004-03-01 04:09:06 +00:00
Rodney Dawes
55a2057d87 Escape the path for thumbnails and fileinfo (#135089)
2004-02-24  Rodney Dawes  <dobey@ximian.com>

	* gnome-wp-info.c (gnome_wp_info_new):
	* gnome-wp-item.c (gnome_wp_item_get_thumbnail): Escape the path for
	thumbnails and fileinfo (#135089)

	Fixes #135089
2004-02-24 20:51:35 +00:00
Rodney Dawes
48c884fe25 Add some explanatory comments to bits of the code Fix the ratio
2004-02-24  Rodney Dawes  <dobey@ximian.com>

	* gnome-wp-item.c (gnome_wp_item_get_thumbnail): Add some explanatory
	comments to bits of the code
	Fix the ratio calculation to handle images of all sizes (#134541)
	Don't force tiling of square images
	Don't do _save_thumbnail () for the custom thumbnails
	If pixbuf is NULL, copy away bgpixbuf and return that instead
	* gnome-wp-utils.c (gnome_wp_tile_pixbuf):
	(gnome_wp_center_pixbuf): Return copied pixbufs

	Fixes #134541
2004-02-24 19:32:05 +00:00
Rodney Dawes
5e266cc532 Switch the binary name to gnome-background-properties, Based on patch from
2004-02-01  Rodney Dawes  <dobey@ximian.com>

	* Makefile.am: Switch the binary name to gnome-background-properties,
	  Based on patch from Seth Nickell
	* background.desktop.in: Use gnome-background-properties here also,
	  based on patch from Seth Nickell
	* gnome-wp-capplet.c: Fix a bug where you can't re-add a wallpaper
	  after you remove it
	  Use the new gnome_wp_item_update_description () call
	  Use a GConfChangeSet to change the gconf keys, based on a patch
	  from Seth Nickell
	  Select the first item in the list ("No Wallpaper") when the wallpaper
	  is removed, based on a patch from Seth Nickell
	  Do the rc string parsing before creating the window, and change some
	  defaults so we can fix the spacing between widgets and the border
	  Fix spacing between widgets and window border
	* gnome-wp-item.[ch]: Add update_description function to clean up
	  code, based on patch from Seth Nickell
	  Fix a crash when trying to thumbnail very wide images that are very
	  short, while trying to maintain aspect ratio
	* gnome-wp-xml.c: Use backgrounds.xml instead of wp-list.xml, and
	  migrate the old wp-list.xml over if backgrounds.xml doesn't exist
	  yet, based on patch from Seth Nickell
2004-02-01 20:57:47 +00:00
Jody Goldberg
55a692788a As long as we're hard coding the path hard code it in only one place.
2004-01-12  Jody Goldberg <jody@gnome.org>

	* Makefile.am : As long as we're hard coding the path hard code it in
	  only one place.  Passing in datadir then adding the magic subdir in
	  C then building in Makefile seems unnecessary.
	  Use GNOMECC_CAPPLETS_*
2004-01-12 06:35:57 +00:00
Rodney Dawes
2e428e7746 Update for new capplet Update Name/Comment/Exec entries
2004-01-12  Rodney Dawes  <dobey@ximian.com>

	* Makefile.am: Update for new capplet
	* background.desktop.in: Update Name/Comment/Exec entries
	* gnome-wp-capplet.[ch]:
	* gnome-wp-info.[ch]:
	* gnome-wp-item.[ch]:
	* gnome-wp-utils.[ch]:
	* gnome-wp-xml.[ch]: Add new capplet code to CVS
2004-01-12 05:10:40 +00:00