From 494636d31c7df6e3ec50755173f55320c4e33082 Mon Sep 17 00:00:00 2001 From: Jens Granseuer Date: Sun, 30 Sep 2007 15:00:25 +0000 Subject: [PATCH] remove old capplets that are now subsumed in the appearance capplet from 2007-09-30 Jens Granseuer * capplets/background: * capplets/font: * capplets/theme-switcher: * capplets/ui-properties: remove old capplets that are now subsumed in the appearance capplet from the repository svn path=/trunk/; revision=8145 --- capplets/background/ChangeLog | 1654 ------------ capplets/background/Makefile.am | 53 - capplets/background/background.desktop.in.in | 15 - .../gnome-background-properties.glade | 541 ---- capplets/background/gnome-wp-capplet.c | 1112 --------- capplets/background/gnome-wp-capplet.h | 92 - capplets/background/gnome-wp-info.c | 103 - capplets/background/gnome-wp-info.h | 47 - capplets/background/gnome-wp-item.c | 385 --- capplets/background/gnome-wp-item.h | 71 - capplets/background/gnome-wp-utils.c | 198 -- capplets/background/gnome-wp-utils.h | 58 - capplets/background/gnome-wp-xml.c | 407 --- capplets/background/gnome-wp-xml.h | 28 - capplets/common/gnome-theme-info.c | 11 + capplets/font/ChangeLog | 344 --- capplets/font/Makefile.am | 38 - capplets/font/font-properties.desktop.in.in | 15 - capplets/font/font-properties.glade | 1655 ------------ capplets/font/main.c | 1020 -------- capplets/font/subpixel-bgr.png | Bin 125 -> 0 bytes capplets/font/subpixel-rgb.png | Bin 125 -> 0 bytes capplets/font/subpixel-vbgr.png | Bin 138 -> 0 bytes capplets/font/subpixel-vrgb.png | Bin 138 -> 0 bytes capplets/theme-switcher/ChangeLog | 1412 ----------- capplets/theme-switcher/Makefile.am | 66 - capplets/theme-switcher/TODO | 17 - capplets/theme-switcher/gnome-ccthemes.png | Bin 2826 -> 0 bytes capplets/theme-switcher/gnome-theme-details.c | 1010 -------- capplets/theme-switcher/gnome-theme-details.h | 9 - .../theme-switcher/gnome-theme-installer.c | 712 ------ .../gnome-theme-installer.desktop.in.in | 17 - .../theme-switcher/gnome-theme-installer.h | 32 - capplets/theme-switcher/gnome-theme-manager.c | 1713 ------------- capplets/theme-switcher/gnome-theme-manager.h | 86 - .../theme-switcher/gnome-theme-package.xml.in | 9 - .../theme-switcher/gnome-theme-save-data.c | 9 - capplets/theme-switcher/gnome-theme-save.c | 361 --- capplets/theme-switcher/gnome-theme-save.h | 12 - .../gtk-theme-selector-capplet.png | Bin 527 -> 0 bytes .../gtk-theme-selector.desktop.in.in | 15 - .../theme-switcher/gtk-theme-switcher.schemas | 47 - .../theme-switcher/theme-properties.glade | 2207 ----------------- .../theme-switcher/theme-switcher-capplet.png | Bin 527 -> 0 bytes .../theme-switcher/theme-thumbnailing.png | Bin 2038 -> 0 bytes capplets/ui-properties/ChangeLog | 374 --- capplets/ui-properties/Makefile.am | 25 - capplets/ui-properties/gnome-ui-properties.c | 313 --- .../gnome-ui-properties.desktop.in.in | 15 - .../ui-properties/gnome-ui-properties.glade | 709 ------ capplets/ui-properties/gnome-warning.png | Bin 771 -> 0 bytes capplets/ui-properties/preferences.h | 156 -- 52 files changed, 11 insertions(+), 17162 deletions(-) delete mode 100644 capplets/background/ChangeLog delete mode 100644 capplets/background/Makefile.am delete mode 100644 capplets/background/background.desktop.in.in delete mode 100644 capplets/background/gnome-background-properties.glade delete mode 100644 capplets/background/gnome-wp-capplet.c delete mode 100644 capplets/background/gnome-wp-capplet.h delete mode 100644 capplets/background/gnome-wp-info.c delete mode 100644 capplets/background/gnome-wp-info.h delete mode 100644 capplets/background/gnome-wp-item.c delete mode 100644 capplets/background/gnome-wp-item.h delete mode 100644 capplets/background/gnome-wp-utils.c delete mode 100644 capplets/background/gnome-wp-utils.h delete mode 100644 capplets/background/gnome-wp-xml.c delete mode 100644 capplets/background/gnome-wp-xml.h delete mode 100644 capplets/font/ChangeLog delete mode 100644 capplets/font/Makefile.am delete mode 100644 capplets/font/font-properties.desktop.in.in delete mode 100644 capplets/font/font-properties.glade delete mode 100644 capplets/font/main.c delete mode 100644 capplets/font/subpixel-bgr.png delete mode 100644 capplets/font/subpixel-rgb.png delete mode 100644 capplets/font/subpixel-vbgr.png delete mode 100644 capplets/font/subpixel-vrgb.png delete mode 100644 capplets/theme-switcher/ChangeLog delete mode 100644 capplets/theme-switcher/Makefile.am delete mode 100644 capplets/theme-switcher/TODO delete mode 100644 capplets/theme-switcher/gnome-ccthemes.png delete mode 100644 capplets/theme-switcher/gnome-theme-details.c delete mode 100644 capplets/theme-switcher/gnome-theme-details.h delete mode 100644 capplets/theme-switcher/gnome-theme-installer.c delete mode 100644 capplets/theme-switcher/gnome-theme-installer.desktop.in.in delete mode 100644 capplets/theme-switcher/gnome-theme-installer.h delete mode 100644 capplets/theme-switcher/gnome-theme-manager.c delete mode 100644 capplets/theme-switcher/gnome-theme-manager.h delete mode 100644 capplets/theme-switcher/gnome-theme-package.xml.in delete mode 100644 capplets/theme-switcher/gnome-theme-save-data.c delete mode 100644 capplets/theme-switcher/gnome-theme-save.c delete mode 100644 capplets/theme-switcher/gnome-theme-save.h delete mode 100644 capplets/theme-switcher/gtk-theme-selector-capplet.png delete mode 100644 capplets/theme-switcher/gtk-theme-selector.desktop.in.in delete mode 100644 capplets/theme-switcher/gtk-theme-switcher.schemas delete mode 100644 capplets/theme-switcher/theme-properties.glade delete mode 100644 capplets/theme-switcher/theme-switcher-capplet.png delete mode 100644 capplets/theme-switcher/theme-thumbnailing.png delete mode 100644 capplets/ui-properties/ChangeLog delete mode 100644 capplets/ui-properties/Makefile.am delete mode 100644 capplets/ui-properties/gnome-ui-properties.c delete mode 100644 capplets/ui-properties/gnome-ui-properties.desktop.in.in delete mode 100644 capplets/ui-properties/gnome-ui-properties.glade delete mode 100644 capplets/ui-properties/gnome-warning.png delete mode 100644 capplets/ui-properties/preferences.h diff --git a/capplets/background/ChangeLog b/capplets/background/ChangeLog deleted file mode 100644 index 0206dd9de..000000000 --- a/capplets/background/ChangeLog +++ /dev/null @@ -1,1654 +0,0 @@ -2007-04-28 Jens Granseuer - - * gnome-wp-capplet.c: (gnome_wp_remove_wallpaper): after removing a - wallpaper select the next one in the list instead of always going - to "No Wallpaper" (closes bug #432514) - -2007-04-27 Rodrigo Moya - - * background.desktop.in.in: renamed Bugzilla product. - -2007-04-16 Jens Granseuer - - Patch by: Priit Laes - - * gnome-background-properties.glade: - * gnome-wp-capplet.c: (gnome_wp_option_menu_set), - (gnome_wp_scale_type_changed), (gnome_wp_shade_type_changed), - (wallpaper_properties_init): replace deprecated GtkOptionMenu with - GtkComboBox (closes bug #421199) - -2007-04-16 Jens Granseuer - - * gnome-wp-capplet.c: (gnome_wp_load_stuffs): don't crash if the - GConf schema is missing (bug #430253). Also fix initialization of - the secondary colour picker - -2007-04-08 Jens Granseuer - - Patch by: Kristof Vansant - - * gnome-background-properties.glade: don't require gnome glade lib - -2007-03-04 Jens Granseuer - - * gnome-wp-capplet.c: (gnome_wp_add_images), - (gnome_wp_file_open_dialog), (bg_properties_dragged_image), - (gnome_wp_main_quit), (gnome_wp_scale_type_changed), - (gnome_wp_shade_type_changed), (gnome_wp_load_stuffs), - (gnome_wp_options_changed), (gnome_wp_shading_changed), - (wallpaper_properties_init), (main): - * gnome-wp-item.c: (gnome_wp_item_new), - (gnome_wp_item_get_thumbnail): - * gnome-wp-xml.c: (gnome_wp_load_legacy), (gnome_wp_xml_load_xml), - (gnome_wp_list_flatten), (gnome_wp_xml_save_list): plug leaks. - Fixes bug #396069. - -2007-01-29 Kjartan Maraas - - * gnome-wp-capplet.c: (wallpaper_properties_init): - ANSIfication of function declaration. - -2007-01-08 David SedeƱo - - * gnome-wp-xml.c: Fix several compile warnings. Fixes #326022 - -2007-01-08 Ray Strode - - Fixes #351991 - - * gnome-wp-info.c (gnome_wp_info_new): don't try to pull from - ~/.thumbnails directly without checking mtime. - - * gnome-wp-item.c (collect_save_options, gnome_wp_item_get_thumbnail): - only generate thumbnails when a lookup shows there isn't already - one. Never load a background just to find out its size. - -2007-01-07 Thomas Wood - - Patch by: Jens Granseuer - - * gnome-wp-capplet.c: (gnome_wp_update_preview): Fixes bug 388616 - (Control center crashes when changing the image name) - -2007-01-07 Thomas Wood - - Patch by: Jens Granseuer - - * gnome-wp-item.c: (gnome_wp_item_get_thumbnail): - * gnome-wp-xml.c: (gnome_wp_xml_load_list): - - Apply patch from bug 335220 (mem leaks in gnome-wp-item) - - -2007-01-06 Lucas Rocha - - Fixes #336286 - - * gnome-wp-capplet.c: switched from popt to GOptionContext. - (wallpaper_properties_init): just iterate over "command_line_files". - (main): call gnome_program_init with the correct arguments. - -2007-01-06 Gabor Kelemen - - * gnome-wp-item.c: Mark message showing background image size - and type for translation - - Patch from Roozbeh Pournander - - Fixes #341899 - -2006-12-08 Kjartan Maraas - - * gnome-wp-xml.c: (gnome_wp_xml_load_list): Plug a leak. - Bug #376949 - -2006-08-18 Rodney Dawes - - * background.desktop.in.in: Use preferences-desktop-wallpaper as the - icon name per the Icon Naming Specification - * gnome-background-properties.glade: Set the icon name for the window - to be preferences-desktop-wallpaper as per the naming spec - * gnome-wp-capplet.[ch]: Remove GtkIconTheme instance from structure - (gnome_wp_icon_theme_changed): Don't need this method any longer - (wallpaper_properties_init): Remove unused variables - Don't need to get the icon_info to load a pixbuf and set an icon, from - the theme any longer, as we can just specify the icon with one call - Don't need the extra _ensure_style call here - -2006-08-18 Rodney Dawes - - * gnome-wp-capplet.c (wallpaper_properties_init): Set the content area - border to 0 in the parsed rc string - Remove the set_border_width calls for the dialog's vbox and action area - - Fixes #332830 - -2006-03-18 Rodney Dawes - - * gnome-wp-xml.c (gnome_wp_xml_load_list): Only pass G_FILE_TEST_IS_DIR - to the g_file_test calls - - Fixes #331486 - -2006-02-11 Theppitak Karoonboonyanan - - * gnome-background-properties.glade: Add the missing translatable flag - in the Finish button. - -2006-02-10 Rodney Dawes - - * gnome-wp-capplet.c (wallpaper_properties_clicked): Add the missing - GTK_RESPONSE_DELETE_EVENT back in so that we exit properly with it - -2006-02-09 Rodney Dawes - - * gnome-background-properties.glade: Replace the Apply/Cancel/OK - buttons with a Finish button, using the stock apply icon - - * gnome-wp-capplet.c (gnome_wp_props_wp_set): Don't need to check if - we are the same image as we were before now - (gnome_wp_props_revert): Remove this as it is no longer needed - (gnome_wp_props_wp_selected): Call the set function here - (gnome_wp_main_quit): Remove the freeing of capplet->old_item - (wallpaper_properties_clicked): Only handle GTK_RESPONSE_OK as an - action to close the dialog now, as we are instant apply again - (gnome_wp_scale_type_changed, gnome_wp_shade_type_changed): - (gnome_wp_color_changed): Set the appropriate gconf keys here - (gnome_wp_load_stuffs): Remove references to capplet->old_item - - * gnome-wp-capplet.h (struct _GnomeWPCapplet): Remove old_item object - - Fixes #327335, #330587 and #329818 - Partially fixes #330168 - -2006-01-26 Rodney Dawes - - * gnome-wp-capplet.c (gnome_wp_capplet_scroll_to_item): If we are - passed in a NULL just return rather than using g_return_if_fail to - do it, so that we can avoid the glib CRITICAL warning (#327327) - (gnome_wp_load_stuffs): If the settings are mangled some how, and - a valid item was not duplicated, duplicated the "No Wallpaper" item - - Fixes #327327 - -2006-01-26 Rodney Dawes - - * 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-14 Rodney Dawes - - * gnome-background-properties.glade: Set the visibility of the second - color chooser button to off by default - - Fixes #319463 - -2006-01-14 Rodney Dawes - - * *.[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 Alan Swanson - - * 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 - -2005-10-05 Dennis Cranston - - * gnome-wp-capplet.c (wallpaper_properties_init): Add an image - filter to the file chooser. - -2005-10-01 Rodney Dawes - - * 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-09-06 Rodney Dawes - - * gnome-wp-capplet.c (wallpaper_properties_init): Set the style - property "action-area-border" for the GtkDialogs here - - "Fixes" #313680 - -2005-08-21 Rodney Dawes - - * gnome-wp-capplet.c (gnome_wp_option_menu_set): If the value for - the "picture_options" key is set to "none", don't set the optin menu - for the scaling options to tiled - - Fixes #313883 - -2005-08-17 Rodney Dawes - - * gnome-wp-capplet.c (wallpaper_properties_init): Replace the changing - of some GtkDialog defaults through style properties with calls to - gtk_widget_ensure_style and gtk_container_set_border_width - - Fixes #313680 - -2005-08-15 Veerapuram Varadhan - - * gnome-wp-capplet.c (gnome_wp_props_wp_set): - (gnome_wp_color[12]_changed, gnome_wp_options_changed): - (gnome_wp_shading_changed, wallpaper_properties_init): - Enable/disable the style-menu, shading-menu and color-picker - buttons w.r.t gconf-keys. - (gnome_wp_set_sensitivities): Utility function to take care of - enabling/disabling widgets w.r.t gconf-keys. - (gnome_wp_props_wp_set): Don't set the sensitivity of the remove and - style buttons here. Just call the new method to do it instead - -2005-07-25 Sebastien Bacher - - * gnome-wp-capplet.c (gnome_wp_{scale,shade}_type_changed): - Update for the changed signal of the option menus - (wallpaper_properties_init): Connect to the changed signal of - the scale and color style option menus - - Fixes #157396 - -2005-07-25 Sebastien Bacher - - * gnome-background-properties.glade: Replace GnomeColorPicker with - the GtkColorButton widget - Some properties were added by newer version of glade - - * gnome-wp-capplet.c (gnome_wp_props_wp_set): - (gnome_wp_[s]color_changed, gnome_wp_color[12]_changed): - (gnome_wp_load_stuffs, wallpaper_properties_init): - Update to use the API for GtkColorButton instead of GnomeColorPicker - - Fixes #171676 - -2005-07-14 Rodney Dawes - - * gnome-wp-xml.c (gnome_wp_xml_load_xml): If xmlParseFile returns - NULL, then just return, rather than trying to parse the document - - Fixes #310041 - -2005-07-13 Rodney Dawes - - * gnome-wp-info.c (gnome_wp_info_new): Pass the md5sum to the call - to g_strconcat to create the path to the thumbnail file - - Fixes #310293 - -2005-07-10 Rodney Dawes - - * gnome-wp-capplet.[ch]: - (gnome_wp_icon_theme_changed): - (wallpaper_properties_init): - Update to use GtkIconTheme rather than GnomeIconTheme - Based on patch from Jan de Groot - - Fixes #171677 - -2005-07-10 Rodney Dawes - - * 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-06-14 Rodney Dawes - - * gnome-wp-info.c (gnome_wp_info_new): Revert undocumented, unapproved - change from Sebastian Bacher committed on 2005-05-22 - -2005-02-26 Rodney Dawes - - * *.[ch]: Update Copyright to include current year - -2005-02-26 Rodney Dawes - - * gnome-wp-capplet.c (gnome_wp_add_image): If the filename is not - encoded in UTF-8, we just ignore it for now to avoid crashing - - * gnome-wp-xml.c (gnome_wp_xml_load_xml): Check to make sure that the - filename and name tags that we read in, aren't NULL - If the filename we read in is NULL, free the item, and continue on - - Fixes #146130 #146645 (resolving these as dups of #168604 ) - Fixes #159441 - -2005-02-06 Rodney Dawes - - * gnome-wp-capplet.c (wallpaper_properties_init): Force using the gtk+ - backend for the file chooser since we don't support vfs yet - - Fixes #154978 - -2005-02-06 Rodney Dawes - - * gnome-wp-capplet.c (gnome_wp_color_changed): Change the API to use - the boolean argument to specify if we want to update gconf or not - Always get the colors for both primary and secondary and update the - thumbnail - Only set the keys in gconf if we have the update boolean argument - (gnome_wp_pcolor_changed): Removed this method, since we don't need - to differentiate between primary/secondary for updating the thumbnail - (gnome_wp_scolor_changed): When we change the color in the UI, we want - to update gconf, we use this method for both color picker buttons now - (gnome_wallpaper_properties_init): Use gnome_wp_scolor_changed for the - callback on both color picker button widgets now - - Fixes #166486 - -2005-01-10 Rodney Dawes - - * gnome-wp-xml.c (gnome_wp_xml_load_xml): - Fix compile warning for syslangs declaration - Wrap g_get_language_names in #if GLIB_CHECK_VERSION as it is 2.6 API - -2005-01-09 Rodney Dawes - - * gnome-wp-capplet.[ch] (gnome_wp_update_preview): Add new callback - routine for when the preview widget in the file chooser needs an update - (wallpaper_properties_init): Set the preview widget in the file chooser - to a GtkImage object and connect to the update-preview signal for when - the selected file changes - - Based on patch from Sebastien Bacher - - Fixes #139714 - -2005-01-08 Rodney Dawes - - * gnome-wp-capplet.c (wallpaper_properties_init): Preload the directory - rather than nothing when adding directories for gconf notification - -2005-01-08 Rodney Dawes - - * 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-08 Thomas Wood - - * gnome-wp-xml.c (gnome_wp_xml_load_xml): Load translated XML - description elements if available - - Fixes #160700 - -2005-01-08 Rodney Dawes - - * gnome-wp-capplet.c (wallpaper_properties_init): Fix the leaks - in the scaling type option menu creation correctly - -2005-01-02 Thomas Cataldo - - * gnome-wp-capplet.c (wallpaper_properties_init): plug icon - filename leak. - -2004-12-11 Rodney Dawes - - * 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-10 Rodney Dawes - - * 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-11-09 Mark McLoughlin - - * Makefile.am: install .desktop file in $(datadir)/applications. - - * background.desktop.in: add OnlyShowIn=GNOME; - -2004-10-14 Jody Goldberg - - * Release 2.8.1 - -2004-10-14 Rodney Dawes - - * gnome-wp-item.c (gnome_wp_item_update_description): - Use g_markup_printf_escaped () to fill in the description - - Fixes #155184 - -2004-09-29 Rodney Dawes - - * 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-22 Rodney Dawes - - * 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-08-20 Frederic Crozat - - * gnome-wp-capplet.c: (gnome_wp_icon_theme_changed), - (wallpaper_properties_init): - Use themed icon for window hint. - -2004-08-16 Rodney Dawes - - * gnome-wp-capplet.c (wallpaper_properties_clicked): - Handle the GTK_RESPONSE_DELETE_EVENT case as well - - Fixes #150273 - -2004-08-15 Rodney Dawes - - * 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-07-19 Rodney Dawes - - * gnome-wp-capplet.c (gnome_wp_remove_wallpaper, gnome_wp_list_sort): - Free what we get with gtk_tree_model_get - - Fixes #147403 - -2004-07-15 Rodney Dawes - - * 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-06-28 Rodney Dawes - - * *.[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-05-14 Muktha Narayan - - * gnome-wp-capplet.c (set_accessible_name): New - (wallpaper_properties_init): Add accessible names. - - Fixes #142517 - -2004-04-27 Rodney Dawes - - * gnome-wp-capplet.c (gnome_wp_file_open_dialog): - (wallpaper_properties_init): Remove the #if checks for GTK+ 2.3.0 and - get rid of the compatibility code for building against 2.2 - -2004-04-24 Rodney Dawes - - * gnome-wp-capplet.c (wallpaper_properties_init): Use the more correct - "Add Wallpaper" term for the file chooser window title - - Fixes #135084 - -2004-04-15 Jody Goldberg - - * Release 2.6.1 - -2004-04-10 Rodney Dawes - - * gnome-wp-capplet.c (gnome_wp_list_sort): Use g_utf8_collate to sort - the descriptions, rather than a strcmp, so that we follow the locale - settings for LC_COLLATE - - Fixes #139517 - -2004-04-08 Rodney Dawes - - * gnome-wp-capplet.c (wallpaper_properties_init): Rever the previous - patch to Fix #135084 as it breaks string freeze - -2004-04-05 Rodney Dawes - - * gnome-wp-capplet.c (wallpaper_properties_init): Change file chooser - dialog title to say "Add Wallpaper" instead of "Add Wallpapers" - - Fixes #135084 - -2004-04-05 Rodney Dawes - - * 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 and 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-01 Jody Goldberg - - * Release 2.6.0.3 - -2004-03-30 Jody Goldberg - - * Release 2.6.0.1 - -2004-03-23 Jody Goldberg - - * Release 2.6.0 - -2004-03-11 Jody Goldberg - - * Release 2.5.4 - -2004-03-04 Rodney Dawes - - * background-properties-capplet.c: - * background-properties.glade: - * background-properties.glade1: - * background-properties.xml: Removed these old files from the old - background capplet - -2004-03-04 Rodney Dawes - - * gnome-wp-capplet.c (gnome_wp_add_image): Select the added image, and - change the scaling type to "wallpaper" if it is "none" (#136228) - - Fixes #136228 - -2004-02-29 Rodney Dawes - - * 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-02-24 Rodney Dawes - - * 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 Rodney Dawes - - * gnome-wp-xml.c (gnome_wp_oad_legacy): Check that the file exists, - and continue through the loop if it doesn't (#135251) - - Fixes #135251 - -2004-02-24 Rodney Dawes - - * 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-17 Rodney Dawes - - * gnome-background-properties.glade: Use untranslated strings for - the color picker dialog titles (glade bug set them to the translated - versions of the strings) - - Fixes #134171 - -2003-12-07 Jan Arne Petersen - - * background-properties-capplet.c: remove unused - "preview_file_selection.h" include. - -2004-02-13 Jody Goldberg - - * Release 2.5.3 - -2004-02-12 Mark McLoughlin - - * background-properties-capplet.c: (cb_dialog_response): - * gnome-wp-capplet.c: (wallpaper_properties_clicked): Update help - links to point to user-guide.xml - -2004-02-04 Rodney Dawes - - * Makefile.am: - * gnome-background-properties.glade: - * gnome-wp-capplet.[ch]: Convert the main dialog UI to glade - -2004-02-04 Rodney Dawes - - * background.desktop.in: Use "Desktop Background" as name and change - the Comment line to a verb phrase as per the HIG - * gnome-wp-capplet.c (gnome_wp_load_stuffs): Fix a little bug so that - opening the capplet with "No Wallpaper" set, actually works - (wallpaper_properties_init): "Desktop Background Preferences" - -2004-02-01 Rodney Dawes - - * 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-01-18 Rodney Dawes - - * gnome-wp-capplet.c: Enable the Help button (#131286) - -2004-01-16 Christophe Merlet - - * Makefile.am: add DESTDIR variable in install-data-local section. - -2004-01-14 Jody Goldberg - - * Release 2.5.2 - -2004-01-12 Rodney Dawes - - * gnome-wp-xml.c (gnome_wp_load_legacy): Fix previous change to - use gnome_wp_item_free () instead of g_free (), and fix tab width - -2004-01-12 Diego Gonzalez - - * gnome-wp-xml.c (gnome_wp_load_legacy): don't crash if we could - not get the file information. - -2004-01-12 Jody Goldberg - - * 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 Rodney Dawes - - * Makefile.am: Add install hook to create data directory - -2004-01-12 Rodney Dawes - - * 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 - -2003-12-30 Jody Goldberg - - * Release 2.5.1.1 - -2003-12-30 Jody Goldberg - - * Release 2.5.1 - -Fri Nov 21 09:42:19 2003 Jonathan Blandford - - * background-properties.glade: Remove translatable radiobutton - strings, #119288 - -2003-10-28 Jody Goldberg - - * Release 2.5.0 - -2003-08-01 Dennis Cranston - - * background-properties-capplet.c, background-properties.glade: - Patch to fix spacing between action area and vbox of preferences - dialog. - -2003-07-17 Dennis Cranston - - * background-properties.glade, - background-properties-capplet.c: Fixes for ui-review - bug report #98916 and duplicate mnemonic fixes. - -2003-07-07 Jody Goldberg - - * Release 2.3.4 - -2003-06-24 Jody Goldberg - - * Release 2.3.3 - -2003-05-07 Jody Goldberg - - * Release 2.3.1 - -Tue Feb 4 17:09:18 2003 Jonathan Blandford - - * Release 2.2.0.1 - -Tue Jan 21 01:15:14 2003 Jonathan Blandford - - * Release 2.2.0 - -Thu Jan 16 02:41:09 2003 Jonathan Blandford - - * Release 2.1.7 - -2003-01-10 Jody Goldberg - - * Release 2.1.6 - -2002-12-18 Jody Goldberg - - * Release 2.1.5 - -2002-11-23 Jody Goldberg - - * Release 2.1.3 - -2002-11-13 Pasupathi Duraisamy - - * background-properties-capplet.c (drag_data_received_cb): - Reset Picture option to "Wall paper" only in the case of - "none" while DnD. Fixes #94329 - -2002-11-02 Jody Goldberg - - * Release 2.1.2 - -2002-10-21 Jody Goldberg - - * Release 2.1.1 - -2002-10-01 Jody Goldberg - - * Release 2.1.0.1 - -2002-08-21 Jody Goldberg - - * Release 2.1.0 - -2002-08-19 Ross Burton - - * background.desktop.in: Fix the desktop file so that it - validates. - -2002-07-12 Jody Goldberg - - * background-properties.glade : The last of the ui-review. - -2002-07-02 Jody Goldberg - - http://bugzilla.gnome.org/show_bug.cgi?id=84014 - * background-properties-capplet.c (drag_data_received_cb) : unescape - the path. - -2002-06-27 Jody Goldberg - - * background-properties-capplet.c (main) : use capplet_set_icon. - -2002-06-18 Jody Goldberg - - http://bugzilla.gnome.org/show_bug.cgi?id=85628 - * background-properties-capplet.c (main) : The dialog - - should not be modal - - has no parent to destroy with - - and should have a seperator - - set default response - -2002-06-17 Jody Goldberg - - * Release 2.0.0 - -2002-06-05 Gediminas Paulauskas - - * background-properties.glade: radiobutton1 and similar things should - not be translatable. - -2002-05-28 Satyajit Kanungo - - * background-properties-capplet.c : Changed the help file link - to get the help document from user-guide. - -2002-05-26 Jody Goldberg - - * background-properties-capplet.c (cb_dialog_response) : improve - handling of help failures. - -Sun May 26 11:29:14 2002 Jonathan Blandford - - * background-properties-capplet.c (main): use APPID instead of - argv[0] - -Thu May 16 02:25:03 2002 Jonathan Blandford - - * background-properties-capplet.c (drag_data_received_cb): accept - drops from the nautilus patterns pallet. There's something broken - here, though. - -2002-05-10 Jody Goldberg - - * background-properties.glade : merge in the missing atk patch. - -2002-05-09 Jody Goldberg - - * background-properties-capplet.c (main) : add a help button. - -2002-05-02 Dennis Cranston - - * background-properties.glade: add a stock information image - to the "You can drag image files..." text. - -2002-05-08 Jody Goldberg - - * background-properties-capplet.c (cb_dialog_response) : new. - (main) : support help. - -2002-04-27 Seth Nickell - - * background.desktop.in: - - Improve the comment. - -2002-04-21 Rachel Hestilow - - * background-properties-capplet.c (setup_dialog): Update for - new enum peditor prototypes. - -Wed Apr 10 18:06:35 2002 Jonathan Blandford - - * background.desktop.in (Exec): s/gnome2/gnome - -Mon Apr 1 19:19:39 2002 Jonathan Blandford - - * background-properties-capplet.c (dialog_button_clicked_cb): - handle GTK_RESPONSE_DELETE_EVENT - - * Makefile.am (bin_PROGRAMS): - s/gnome2-background-properties/gnome-background-properties - - -2002-03-28 Richard Hestilow - - * background-properties-capplet.c (create_dialog), - background-properties.glade: Add mnemonics. - (main): Set title to "Background Preferences". - -2002-03-21 Seth Nickell - - * background-properties-capplet.c: (main): - - Set the window icon. - -2002-03-21 Seth Nickell - - * background-properties-capplet.c: (string_to_orientation), - (update_color_widget_labels_and_visibility), - (peditor_value_changed), (setup_dialog), (create_dialog): - * background-properties.glade: - - Recapture some of the more subtle interactions of "Seth's UI". - Change colour labels when the gradient orientation changes, - and use mnemonics so the capplet is accessible. Pad and space - as designed. - - There are still at least two things wrong: - - 1) Havoc & Jonathan convinced me that the large button with - label was wrong. This should instead look like: - http://beauty.stanford.edu/bg_button.png - The new format should be right for all image selectors, the - old mechanism had serious usability problems. - 2) "No Picture" should be the first toggle - -2002-03-19 Richard Hestilow - - * background-properties-capplet.c: - (everywhere): Use an ApplierSet instead of passing around - BGPreferences. - (real_realize_cb): Call applier_set_redraw. - (peditor_value_changed): Merge entry in set->prefs, - and call applier_set_redraw if realized. Also, hide the second - color option if shading type is solid. - (setup_dialog): Set data for the second color selector. - Also, update peditors for new UI. - (create_dialog): Add previews and labels to radio buttons. - (main): Create applier set. Also, connect to DnD signals. - - * background-properties.glade: Implement seth's new UI. - -2002-03-14 Richard Hestilow - - * background-properties-capplet.c (setup_dialog): Use new enum - peditors, and convert to using the #defined gconf keys from - preferences.h. - -2002-03-09 Richard Hestilow - - * background-properties-capplet.c (setup_dialog): Hook up - the previewing file selector to the FileEntry. - -2002-02-27 Kjartan Maraas - - * background-properties-capplet.c (main): s/PACKAGE/GETTEXT_PACKAGE/g - * main.c: Same here. - -2002-02-17 Bradford Hovinen - - * background-properties-capplet.c (main) - (dialog_button_clicked_cb): Switch to instant apply; remove apply - button - -2002-02-12 Lauris Kaplinski - - * background-properties-capplet.c (dialog_button_clicked_cb): Use - GtkDialog instead of GnomeDialog - -2002-02-06 Seth Nickell - - * background-properties-capplet.c: (drag_motion_cb), - (drag_leave_cb), (drag_data_received_cb), - (change_background_type_toggles), (set_background_picture), - (quit_cb), (main): - * background-properties.glade: - * background-properties.glade1: - - More fixes. Change layout in glade a bit, make DND work, - fix widget previews. - -2002-02-04 Lauris Kaplinski - - * background-properties-capplet.c (setup_color_widgets): Kill warning - (set_background_image_preview): Use g_file_test, use g_object_unref - instead of gdk_pixbuf_unref - (image_filename_clicked): Use g_signal_connect - (dialog_button_clicked_cb): Use GtkDialog instead of GnomeDialog - (realize_2_cb): Comment out to kill warning - (realize_cb): Ditto - (real_realize_cb): Ditto - (string_to_background_type): Treat NULL string as default - (string_to_orientation): Ditto - -2002-01-13 Seth Nickell - - reviewed by: - - * .cvsignore: - * Makefile.am: - * background-properties-capplet.c: (set_picture_is_present), - (string_to_background_type), (background_type_to_string), - (orientation_to_string), (string_to_orientation), - (peditor_string_to_orientation), (peditor_orientation_to_string), - (update_preview_widgets), (get_legacy_settings), - (setup_color_widgets), (peditor_value_changed), - (set_background_image_preview), (file_selector_cb), - (image_filename_clicked), (background_type_toggled), - (change_background_type_toggles), (background_type_changed), - (create_dialog), (idle_draw), (dialog_button_clicked_cb), (main): - * background-properties.glade: - * background-properties.glade1: - * background-properties.xml: - -2002-01-28 Richard Hestilow - - * Link to libbackground.la. - -2002-01-17 Jakub Steiner - - * background-capplet.png: minor tweaks - -2002-01-14 Bradford Hovinen - - * Makefile.am (bin_PROGRAMS): Rename binary gnome2-background-properties - -2002-01-02 Bradford Hovinen - - * background-properties-capplet.c (main): Removed call to set up - session management - obsolete - -2001-12-20 Bradford Hovinen - - * background-properties-capplet.c: Update - (main): Use a GtkDialog rather than a GnomeDialog - (main): Don't put weak ref on gtk_main_quit - (dialog_button_clicked_cb): Update - Eliminate compiler warnings - - * Makefile.am: Update - - * background.desktop.in.in (Exec): Update - - * background-properties-capplet.c (dialog_button_clicked_cb): - Remove call to apply_settings - (apply_settings): Remove - (main): Remove apply_only support - -2001-12-19 Seth Nickell - - * background.desktop.in.in: - - Add Categories field so it goes into the right location - in the panel menus. - -2001-12-18 Bradford Hovinen - - * background-properties-capplet.c: Use gconf_client rather than - gconf_engine - (setup_dialog): Use correct path for enabled - (main): Preload the background settings directory for performance - Don't #include bonobo.h - - * background.schema: Update keys to use /desktop/gnome/background - - * background-properties-capplet.c (property_change_cb): Remove - (create_dialog): Return GladeXML, not GtkWidget - (setup_dialog): Put GladeXML in the signature rather than - GtkWidget - (peditor_value_changed): Retrieve color_frame directory rather - than through Glade - (real_realize_cb): Ditto - (setup_dialog): Set color-frame rather than glade-data - (main): Construct the preview applier here rather than in - create_dialog - (main): Unref the applier object when the dialog is destroyed - (setup_dialog, create_dialog): Put the applier in the signature - Use weak_ref rather than the destroy signal for all relevant - objects - Update GConf keys to use /desktop/gnome/background - -2001-12-17 Bradford Hovinen - - * background.desktop.in.in (Exec): Update - - * background-properties-capplet.c (setup_dialog): Don't hide - opacity controls - (dialog_button_clicked_cb): Apply settings after commiting the - change set - (peditor_value_changed): Implement - (setup_dialog): Connect value-changed signals - (setup_dialog): Store the applier in the preferences object - (peditor_value_changed): Retrieve the applier from the preferences - object and use it to apply settings on the preview widget - (setup_dialog): Connect missing signal - (setup_dialog): Enabled set_guard call - (peditor_value_changed): Set the sensitivity of the color frame - depending on the settings - (peditor_value_changed): Use correct keys - - * background.schema: Added wallpaper-enabled - - * background-properties-capplet.c (create_dialog): Use - prefs_widget rather than preview placeholder widget - -2001-12-07 Bradford Hovinen - - * background.schema: Fix default values - - * background-properties-capplet.c (main): Connect the destroy - signal - - * background.schema: Fix type on opacity schema - - * background-properties-capplet.c (main): Remove use of - capplet_init, instead do the initialization ourselves (note: this - means we are no longer a Bonobo control) - (dialog_button_clicked_cb): Implement - (main): Show the dialog when we are done constructing it - (main): NULL-terminate the dialog construction parameters - -2001-10-19 Jakub Steiner - - * background-capplet.png: more clear brush - -2001-10-12 Bradford Hovinen - - * Makefile.am ($(oaffile)): Make creation of the .oaf file generic - - * applier.c (render_to_screen): Use standard gdk and gdk_pixbuf - rather than xlib and gdk_pixbuf_xlib - (make_root_pixmap): Create a GdkPixmap - (set_root_pixmap): Accept GdkPixmap and convert to X id - -2001-09-28 Bradford Hovinen - - * preferences.c (preferences_load_from_bonobo_db): - (preferences_load_from_bonobo_pbag): Use BONOBO_RET_EX rather than - RETURN_IF_EX; remove the definition of the latter macro - - * applier.c (fill_gradient): Copied from control center 1.4.0 - (render_background): Create the pixbuf first and then pass to - fill_gradient - (render_to_screen): Use XLIB_RGB_DITHER_MAX rather than - GDK_RGB_DITHER_NORMAL - - * Makefile.am: Change the binary name to - background-properties-control and create a wrapper script from - ../common/wrapper-script.in to be named - background-properties-capplet - Remove support for disabling bonobo-conf build - -2001-09-22 Bradford Hovinen - - * applier.c (run_render_pipeline): Create the root pixmap after we - know about the gradient geometry - (place_pixbuf): - (tile_pixbuf): Fix calls to gdk_pixbuf_composite[_color] - (render_wallpaper): Fix setting of pixbuf_xlate - (render_background): Fix pixbuf_render_geom here in case the - gradient geometry is small - -2001-09-21 Bradford Hovinen - - * applier.c: Total reorganization - -2001-09-17 Bradford Hovinen - - * preferences.c (preferences_save): Move from - applier.c:output_compat_prefs; it really belongs here - (preferences_class_init): Don't construct an applier here - - * background-properties-capplet.c (setup_dialog): Create a new - applier for every dialog - (create_dialog): Create applier locally, just for this one widget - (apply_settings): Create applier locally and destroy on exit - (main): Remove call to gnome_window_set_... - -2001-09-14 Bradford Hovinen - - * background-properties-capplet.c (property_change_cb): Use - applier_render_color_p - (real_realize_cb): Ditto - (get_legacy_settings): Set the wallpaper_enabled flag based on the - value of wallpaper_filename; use (none) as the default for - wallpaper_filename - (setup_dialog): Removed unused variable - - * applier.c (applier_render_color_p): Renamed from - applier_render_gradient_p; check both solid color and gradient - - * preferences.c (preferences_need_color_opts): Removed; use - applier_render_color_p instead - -2001-09-13 Bradford Hovinen - - * preferences.c (preferences_load_from_bonobo_db): - (preferences_load_from_bonobo_pbag): Default to TRUE on enabled; - check value of wallpaper_filename to set wallpaper_enabled if - wallpaper_enabled could not be found - - * background-properties-capplet.c (setup_dialog): - (apply_settings): Check for error condition after creating - preferences object - - * preferences.c (preferences_destroy): Make this static - (read_color_from_string): Made argument const - (bonobo_color_to_gdk): Made argument const - (DB_GET_VALUE): Removed - (PB_GET_VALUE): Removed - (preferences_load_from_bonobo_pbag): Use - local_bonobo_property_bag_client_get_value_{color|filename} - (preferences_new_from_bonobo_db): - (preferences_new_from_bonobo_pbag): Deallocate object and return - NULL if there was an error - (local_bonobo_property_bag_client_get_value_color): - (local_bonobo_property_bag_client_get_value_filename): Implement - (MAKE_GET_SIMPLE): Implement (copy from bonobo-conf) - (preferences_load_from_bonobo_pbag): Read enabled property - (preferences_load_from_bonobo_pbag): Forgive wallpaper_enabled and - enabled not being found - - * applier.c (applier_render_gradient_p): Implement - (applier_destroy): Make this static - - * preferences.c (preferences_load_from_bonobo_db): Use - bonobo_config_get_boolean rather than BONOBO_ARG_GET_BOOLEAN - (DB_GET_VALUE ()). Ditto bonobo_config_get_long - (preferences_load_from_bonobo_db): Pass ev pointer to each call to - bonobo_config_get_* - (preferences_load_from_bonobo_db): Check ev pointer after each - call to bonobo_config_get_* and return if an exception is set - (preferences_load_from_bonobo_db): Allow the enabled flag not to - be present in the database since some older configurations don't - have it included - (all): Remove support for compiling without bonobo-conf - -2001-09-07 Richard Hestilow - - * background-properties.glade: Redid UI a bit to add new enabled - checkbox. - - * background-properties.xml: Add default for "wallpaper_enabled". - - * preferences.[ch]: New function preferences_need_color_opts. - (preferences_load_from_bonobo_db): Load wallpaper_enabled from - bonobo-conf. - (preferences_load_from_bonobo_pbag): Ditto. - - * applier.[ch]: New function applier_get_wallpaper_pixbuf - (needed by preferences_need_color_opts, else pixbuf gets created - twice). - - * background-properties-capplet.c (real_realize_cb): Set - color frame sensitivity based on preferences_need_color_opts. - (property_change_cb): Ditto. - (setup_dialog): Add peditor/guard for wallpaper_enabled. Also, - set glade object data on the preferences structure as well. - -2001-09-03 Bradford Hovinen - - * background-properties-capplet.c (setup_dialog): Apply - preferences now if the preview widget is already realized - -2001-08-28 Bradford Hovinen - - * background-properties-capplet.c (get_legacy_settings): Retrieve - the correct value for wallpaper_types - - * applier.c (output_compat_prefs): Output the correct value for - wallpaperAlign - - * preferences.c (preferences_load_from_bonobo_pbag): Don't adjust - the opacity if the opacity setting is invalid - (preferences_load_from_bonobo_db): Ditto - -2001-08-27 Bradford Hovinen - - * background-properties-capplet.c (setup_dialog): Initialize/free - the CORBA environment structure - (real_realize_cb): Put into an idle handler, called by - realize_2_cb, the new timeout handler - - * preferences.c (preferences_load_from_bonobo_pbag): - (preferences_load_from_bonobo_db): Extract from preferences_new_* - - * background-properties-capplet.c (property_change_cb): - (realize_cb): Accept prefs structure in lieu of - Bonobo_PropertyBag; don't reload the preferences structure from - the property bag - (property_change_cb): Call preferences_apply_event to modify the - preferences structure appropriately - (property_change_cb): - (realize_cb): If the preferences structure is marked destroyed, - just return - (setup_dialog): Create a preferences structure from the property - bag given and use that as the extra data passed to callbacks - (realize_cb): Put into an idle handler real_realize_cb - - * preferences.c (preferences_apply_event): Implement - - * applier.c (output_compat_prefs): Make prefs const - - * applier.[ch]: Have applier_apply_prefs take a const Preferences - structure - - * preferences.[ch]: Make preferences_clone take a const - Preferences structure - -2001-08-26 Bradford Hovinen - - * applier.c (renderer_render_background): Remove debugging message - (renderer_render_wallpaper): Ditto - -2001-08-17 Bradford Hovinen - - * applier.c (renderer_render_wallpaper): Adjust opacity value to - 0...255 scale - - * preferences.c (preferences_new_from_bonobo_pbag): - (preferences_new_from_bonobo_db): Use correct check to disable - opacity - -2001-08-13 Richard Hestilow - - * background-properties-capplet.c (setup_dialog): Really - override enabled this time. Really. - -2001-08-13 Richard Hestilow - - * applier.c (applier_apply_prefs): Only draw disabled message - if do_preview. Actually, the user will never see this because - the correct behavior (which is done) is to assume if they're - running capplet, prefs->enable should be TRUE. This is because - we are only honoring enable as a hacker-only setting. - (output_compat_prefs): Output the correct "Enable" setting. - - * background-properties-capplet.c (get_legacy_settings): Support - the "Enabled" flag. - - * preferences.c (preferences_new_from_bonobo_db): Import the - "enabled" flag. Note that this is not bothered with in the _pbag - function, because that's from the Proxy settings, which is only - used for the GUI capplet, which always sets enabled to True, because - this is a hacker-only option. Got it? - - * background-properties.xml: Add "enabled". - -2001-07-31 Chema Celorio - - * Makefile.am (cappletname): add DISTDIR to install-data-local - -2001-07-27 Bradford Hovinen - - * background-properties-capplet.c (get_legacy_settings): Fix - val_ulong in the gradient case - - * RELEASE : 1.5.2 - -2001-07-26 Bradford Hovinen - - * applier.c (applier_apply_prefs): Don't try to load the wallpaper - if it's not enabled - - * preferences.c (preferences_new_from_bonobo_pbag): Use - bonobo_property_editor_client_get_value_* - (preferences_new_from_bonobo_pbag): Set gradient_enabled properly - from property bag - (preferences_new_from_bonobo_pbag): Check for wallpaper == "(none)" - (preferences_new_from_bonobo_db): Ditto above - - * applier.c (renderer_render_wallpaper): Restore some lost tweaks - from earlier. - - * preferences.c (preferences_init): strdup the home directory - - * applier.c: Store preview widget in the renderer, not the applier - itself - - * background-properties-capplet.c (create_dialog): Add a "(none)" - string to the history - -2001-07-26 Richard Hestilow - - * applier.c: Remove all bonobo-conf stuff. - - * preferences.[ch]: New functions preferences_new_from_bonobo_pbag - and preferences_new_from_bonobo_db. - -2001-07-26 Bradford Hovinen - - * background-properties.glade: Tweak borders and padding - - * applier.c (get_geometry): Tweak geometry settings - (renderer_render_wallpaper): Rendering geometry fixes - (renderer_render_wallpaper): Remove debugging code - - * background-properties-capplet.c (property_change_cb): Accept - applier as argument; retrieve property bag from applier - (realize_cb): Retrieve applier from widget - (setup_dialog): Store property bag in applier - - * applier.c (renderer_new): Store applier inside renderer; accept - applier as function parameter - - * background-properties-capplet.c (create_dialog): Store the - applier inside the widget - - * applier.c (struct _ApplierPrivate ): Define preview_widget here - rather than globally - (applier_get_preview_widget): Make this a method of the applier class - -2001-07-25 Chema Celorio - - * Makefile.am ($(oaffile)): remove the oaffile_IN_RULE macro and copy - it here - * Makefile.am: remove the DESKTOP_IN_RULE and copy the sed here - -2001-07-24 Bradford Hovinen - - * main.c (setup_dialog): Use bonobo_peditor_option_menu_construct - -2001-07-25 Richard Hestilow - - * main.c (setup_dialog): Hide opacity settings for now. - - * background-properties.glade: Rename opacity label. - -2001-07-24 Richard Hestilow - - * applier.c (output_compat_prefs): Write to gnome-config to make - nautilus happy. - (applier_apply_prefs): Change of is_nautilus_running handling - logic to still output legacy settings. Also, call - output_compat_prefs if is_root -. -2001-07-24 Richard Hestilow - - * main.c (main): Pass in legacy files to capplet_init. - -2001-07-23 Bradford Hovinen - - * applier.c (renderer_render_wallpaper): Don't adjust pixmap width - -2001-07-20 Chema Celorio - - * RELEASE : 1.5.0 - -2001-07-19 Chema Celorio - - * Makefile.am (cappletname): make distcheck love - -2001-07-19 Richard Hestilow - - * main.c: Add compatibility "-b" argument. - -2001-07-19 Richard Hestilow - - * applier.c: remove debugging spew - - * main.c (get_legacy_settings): Fix for FileName corba type. - (apply_settings): Check to make sure applier exists. - -2001-07-19 Bradford Hovinen - - * Makefile.am: Rename binary to background-properties - -2001-07-19 Richard Hestilow - - * background-properties.desktop.in.in: Change exec string for - bonobo-conf. - -2001-07-19 Richard Hestilow - - * bonobo-conf rewrite. - -2001-07-19 Bradford Hovinen - - * Makefile.am: Remove SUBDIRS - (background_properties_SOURCES): Added missing applier.h - - * prefs-widget.c: Remove references to auto apply feature - - * applier.c (get_geometry): Use vwidth and vheight rather than - dwidth and dheight when computing aspect ratio - (get_geometry): Adjust rwidth and rheight according to above change - - * preferences.c (preferences_changed): Disable auto-apply - - * background-properties.glade: Remove apply automatically check - button; change "More Solid" to "More Opaque" - -2001-07-17 Chema Celorio - - * start - diff --git a/capplets/background/Makefile.am b/capplets/background/Makefile.am deleted file mode 100644 index 6b5fce7d3..000000000 --- a/capplets/background/Makefile.am +++ /dev/null @@ -1,53 +0,0 @@ -# This is used in GNOMECC_CAPPLETS_CFLAGS -cappletname = background - -WALLPAPER_DATADIR = $(datadir)/gnome-background-properties - -INCLUDES = \ - $(GNOMECC_CAPPLETS_CFLAGS) \ - -DGNOMELOCALEDIR="\"$(datadir)/locale\"" \ - -DGNOMECC_GLADE_DIR="\"$(pkgdatadir)/glade\"" \ - -DWALLPAPER_DATADIR=\""$(WALLPAPER_DATADIR)"\" - -bin_PROGRAMS = gnome-background-properties - -noinst_LTLIBRARIES = libgnomewp.la - -gnome_background_properties_LDADD = \ - $(GNOMECC_CAPPLETS_LIBS) \ - libgnomewp.la - -gnome_background_properties_SOURCES = \ - gnome-wp-capplet.c gnome-wp-capplet.h \ - gnome-wp-info.c gnome-wp-info.h - -libgnomewp_la_SOURCES = \ - gnome-wp-item.c gnome-wp-item.h \ - gnome-wp-utils.c gnome-wp-utils.h \ - gnome-wp-xml.c gnome-wp-xml.h - -libgnomewp_la_LIBADD = \ - $(GNOMECC_CAPPLETS_LIBS) - -desktopdir = $(datadir)/applications -desktop_in_files = background.desktop.in -desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) - -@INTLTOOL_DESKTOP_RULE@ - -gladedir = $(pkgdatadir)/glade -glade_DATA = gnome-background-properties.glade - -install-data-local: - $(mkinstalldirs) $(DESTDIR)$(WALLPAPER_DATADIR) - -EXTRA_DIST = \ - background.desktop.in.in \ - $(glade_DATA) - -CLEANFILES = \ - $(desktop_in_files) $(desktop_DATA) - -MAINTAINERCLEANFILES = \ - Makefile.in - diff --git a/capplets/background/background.desktop.in.in b/capplets/background/background.desktop.in.in deleted file mode 100644 index 112af347a..000000000 --- a/capplets/background/background.desktop.in.in +++ /dev/null @@ -1,15 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -_Name=Desktop Background -_Comment=Change your Desktop Background settings -Exec=gnome-background-properties %F -Icon=preferences-desktop-wallpaper -Terminal=false -Type=Application -StartupNotify=true -Categories=GNOME;GTK;Settings;DesktopSettings; -OnlyShowIn=GNOME; -X-GNOME-Bugzilla-Bugzilla=GNOME -X-GNOME-Bugzilla-Product=gnome-control-center -X-GNOME-Bugzilla-Component=background -X-GNOME-Bugzilla-Version=@VERSION@ diff --git a/capplets/background/gnome-background-properties.glade b/capplets/background/gnome-background-properties.glade deleted file mode 100644 index 04292a287..000000000 --- a/capplets/background/gnome-background-properties.glade +++ /dev/null @@ -1,541 +0,0 @@ - - - - - - True - Desktop Background Preferences - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_CENTER - False - 360 - 418 - True - False - preferences-desktop-wallpaper - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - False - - - - True - False - 6 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-help - True - GTK_RELIEF_NORMAL - True - -11 - - - - - - True - True - True - GTK_RELIEF_NORMAL - True - -5 - - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-apply - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - _Finish - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - - - - - - 0 - False - True - GTK_PACK_END - - - - - - 12 - True - False - 6 - - - - True - <b>Desktop _Wallpaper</b> - True - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - wp_tree - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 6 - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 6 - - - - True - False - 6 - - - - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - False - False - False - True - False - False - False - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - True - False - 6 - - - - True - _Style: - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - - False - True - - - 0 - False - False - - - - - - True - True - _Remove - True - GTK_RELIEF_NORMAL - True - - - 0 - False - False - GTK_PACK_END - - - - - - True - True - _Add Wallpaper - True - GTK_RELIEF_NORMAL - True - - - 0 - False - False - GTK_PACK_END - - - - - 0 - False - False - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - <b>_Desktop Colors</b> - True - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - color_menu - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 6 - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - - False - True - - - 0 - False - False - - - - - - True - True - False - True - - Open a dialog to specify the color - - - - 0 - False - False - - - - - - True - False - True - - Open a dialog to specify the color - - - - 0 - False - False - - - - - 0 - False - False - - - - - 0 - True - True - - - - - - - diff --git a/capplets/background/gnome-wp-capplet.c b/capplets/background/gnome-wp-capplet.c deleted file mode 100644 index 6ad1e9977..000000000 --- a/capplets/background/gnome-wp-capplet.c +++ /dev/null @@ -1,1112 +0,0 @@ -/* - * Authors: Rodney Dawes - * - * Copyright 2003-2006 Novell, Inc. (www.novell.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of version 2 of the GNU General Public License - * as published by the Free Software Foundation - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - -#include "gnome-wp-capplet.h" - -enum { - TARGET_URI_LIST, - TARGET_URL, - TARGET_COLOR, - TARGET_BGIMAGE, - TARGET_BACKGROUND_RESET -}; - -static GtkTargetEntry drop_types[] = { - {"text/uri-list", 0, TARGET_URI_LIST}, - /* { "application/x-color", 0, TARGET_COLOR }, */ - { "property/bgimage", 0, TARGET_BGIMAGE }, - /* { "x-special/gnome-reset-background", 0, TARGET_BACKGROUND_RESET }*/ -}; - -static gchar **command_line_files = NULL; - -static const GOptionEntry options[] = { - { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &command_line_files, NULL, N_("[FILE...]") }, - { NULL } -}; - -static void wp_props_load_wallpaper (gchar * key, - GnomeWPItem * item, - GnomeWPCapplet * capplet); - -static void gnome_wp_set_sensitivities (GnomeWPCapplet* capplet); - -static void wp_properties_error_dialog (GtkWindow * parent, char const * msg, - GError * err) { - if (err != NULL) { - GtkWidget *dialog; - - dialog = gtk_message_dialog_new (GTK_WINDOW (parent), - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_CLOSE, - msg, err->message); - - g_signal_connect (G_OBJECT (dialog), - "response", - G_CALLBACK (gtk_widget_destroy), NULL); - gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); - gtk_widget_show (dialog); - g_error_free (err); - } -} - -static void wp_properties_help (GtkWindow * parent, char const * helpfile, - char const * section) { - GError *error = NULL; - - g_return_if_fail (helpfile != NULL); - g_return_if_fail (section != NULL); - - gnome_help_display_desktop (NULL, "user-guide", helpfile, section, &error); - if (error != NULL) { - wp_properties_error_dialog (parent, - _("There was an error displaying help: %s"), - error); - } -} - -static void gnome_wp_capplet_scroll_to_item (GnomeWPCapplet * capplet, - GnomeWPItem * item) { - GtkTreePath * path; - - g_return_if_fail (capplet != NULL); - - if (item == NULL) - return; - - path = gtk_tree_row_reference_get_path (item->rowref); - gtk_tree_view_set_cursor (GTK_TREE_VIEW (capplet->treeview), path, - NULL, FALSE); - gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (capplet->treeview), - path, NULL, TRUE, 0.5, 0.0); - gtk_tree_path_free (path); -} - -static GnomeWPItem * gnome_wp_add_image (GnomeWPCapplet * capplet, - const gchar * filename) { - GnomeWPItem * item; - - item = g_hash_table_lookup (capplet->wphash, filename); - if (item != NULL) { - if (item->deleted) { - item->deleted = FALSE; - wp_props_load_wallpaper (item->filename, item, capplet); - } - } else { - item = gnome_wp_item_new (filename, capplet->wphash, capplet->thumbs); - if (item != NULL) { - wp_props_load_wallpaper (item->filename, item, capplet); - } - } - - return item; -} - -static void gnome_wp_add_images (GnomeWPCapplet * capplet, - GSList * images) { - GdkCursor * cursor; - GnomeWPItem * item; - - item = NULL; - cursor = gdk_cursor_new_for_display (gdk_display_get_default (), - GDK_WATCH); - gdk_window_set_cursor (capplet->window->window, cursor); - gdk_cursor_unref (cursor); - - while (images != NULL) { - gchar * uri = images->data; - - item = gnome_wp_add_image (capplet, uri); - images = g_slist_remove (images, uri); - g_free (uri); - } - - gdk_window_set_cursor (capplet->window->window, NULL); - - if (item != NULL) { - gnome_wp_capplet_scroll_to_item (capplet, item); - } -} - -static void gnome_wp_file_open_dialog (GtkWidget * widget, - GnomeWPCapplet * capplet) { - GSList * files; - - switch (gtk_dialog_run (GTK_DIALOG (capplet->filesel))) { - case GTK_RESPONSE_OK: - files = gtk_file_chooser_get_filenames (GTK_FILE_CHOOSER (capplet->filesel)); - gnome_wp_add_images (capplet, files); - case GTK_RESPONSE_CANCEL: - default: - gtk_widget_hide (capplet->filesel); - break; - } -} - -static void bg_properties_dragged_image (GtkWidget * widget, - GdkDragContext * context, - gint x, gint y, - GtkSelectionData * selection_data, - guint info, guint time, - GnomeWPCapplet * capplet) { - - if (info == TARGET_URI_LIST || info == TARGET_BGIMAGE) { - GList * uris; - GSList * realuris = NULL; - - uris = gnome_vfs_uri_list_parse ((gchar *) selection_data->data); - - if (uris != NULL && uris->data != NULL) { - GdkCursor * cursor; - - cursor = gdk_cursor_new_for_display (gdk_display_get_default (), - GDK_WATCH); - gdk_window_set_cursor (capplet->window->window, cursor); - gdk_cursor_unref (cursor); - - for (; uris != NULL; uris = uris->next) { - realuris = g_slist_append (realuris, - g_strdup (gnome_vfs_uri_get_path (uris->data))); - } - gnome_wp_add_images (capplet, realuris); - gdk_window_set_cursor (capplet->window->window, NULL); - } - gnome_vfs_uri_list_free (uris); - } -} - -static void wp_props_load_wallpaper (gchar * key, - GnomeWPItem * item, - GnomeWPCapplet * capplet) { - GtkTreeIter iter; - GtkTreePath * path; - GdkPixbuf * pixbuf; - - if (item->deleted == TRUE) { - return; - } - - gtk_list_store_append (GTK_LIST_STORE (capplet->model), &iter); - - pixbuf = gnome_wp_item_get_thumbnail (item, capplet->thumbs); - gnome_wp_item_update_description (item); - - if (pixbuf != NULL) { - gtk_list_store_set (GTK_LIST_STORE (capplet->model), &iter, - 0, pixbuf, - 1, item->description, - 2, item->filename, - -1); - g_object_unref (pixbuf); - } else { - gtk_list_store_set (GTK_LIST_STORE (capplet->model), &iter, - 1, item->description, - 2, item->filename, - -1); - } - path = gtk_tree_model_get_path (capplet->model, &iter); - item->rowref = gtk_tree_row_reference_new (capplet->model, path); - gtk_tree_path_free (path); -} - -static void gnome_wp_option_menu_set (GnomeWPCapplet * capplet, - const gchar * value, - gboolean shade_type) { - if (shade_type) { - if (!strcmp (value, "horizontal-gradient")) { - gtk_combo_box_set_active (GTK_COMBO_BOX (capplet->color_opt), - GNOME_WP_SHADE_TYPE_HORIZ); - gtk_widget_show (capplet->sc_picker); - } else if (!strcmp (value, "vertical-gradient")) { - gtk_combo_box_set_active (GTK_COMBO_BOX (capplet->color_opt), - GNOME_WP_SHADE_TYPE_VERT); - gtk_widget_show (capplet->sc_picker); - } else { - gtk_combo_box_set_active (GTK_COMBO_BOX (capplet->color_opt), - GNOME_WP_SHADE_TYPE_SOLID); - gtk_widget_hide (capplet->sc_picker); - } - } else { - if (!strcmp (value, "centered")) { - gtk_combo_box_set_active (GTK_COMBO_BOX (capplet->wp_opts), - GNOME_WP_SCALE_TYPE_CENTERED); - } else if (!strcmp (value, "stretched")) { - gtk_combo_box_set_active (GTK_COMBO_BOX (capplet->wp_opts), - GNOME_WP_SCALE_TYPE_STRETCHED); - } else if (!strcmp (value, "scaled")) { - gtk_combo_box_set_active (GTK_COMBO_BOX (capplet->wp_opts), - GNOME_WP_SCALE_TYPE_SCALED); - } else if (!strcmp (value, "zoom")) { - gtk_combo_box_set_active (GTK_COMBO_BOX (capplet->wp_opts), - GNOME_WP_SCALE_TYPE_ZOOM); - } else if (strcmp (value, "none") != 0) { - gtk_combo_box_set_active (GTK_COMBO_BOX (capplet->wp_opts), - GNOME_WP_SCALE_TYPE_TILED); - } - } -} - -static gboolean gnome_wp_props_wp_set (GnomeWPCapplet * capplet) { - GtkTreeIter iter; - GtkTreeModel * model; - GtkTreeSelection * selection; - GnomeWPItem * item; - GConfChangeSet * cs; - gchar * wpfile; - - selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (capplet->treeview)); - if (gtk_tree_selection_get_selected (selection, &model, &iter)) { - gtk_tree_model_get (model, &iter, 2, &wpfile, -1); - - item = g_hash_table_lookup (capplet->wphash, wpfile); - - cs = gconf_change_set_new (); - - if (!strcmp (item->filename, "(none)")) { - gconf_change_set_set_string (cs, WP_OPTIONS_KEY, "none"); - gconf_change_set_set_string (cs, WP_FILE_KEY, ""); - } else { - gchar * uri; - - if (g_utf8_validate (item->filename, -1, NULL)) - uri = g_strdup (item->filename); - else - uri = g_filename_to_utf8 (item->filename, -1, NULL, NULL, NULL); - - gconf_change_set_set_string (cs, WP_FILE_KEY, uri); - g_free (uri); - - gconf_change_set_set_string (cs, WP_OPTIONS_KEY, item->options); - } - - gconf_change_set_set_string (cs, WP_SHADING_KEY, item->shade_type); - - gconf_change_set_set_string (cs, WP_PCOLOR_KEY, item->pri_color); - gconf_change_set_set_string (cs, WP_SCOLOR_KEY, item->sec_color); - - gconf_client_commit_change_set (capplet->client, cs, TRUE, NULL); - - gconf_change_set_unref (cs); - - g_free (wpfile); - } - - return FALSE; -} - -static void gnome_wp_props_wp_selected (GtkTreeSelection * selection, - GnomeWPCapplet * capplet) { - GtkTreeIter iter; - GtkTreeModel * model; - GnomeWPItem * item; - gchar * wpfile; - - if (gtk_tree_selection_get_selected (selection, &model, &iter)) { - gtk_tree_model_get (model, &iter, 2, &wpfile, -1); - - item = g_hash_table_lookup (capplet->wphash, wpfile); - - gnome_wp_set_sensitivities (capplet); - - if (strcmp (item->filename, "(none)") != 0) { - gnome_wp_option_menu_set (capplet, item->options, FALSE); - } - gnome_wp_option_menu_set (capplet, item->shade_type, TRUE); - - gtk_color_button_set_color (GTK_COLOR_BUTTON (capplet->pc_picker), - item->pcolor); - gtk_color_button_set_color (GTK_COLOR_BUTTON (capplet->sc_picker), - item->scolor); - - g_free (wpfile); - } else { - gtk_widget_set_sensitive (capplet->rm_button, FALSE); - } - - gnome_wp_props_wp_set (capplet); -} - -static void gnome_wp_remove_wp (gchar * key, GnomeWPItem * item, - GnomeWPCapplet * capplet) { - GtkTreePath * path; - GtkTreeIter iter; - - if (item->rowref != NULL && item->deleted == FALSE) { - path = gtk_tree_row_reference_get_path (item->rowref); - if (path != NULL) { - gtk_tree_model_get_iter (capplet->model, &iter, path); - gtk_tree_path_free (path); - - gtk_list_store_remove (GTK_LIST_STORE (capplet->model), &iter); - } - } -} - -void gnome_wp_main_quit (GnomeWPCapplet * capplet) { - g_hash_table_foreach (capplet->wphash, (GHFunc) gnome_wp_remove_wp, capplet); - - gnome_wp_xml_save_list (capplet); - - g_object_unref (capplet->thumbs); - - g_object_unref (capplet->client); - g_free (capplet); - - gtk_main_quit (); -} - -static void wallpaper_properties_clicked (GtkWidget * dialog, - gint response_id, - GnomeWPCapplet * capplet) { - switch (response_id) { - case GTK_RESPONSE_HELP: - wp_properties_help (GTK_WINDOW (dialog), - "user-guide.xml", "goscustdesk-7"); - break; - case GTK_RESPONSE_DELETE_EVENT: - case GTK_RESPONSE_OK: - gtk_widget_destroy (dialog); - gnome_wp_main_quit (capplet); - break; - } -} - -static void gnome_wp_scale_type_changed (GtkComboBox* combobox, - GnomeWPCapplet * capplet) { - GnomeWPItem * item = NULL; - GdkPixbuf * pixbuf; - GtkTreeIter iter; - GtkTreeModel * model; - GtkTreeSelection * selection; - gchar * wpfile; - - selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (capplet->treeview)); - if (gtk_tree_selection_get_selected (selection, &model, &iter)) { - gtk_tree_model_get (model, &iter, 2, &wpfile, -1); - - item = g_hash_table_lookup (capplet->wphash, wpfile); - - g_free (wpfile); - } - - if (item == NULL) { - return; - } - - g_free (item->options); - - switch (gtk_combo_box_get_active (GTK_COMBO_BOX (capplet->wp_opts))) { - case GNOME_WP_SCALE_TYPE_CENTERED: - item->options = g_strdup ("centered"); - break; - case GNOME_WP_SCALE_TYPE_STRETCHED: - item->options = g_strdup ("stretched"); - break; - case GNOME_WP_SCALE_TYPE_SCALED: - item->options = g_strdup ("scaled"); - break; - case GNOME_WP_SCALE_TYPE_ZOOM: - item->options = g_strdup ("zoom"); - break; - case GNOME_WP_SCALE_TYPE_TILED: - default: - item->options = g_strdup ("wallpaper"); - break; - } - pixbuf = gnome_wp_item_get_thumbnail (item, capplet->thumbs); - gtk_list_store_set (GTK_LIST_STORE (capplet->model), &iter, - 0, pixbuf, - -1); - g_object_unref (pixbuf); - gconf_client_set_string (capplet->client, WP_OPTIONS_KEY, - item->options, NULL); -} - -static void gnome_wp_shade_type_changed (GtkWidget* combobox, - GnomeWPCapplet * capplet) { - GnomeWPItem * item = NULL; - GtkTreeIter iter; - GtkTreeModel * model; - GtkTreeSelection * selection; - gchar * wpfile; - GdkPixbuf * pixbuf; - - selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (capplet->treeview)); - if (gtk_tree_selection_get_selected (selection, &model, &iter)) { - gtk_tree_model_get (model, &iter, 2, &wpfile, -1); - - item = g_hash_table_lookup (capplet->wphash, wpfile); - - g_free (wpfile); - } - - if (item == NULL) { - return; - } - - g_free (item->shade_type); - - switch (gtk_combo_box_get_active (GTK_COMBO_BOX (capplet->color_opt))) { - case GNOME_WP_SHADE_TYPE_HORIZ: - item->shade_type = g_strdup ("horizontal-gradient"); - gtk_widget_show (capplet->sc_picker); - break; - case GNOME_WP_SHADE_TYPE_VERT: - item->shade_type = g_strdup ("vertical-gradient"); - gtk_widget_show (capplet->sc_picker); - break; - case GNOME_WP_SHADE_TYPE_SOLID: - default: - item->shade_type = g_strdup ("solid"); - gtk_widget_hide (capplet->sc_picker); - break; - } - pixbuf = gnome_wp_item_get_thumbnail (item, capplet->thumbs); - gtk_list_store_set (GTK_LIST_STORE (capplet->model), &iter, - 0, pixbuf, - -1); - g_object_unref (pixbuf); - gconf_client_set_string (capplet->client, WP_SHADING_KEY, - item->shade_type, NULL); -} - -static void gnome_wp_color_changed (GnomeWPCapplet * capplet, - gboolean update) { - GnomeWPItem * item = NULL; - GtkTreeIter iter; - GtkTreeModel * model; - GtkTreeSelection * selection; - gchar * wpfile; - - selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (capplet->treeview)); - if (gtk_tree_selection_get_selected (selection, &model, &iter)) { - gtk_tree_model_get (model, &iter, 2, &wpfile, -1); - - item = g_hash_table_lookup (capplet->wphash, wpfile); - - g_free (wpfile); - } - - if (item == NULL) { - return; - } - - g_free (item->pri_color); - - gtk_color_button_get_color (GTK_COLOR_BUTTON (capplet->pc_picker), item->pcolor); - - item->pri_color = g_strdup_printf ("#%02X%02X%02X", - item->pcolor->red >> 8, - item->pcolor->green >> 8, - item->pcolor->blue >> 8); - - g_free (item->sec_color); - - gtk_color_button_get_color (GTK_COLOR_BUTTON (capplet->sc_picker), item->scolor); - - item->sec_color = g_strdup_printf ("#%02X%02X%02X", - item->scolor->red >> 8, - item->scolor->green >> 8, - item->scolor->blue >> 8); - - if (update) { - gconf_client_set_string (capplet->client, WP_PCOLOR_KEY, - item->pri_color, NULL); - gconf_client_set_string (capplet->client, WP_SCOLOR_KEY, - item->sec_color, NULL); - } - - gnome_wp_shade_type_changed (NULL, capplet); -} - -static void gnome_wp_scolor_changed (GtkWidget * widget, - GnomeWPCapplet * capplet) { - gnome_wp_color_changed (capplet, TRUE); -} - -static void gnome_wp_remove_wallpaper (GtkWidget * widget, - GnomeWPCapplet * capplet) { - GtkTreeIter iter; - GtkTreeModel * model; - GtkTreeSelection * selection; - - selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (capplet->treeview)); - if (gtk_tree_selection_get_selected (selection, &model, &iter)) { - GnomeWPItem * item; - gchar * wpfile; - GtkTreePath * path; - - gtk_tree_model_get (model, &iter, 2, &wpfile, -1); - - item = g_hash_table_lookup (capplet->wphash, wpfile); - item->deleted = TRUE; - g_free (wpfile); - - if (gtk_list_store_remove (GTK_LIST_STORE (model), &iter)) - path = gtk_tree_model_get_path (model, &iter); - else - path = gtk_tree_path_new_first (); - - gtk_tree_view_set_cursor (GTK_TREE_VIEW (capplet->treeview), - path, NULL, FALSE); - gtk_tree_path_free (path); - } -} - -static gboolean gnome_wp_load_stuffs (void * data) { - GnomeWPCapplet * capplet = (GnomeWPCapplet *) data; - gchar * imagepath, * style, * uri; - GnomeWPItem * item; - - gnome_wp_xml_load_list (capplet); - g_hash_table_foreach (capplet->wphash, (GHFunc) wp_props_load_wallpaper, - capplet); - - gdk_window_set_cursor (capplet->window->window, NULL); - - style = gconf_client_get_string (capplet->client, - WP_OPTIONS_KEY, - NULL); - if (style == NULL) - style = g_strdup ("none"); - - uri = gconf_client_get_string (capplet->client, - WP_FILE_KEY, - NULL); - if (uri == NULL) - uri = g_strdup ("(none)"); - - if (g_utf8_validate (uri, -1, NULL) && g_file_test (uri, G_FILE_TEST_EXISTS)) - imagepath = g_strdup (uri); - else - imagepath = g_filename_from_utf8 (uri, -1, NULL, NULL, NULL); - - g_free (uri); - - item = g_hash_table_lookup (capplet->wphash, imagepath); - if (item != NULL && strcmp (style, "none") != 0) { - if (item->deleted == TRUE) { - item->deleted = FALSE; - wp_props_load_wallpaper (item->filename, item, capplet); - } - - gnome_wp_capplet_scroll_to_item (capplet, item); - - gnome_wp_option_menu_set (capplet, item->options, FALSE); - gnome_wp_option_menu_set (capplet, item->shade_type, TRUE); - - gtk_color_button_set_color (GTK_COLOR_BUTTON (capplet->pc_picker), item->pcolor); - gtk_color_button_set_color (GTK_COLOR_BUTTON (capplet->sc_picker), item->scolor); - - } else if (strcmp (style, "none") != 0) { - item = gnome_wp_add_image (capplet, imagepath); - gnome_wp_capplet_scroll_to_item (capplet, item); - } - - item = g_hash_table_lookup (capplet->wphash, "(none)"); - if (item == NULL) { - item = gnome_wp_item_new ("(none)", capplet->wphash, capplet->thumbs); - if (item != NULL) { - wp_props_load_wallpaper (item->filename, item, capplet); - } - } else { - if (item->deleted == TRUE) { - item->deleted = FALSE; - wp_props_load_wallpaper (item->filename, item, capplet); - } - - if (!strcmp (style, "none")) { - gnome_wp_capplet_scroll_to_item (capplet, item); - } - } - g_free (imagepath); - g_free (style); - - if (capplet->uri_list) { - gnome_wp_add_images (capplet, capplet->uri_list); - } - - return FALSE; -} - -static gint gnome_wp_list_sort (GtkTreeModel * model, - GtkTreeIter * a, GtkTreeIter * b, - GnomeWPCapplet * capplet) { - gchar * foo, * bar; - gchar * desca, * descb; - gint retval; - - gtk_tree_model_get (model, a, 1, &desca, 2, &foo, -1); - gtk_tree_model_get (model, b, 1, &descb, 2, &bar, -1); - - if (!strcmp (foo, "(none)")) { - retval = -1; - } else if (!strcmp (bar, "(none)")) { - retval = 1; - } else { - retval = g_utf8_collate (desca, descb); - } - - g_free (desca); - g_free (descb); - g_free (foo); - g_free (bar); - - return retval; -} - -static void gnome_wp_file_changed (GConfClient * client, guint id, - GConfEntry * entry, - GnomeWPCapplet * capplet) { - GtkTreeSelection * selection; - GtkTreeModel * model; - GtkTreeIter iter; - GnomeWPItem * item; - gchar * wpfile, * selected; - const gchar * uri; - - uri = gconf_value_get_string (entry->value); - if (g_utf8_validate (uri, -1, NULL) && g_file_test (uri, G_FILE_TEST_EXISTS)) - wpfile = g_strdup (uri); - else - wpfile = g_filename_from_utf8 (uri, -1, NULL, NULL, NULL); - - item = g_hash_table_lookup (capplet->wphash, wpfile); - - selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (capplet->treeview)); - if (gtk_tree_selection_get_selected (selection, &model, &iter)) { - gtk_tree_model_get (model, &iter, 2, &selected, -1); - if (strcmp (selected, wpfile) != 0) { - if (item != NULL) { - gnome_wp_capplet_scroll_to_item (capplet, item); - } else { - item = gnome_wp_add_image (capplet, wpfile); - gnome_wp_capplet_scroll_to_item (capplet, item); - } - } - g_free (wpfile); - g_free (selected); - } -} - -static void gnome_wp_options_changed (GConfClient * client, guint id, - GConfEntry * entry, - GnomeWPCapplet * capplet) { - GtkTreeSelection * selection; - GtkTreeModel * model; - GtkTreeIter iter; - GnomeWPItem * item; - gchar * wpfile; - - selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (capplet->treeview)); - if (gtk_tree_selection_get_selected (selection, &model, &iter)) { - gtk_tree_model_get (model, &iter, 2, &wpfile, -1); - - item = g_hash_table_lookup (capplet->wphash, wpfile); - - if (item != NULL) { - g_free (item->options); - item->options = g_strdup (gconf_value_get_string (entry->value)); - gnome_wp_option_menu_set (capplet, item->options, FALSE); - } - g_free (wpfile); - } -} - -static void gnome_wp_shading_changed (GConfClient * client, guint id, - GConfEntry * entry, - GnomeWPCapplet * capplet) { - GtkTreeSelection * selection; - GtkTreeModel * model; - GtkTreeIter iter; - GnomeWPItem * item; - gchar * wpfile; - - gnome_wp_set_sensitivities (capplet); - - selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (capplet->treeview)); - if (gtk_tree_selection_get_selected (selection, &model, &iter)) { - gtk_tree_model_get (model, &iter, 2, &wpfile, -1); - - item = g_hash_table_lookup (capplet->wphash, wpfile); - - if (item != NULL) { - g_free (item->shade_type); - item->shade_type = g_strdup (gconf_value_get_string (entry->value)); - gnome_wp_option_menu_set (capplet, item->shade_type, TRUE); - } - g_free (wpfile); - } -} - -static void gnome_wp_color1_changed (GConfClient * client, guint id, - GConfEntry * entry, - GnomeWPCapplet * capplet) { - GdkColor color; - const gchar * colorhex; - - colorhex = gconf_value_get_string (entry->value); - - gdk_color_parse (colorhex, &color); - - gtk_color_button_set_color (GTK_COLOR_BUTTON (capplet->pc_picker), &color); - - - gnome_wp_color_changed (capplet, FALSE); -} - -static void gnome_wp_color2_changed (GConfClient * client, guint id, - GConfEntry * entry, - GnomeWPCapplet * capplet) { - GdkColor color; - const gchar * colorhex; - - gnome_wp_set_sensitivities (capplet); - - colorhex = gconf_value_get_string (entry->value); - - gdk_color_parse (colorhex, &color); - - gtk_color_button_set_color (GTK_COLOR_BUTTON (capplet->sc_picker), &color); - - gnome_wp_color_changed (capplet, FALSE); -} - -static GladeXML * gnome_wp_create_dialog (void) { - GladeXML * new; - gchar * gladefile; - - gladefile = g_build_filename (GNOMECC_GLADE_DIR, - "gnome-background-properties.glade", - NULL); - - if (!g_file_test (gladefile, G_FILE_TEST_EXISTS)) { - gladefile = g_build_filename (g_get_current_dir (), - "gnome-background-properties.glade", - NULL); - } - new = glade_xml_new (gladefile, NULL, NULL); - g_free (gladefile); - - return new; -} - -static void gnome_wp_update_preview (GtkFileChooser *chooser, - GnomeWPCapplet *capplet) { - gchar *uri; - - uri = gtk_file_chooser_get_preview_uri (chooser); - - if (uri) { - GdkPixbuf *pixbuf = NULL; - gchar *mime_type; - - mime_type = gnome_vfs_get_mime_type (uri); - if (mime_type) { - pixbuf = gnome_thumbnail_factory_generate_thumbnail (capplet->thumbs, - uri, - mime_type); - } - - if(pixbuf != NULL) { - gtk_image_set_from_pixbuf (GTK_IMAGE (capplet->image), pixbuf); - g_object_unref (pixbuf); - } else { - gtk_image_set_from_stock (GTK_IMAGE (capplet->image), - "gtk-dialog-question", - GTK_ICON_SIZE_DIALOG); - } - g_free (mime_type); - } - gtk_file_chooser_set_preview_widget_active (chooser, TRUE); -} - -static void wallpaper_properties_init (void) { - GnomeWPCapplet * capplet; - GladeXML * dialog; - GtkWidget * add_button; - GtkCellRenderer * renderer; - GtkTreeViewColumn * column; - GtkTreeSelection * selection; - GdkCursor * cursor; - GtkFileFilter *filter; - - gtk_rc_parse_string ("style \"wp-tree-defaults\" {\n" - " GtkTreeView::horizontal-separator = 6\n" - "} widget_class \"*TreeView*\"" - " style \"wp-tree-defaults\"\n" - "style \"wp-dialog-defaults\" {\n" - " GtkDialog::content-area-border = 0\n" - " GtkDialog::action-area-border = 12\n" - "} widget_class \"*Dialog*\"" - " style \"wp-dialog-defaults\"\n"); - - capplet = g_new0 (GnomeWPCapplet, 1); - capplet->client = gconf_client_get_default (); - - gconf_client_add_dir (capplet->client, WP_KEYBOARD_PATH, - GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); - gconf_client_add_dir (capplet->client, WP_PATH_KEY, - GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); - - gconf_client_notify_add (capplet->client, - WP_FILE_KEY, - (GConfClientNotifyFunc) gnome_wp_file_changed, - capplet, NULL, NULL); - gconf_client_notify_add (capplet->client, - WP_OPTIONS_KEY, - (GConfClientNotifyFunc) gnome_wp_options_changed, - capplet, NULL, NULL); - gconf_client_notify_add (capplet->client, - WP_SHADING_KEY, - (GConfClientNotifyFunc) gnome_wp_shading_changed, - capplet, NULL, NULL); - gconf_client_notify_add (capplet->client, - WP_PCOLOR_KEY, - (GConfClientNotifyFunc) gnome_wp_color1_changed, - capplet, NULL, NULL); - gconf_client_notify_add (capplet->client, - WP_SCOLOR_KEY, - (GConfClientNotifyFunc) gnome_wp_color2_changed, - capplet, NULL, NULL); - - capplet->wphash = g_hash_table_new (g_str_hash, g_str_equal); - - capplet->thumbs = gnome_thumbnail_factory_new (GNOME_THUMBNAIL_SIZE_NORMAL); - - dialog = gnome_wp_create_dialog (); - capplet->window = glade_xml_get_widget (dialog, "gnome_wp_properties"); - - gtk_window_set_default_icon_name ("preferences-desktop-wallpaper"); - - gtk_widget_realize (capplet->window); - - /* Drag and Drop Support */ - gtk_drag_dest_unset (capplet->window); - gtk_drag_dest_set (capplet->window, GTK_DEST_DEFAULT_ALL, drop_types, - sizeof (drop_types) / sizeof (drop_types[0]), - GDK_ACTION_COPY | GDK_ACTION_MOVE); - g_signal_connect (G_OBJECT (capplet->window), "drag_data_received", - G_CALLBACK (bg_properties_dragged_image), capplet); - - capplet->treeview = glade_xml_get_widget (dialog, "wp_tree"); - - capplet->model = GTK_TREE_MODEL (gtk_list_store_new (3, GDK_TYPE_PIXBUF, - G_TYPE_STRING, - G_TYPE_STRING)); - - gtk_tree_view_set_model (GTK_TREE_VIEW (capplet->treeview), capplet->model); - - column = gtk_tree_view_column_new (); - renderer = gtk_cell_renderer_pixbuf_new (); - gtk_tree_view_column_pack_start (column, renderer, FALSE); - gtk_tree_view_column_set_attributes (column, renderer, - "pixbuf", 0, - NULL); - - renderer = gtk_cell_renderer_text_new (); - gtk_tree_view_column_pack_start (column, renderer, FALSE); - gtk_tree_view_column_set_attributes (column, renderer, - "markup", 1, - NULL); - gtk_tree_view_column_set_spacing (column, 6); - - gtk_tree_view_append_column (GTK_TREE_VIEW (capplet->treeview), column); - - gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (capplet->model), 2, - (GtkTreeIterCompareFunc) gnome_wp_list_sort, - capplet, NULL); - - gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (capplet->model), - 2, GTK_SORT_ASCENDING); - - capplet->wp_opts = glade_xml_get_widget (dialog, "style_menu"); - - gtk_combo_box_append_text (GTK_COMBO_BOX (capplet->wp_opts), _("Centered")); - gtk_combo_box_append_text (GTK_COMBO_BOX (capplet->wp_opts), _("Fill Screen")); - gtk_combo_box_append_text (GTK_COMBO_BOX (capplet->wp_opts), _("Scaled")); - gtk_combo_box_append_text (GTK_COMBO_BOX (capplet->wp_opts), _("Zoom")); - gtk_combo_box_append_text (GTK_COMBO_BOX (capplet->wp_opts), _("Tiled")); - - g_signal_connect (G_OBJECT (capplet->wp_opts), "changed", - G_CALLBACK (gnome_wp_scale_type_changed), capplet); - - add_button = glade_xml_get_widget (dialog, "add_button"); - capplet->rm_button = glade_xml_get_widget (dialog, "rem_button"); - - g_signal_connect (G_OBJECT (add_button), "clicked", - G_CALLBACK (gnome_wp_file_open_dialog), capplet); - g_signal_connect (G_OBJECT (capplet->rm_button), "clicked", - G_CALLBACK (gnome_wp_remove_wallpaper), capplet); - - capplet->color_opt = glade_xml_get_widget (dialog, "color_menu"); - - gtk_combo_box_append_text (GTK_COMBO_BOX (capplet->color_opt), _("Solid Color")); - gtk_combo_box_append_text (GTK_COMBO_BOX (capplet->color_opt), _("Horizontal Gradient")); - gtk_combo_box_append_text (GTK_COMBO_BOX (capplet->color_opt), _("Vertical Gradient")); - - g_signal_connect (G_OBJECT (capplet->color_opt), "changed", - G_CALLBACK (gnome_wp_shade_type_changed), capplet); - - capplet->pc_picker = glade_xml_get_widget (dialog, "pcpicker"); - g_signal_connect (G_OBJECT (capplet->pc_picker), "color-set", - G_CALLBACK (gnome_wp_scolor_changed), capplet); - - capplet->sc_picker = glade_xml_get_widget (dialog, "scpicker"); - g_signal_connect (G_OBJECT (capplet->sc_picker), "color-set", - G_CALLBACK (gnome_wp_scolor_changed), capplet); - - g_signal_connect (G_OBJECT (capplet->window), "response", - G_CALLBACK (wallpaper_properties_clicked), capplet); - - gtk_widget_show (capplet->window); - - cursor = gdk_cursor_new_for_display (gdk_display_get_default (), - GDK_WATCH); - gdk_window_set_cursor (capplet->window->window, cursor); - gdk_cursor_unref (cursor); - - if (command_line_files != NULL) { - const gchar ** p; - - for (p = (const gchar **) command_line_files; *p != NULL; p++) { - capplet->uri_list = g_slist_append (capplet->uri_list, g_strdup (*p)); - } - g_strfreev (command_line_files); - } - - g_idle_add (gnome_wp_load_stuffs, capplet); - - selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (capplet->treeview)); - g_signal_connect (G_OBJECT (selection), "changed", - G_CALLBACK (gnome_wp_props_wp_selected), capplet); - - gnome_wp_set_sensitivities (capplet); - - /* Create the file chooser dialog stuff here */ - capplet->filesel = gtk_file_chooser_dialog_new_with_backend (_("Add Wallpaper"), - GTK_WINDOW (capplet->window), - GTK_FILE_CHOOSER_ACTION_OPEN, - "gtk+", - GTK_STOCK_CANCEL, - GTK_RESPONSE_CANCEL, - GTK_STOCK_OPEN, - GTK_RESPONSE_OK, - NULL); - gtk_file_chooser_set_select_multiple (GTK_FILE_CHOOSER (capplet->filesel), - TRUE); - - gtk_file_chooser_set_use_preview_label (GTK_FILE_CHOOSER (capplet->filesel), - FALSE); - - filter = gtk_file_filter_new (); - gtk_file_filter_add_pixbuf_formats (filter); - gtk_file_filter_set_name (filter, _("Images")); - gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (capplet->filesel), filter); - - filter = gtk_file_filter_new (); - gtk_file_filter_set_name (filter, _("All Files")); - gtk_file_filter_add_pattern (filter, "*"); - gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (capplet->filesel), filter); - - capplet->image = gtk_image_new (); - gtk_file_chooser_set_preview_widget (GTK_FILE_CHOOSER (capplet->filesel), - capplet->image); - gtk_widget_set_size_request (capplet->image, 128, -1); - - gtk_widget_show (capplet->image); - - g_signal_connect (capplet->filesel, "update-preview", - G_CALLBACK (gnome_wp_update_preview), capplet); -} - -static void gnome_wp_set_sensitivities (GnomeWPCapplet* capplet) { - GtkTreeIter iter; - GtkTreeModel * model; - GtkTreeSelection * selection; - GnomeWPItem * item; - gchar * wpfile; - gchar * filename = NULL; - - selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (capplet->treeview)); - if (gtk_tree_selection_get_selected (selection, &model, &iter)) { - gtk_tree_model_get (model, &iter, 2, &wpfile, -1); - - item = g_hash_table_lookup (capplet->wphash, wpfile); - filename = item->filename; - g_free (wpfile); - } - - if (!gconf_client_key_is_writable (capplet->client, WP_OPTIONS_KEY, NULL) - || (filename && !strcmp (filename, "(none)"))) - gtk_widget_set_sensitive (capplet->wp_opts, FALSE); - else - gtk_widget_set_sensitive (capplet->wp_opts, TRUE); - - if (!gconf_client_key_is_writable (capplet->client, WP_SHADING_KEY, NULL)) - gtk_widget_set_sensitive (capplet->color_opt, FALSE); - else - gtk_widget_set_sensitive (capplet->color_opt, TRUE); - - if (!gconf_client_key_is_writable (capplet->client, WP_PCOLOR_KEY, NULL)) - gtk_widget_set_sensitive (capplet->pc_picker, FALSE); - else - gtk_widget_set_sensitive (capplet->pc_picker, TRUE); - - if (!gconf_client_key_is_writable (capplet->client, WP_SCOLOR_KEY, NULL)) - gtk_widget_set_sensitive (capplet->sc_picker, FALSE); - else - gtk_widget_set_sensitive (capplet->sc_picker, TRUE); - - if (!filename || !strcmp (filename, "(none)")) - gtk_widget_set_sensitive (capplet->rm_button, FALSE); - else - gtk_widget_set_sensitive (capplet->rm_button, TRUE); -} - -gint main (gint argc, gchar *argv[]) { - GnomeProgram * program; - GOptionContext *ctx; - - ctx = g_option_context_new (_("- Desktop Background Preferences")); - -#ifdef ENABLE_NLS - bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); - bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); - textdomain (GETTEXT_PACKAGE); - g_option_context_add_main_entries (ctx, options, GETTEXT_PACKAGE); -#else - g_option_context_add_main_entries (ctx, options, NULL); -#endif - - program = gnome_program_init ("gnome-background-properties", VERSION, - LIBGNOMEUI_MODULE, argc, argv, - GNOME_PARAM_GOPTION_CONTEXT, ctx, - GNOME_PARAM_NONE); - - wallpaper_properties_init (); - - gtk_main (); - - g_object_unref (program); - - return 0; -} diff --git a/capplets/background/gnome-wp-capplet.h b/capplets/background/gnome-wp-capplet.h deleted file mode 100644 index 35a8b8da8..000000000 --- a/capplets/background/gnome-wp-capplet.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Authors: Rodney Dawes - * - * Copyright 2003-2006 Novell, Inc. (www.novell.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of version 2 of the GNU General Public License - * as published by the Free Software Foundation - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - -#ifndef _GNOME_WP_CAPPLET_H_ -#define _GNOME_WP_CAPPLET_H_ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -typedef struct _GnomeWPCapplet GnomeWPCapplet; - -#include "gnome-wp-info.h" -#include "gnome-wp-item.h" -#include "gnome-wp-utils.h" -#include "gnome-wp-xml.h" - -struct _GnomeWPCapplet { - GtkWidget * window; - - /* List of files passed to command line */ - GSList * uri_list; - - /* The Tree View */ - GtkWidget * treeview; - GtkTreeModel * model; - - /* Option Menu for Scaling Options */ - GtkWidget * wp_opts; - GtkWidget * rm_button; - - /* Widgets for Color Options */ - GtkWidget * color_opt; - GtkWidget * pc_picker; - GtkWidget * sc_picker; - - /* GConf Client */ - GConfClient * client; - - /* Thumbnailing and Icon Theme stuff */ - GnomeThumbnailFactory * thumbs; - - /* Hash Table of Wallpapers */ - GHashTable * wphash; - - /* File Chooser Dialog */ - GtkWidget * filesel; - GtkWidget * image; -}; - -typedef enum { - GNOME_WP_SHADE_TYPE_SOLID, - GNOME_WP_SHADE_TYPE_HORIZ, - GNOME_WP_SHADE_TYPE_VERT -} GnomeWPShadeType; - -typedef enum { - GNOME_WP_SCALE_TYPE_CENTERED, - GNOME_WP_SCALE_TYPE_STRETCHED, - GNOME_WP_SCALE_TYPE_SCALED, - GNOME_WP_SCALE_TYPE_ZOOM, - GNOME_WP_SCALE_TYPE_TILED -} GnomeWPScaleType; - -void gnome_wp_main_quit (GnomeWPCapplet * capplet); - -#endif - diff --git a/capplets/background/gnome-wp-info.c b/capplets/background/gnome-wp-info.c deleted file mode 100644 index 12ada351a..000000000 --- a/capplets/background/gnome-wp-info.c +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Authors: Rodney Dawes - * - * Copyright 2003-2006 Novell, Inc. (www.novell.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of version 2 of the GNU General Public License - * as published by the Free Software Foundation - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - -#include -#include -#include "gnome-wp-info.h" - -GnomeWPInfo * gnome_wp_info_new (const gchar * uri, - GnomeThumbnailFactory * thumbs) { - GnomeWPInfo * new; - GnomeVFSFileInfo * info; - GnomeVFSResult result; - gchar * escaped_path; - - info = gnome_vfs_file_info_new (); - escaped_path = gnome_vfs_escape_path_string (uri); - - result = gnome_vfs_get_file_info (escaped_path, info, - GNOME_VFS_FILE_INFO_DEFAULT | - GNOME_VFS_FILE_INFO_GET_MIME_TYPE | - GNOME_VFS_FILE_INFO_FOLLOW_LINKS); - if (info == NULL || info->mime_type == NULL || result != GNOME_VFS_OK) { - if (!strcmp (uri, "(none)")) { - new = g_new0 (GnomeWPInfo, 1); - - new->mime_type = g_strdup ("image/x-no-data"); - new->uri = g_strdup (uri); - new->name = g_strdup (_("No Wallpaper")); - new->size = 0; - } else { - new = NULL; - } - } else { - new = g_new0 (GnomeWPInfo, 1); - - new->uri = g_strdup (uri); - - new->thumburi = gnome_thumbnail_factory_lookup (thumbs, - escaped_path, - info->mtime); - new->name = g_strdup (info->name); - new->mime_type = g_strdup (info->mime_type); - - new->size = info->size; - new->mtime = info->mtime; - } - g_free (escaped_path); - gnome_vfs_file_info_unref (info); - - return new; -} - -GnomeWPInfo * gnome_wp_info_dup (const GnomeWPInfo * info) { - GnomeWPInfo * new; - - if (info == NULL) { - return NULL; - } - - new = g_new0 (GnomeWPInfo, 1); - - new->uri = g_strdup (info->uri); - new->thumburi = g_strdup (info->uri); - - new->name = g_strdup (info->name); - new->mime_type = g_strdup (info->mime_type); - - new->size = info->size; - new->mtime = info->mtime; - - return new; -} - -void gnome_wp_info_free (GnomeWPInfo * info) { - if (info == NULL) { - return; - } - - g_free (info->uri); - g_free (info->thumburi); - g_free (info->name); - g_free (info->mime_type); - - info = NULL; -} - diff --git a/capplets/background/gnome-wp-info.h b/capplets/background/gnome-wp-info.h deleted file mode 100644 index 2f58406eb..000000000 --- a/capplets/background/gnome-wp-info.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Authors: Rodney Dawes - * - * Copyright 2003-2006 Novell, Inc. (www.novell.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of version 2 of the GNU General Public License - * as published by the Free Software Foundation - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - -#ifndef _GNOME_WP_INFO_H_ -#define _GNOME_WP_INFO_H_ - -#include -#include -#include - -typedef struct _GnomeWPInfo GnomeWPInfo; - -struct _GnomeWPInfo { - gchar * uri; - gchar * thumburi; - gchar * name; - gchar * mime_type; - - GnomeVFSFileSize size; - - time_t mtime; -}; - -GnomeWPInfo * gnome_wp_info_new (const gchar * uri, - GnomeThumbnailFactory * thumbs); -GnomeWPInfo * gnome_wp_info_dup (const GnomeWPInfo * info); -void gnome_wp_info_free (GnomeWPInfo * info); - -#endif - diff --git a/capplets/background/gnome-wp-item.c b/capplets/background/gnome-wp-item.c deleted file mode 100644 index 5bc7d273a..000000000 --- a/capplets/background/gnome-wp-item.c +++ /dev/null @@ -1,385 +0,0 @@ -/* - * Authors: Rodney Dawes - * - * Copyright 2003-2006 Novell, Inc. (www.novell.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of version 2 of the GNU General Public License - * as published by the Free Software Foundation - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - -#include - -#include -#include -#include -#include -#include - -#include "gnome-wp-item.h" -#include "gnome-wp-utils.h" - -GnomeWPItem * gnome_wp_item_new (const gchar * filename, - GHashTable * wallpapers, - GnomeThumbnailFactory * thumbnails) { - GnomeWPItem * item = NULL; - GdkColor color1, color2; - GConfClient * client; - - client = gconf_client_get_default (); - - item = g_new0 (GnomeWPItem, 1); - - item->filename = gnome_vfs_unescape_string_for_display (filename); - - item->fileinfo = gnome_wp_info_new (item->filename, thumbnails); - - item->shade_type = gconf_client_get_string (client, WP_SHADING_KEY, NULL); - item->pri_color = gconf_client_get_string (client, WP_PCOLOR_KEY, NULL); - item->sec_color = gconf_client_get_string (client, WP_SCOLOR_KEY, NULL); - - 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); - - if (item->fileinfo != NULL && - !strncmp (item->fileinfo->mime_type, "image/", strlen ("image/"))) { - if (item->name == NULL) { - if (g_utf8_validate (item->fileinfo->name, -1, NULL)) - item->name = g_strdup (item->fileinfo->name); - else - item->name = g_filename_to_utf8 (item->fileinfo->name, -1, NULL, - NULL, NULL); - } - item->options = gconf_client_get_string (client, WP_OPTIONS_KEY, NULL); - - if (!strcmp (item->options, "none")) { - item->options = g_strdup ("scaled"); - } - gnome_wp_item_update_description (item); - - g_hash_table_insert (wallpapers, item->filename, item); - } else { - gnome_wp_item_free (item); - item = NULL; - } - - g_object_unref (client); - - return item; -} - -void gnome_wp_item_free (GnomeWPItem * item) { - if (item == NULL) { - return; - } - - g_free (item->name); - g_free (item->filename); - g_free (item->description); - g_free (item->imguri); - g_free (item->options); - g_free (item->shade_type); - - g_free (item->pri_color); - g_free (item->sec_color); - - if (item->pcolor != NULL) - gdk_color_free (item->pcolor); - - if (item->scolor != NULL) - gdk_color_free (item->scolor); - - gnome_wp_info_free (item->fileinfo); - gnome_wp_info_free (item->uriinfo); - - gtk_tree_row_reference_free (item->rowref); - - 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, - gint width, - gint height) { - gchar ** options; - gint n, count; - - count = 0; - - options = g_object_get_qdata (G_OBJECT (pixbuf), - g_quark_from_static_string ("gdk_pixbuf_options")); - if (options) { - for (n = 0; options[2 * n]; n++) { - ++count; - - *keys = g_realloc (*keys, sizeof (gchar *) * (count + 1)); - *vals = g_realloc (*vals, sizeof (gchar *) * (count + 1)); - - (*keys)[count - 1] = g_strdup (options[2 * n]); - (*vals)[count - 1] = g_strdup (options[2 * n + 1]); - - (*keys)[count] = NULL; - (*vals)[count] = NULL; - } - } - ++count; - - *keys = g_realloc (*keys, sizeof (gchar *) * (count + 1)); - *vals = g_realloc (*vals, sizeof (gchar *) * (count + 1)); - - (*keys)[count - 1] = g_strdup ("tEXt::Thumb::Image::Width"); - (*vals)[count - 1] = g_strdup_printf ("%d", width); - - (*keys)[count] = NULL; - (*vals)[count] = NULL; - - ++count; - - *keys = g_realloc (*keys, sizeof (gchar *) * (count + 1)); - *vals = g_realloc (*vals, sizeof (gchar *) * (count + 1)); - - (*keys)[count - 1] = g_strdup ("tEXt::Thumb::Image::Height"); - (*vals)[count - 1] = g_strdup_printf ("%d", height); - - (*keys)[count] = NULL; - (*vals)[count] = NULL; -} - -#define LIST_IMAGE_WIDTH 64 - -GdkPixbuf * gnome_wp_item_get_thumbnail (GnomeWPItem * item, - GnomeThumbnailFactory * thumbs) { - GdkPixbuf * pixbuf, * bgpixbuf; - GdkPixbuf * scaled = NULL; - gint sw, sh, bw, bh, pw, ph, tw, th; - gdouble ratio; - - sw = sh = bw = bh = pw = ph = tw = th = 0; - - /* - Get the size of the screen and calculate our aspect ratio divisor - We do this, so that images are thumbnailed as they would look on - the screen in reality - */ - sw = gdk_screen_get_width (gdk_screen_get_default ()); - sh = gdk_screen_get_height (gdk_screen_get_default ()); - ratio = (gdouble) sw / (gdouble) LIST_IMAGE_WIDTH; - bw = sw / ratio; - bh = sh / ratio; - - /* - Create the pixbuf for the background colors, which will show up for - oddly sized images, smaller images that are centered, or alpha images - */ - if (!strcmp (item->shade_type, "solid")) { - bgpixbuf = gnome_wp_pixbuf_new_solid (item->pcolor, bw, bh); - } else if (!strcmp (item->shade_type, "vertical-gradient")) { - bgpixbuf = gnome_wp_pixbuf_new_gradient (GTK_ORIENTATION_VERTICAL, - item->pcolor, item->scolor, - bw, bh); - } else { - bgpixbuf = gnome_wp_pixbuf_new_gradient (GTK_ORIENTATION_HORIZONTAL, - item->pcolor, item->scolor, - bw, bh); - } - - /* - Load up the thumbnail image using the thumbnail spec - If the image doesn't exist, we create it - If we are creating the thumbnail for "No Wallpaper", then we just copy - the background colors pixbuf we created above, here - */ - pixbuf = NULL; - if (!strcmp (item->filename, "(none)")) { - return bgpixbuf; - } else { - gchar * escaped_path, * thumbnail_filename; - - escaped_path = gnome_vfs_escape_path_string (item->filename); - thumbnail_filename = gnome_thumbnail_factory_lookup (thumbs, - escaped_path, - item->fileinfo->mtime); - - if (thumbnail_filename == NULL) { - pixbuf = gnome_thumbnail_factory_generate_thumbnail (thumbs, - escaped_path, - item->fileinfo->mime_type); - gnome_thumbnail_factory_save_thumbnail (thumbs, pixbuf, - escaped_path, - item->fileinfo->mtime); - g_object_unref (pixbuf); - pixbuf = NULL; - - thumbnail_filename = gnome_thumbnail_factory_lookup (thumbs, - escaped_path, - item->fileinfo->mtime); - } - - if (thumbnail_filename != NULL) { - - pixbuf = gdk_pixbuf_new_from_file (thumbnail_filename, NULL); - - if (pixbuf != NULL) { - g_free (item->fileinfo->thumburi); - item->fileinfo->thumburi = thumbnail_filename; - thumbnail_filename = NULL; - } - - g_free (thumbnail_filename); - } - - g_free (escaped_path); - } - - if (pixbuf != NULL) { - const gchar * w_val, * h_val; - - w_val = gdk_pixbuf_get_option (pixbuf, "tEXt::Thumb::Image::Width"); - h_val = gdk_pixbuf_get_option (pixbuf, "tEXt::Thumb::Image::Height"); - if (item->width <= 0 || item->height <= 0) { - if (w_val && h_val) { - item->width = atoi (w_val); - item->height = atoi (h_val); - } else { - gchar ** keys = NULL; - gchar ** vals = NULL; - - gdk_pixbuf_get_file_info (item->filename, - &item->width, &item->height); - collect_save_options (pixbuf, &keys, &vals, item->width, item->height); - gdk_pixbuf_savev (pixbuf, item->fileinfo->thumburi, "png", - keys, vals, NULL); - - g_strfreev (keys); - g_strfreev (vals); - } - } - - pw = gdk_pixbuf_get_width (pixbuf); - ph = gdk_pixbuf_get_height (pixbuf); - - if (item->width <= bw && item->height <= bh) - ratio = 1.0; - - tw = item->width / ratio; - th = item->height / ratio; - - if (!strcmp (item->options, "wallpaper")) { - scaled = gnome_wp_pixbuf_tile (pixbuf, bgpixbuf, tw, th); - } else if (!strcmp (item->options, "centered")) { - scaled = gnome_wp_pixbuf_center (pixbuf, bgpixbuf, tw, th); - } else if (!strcmp (item->options, "stretched")) { - scaled = gnome_wp_pixbuf_center (pixbuf, bgpixbuf, bw, bh); - } else if (!strcmp (item->options, "scaled")) { - if ((gdouble) ph * (gdouble) bw > (gdouble) pw * (gdouble) bh) { - tw = 0.5 + (gdouble) pw * (gdouble) bh / (gdouble) ph; - th = bh; - } else { - th = 0.5 + (gdouble) ph * (gdouble) bw / (gdouble) pw; - tw = bw; - } - scaled = gnome_wp_pixbuf_center (pixbuf, bgpixbuf, tw, th); - } else if (!strcmp (item->options, "zoom")) { - if ((gdouble) ph * (gdouble) bw < (gdouble) pw * (gdouble) bh) { - tw = 0.5 + (gdouble) pw * (gdouble) bh / (gdouble) ph; - th = bh; - } else { - th = 0.5 + (gdouble) ph * (gdouble) bw / (gdouble) pw; - tw = bw; - } - scaled = gnome_wp_pixbuf_center (pixbuf, bgpixbuf, tw, th); - } - - g_object_unref (pixbuf); - } - - g_object_unref (bgpixbuf); - - return scaled; -} - -void gnome_wp_item_update_description (GnomeWPItem * item) { - g_free (item->description); - - if (!strcmp (item->filename, "(none)")) { - item->description = g_strdup_printf ("%s", item->name); - } else { - gchar * info; - - /* - Translators: This message is used to render the type and size of the - background images in gnome-background-properites. The first "%s" will - be replaced by the image type, and the two "%d %s"s will be replaced - with the images' dimensions. For example, in US English, this may be - displayed as "JPEG Image, 1600 pixels x 1200 pixels". - - Do not translate the "background size|" type. Remove it from the - translation. - */ - info = g_strdup_printf (Q_("background size|%s, %d %s x %d %s"), - gnome_vfs_mime_get_description (item->fileinfo->mime_type), - item->width, - ngettext ("pixel", "pixels", item->width), - item->height, - ngettext ("pixel", "pixels", item->height)); - - item->description = g_markup_printf_escaped ("%s\n" - "%s", - item->name, - info); - - g_free (info); - } -} diff --git a/capplets/background/gnome-wp-item.h b/capplets/background/gnome-wp-item.h deleted file mode 100644 index 729e935c2..000000000 --- a/capplets/background/gnome-wp-item.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Authors: Rodney Dawes - * - * Copyright 2003-2006 Novell, Inc. (www.novell.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of version 2 of the GNU General Public License - * as published by the Free Software Foundation - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - -#include -#include -#include -#include -#include -#include - -#ifndef _GNOME_WP_ITEM_H_ -#define _GNOME_WP_ITEM_H_ - -typedef struct _GnomeWPItem GnomeWPItem; - -struct _GnomeWPItem { - gchar * name; - gchar * filename; - gchar * description; - gchar * imguri; - gchar * options; - gchar * shade_type; - gchar * pri_color; - gchar * sec_color; - - /* Where the Item is in the List */ - GtkTreeRowReference * rowref; - - /* Real colors */ - GdkColor * pcolor; - GdkColor * scolor; - - GnomeWPInfo * fileinfo; - GnomeWPInfo * uriinfo; - - /* Did the user remove us? */ - gboolean deleted; - - /* Width and Height of the original image */ - gint width; - gint height; -}; - -GnomeWPItem * gnome_wp_item_new (const gchar * filename, - GHashTable * wallpapers, - GnomeThumbnailFactory * thumbnails); -void gnome_wp_item_free (GnomeWPItem * item); -GnomeWPItem * gnome_wp_item_dup (GnomeWPItem * item); -GdkPixbuf * gnome_wp_item_get_thumbnail (GnomeWPItem * item, - GnomeThumbnailFactory * thumbs); -void gnome_wp_item_update_description (GnomeWPItem * item); - -#endif - diff --git a/capplets/background/gnome-wp-utils.c b/capplets/background/gnome-wp-utils.c deleted file mode 100644 index aa1555f47..000000000 --- a/capplets/background/gnome-wp-utils.c +++ /dev/null @@ -1,198 +0,0 @@ -/* - * Authors: Rodney Dawes - * - * Copyright 2003-2006 Novell, Inc. (www.novell.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of version 2 of the GNU General Public License - * as published by the Free Software Foundation - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - -#include "gnome-wp-utils.h" -#include - -GdkPixbuf * gnome_wp_pixbuf_new_gradient (GtkOrientation orientation, - GdkColor * c1, - GdkColor * c2, - gint width, gint height) { - GdkPixbuf * pixbuf; - gint i, j; - gint dr, dg, db; - gint gs1; - gint vc = ((orientation == GTK_ORIENTATION_HORIZONTAL) || (c1 == c2)); - guchar * b, * row, * d; - int rowstride; - - pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, width, height); - d = gdk_pixbuf_get_pixels (pixbuf); - rowstride = gdk_pixbuf_get_rowstride (pixbuf); - - dr = c2->red - c1->red; - dg = c2->green - c1->green; - db = c2->blue - c1->blue; - - gs1 = (orientation == GTK_ORIENTATION_VERTICAL) ? height - 1 : width - 1; - - row = g_new (unsigned char, rowstride); - - if (vc) { - b = row; - for (j = 0; j < width; j++) { - *b++ = (c1->red + (j * dr) / gs1) >> 8; - *b++ = (c1->green + (j * dg) / gs1) >> 8; - *b++ = (c1->blue + (j * db) / gs1) >> 8; - } - } - - for (i = 0; i < height; i++) { - if (!vc) { - unsigned char cr, cg, cb; - cr = (c1->red + (i * dr) / gs1) >> 8; - cg = (c1->green + (i * dg) / gs1) >> 8; - cb = (c1->blue + (i * db) / gs1) >> 8; - b = row; - for (j = 0; j < width; j++) { - *b++ = cr; - *b++ = cg; - *b++ = cb; - } - } - memcpy (d, row, width * 3); - d += rowstride; - } - g_free (row); - - return pixbuf; -} - -GdkPixbuf * gnome_wp_pixbuf_new_solid (GdkColor * color, - gint width, gint height) { - GdkPixbuf * pixbuf; - gint j, rowstride; - guchar * b, * d, * row; - - pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, width, height); - d = gdk_pixbuf_get_pixels (pixbuf); - rowstride = gdk_pixbuf_get_rowstride (pixbuf); - - row = g_new (unsigned char, rowstride); - - b = row; - for (j = 0; j < width; j++) { - *b++ = color->red >> 8; - *b++ = color->green >> 8; - *b++ = color->blue >> 8; - } - - for (j = 0; j < height; j++) { - memcpy (d, row, width * 3); - d += rowstride; - } - - g_free (row); - - return pixbuf; -} - -GdkPixbuf * gnome_wp_pixbuf_tile (GdkPixbuf * src_pixbuf, - GdkPixbuf * dest_pixbuf, - gint scaled_width, - gint scaled_height) { - GdkPixbuf * tmpbuf; - gdouble cx, cy; - gint dwidth, dheight; - gint swidth, sheight; - guint alpha = 255; - - if (dest_pixbuf == NULL) { - return gdk_pixbuf_copy (src_pixbuf); - } - - tmpbuf = gdk_pixbuf_scale_simple (src_pixbuf, scaled_width, scaled_height, - GDK_INTERP_BILINEAR); - - swidth = gdk_pixbuf_get_width (tmpbuf); - sheight = gdk_pixbuf_get_height (tmpbuf); - - dwidth = gdk_pixbuf_get_width (dest_pixbuf); - dheight = gdk_pixbuf_get_height (dest_pixbuf); - - for (cy = 0; cy < dheight; cy += sheight) { - for (cx = 0; cx < dwidth; cx += swidth) { - gdk_pixbuf_composite (tmpbuf, dest_pixbuf, cx, cy, - MIN (swidth, dwidth - cx), - MIN (sheight, dheight - cy), - cx, cy, 1.0, 1.0, - GDK_INTERP_BILINEAR, alpha); - } - } - g_object_unref (tmpbuf); - - return gdk_pixbuf_copy (dest_pixbuf); -} - -GdkPixbuf * gnome_wp_pixbuf_center (GdkPixbuf * src_pixbuf, - GdkPixbuf * dest_pixbuf, - gint scaled_width, - gint scaled_height) { - GdkPixbuf * tmpbuf; - gint ox, oy, cx, cy; - gint dwidth, dheight; - gint swidth, sheight; - gint cwidth, cheight; - guint alpha = 255; - - if (dest_pixbuf == NULL) { - return gdk_pixbuf_copy (src_pixbuf); - } - - ox = cx = oy = cy = 0; - - tmpbuf = gdk_pixbuf_scale_simple (src_pixbuf, scaled_width, scaled_height, - GDK_INTERP_BILINEAR); - - swidth = gdk_pixbuf_get_width (tmpbuf); - sheight = gdk_pixbuf_get_height (tmpbuf); - - dwidth = gdk_pixbuf_get_width (dest_pixbuf); - dheight = gdk_pixbuf_get_height (dest_pixbuf); - - if (dwidth > swidth) { - ox = (dwidth - swidth) / 2; - cx = 0; - cwidth = swidth; - } else { - cx = (swidth - dwidth) / 2; - oy = 0; - cwidth = dwidth; - } - - if (dheight > sheight) { - oy = ((dheight - sheight) / 2); - cy = 0; - cheight = sheight; - } else { - cy = (sheight - dheight) / 2; - oy = 0; - cheight = dheight; - } - - gdk_pixbuf_composite (tmpbuf, dest_pixbuf, ox, oy, - cwidth, cheight, - ox - cx, oy - cy, 1.0, 1.0, - GDK_INTERP_BILINEAR, alpha); - - g_object_unref (tmpbuf); - return gdk_pixbuf_copy (dest_pixbuf); -} - diff --git a/capplets/background/gnome-wp-utils.h b/capplets/background/gnome-wp-utils.h deleted file mode 100644 index abfcd4f7a..000000000 --- a/capplets/background/gnome-wp-utils.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Authors: Rodney Dawes - * - * Copyright 2003-2006 Novell, Inc. (www.novell.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of version 2 of the GNU General Public License - * as published by the Free Software Foundation - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - -#ifndef _GNOME_WP_UTILS_H_ -#define _GNOME_WP_UTILS_H_ - -#include -#include - -#define WP_PATH_KEY "/desktop/gnome/background" -#define WP_FILE_KEY WP_PATH_KEY "/picture_filename" -#define WP_OPTIONS_KEY WP_PATH_KEY "/picture_options" -#define WP_SHADING_KEY WP_PATH_KEY "/color_shading_type" -#define WP_PCOLOR_KEY WP_PATH_KEY "/primary_color" -#define WP_SCOLOR_KEY WP_PATH_KEY "/secondary_color" -#define WP_KEYBOARD_PATH "/desktop/gnome/peripherals/keyboard" -#define WP_DELAY_KEY WP_KEYBOARD_PATH "/delay" - -G_BEGIN_DECLS - -GdkPixbuf * gnome_wp_pixbuf_new_gradient (GtkOrientation orientation, - GdkColor * c1, - GdkColor * c2, - gint width, gint height); - -GdkPixbuf * gnome_wp_pixbuf_new_solid (GdkColor * color, - gint width, gint height); - -GdkPixbuf * gnome_wp_pixbuf_tile (GdkPixbuf * src_pixbuf, - GdkPixbuf * dest_pixbuf, - gint scaled_width, - gint scaled_height); - -GdkPixbuf * gnome_wp_pixbuf_center (GdkPixbuf * src_pixbuf, - GdkPixbuf * dest_pixbuf, - gint scaled_width, - gint scaled_height); - -G_END_DECLS - -#endif diff --git a/capplets/background/gnome-wp-xml.c b/capplets/background/gnome-wp-xml.c deleted file mode 100644 index 79171515d..000000000 --- a/capplets/background/gnome-wp-xml.c +++ /dev/null @@ -1,407 +0,0 @@ -/* - * Authors: Rodney Dawes - * - * Copyright 2003-2006 Novell, Inc. (www.novell.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of version 2 of the GNU General Public License - * as published by the Free Software Foundation - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - -#include "gnome-wp-capplet.h" - -static gboolean gnome_wp_xml_get_bool (const xmlNode * parent, - const gchar * prop_name) { - xmlChar * prop; - gboolean ret_val = FALSE; - - g_return_val_if_fail (parent != NULL, FALSE); - g_return_val_if_fail (prop_name != NULL, FALSE); - - prop = xmlGetProp ((xmlNode *) parent, (xmlChar*)prop_name); - if (prop != NULL) { - if (!g_strcasecmp ((gchar *)prop, "true") || !g_strcasecmp ((gchar *)prop, "1")) { - ret_val = TRUE; - } else { - ret_val = FALSE; - } - g_free (prop); - } - - return ret_val; -} - -static void gnome_wp_xml_set_bool (const xmlNode * parent, - const xmlChar * prop_name, gboolean value) { - g_return_if_fail (parent != NULL); - g_return_if_fail (prop_name != NULL); - - if (value) { - xmlSetProp ((xmlNode *) parent, prop_name, (xmlChar *)"true"); - } else { - xmlSetProp ((xmlNode *) parent, prop_name, (xmlChar *)"false"); - } -} - -static void gnome_wp_load_legacy (GnomeWPCapplet * capplet) { - FILE * fp; - gchar * foo, * filename; - - filename = g_build_filename (g_get_home_dir (), ".gnome2", - "wallpapers.list", NULL); - - if (g_file_test (filename, G_FILE_TEST_EXISTS)) { - if ((fp = fopen (filename, "r")) != NULL) { - foo = (gchar *) g_malloc (sizeof (gchar) * 4096); - while (fgets (foo, 4096, fp)) { - GnomeWPItem * item; - - if (foo[strlen (foo) - 1] == '\n') { - foo[strlen (foo) - 1] = '\0'; - } - - item = g_hash_table_lookup (capplet->wphash, foo); - if (item != NULL) { - continue; - } - - if (!g_file_test (foo, G_FILE_TEST_EXISTS)) { - continue; - } - - item = gnome_wp_item_new (foo, capplet->wphash, capplet->thumbs); - if (item != NULL && item->fileinfo == NULL) { - gnome_wp_item_free (item); - } - } - fclose (fp); - g_free (foo); - } - } - - g_free (filename); -} - -static void gnome_wp_xml_load_xml (GnomeWPCapplet * capplet, - const gchar * filename) { - xmlDoc * wplist; - xmlNode * root, * list, * wpa; - xmlChar * nodelang; - const gchar * const * syslangs; - GdkColor color1, color2; - GnomeWPItem * item; - gint i; - -#if GLIB_CHECK_VERSION (2, 6, 0) - syslangs = g_get_language_names (); -#endif - - wplist = xmlParseFile (filename); - - if (!wplist) - return; - - root = xmlDocGetRootElement (wplist); - - for (list = root->children; list != NULL; list = list->next) { - if (!strcmp ((gchar *)list->name, "wallpaper")) { - GnomeWPItem * wp; - - wp = g_new0 (GnomeWPItem, 1); - - wp->deleted = gnome_wp_xml_get_bool (list, "deleted"); - - for (wpa = list->children; wpa != NULL; wpa = wpa->next) { - if (!strcmp ((gchar *)wpa->name, "filename")) { - if (wpa->last != NULL && wpa->last->content != NULL) { - const char * none = "(none)"; - gchar *content = g_strstrip ((gchar *)wpa->last->content); - - if (!strncmp (content, none, strlen (none))) - wp->filename = g_strdup (content); - else if (g_utf8_validate (content, -1, NULL) && - g_file_test (content, G_FILE_TEST_EXISTS)) - wp->filename = g_strdup (content); - else - wp->filename = g_filename_from_utf8 (content, -1, NULL, NULL, NULL); - } else { - break; - } - } else if (!strcmp ((gchar *)wpa->name, "name")) { - if (wpa->last != NULL && wpa->last->content != NULL) { - nodelang = xmlNodeGetLang (wpa->last); - - if (wp->name == NULL && nodelang == NULL) { - wp->name = g_strdup (g_strstrip ((gchar *)wpa->last->content)); - } else { - for (i = 0; syslangs[i] != NULL; i++) { - if (!strcmp (syslangs[i], (gchar *)nodelang)) { - g_free (wp->name); - wp->name = g_strdup (g_strstrip ((gchar *)wpa->last->content)); - break; - } - } - } - - xmlFree (nodelang); - } else { - break; - } - } else if (!strcmp ((gchar *)wpa->name, "imguri")) { - if (wpa->last != NULL) { - wp->imguri = g_strdup (g_strstrip ((gchar *)wpa->last->content)); - } - } else if (!strcmp ((gchar *)wpa->name, "options")) { - if (wpa->last != NULL) { - wp->options = g_strdup (g_strstrip ((gchar *)wpa->last->content)); - } else { - wp->options = gconf_client_get_string (capplet->client, - WP_OPTIONS_KEY, NULL); - } - } else if (!strcmp ((gchar *)wpa->name, "shade_type")) { - if (wpa->last != NULL) { - wp->shade_type = g_strdup (g_strstrip ((gchar *)wpa->last->content)); - } - } else if (!strcmp ((gchar *)wpa->name, "pcolor")) { - if (wpa->last != NULL) { - wp->pri_color = g_strdup (g_strstrip ((gchar *)wpa->last->content)); - } - } else if (!strcmp ((gchar *)wpa->name, "scolor")) { - if (wpa->last != NULL) { - wp->sec_color = g_strdup (g_strstrip ((gchar *)wpa->last->content)); - } - } else if (!strcmp ((gchar *)wpa->name, "text")) { - /* Do nothing here, libxml2 is being weird */ - } else { - g_warning ("Unknown Tag: %s\n", wpa->name); - } - } - - /* Make sure we don't already have this one and that filename exists */ - if (wp->filename != NULL) { - item = g_hash_table_lookup (capplet->wphash, wp->filename); - - if (item != NULL) { - gnome_wp_item_free (wp); - continue; - } - } else { - gnome_wp_item_free (wp); - continue; - } - - /* Verify the colors and alloc some GdkColors here */ - if (wp->shade_type == NULL) { - wp->shade_type = gconf_client_get_string (capplet->client, - WP_SHADING_KEY, NULL); - } - if (wp->pri_color == NULL) { - wp->pri_color = gconf_client_get_string (capplet->client, - WP_PCOLOR_KEY, NULL); - } - if (wp->sec_color == NULL) { - wp->sec_color = gconf_client_get_string (capplet->client, - WP_SCOLOR_KEY, NULL); - } - gdk_color_parse (wp->pri_color, &color1); - gdk_color_parse (wp->sec_color, &color2); - - wp->pcolor = gdk_color_copy (&color1); - wp->scolor = gdk_color_copy (&color2); - - if ((wp->filename != NULL && - g_file_test (wp->filename, G_FILE_TEST_EXISTS)) || - !strcmp (wp->filename, "(none)")) { - wp->fileinfo = gnome_wp_info_new (wp->filename, capplet->thumbs); - - if (wp->name == NULL || !strcmp (wp->filename, "(none)")) { - wp->name = g_strdup (wp->fileinfo->name); - } - - gnome_wp_item_update_description (wp); - g_hash_table_insert (capplet->wphash, wp->filename, wp); - } else { - gnome_wp_item_free (wp); - } - } - } - xmlFreeDoc (wplist); -} - -static void gnome_wp_file_changed (GnomeVFSMonitorHandle * handle, - const gchar * monitor_uri, - const gchar * info_uri, - GnomeVFSMonitorEventType event_type, - GnomeWPCapplet * capplet) { - gchar * filename; - - switch (event_type) { - case GNOME_VFS_MONITOR_EVENT_CHANGED: - case GNOME_VFS_MONITOR_EVENT_CREATED: - filename = gnome_vfs_get_local_path_from_uri (info_uri); - gnome_wp_xml_load_xml (capplet, filename); - g_free (filename); - default: - break; - } -} - -void gnome_wp_xml_load_list (GnomeWPCapplet * capplet) { - GnomeVFSMonitorHandle * handle; - GList * list, * l; - gchar * wpdbfile, * xdgdirslist; - gchar ** xdgdirs; - gint i; - - wpdbfile = g_build_filename (g_get_home_dir (), - ".gnome2", - "backgrounds.xml", - NULL); - - if (g_file_test (wpdbfile, G_FILE_TEST_EXISTS)) { - gnome_wp_xml_load_xml (capplet, wpdbfile); - } else { - g_free (wpdbfile); - wpdbfile = g_build_filename (g_get_home_dir (), - ".gnome2", - "wp-list.xml", - NULL); - if (g_file_test (wpdbfile, G_FILE_TEST_EXISTS)) { - gnome_wp_xml_load_xml (capplet, wpdbfile); - } - } - g_free (wpdbfile); - - xdgdirslist = g_strdup (g_getenv ("XDG_DATA_DIRS")); - if (xdgdirslist == NULL || strlen (xdgdirslist) == 0) - xdgdirslist = g_strdup ("/usr/local/share:/usr/share"); - - xdgdirs = g_strsplit (xdgdirslist, ":", -1); - for (i = 0; xdgdirs && xdgdirs[i]; i++) { - gchar * datadir; - - datadir = g_build_filename (xdgdirs[i], "gnome-background-properties", - NULL); - if (g_file_test (datadir, G_FILE_TEST_IS_DIR)) { - gnome_vfs_directory_list_load (&list, datadir, - GNOME_VFS_FILE_INFO_DEFAULT | - GNOME_VFS_FILE_INFO_FOLLOW_LINKS); - - for (l = list; l != NULL; l = l->next) { - GnomeVFSFileInfo * info = l->data; - - if (strcmp (".", info->name) != 0 && strcmp ("..", info->name) != 0) { - gchar * filename; - - filename = g_build_filename (datadir, info->name, NULL); - gnome_wp_xml_load_xml (capplet, filename); - g_free (filename); - } - } - gnome_vfs_file_info_list_free (list); - - gnome_vfs_monitor_add (&handle, datadir, GNOME_VFS_MONITOR_DIRECTORY, - (GnomeVFSMonitorCallback) gnome_wp_file_changed, - capplet); - } - g_free (datadir); - } - g_strfreev (xdgdirs); - g_free (xdgdirslist); - - if (g_file_test (WALLPAPER_DATADIR, G_FILE_TEST_IS_DIR)) { - gnome_vfs_directory_list_load (&list, WALLPAPER_DATADIR, - GNOME_VFS_FILE_INFO_DEFAULT | - GNOME_VFS_FILE_INFO_FOLLOW_LINKS); - - for (l = list; l != NULL; l = l->next) { - GnomeVFSFileInfo * info = l->data; - - if (strcmp (".", info->name) != 0 && strcmp ("..", info->name) != 0) { - gchar * filename; - - filename = g_build_filename (WALLPAPER_DATADIR, info->name, NULL); - gnome_wp_xml_load_xml (capplet, filename); - g_free (filename); - } - } - gnome_vfs_file_info_list_free (list); - - gnome_vfs_monitor_add (&handle, WALLPAPER_DATADIR, GNOME_VFS_MONITOR_DIRECTORY, - (GnomeVFSMonitorCallback) gnome_wp_file_changed, - capplet); - } - - gnome_wp_load_legacy (capplet); -} - -static void gnome_wp_list_flatten (const gchar * key, GnomeWPItem * item, - GSList ** list) { - g_return_if_fail (key != NULL); - g_return_if_fail (item != NULL); - - *list = g_slist_prepend (*list, item); -} - -void gnome_wp_xml_save_list (GnomeWPCapplet * capplet) { - xmlDoc * wplist; - xmlNode * root, * wallpaper, * item; - GSList * list = NULL; - gchar * wpfile; - - g_hash_table_foreach_remove (capplet->wphash, - (GHRFunc) gnome_wp_list_flatten, &list); - g_hash_table_destroy (capplet->wphash); - list = g_slist_reverse (list); - - wpfile = g_build_filename (g_get_home_dir (), - "/.gnome2", - "backgrounds.xml", - NULL); - - xmlKeepBlanksDefault (0); - - wplist = xmlNewDoc ((xmlChar *)"1.0"); - xmlCreateIntSubset (wplist, (xmlChar *)"wallpapers", NULL, (xmlChar *)"gnome-wp-list.dtd"); - root = xmlNewNode (NULL, (xmlChar *)"wallpapers"); - xmlDocSetRootElement (wplist, root); - - while (list != NULL) { - GnomeWPItem * wpitem = list->data; - const char * none = "(none)"; - gchar * filename; - - if (!strncmp (wpitem->filename, none, strlen (none)) || - (g_utf8_validate (wpitem->filename, -1, NULL) && - g_file_test (wpitem->filename, G_FILE_TEST_EXISTS))) - filename = g_strdup (wpitem->filename); - else - filename = g_filename_to_utf8 (wpitem->filename, -1, NULL, NULL, NULL); - - wallpaper = xmlNewChild (root, NULL, (xmlChar *)"wallpaper", NULL); - gnome_wp_xml_set_bool (wallpaper, (xmlChar *)"deleted", wpitem->deleted); - item = xmlNewTextChild (wallpaper, NULL, (xmlChar *)"name", (xmlChar *)wpitem->name); - item = xmlNewTextChild (wallpaper, NULL, (xmlChar *)"filename", (xmlChar *)filename); - item = xmlNewTextChild (wallpaper, NULL, (xmlChar *)"options", (xmlChar *)wpitem->options); - item = xmlNewTextChild (wallpaper, NULL, (xmlChar *)"shade_type", (xmlChar *)wpitem->shade_type); - item = xmlNewTextChild (wallpaper, NULL, (xmlChar *)"pcolor", (xmlChar *)wpitem->pri_color); - item = xmlNewTextChild (wallpaper, NULL, (xmlChar *)"scolor", (xmlChar *)wpitem->sec_color); - g_free (filename); - - list = g_slist_remove (list, wpitem); - gnome_wp_item_free (wpitem); - } - xmlSaveFormatFile (wpfile, wplist, 1); - xmlFreeDoc (wplist); - g_free (wpfile); -} diff --git a/capplets/background/gnome-wp-xml.h b/capplets/background/gnome-wp-xml.h deleted file mode 100644 index 7bccc49f9..000000000 --- a/capplets/background/gnome-wp-xml.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Authors: Rodney Dawes - * - * Copyright 2003-2006 Novell, Inc. (www.novell.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of version 2 of the GNU General Public License - * as published by the Free Software Foundation - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - -#ifndef _GNOME_WP_XML_H_ -#define _GNOME_WP_XML_H_ - -void gnome_wp_xml_load_list (GnomeWPCapplet * capplet); -void gnome_wp_xml_save_list (GnomeWPCapplet * capplet); - -#endif - diff --git a/capplets/common/gnome-theme-info.c b/capplets/common/gnome-theme-info.c index f7dce8b35..3f8211b86 100644 --- a/capplets/common/gnome-theme-info.c +++ b/capplets/common/gnome-theme-info.c @@ -1991,6 +1991,17 @@ gnome_theme_init (gboolean *monitor_not_added) top_theme_dir_string = g_build_filename (INSTALL_PREFIX, "share", "icons", NULL); } top_theme_dir_uri = gnome_vfs_uri_new (top_theme_dir_string); + +#ifdef XCURSOR_ICONDIR + /* if there's a separate xcursors dir, add that as well */ + if (strcmp (XCURSOR_ICONDIR, top_theme_dir_string) && + strcmp (XCURSOR_ICONDIR, "/usr/share/icons")) { + top_theme_dir_uri = gnome_vfs_uri_new (XCURSOR_ICONDIR); + if (gnome_vfs_uri_exists (top_theme_dir_uri)) + result = add_top_icon_theme_dir_monitor (top_theme_dir_uri, &real_monitor_not_added, 1, NULL); + gnome_vfs_uri_unref (top_theme_dir_uri); + } +#endif g_free (top_theme_dir_string); if (!gnome_vfs_uri_exists (top_theme_dir_uri)) diff --git a/capplets/font/ChangeLog b/capplets/font/ChangeLog deleted file mode 100644 index 1b77070a2..000000000 --- a/capplets/font/ChangeLog +++ /dev/null @@ -1,344 +0,0 @@ -2007-04-27 Rodrigo Moya - - * font-properties.desktop.in.in: renamed Bugzilla product. - -2007-04-08 Jens Granseuer - - Patch by: Kristof Vansant - - * font-properties.glade: don't require gnome glade lib - -2007-01-07 Thomas Wood - - Based on patch by: Gabor Kelemen - - * main.c: (application_font_to_gconf): Fixes bug 335963 ("Font may be - too large" dialog unclear). - -2006-06-06 Sergey Udaltsov - - * Makefile.am: added $(GNOMECC_CAPPLETS_LIBS) - -2006-02-17 Rodrigo Moya - - Fixes #327021 - - * main.c (setup_dialog): don't unref the GladeXML structure, it's - needed in the callbacks. - -2005-11-14 Kjartan Maraas - - * main.c: (setup_font_sample): Fix compiler warnings. - -2005-05-22 Sebastien Bacher - - * font-properties.glade: - * main.c: (application_font_to_gconf), (application_font_changed), - (setup_dialog), (cb_show_details), (main): - port of the font capplet to gtk_font_button and some cleanup, - patch from paolo borelli (Closes: #160016). - -2005-01-02 Sebastien Bacher - - * font-properties.glade: - patch from Heikki Paajanen (based on the patch - from Andrew Johnson ) - to not set "close" as the default button (Closes: #98202). - -2004-11-09 Mark McLoughlin - - * Makefile.am: install .desktop file in $(datadir)/applications. - - * font-properties.desktop.in: add OnlyShowIn=GNOME; - -2004-10-14 Jody Goldberg - - * Release 2.8.1 - -2004-08-20 Frederic Crozat - - * main.c: (setup_dialog): - Use themed iconf for WM hint. - -2004-05-17 Jody Goldberg - - http://bugzilla.gnome.org/show_bug.cgi?id=142190 - http://bugzilla.gnome.org/show_bug.cgi?id=142191 - * font-properties.glade : fix conflicting mnemonics - -2004-04-15 Jody Goldberg - - * Release 2.6.1 - -2004-04-01 Jody Goldberg - - * Release 2.6.0.3 - -2004-03-30 Jody Goldberg - - * Release 2.6.0.1 - -2004-03-23 Jody Goldberg - - * Release 2.6.0 - -2004-03-11 Jody Goldberg - - * Release 2.5.4 - -2004-02-16 Jody Goldberg - - http://bugzilla.gnome.org/show_bug.cgi?id=134446 - * font-properties.glade : removed space - -2004-02-13 Jody Goldberg - - * Release 2.5.3 - -2004-02-12 Mark McLoughlin - - * main.c: (cb_dialog_response), (cb_details_response): Update help - link to point to user-guide.xml - -2004-01-14 Jody Goldberg - - * Release 2.5.2 - -2003-12-30 Jody Goldberg - - * Release 2.5.1.1 - -2003-12-30 Jody Goldberg - - * Release 2.5.1 - -2003-11-06 Padraig O'Briain - - * font-properties.glade: Correct mnemonic widget for Window title font. - Move declaration of GnomeFontPicker for applications to immediately - after declaration of the label. This fixes bug #125689. - -2003-10-28 Jody Goldberg - - * Release 2.5.0 - -2003-10-28 Jody Goldberg - - http://bugzilla.gnome.org/show_bug.cgi?id=116710 - * main.c (cb_show_details) : be smarter about selecting a maximum - - http://bugzilla.gnome.org/show_bug.cgi?id=115435 - * font-properties.glade : some of the UI review changes. - - http://bugzilla.gnome.org/show_bug.cgi?id=124513 - * main.c (setup_font_sample) : merge in patch to allocate black and - white correctly on TruColor displays. - -2003-10-23 Jody Goldberg - - http://bugzilla.gnome.org/show_bug.cgi?id=106489 - * main.c (dpi_load) : add some protection again invalid dpi in the - case of gconf failure. - -2003-08-01 Dennis Cranston - - * font-properties.glade: Patch to fix spacing between action - area and vbox of preferences dialog. - -Sat Aug 2 01:16:16 2003 Jonathan Blandford - - * main.c (application_font_to_gconf): Warn when a font larger than - 31 points is selected, #97653. - -2003-07-17 Dennis Cranston - - * font-properties.glade: Some HIGification of the dialog. - Fixes some of ui-review bug #98922. - -2003-07-07 Jody Goldberg - - * Release 2.3.4 - -2003-06-24 Jody Goldberg - - * Release 2.3.3 - -2003-05-07 Jody Goldberg - - * Release 2.3.1 - -Wed Jan 15 12:50:34 2003 Jonathan Blandford - - * main.c (cb_details_response): run "nautilus --no-desktop - fonts:///" if button pressed. - - (cb_show_details): show a 'Go to font folder' button if fonts:/// - exists. - -Tue Feb 4 17:09:18 2003 Jonathan Blandford - - * Release 2.2.0.1 - -Tue Jan 21 01:15:14 2003 Jonathan Blandford - - * Release 2.2.0 - -Thu Jan 16 02:41:09 2003 Jonathan Blandford - - * Release 2.1.7 - -2003-01-10 Jody Goldberg - - * Release 2.1.6 - -2002-12-18 Jody Goldberg - - * Release 2.1.5 - -2002-11-23 Jody Goldberg - - * Release 2.1.3 - -2002-11-13 Pasupathi Duraisamy - - * main.c: Added the "desktop_font" key directory to the list - of directories GConfClient will watch for changes. - Fixes Bug #94766. - -2002-11-02 Jody Goldberg - - * Release 2.1.2 - -Fri Nov 1 18:21:22 2002 Jonathan Blandford - - * main.c: remove the duplicate #defined key. - -2002-10-21 Jody Goldberg - - * Release 2.1.1 - -2002-10-16 Jody Goldberg - - http://bugzilla.gnome.org/show_bug.cgi?id=95807 - From sylvain_pasche@yahoo.fr - * main.c (open_pattern) : Add a safety check. - -2002-10-01 Jody Goldberg - - * Release 2.1.0.1 - -2002-08-21 Jody Goldberg - - * Release 2.1.0 - -2002-08-19 Ross Burton - - * font-properties.desktop.in: Fix the desktop file so that it - validates. - -2002-08-19 Jody Goldberg - - * font-properties.glade : - * main.c: (setup_dialog): merge in owen's patch to configure the - window title font and the font to use for terminals. This patch - uses a metacity specific key for the window title. Owen ? Seth ? - Can you folk choose please. - -2002-06-24 Seth Nickell - - * font-properties.glade: - * main.c: (setup_dialog): - - Add a font picker for controlling the window title font (and size). - Set border widths nicely so things align. - -2002-07-24 jacob berkman - - * Makefile.am (EXTRA_DIST): dist the pixel icons - -2002-07-02 Jody Goldberg - - http://bugzilla.gnome.org/show_bug.cgi?id=85629 - * font-properties.glade : Make wider to avoid clipping. - -2002-06-27 Jody Goldberg - - http://bugzilla.gnome.org/show_bug.cgi?id=86593 - * main.c (setup_dialog) : watch for missing icons - -2002-06-17 Jody Goldberg - - * Release 2.0.0 - -2002-05-28 Satyajit Kanungo - - * main.c : Changed the help file link - to get the help document from user-guide. - -2002-05-26 Jody Goldberg - - * main.c (cb_dialog_response) : improve handling of help failures. - -Sun May 26 11:38:48 2002 Jonathan Blandford - - * main.c (main): use APPID instead of argv[0] - -Fri May 10 19:00:25 2002 Jonathan Blandford - - * main.c (DESKTOP_FONT_NAME_KEY): get it to use the right key. - -2002-05-08 Jody Goldberg - - * main.c (cb_dialog_response) : new. - (setup_dialog) : support help. - -2002-04-27 Seth Nickell - - * font-properties.desktop.in: - - Tweak categories and comment a little. - - * font-properties.glade: - - Change labels to be a little more descriptive, - force dialogue to be a little larger. - -2002-04-26 Seth Nickell - - * Makefile.am: - * font-properties.glade: - * main.c: (create_dialog), (setup_dialog), (main): - - Bring back in sync with the merged theme/font dialog. - -Wed Apr 10 18:03:00 2002 Jonathan Blandford - - * font-properties.desktop.in (Exec): s/gnome2/gnome - -2002-03-27 Lauris Kaplinski - - * main.c (response_cb): No responses here - (font_capplet_custom_toggled): New signal handler - (font_capplet_font_set): Ditto - (font_capplet_value_notify): Ditto - (setup_dialog): Removed peditor stuff, as I do not know, how to - mix it with NULL == unset, string == set - (main): Get GConfClient and activate directory - - * font-properties.glade: Reverted to original version, - added label telling about applying - -2002-03-17 Jonathan Blandford - - * font-properties.glade: - * main.c: (setup_dialog): - -2002-02-27 Kjartan Maraas - - * main.c: s/PACKAGE/GETTEXT_PACKAGE/g - -2002-02-18 Gediminas Paulauskas - - * ChangeLog: added - * main.c: correct i18n - diff --git a/capplets/font/Makefile.am b/capplets/font/Makefile.am deleted file mode 100644 index 7f6e3eb9e..000000000 --- a/capplets/font/Makefile.am +++ /dev/null @@ -1,38 +0,0 @@ -# This is used in GNOMECC_CAPPLETS_CFLAGS -cappletname = font - -bin_PROGRAMS = gnome-font-properties - -gnome_font_properties_LDADD = \ - $(top_builddir)/capplets/common/libcommon.la \ - $(FONT_CAPPLET_LIBS) \ - $(GNOMECC_CAPPLETS_LIBS) - -gnome_font_properties_SOURCES = \ - main.c -gnome_font_properties_LDFLAGS = -export-dynamic - -@INTLTOOL_DESKTOP_RULE@ - -pixmapdir = $(pkgdatadir)/pixmaps -pixmap_DATA = \ - subpixel-rgb.png \ - subpixel-bgr.png \ - subpixel-vrgb.png \ - subpixel-vbgr.png - -desktopdir = $(datadir)/applications -Desktop_in_files = font-properties.desktop.in -desktop_DATA = $(Desktop_in_files:.desktop.in=.desktop) - -gladedir = $(pkgdatadir)/glade -glade_DATA = font-properties.glade - -INCLUDES = $(FONT_CAPPLET_CFLAGS) \ - $(GNOMECC_CAPPLETS_CFLAGS) \ - -DGLADEDIR=\""$(gladedir)"\" \ - -DGNOMELOCALEDIR="\"$(datadir)/locale\"" \ - -DPIXMAPDIR=\""$(pixmapdir)"\" \ - -DGNOMECC_DATA_DIR="\"$(pkgdatadir)\"" -CLEANFILES = $(GNOMECC_CAPPLETS_CLEANFILES) $(Desktop_in_files) $(desktop_DATA) -EXTRA_DIST = $(glade_DATA) $(pixmap_DATA) diff --git a/capplets/font/font-properties.desktop.in.in b/capplets/font/font-properties.desktop.in.in deleted file mode 100644 index cc9108380..000000000 --- a/capplets/font/font-properties.desktop.in.in +++ /dev/null @@ -1,15 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -_Name=Font -_Comment=Select fonts for the desktop -Exec=gnome-font-properties -Icon=gnome-settings-font -Terminal=false -Type=Application -StartupNotify=true -Categories=GNOME;GTK;Settings;DesktopSettings; -OnlyShowIn=GNOME; -X-GNOME-Bugzilla-Bugzilla=GNOME -X-GNOME-Bugzilla-Product=gnome-control-center -X-GNOME-Bugzilla-Component=font properties -X-GNOME-Bugzilla-Version=@VERSION@ diff --git a/capplets/font/font-properties.glade b/capplets/font/font-properties.glade deleted file mode 100644 index fbef7bb50..000000000 --- a/capplets/font/font-properties.glade +++ /dev/null @@ -1,1655 +0,0 @@ - - - - - - 5 - Font Preferences - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - False - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - False - - - - True - False - 2 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-help - True - GTK_RELIEF_NORMAL - True - -11 - - - - - - True - True - True - gtk-close - True - GTK_RELIEF_NORMAL - True - -7 - - - - - 0 - False - True - GTK_PACK_END - - - - - - 5 - True - False - 18 - - - - True - 5 - 2 - False - 6 - 12 - - - - True - _Application font: - True - False - GTK_JUSTIFY_RIGHT - False - False - 0 - 0.5 - 0 - 0 - application_font - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - True - True - True - True - False - True - - - 1 - 2 - 0 - 1 - - - - - - - True - _Fixed width font: - True - False - GTK_JUSTIFY_RIGHT - False - False - 0 - 0.5 - 0 - 0 - monospace_font - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 4 - 5 - fill - - - - - - - True - _Window title font: - True - False - GTK_JUSTIFY_RIGHT - False - False - 0 - 0.5 - 0 - 0 - window_title_font - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 3 - 4 - fill - - - - - - - True - Des_ktop font: - True - False - GTK_JUSTIFY_RIGHT - False - False - 0 - 0.5 - 0 - 0 - desktop_font - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 2 - 3 - fill - - - - - - - True - True - True - True - True - False - True - - - 1 - 2 - 4 - 5 - fill - - - - - - - True - True - True - True - True - False - True - - - 1 - 2 - 3 - 4 - fill - - - - - - - True - True - True - True - True - False - True - - - 1 - 2 - 2 - 3 - fill - - - - - - - True - _Document font: - True - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - document_font - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - True - True - True - True - False - True - - - 1 - 2 - 1 - 2 - fill - - - - - - 0 - True - True - - - - - - True - False - 6 - - - - True - <b>Font Rendering</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - 3 - 2 - False - 6 - 12 - - - - True - False - 6 - - - - True - True - _Monochrome - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 0 - 0 - - - - True - - - - - 0 - True - True - - - - - 0 - 1 - 0 - 1 - - - - - - True - 1 - 0.5 - 0 - 1 - 0 - 0 - 0 - 0 - - - - True - True - D_etails... - True - GTK_RELIEF_NORMAL - True - - - - - 1 - 2 - 2 - 3 - fill - - - - - - - True - False - 6 - - - - True - True - Best _shapes - True - GTK_RELIEF_NORMAL - True - False - False - True - monochrome_radio - - - 0 - False - False - - - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 0 - 0 - - - - True - - - - - 0 - True - True - - - - - 1 - 2 - 0 - 1 - - - - - - True - False - 6 - - - - True - True - Best co_ntrast - True - GTK_RELIEF_NORMAL - True - False - False - True - monochrome_radio - - - 0 - False - False - - - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 0 - 0 - - - - True - - - - - 0 - True - True - - - - - 0 - 1 - 1 - 2 - - - - - - True - False - 6 - - - - True - True - Sub_pixel smoothing (LCDs) - True - GTK_RELIEF_NORMAL - True - False - False - True - monochrome_radio - - - 0 - False - False - - - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 0 - 0 - - - - True - - - - - 0 - True - True - - - - - 1 - 2 - 1 - 2 - - - - - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - - - 5 - Font Rendering Details - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - False - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - False - - - - True - False - 2 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-help - True - GTK_RELIEF_NORMAL - True - -11 - - - - - - True - True - True - Go _to font folder - True - GTK_RELIEF_NORMAL - True - 1 - - - - - - True - True - True - gtk-close - True - GTK_RELIEF_NORMAL - True - -7 - - - - - 0 - False - True - GTK_PACK_END - - - - - - 5 - True - False - 12 - - - - True - 0 - 0.5 - 0 - 1 - 0 - 0 - 0 - 0 - - - - True - False - 10 - - - - True - R_esolution: - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - dpi_spinner - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - 1 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 96 50 200 1 10 10 - - - 0 - True - False - - - - - - True - dots per inch - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - - 0 - False - False - - - - - - True - False - 0 - - - - True - <b>Smoothing</b>: - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - 2 - 2 - False - 0 - 0 - - - - True - False - 0 - - - - True - True - _None - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - 5 - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 0 - 0 - - - - True - - - - - 0 - True - True - - - - - 0 - 1 - 0 - 1 - fill - - - - - - True - False - 0 - - - - True - True - Gra_yscale - True - GTK_RELIEF_NORMAL - True - False - False - True - antialias_none_radio - - - 0 - False - False - - - - - - 5 - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 0 - 0 - - - - True - - - - - 0 - True - True - - - - - 1 - 2 - 0 - 1 - fill - - - - - - True - False - 0 - - - - True - True - Sub_pixel (LCDs) - True - GTK_RELIEF_NORMAL - True - False - False - True - antialias_none_radio - - - 0 - False - False - - - - - - 5 - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 0 - 0 - - - - True - - - - - 0 - True - True - - - - - 0 - 1 - 1 - 2 - fill - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - True - False - 0 - - - - True - <b>Hinting</b>: - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - 2 - 2 - False - 0 - 0 - - - - True - False - 0 - - - - True - True - N_one - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - 5 - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 0 - 0 - - - - True - - - - - 0 - True - True - - - - - 0 - 1 - 0 - 1 - - - - - - True - False - 0 - - - - True - True - _Slight - True - GTK_RELIEF_NORMAL - True - False - False - True - hint_none_radio - - - 0 - False - False - - - - - - 5 - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 0 - 0 - - - - True - - - - - 0 - True - True - - - - - 1 - 2 - 0 - 1 - fill - - - - - - True - False - 0 - - - - True - True - _Medium - True - GTK_RELIEF_NORMAL - True - False - False - True - hint_none_radio - - - 0 - False - False - - - - - - 5 - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 0 - 0 - - - - True - - - - - 0 - True - True - - - - - 0 - 1 - 1 - 2 - fill - - - - - - True - False - 0 - - - - True - True - _Full - True - GTK_RELIEF_NORMAL - True - False - False - True - hint_none_radio - - - 0 - False - False - - - - - - 5 - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 0 - 0 - - - - True - - - - - 0 - True - True - - - - - 1 - 2 - 1 - 2 - fill - fill - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - True - False - 0 - - - - True - <b>Subpixel order</b>: - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - 2 - 2 - False - 5 - 5 - - - - True - False - 0 - - - - True - True - _RGB - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - True - True - - - - - - True - 0.5 - 0.5 - 0 - 0 - - - 5 - False - False - - - - - 0 - 1 - 0 - 1 - - - - - - True - False - 0 - - - - True - True - _BGR - True - GTK_RELIEF_NORMAL - True - False - False - True - subpixel_rgb_radio - - - 0 - True - True - - - - - - True - 0.5 - 0.5 - 0 - 0 - - - 5 - False - False - - - - - 1 - 2 - 0 - 1 - fill - - - - - - True - False - 0 - - - - True - True - _VRGB - True - GTK_RELIEF_NORMAL - True - False - False - True - subpixel_rgb_radio - - - 0 - True - True - - - - - - True - 0.5 - 0.5 - 0 - 0 - - - 5 - False - False - - - - - 0 - 1 - 1 - 2 - fill - - - - - - True - False - 0 - - - - True - True - VB_GR - True - GTK_RELIEF_NORMAL - True - False - False - True - subpixel_rgb_radio - - - 0 - True - True - - - - - - True - 0.5 - 0.5 - 0 - 0 - - - 5 - False - False - - - - - 1 - 2 - 1 - 2 - fill - fill - - - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - - diff --git a/capplets/font/main.c b/capplets/font/main.c deleted file mode 100644 index 4bd94e7fc..000000000 --- a/capplets/font/main.c +++ /dev/null @@ -1,1020 +0,0 @@ -/* This program was written with lots of love under the GPL by Jonathan - * Blandford - */ - -#include - -#include -#include -#include -#include -#include -#include - -#ifdef HAVE_XFT2 -#include -#include -#endif /* HAVE_XFT2 */ - -#include "capplet-util.h" -#include "activate-settings-daemon.h" -#include "gconf-property-editor.h" - -#ifdef HAVE_XFT2 -static void cb_show_details (GtkWidget *button, - GtkWindow *parent); -#endif /* HAVE_XFT2 */ - -#define GTK_FONT_KEY "/desktop/gnome/interface/font_name" -#define DESKTOP_FONT_KEY "/apps/nautilus/preferences/desktop_font" - -#define METACITY_DIR "/apps/metacity/general" -#define WINDOW_TITLE_FONT_KEY METACITY_DIR "/titlebar_font" -#define WINDOW_TITLE_USES_SYSTEM_KEY METACITY_DIR "/titlebar_uses_system_font" -#define MONOSPACE_FONT_KEY "/desktop/gnome/interface/monospace_font_name" -#define DOCUMENT_FONT_KEY "/desktop/gnome/interface/document_font_name" - -#ifdef HAVE_XFT2 -#define FONT_RENDER_DIR "/desktop/gnome/font_rendering" -#define FONT_ANTIALIASING_KEY FONT_RENDER_DIR "/antialiasing" -#define FONT_HINTING_KEY FONT_RENDER_DIR "/hinting" -#define FONT_RGBA_ORDER_KEY FONT_RENDER_DIR "/rgba_order" -#define FONT_DPI_KEY FONT_RENDER_DIR "/dpi" - -/* X servers sometimes lie about the screen's physical dimensions, so we cannot - * compute an accurate DPI value. When this happens, the user gets fonts that - * are too huge or too tiny. So, we see what the server returns: if it reports - * something outside of the range [DPI_LOW_REASONABLE_VALUE, - * DPI_HIGH_REASONABLE_VALUE], then we assume that it is lying and we use - * DPI_FALLBACK instead. - * - * See get_dpi_from_gconf_or_server() below, and also - * https://bugzilla.novell.com/show_bug.cgi?id=217790 - */ -#define DPI_FALLBACK 96 -#define DPI_LOW_REASONABLE_VALUE 50 -#define DPI_HIGH_REASONABLE_VALUE 500 -#endif /* HAVE_XFT2 */ -static gboolean in_change = FALSE; -static gchar *old_font = NULL; - -#define MAX_FONT_POINT_WITHOUT_WARNING 32 -#define MAX_FONT_SIZE_WITHOUT_WARNING MAX_FONT_POINT_WITHOUT_WARNING*1024 - -static void -cb_dialog_response (GtkDialog *dialog, gint response_id) -{ - if (response_id == GTK_RESPONSE_HELP) - capplet_help (GTK_WINDOW (dialog), - "user-guide.xml", - "goscustdesk-38"); - else - gtk_main_quit (); -} - -#ifdef HAVE_XFT2 - -/* - * Code for displaying previews of font rendering with various Xft options - */ - -static void -sample_size_request (GtkWidget *darea, - GtkRequisition *requisition) -{ - GdkPixbuf *pixbuf = g_object_get_data (G_OBJECT (darea), "sample-pixbuf"); - - requisition->width = gdk_pixbuf_get_width (pixbuf) + 2; - requisition->height = gdk_pixbuf_get_height (pixbuf) + 2; -} - -static void -sample_expose (GtkWidget *darea, - GdkEventExpose *expose) -{ - GdkPixbuf *pixbuf = g_object_get_data (G_OBJECT (darea), "sample-pixbuf"); - int width = gdk_pixbuf_get_width (pixbuf); - int height = gdk_pixbuf_get_height (pixbuf); - - int x = (darea->allocation.width - width) / 2; - int y = (darea->allocation.height - height) / 2; - - gdk_draw_rectangle (darea->window, darea->style->white_gc, TRUE, - 0, 0, - darea->allocation.width, darea->allocation.height); - gdk_draw_rectangle (darea->window, darea->style->black_gc, FALSE, - 0, 0, - darea->allocation.width - 1, darea->allocation.height - 1); - - gdk_pixbuf_render_to_drawable (pixbuf, darea->window, NULL, - 0, 0, x, y, width, height, - GDK_RGB_DITHER_NORMAL, 0, 0); -} - -typedef enum { - ANTIALIAS_NONE, - ANTIALIAS_GRAYSCALE, - ANTIALIAS_RGBA -} Antialiasing; - -static GConfEnumStringPair antialias_enums[] = { - { ANTIALIAS_NONE, "none" }, - { ANTIALIAS_GRAYSCALE, "grayscale" }, - { ANTIALIAS_RGBA, "rgba" }, - { -1, NULL } -}; - -typedef enum { - HINT_NONE, - HINT_SLIGHT, - HINT_MEDIUM, - HINT_FULL -} Hinting; - -static GConfEnumStringPair hint_enums[] = { - { HINT_NONE, "none" }, - { HINT_SLIGHT, "slight" }, - { HINT_MEDIUM, "medium" }, - { HINT_FULL, "full" }, - { -1, NULL } -}; - -typedef enum { - RGBA_RGB, - RGBA_BGR, - RGBA_VRGB, - RGBA_VBGR -} RgbaOrder; - -static GConfEnumStringPair rgba_order_enums[] = { - { RGBA_RGB, "rgb" }, - { RGBA_BGR, "bgr" }, - { RGBA_VRGB, "vrgb" }, - { RGBA_VBGR, "vbgr" }, - { -1, NULL } -}; - -static XftFont * -open_pattern (FcPattern *pattern, - Antialiasing antialiasing, - Hinting hinting) -{ -#ifdef FC_HINT_STYLE - static const int hintstyles[] = { FC_HINT_NONE, FC_HINT_SLIGHT, FC_HINT_MEDIUM, FC_HINT_FULL }; -#endif /* FC_HINT_STYLE */ - - FcPattern *res_pattern; - FcResult result; - XftFont *font; - - Display *xdisplay = gdk_x11_get_default_xdisplay (); - int screen = gdk_x11_get_default_screen (); - - res_pattern = XftFontMatch (xdisplay, screen, pattern, &result); - if (res_pattern == NULL) - return NULL; - - FcPatternDel (res_pattern, FC_HINTING); - FcPatternAddBool (res_pattern, FC_HINTING, hinting != HINT_NONE); - -#ifdef FC_HINT_STYLE - FcPatternDel (res_pattern, FC_HINT_STYLE); - FcPatternAddInteger (res_pattern, FC_HINT_STYLE, hintstyles[hinting]); -#endif /* FC_HINT_STYLE */ - - FcPatternDel (res_pattern, FC_ANTIALIAS); - FcPatternAddBool (res_pattern, FC_ANTIALIAS, antialiasing != ANTIALIAS_NONE); - - FcPatternDel (res_pattern, FC_RGBA); - FcPatternAddInteger (res_pattern, FC_RGBA, - antialiasing == ANTIALIAS_RGBA ? FC_RGBA_RGB : FC_RGBA_NONE); - - FcPatternDel (res_pattern, FC_DPI); - FcPatternAddInteger (res_pattern, FC_DPI, 96); - - font = XftFontOpenPattern (xdisplay, res_pattern); - if (!font) - FcPatternDestroy (res_pattern); - - return font; -} - -static void -setup_font_sample (GtkWidget *darea, - Antialiasing antialiasing, - Hinting hinting) -{ - const char *string1 = "abcfgop AO "; - const char *string2 = "abcfgop"; - - XftColor black, white; - XRenderColor rendcolor; - - Display *xdisplay = gdk_x11_get_default_xdisplay (); - - GdkColormap *colormap = gdk_rgb_get_colormap (); - Colormap xcolormap = GDK_COLORMAP_XCOLORMAP (colormap); - - GdkVisual *visual = gdk_colormap_get_visual (colormap); - Visual *xvisual = GDK_VISUAL_XVISUAL (visual); - - FcPattern *pattern; - XftFont *font1, *font2; - XGlyphInfo extents1 = { 0 }; - XGlyphInfo extents2 = { 0 }; - GdkPixmap *pixmap; - XftDraw *draw; - GdkPixbuf *tmp_pixbuf, *pixbuf; - - int width, height; - int ascent, descent; - - pattern = FcPatternBuild (NULL, - FC_FAMILY, FcTypeString, "Serif", - FC_SLANT, FcTypeInteger, FC_SLANT_ROMAN, - FC_SIZE, FcTypeDouble, 18., - NULL); - font1 = open_pattern (pattern, antialiasing, hinting); - FcPatternDestroy (pattern); - - pattern = FcPatternBuild (NULL, - FC_FAMILY, FcTypeString, "Serif", - FC_SLANT, FcTypeInteger, FC_SLANT_ITALIC, - FC_SIZE, FcTypeDouble, 20., - NULL); - font2 = open_pattern (pattern, antialiasing, hinting); - FcPatternDestroy (pattern); - - if (font1) - XftTextExtentsUtf8 (xdisplay, font1, (unsigned char *)string1, strlen (string1), &extents1); - if (font2) - XftTextExtentsUtf8 (xdisplay, font2, (unsigned char *)string2, strlen (string2), &extents2); - - ascent = 0; - if (font1) - ascent = MAX (ascent, font1->ascent); - if (font2) - ascent = MAX (ascent, font2->ascent); - - descent = 0; - if (font1) - descent = MAX (descent, font1->descent); - if (font2) - descent = MAX (descent, font2->descent); - - width = extents1.xOff + extents2.xOff + 4; - - height = ascent + descent + 2; - - pixmap = gdk_pixmap_new (NULL, width, height, visual->depth); - - draw = XftDrawCreate (xdisplay, GDK_DRAWABLE_XID (pixmap), xvisual, xcolormap); - - rendcolor.red = 0; - rendcolor.green = 0; - rendcolor.blue = 0; - rendcolor.alpha = 0xffff; - XftColorAllocValue (xdisplay, xvisual, xcolormap, &rendcolor, &black); - - rendcolor.red = 0xffff; - rendcolor.green = 0xffff; - rendcolor.blue = 0xffff; - rendcolor.alpha = 0xffff; - XftColorAllocValue (xdisplay, xvisual, xcolormap, &rendcolor, &white); - XftDrawRect (draw, &white, 0, 0, width, height); - if (font1) - XftDrawStringUtf8 (draw, &black, font1, - 2, 2 + ascent, - (unsigned char *)string1, strlen (string1)); - if (font2) - XftDrawStringUtf8 (draw, &black, font2, - 2 + extents1.xOff, 2 + ascent, - (unsigned char *)string2, strlen (string2)); - - XftDrawDestroy (draw); - - if (font1) - XftFontClose (xdisplay, font1); - if (font2) - XftFontClose (xdisplay, font2); - - tmp_pixbuf = gdk_pixbuf_get_from_drawable (NULL, pixmap, colormap, 0, 0, 0, 0, width, height); - pixbuf = gdk_pixbuf_scale_simple (tmp_pixbuf, 1 * width, 1 * height, GDK_INTERP_TILES); - - g_object_unref (pixmap); - g_object_unref (tmp_pixbuf); - - g_object_set_data_full (G_OBJECT (darea), "sample-pixbuf", - pixbuf, (GDestroyNotify)g_object_unref); - - g_signal_connect (darea, "size_request", G_CALLBACK (sample_size_request), NULL); - g_signal_connect (darea, "expose_event", G_CALLBACK (sample_expose), NULL); -} - -/* - * Code implementing a group of radio buttons with different Xft option combinations. - * If one of the buttons is matched by the GConf key, we pick it. Otherwise we - * show the group as inconsistent. - */ -static void -font_render_get_gconf (Antialiasing *antialiasing, - Hinting *hinting) -{ - GConfClient *client = gconf_client_get_default (); - char *antialias_str = gconf_client_get_string (client, FONT_ANTIALIASING_KEY, NULL); - char *hint_str = gconf_client_get_string (client, FONT_HINTING_KEY, NULL); - int val; - - val = ANTIALIAS_GRAYSCALE; - if (antialias_str) { - gconf_string_to_enum (antialias_enums, antialias_str, &val); - g_free (antialias_str); - } - *antialiasing = val; - - val = HINT_FULL; - if (hint_str) { - gconf_string_to_enum (hint_enums, hint_str, &val); - g_free (hint_str); - } - *hinting = val; - - g_object_unref (client); -} - -typedef struct { - Antialiasing antialiasing; - Hinting hinting; - GtkWidget *radio; -} FontPair; - -static GSList *font_pairs = NULL; - -static void -font_render_load (void) -{ - Antialiasing antialiasing; - Hinting hinting; - gboolean inconsistent = TRUE; - GSList *tmp_list; - - font_render_get_gconf (&antialiasing, &hinting); - - in_change = TRUE; - - for (tmp_list = font_pairs; tmp_list; tmp_list = tmp_list->next) { - FontPair *pair = tmp_list->data; - - if (antialiasing == pair->antialiasing && hinting == pair->hinting) { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (pair->radio), TRUE); - inconsistent = FALSE; - } - } - - for (tmp_list = font_pairs; tmp_list; tmp_list = tmp_list->next) { - FontPair *pair = tmp_list->data; - - gtk_toggle_button_set_inconsistent (GTK_TOGGLE_BUTTON (pair->radio), inconsistent); - } - - in_change = FALSE; -} - -static void -font_render_changed (GConfClient *client, - guint cnxn_id, - GConfEntry *entry, - gpointer user_data) -{ - font_render_load (); -} - -static void -font_radio_toggled (GtkToggleButton *toggle_button, - FontPair *pair) -{ - if (!in_change) { - GConfClient *client = gconf_client_get_default (); - - gconf_client_set_string (client, FONT_ANTIALIASING_KEY, - gconf_enum_to_string (antialias_enums, pair->antialiasing), - NULL); - gconf_client_set_string (client, FONT_HINTING_KEY, - gconf_enum_to_string (hint_enums, pair->hinting), - NULL); - - g_object_unref (client); - } - - /* Restore back to the previous state until we get notification - */ - font_render_load (); -} - -static void -setup_font_pair (GtkWidget *radio, - GtkWidget *darea, - Antialiasing antialiasing, - Hinting hinting) -{ - FontPair *pair = g_new (FontPair, 1); - - pair->antialiasing = antialiasing; - pair->hinting = hinting; - pair->radio = radio; - - setup_font_sample (darea, antialiasing, hinting); - font_pairs = g_slist_prepend (font_pairs, pair); - - g_signal_connect (radio, "toggled", - G_CALLBACK (font_radio_toggled), pair); -} -#endif /* HAVE_XFT2 */ - -static void -metacity_titlebar_load_sensitivity (GConfClient *client, - GladeXML *dialog) -{ - gtk_widget_set_sensitive (WID ("window_title_font"), - !gconf_client_get_bool (client, - WINDOW_TITLE_USES_SYSTEM_KEY, - NULL)); -} - -static void -metacity_changed (GConfClient *client, - guint cnxn_id, - GConfEntry *entry, - gpointer user_data) -{ - if (strcmp (entry->key, WINDOW_TITLE_USES_SYSTEM_KEY) == 0) - metacity_titlebar_load_sensitivity (client, user_data); -} - -/* returns 0 if the font is safe, otherwise returns the size in points. */ -static gint -new_font_dangerous (const char *new_font) -{ - PangoFontDescription *pfd; - gboolean retval = 0; - - pfd = pango_font_description_from_string (new_font); - if (pfd == NULL) - /* an invalid font was passed in. This isn't our problem. */ - return 0; - - if (pango_font_description_get_set_fields (pfd) & PANGO_FONT_MASK_SIZE) { - if (pango_font_description_get_size (pfd) >= MAX_FONT_SIZE_WITHOUT_WARNING) { - retval = pango_font_description_get_size (pfd)/1024; - } - } - pango_font_description_free (pfd); - - return retval; -} - -static GConfValue * -application_font_to_gconf (GConfPropertyEditor *peditor, - GConfValue *value) -{ - GConfValue *new_value; - const char *new_font; - GtkWidget *font_button; - gint danger_level; - - font_button = GTK_WIDGET (gconf_property_editor_get_ui_control (peditor)); - g_return_val_if_fail (font_button != NULL, NULL); - - new_value = gconf_value_new (GCONF_VALUE_STRING); - new_font = gconf_value_get_string (value); - if (new_font_dangerous (old_font)) { - /* If we're already too large, we don't warn again. */ - gconf_value_set_string (new_value, new_font); - return new_value; - } - - danger_level = new_font_dangerous (new_font); - if (danger_level) { - GtkWidget *warning_dialog, *apply_button; - gchar *warning_label; - gchar *warning_label2; - - warning_label = g_strdup (_("Font may be too large")); - - if (danger_level > MAX_FONT_POINT_WITHOUT_WARNING) { - warning_label2 = g_strdup_printf (ngettext ( - "The font selected is %d point large, " - "and may make it difficult to effectively " - "use the computer. It is recommended that " - "you select a size smaller than %d.", - "The font selected is %d points large, " - "and may make it difficult to effectively " - "use the computer. It is recommended that " - "you select a size smaller than %d.", - danger_level), - danger_level, - MAX_FONT_POINT_WITHOUT_WARNING); - } else { - warning_label2 = g_strdup_printf (ngettext ( - "The font selected is %d point large, " - "and may make it difficult to effectively " - "use the computer. It is recommended that " - "you select a smaller sized font.", - "The font selected is %d points large, " - "and may make it difficult to effectively " - "use the computer. It is recommended that " - "you select a smaller sized font.", - danger_level), - danger_level); - } - - warning_dialog = gtk_message_dialog_new (NULL, - GTK_DIALOG_MODAL, - GTK_MESSAGE_WARNING, - GTK_BUTTONS_NONE, - warning_label); - - gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (warning_dialog), - warning_label2); - - gtk_dialog_add_button (GTK_DIALOG (warning_dialog), _("Use previous font"), GTK_RESPONSE_CLOSE); - - apply_button = gtk_button_new_with_label (_("Use selected font")); - - gtk_button_set_image (GTK_BUTTON (apply_button), gtk_image_new_from_stock (GTK_STOCK_APPLY, GTK_ICON_SIZE_BUTTON)); - gtk_dialog_add_action_widget (GTK_DIALOG (warning_dialog), apply_button, GTK_RESPONSE_APPLY); - GTK_WIDGET_SET_FLAGS (apply_button, GTK_CAN_DEFAULT); - gtk_widget_show (apply_button); - - gtk_dialog_set_default_response (GTK_DIALOG (warning_dialog), GTK_RESPONSE_CLOSE); - - g_free (warning_label); - g_free (warning_label2); - - if (gtk_dialog_run (GTK_DIALOG (warning_dialog)) == GTK_RESPONSE_APPLY) { - gconf_value_set_string (new_value, new_font); - } else { - gconf_value_set_string (new_value, old_font); - gtk_font_button_set_font_name (GTK_FONT_BUTTON (font_button), old_font); - } - - gtk_widget_destroy (warning_dialog); - } else { - gconf_value_set_string (new_value, new_font); - } - - return new_value; -} - -static void -application_font_changed (GtkWidget *font_button) -{ - const gchar *font; - - font = gtk_font_button_get_font_name (GTK_FONT_BUTTON (font_button)); - g_free (old_font); - old_font = g_strdup (font); -} - -static void -setup_dialog (void) -{ - GladeXML *dialog; - GConfClient *client; - GtkWidget *widget; - GObject *peditor; - - dialog = glade_xml_new (GLADEDIR "/font-properties.glade", "font_dialog", NULL); - if (!dialog) { - g_warning ("could not load font-properties.glade"); - return; - } - - client = gconf_client_get_default (); - - gconf_client_add_dir (client, "/desktop/gnome/interface", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); - gconf_client_add_dir (client, "/apps/nautilus/preferences", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); - gconf_client_add_dir (client, METACITY_DIR, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); -#ifdef HAVE_XFT2 - gconf_client_add_dir (client, FONT_RENDER_DIR, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); -#endif /* HAVE_XFT2 */ - - peditor = gconf_peditor_new_font (NULL, GTK_FONT_KEY, - WID ("application_font"), - "conv-from-widget-cb", application_font_to_gconf, - NULL); - g_signal_connect_swapped (peditor, "value-changed", - G_CALLBACK (application_font_changed), WID ("application_font")); - application_font_changed (WID ("application_font")); - - peditor = gconf_peditor_new_font (NULL, DOCUMENT_FONT_KEY, - WID ("document_font"), - NULL); - - peditor = gconf_peditor_new_font (NULL, DESKTOP_FONT_KEY, - WID ("desktop_font"), - NULL); - - peditor = gconf_peditor_new_font (NULL, WINDOW_TITLE_FONT_KEY, - WID ("window_title_font"), - NULL); - - peditor = gconf_peditor_new_font (NULL, MONOSPACE_FONT_KEY, - WID ("monospace_font"), - NULL); - - gconf_client_notify_add (client, METACITY_DIR, - metacity_changed, - dialog, NULL, NULL); - - metacity_titlebar_load_sensitivity (client, dialog); - - widget = WID ("font_dialog"); - capplet_set_icon (widget, "gnome-settings-font"); - -#ifdef HAVE_XFT2 - setup_font_pair (WID ("monochrome_radio"), WID ("monochrome_sample"), ANTIALIAS_NONE, HINT_FULL); - setup_font_pair (WID ("best_shapes_radio"), WID ("best_shapes_sample"), ANTIALIAS_GRAYSCALE, HINT_MEDIUM); - setup_font_pair (WID ("best_contrast_radio"), WID ("best_contrast_sample"), ANTIALIAS_GRAYSCALE, HINT_FULL); - setup_font_pair (WID ("subpixel_radio"), WID ("subpixel_sample"), ANTIALIAS_RGBA, HINT_FULL); - - font_render_load (); - - gconf_client_notify_add (client, FONT_RENDER_DIR, - font_render_changed, - NULL, NULL, NULL); - - g_signal_connect (WID ("details_button"), "clicked", - G_CALLBACK (cb_show_details), widget); -#else /* !HAVE_XFT2 */ - gtk_widget_hide (WID ("font_render_frame")); -#endif /* HAVE_XFT2 */ - - g_signal_connect (widget, "response", - G_CALLBACK (cb_dialog_response), NULL); - - gtk_widget_show (widget); - - g_object_unref (client); -} - -#ifdef HAVE_XFT2 -/* - * EnumGroup - a group of radio buttons tied to a string enumeration - * value. We add this here because the gconf peditor - * equivalent of this is both painful to use (you have - * to supply functions to convert from enums to indices) - * and conceptually broken (the order of radio buttons - * in a group when using Glade is not predictable. - */ -typedef struct -{ - GConfClient *client; - GSList *items; - const gchar *gconf_key; - GConfEnumStringPair *enums; - int default_value; -} EnumGroup; - -typedef struct -{ - EnumGroup *group; - GtkWidget *widget; - int value; -} EnumItem; - -static void -enum_group_load (EnumGroup *group) -{ - char *str = gconf_client_get_string (group->client, group->gconf_key, NULL); - int val = group->default_value; - GSList *tmp_list; - - if (str) - gconf_string_to_enum (group->enums, str, &val); - - g_free (str); - - in_change = TRUE; - - for (tmp_list = group->items; tmp_list; tmp_list = tmp_list->next) { - EnumItem *item = tmp_list->data; - - if (val == item->value) - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item->widget), TRUE); - } - - - - in_change = FALSE; -} - -static void -enum_group_changed (GConfClient *client, - guint cnxn_id, - GConfEntry *entry, - gpointer user_data) -{ - enum_group_load (user_data); -} - -static void -enum_item_toggled (GtkToggleButton *toggle_button, - EnumItem *item) -{ - EnumGroup *group = item->group; - - if (!in_change) { - gconf_client_set_string (group->client, group->gconf_key, - gconf_enum_to_string (group->enums, item->value), - NULL); - } - - /* Restore back to the previous state until we get notification - */ - enum_group_load (group); -} - -static EnumGroup * -enum_group_create (const gchar *gconf_key, - GConfEnumStringPair *enums, - int default_value, - GtkWidget *first_widget, - ...) -{ - EnumGroup *group; - GtkWidget *widget; - va_list args; - - group = g_new (EnumGroup, 1); - - group->client = gconf_client_get_default (); - group->gconf_key = g_strdup (gconf_key); - group->enums = enums; - group->default_value = default_value; - group->items = NULL; - - va_start (args, first_widget); - - widget = first_widget; - while (widget) - { - EnumItem *item; - - item = g_new (EnumItem, 1); - item->group = group; - item->widget = widget; - item->value = va_arg (args, int); - - g_signal_connect (item->widget, "toggled", - G_CALLBACK (enum_item_toggled), item); - - group->items = g_slist_prepend (group->items, item); - - widget = va_arg (args, GtkWidget *); - } - - va_end (args); - - enum_group_load (group); - - gconf_client_notify_add (group->client, gconf_key, - enum_group_changed, - group, NULL, NULL); - - return group; -} - -static double -dpi_from_pixels_and_mm (int pixels, int mm) -{ - double dpi; - - if (mm >= 1) - dpi = pixels / (mm / 25.4); - else - dpi = 0; - - return dpi; -} - -static double -get_dpi_from_x_server (void) -{ - GdkScreen *screen; - double dpi; - - screen = gdk_screen_get_default (); - if (screen) - { - double width_dpi, height_dpi; - - width_dpi = dpi_from_pixels_and_mm (gdk_screen_get_width (screen), gdk_screen_get_width_mm (screen)); - height_dpi = dpi_from_pixels_and_mm (gdk_screen_get_height (screen), gdk_screen_get_height_mm (screen)); - - if (width_dpi < DPI_LOW_REASONABLE_VALUE || width_dpi > DPI_HIGH_REASONABLE_VALUE - || height_dpi < DPI_LOW_REASONABLE_VALUE || height_dpi > DPI_HIGH_REASONABLE_VALUE) - dpi = DPI_FALLBACK; - else - dpi = (width_dpi + height_dpi) / 2.0; - } - else - { - /* Huh!? No screen? */ - - dpi = DPI_FALLBACK; - } - - return dpi; -} - -/* - * The font rendering details dialog - */ -static void -dpi_load (GConfClient *client, - GtkSpinButton *spinner) -{ - GConfValue *value; - gdouble dpi; - - value = gconf_client_get_without_default (client, FONT_DPI_KEY, NULL); - - if (value) { - dpi = gconf_value_get_float (value); - gconf_value_free (value); - } else - dpi = get_dpi_from_x_server (); - - if (dpi < 50.) - dpi = 50.; - - in_change = TRUE; - gtk_spin_button_set_value (spinner, dpi); - in_change = FALSE; -} - -static void -dpi_changed (GConfClient *client, - guint cnxn_id, - GConfEntry *entry, - gpointer user_data) -{ - dpi_load (client, user_data); -} - -static void -dpi_value_changed (GtkSpinButton *spinner, - GConfClient *client) -{ - /* Like any time when using a spin button with GConf, there is - * a race condition here. When we change, we send the new - * value to GCOnf, then restore to the old value until - * we get a response to emulate the proper model/view behavior. - * - * If the user changes the value faster than responses are - * received from GConf, this may cause mild strange effects. - */ - gdouble new_dpi = gtk_spin_button_get_value (spinner); - - gconf_client_set_float (client, FONT_DPI_KEY, new_dpi, NULL); - - dpi_load (client, spinner); -} - -static void -cb_details_response (GtkDialog *dialog, gint response_id) -{ - if (response_id == GTK_RESPONSE_HELP) - capplet_help (GTK_WINDOW (dialog), - "user-guide.xml", - "goscustdesk-38"); - else if (response_id == 1) { - /* "Go to font folder" was clicked */ - g_spawn_command_line_async ("nautilus --no-desktop fonts:///", NULL); - } else - gtk_widget_hide (GTK_WIDGET (dialog)); -} - -static void -cb_show_details (GtkWidget *button, - GtkWindow *parent) -{ - static GtkWidget *details_dialog = NULL; - - if (!details_dialog) { - GConfClient *client = gconf_client_get_default (); - GladeXML *dialog; - GtkWidget *dpi_spinner; - GnomeVFSURI *uri; - int dpi; - GtkAdjustment *adjustment; - - dialog = glade_xml_new (GLADEDIR "/font-properties.glade", "render_details", NULL); - if (!dialog) { - g_warning ("could not load font-properties.glade"); - return; - } - - details_dialog = WID ("render_details"); - uri = gnome_vfs_uri_new ("fonts:///"); - if (uri == NULL) { - gtk_widget_hide (WID ("go_to_font_button")); - } else { - gnome_vfs_uri_unref (uri); - gtk_widget_show (WID ("go_to_font_button")); - } - - gtk_window_set_transient_for (GTK_WINDOW (details_dialog), parent); - - dpi_spinner = WID ("dpi_spinner"); - - /* pick a sensible maximum dpi */ - dpi = floor ((gdk_screen_width () / gdk_screen_width_mm () + - gdk_screen_height () / gdk_screen_height_mm ()) * 25.4 / 2. + .5); - if (dpi < 50) - dpi = 50; /* be extra careful */ - adjustment = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (dpi_spinner)); - adjustment->upper = dpi * 3; - - dpi_load (client, GTK_SPIN_BUTTON (dpi_spinner)); - g_signal_connect (dpi_spinner, "value_changed", - G_CALLBACK (dpi_value_changed), client); - - gconf_client_notify_add (client, FONT_DPI_KEY, - dpi_changed, - dpi_spinner, NULL, NULL); - - setup_font_sample (WID ("antialias_none_sample"), ANTIALIAS_NONE, HINT_FULL); - setup_font_sample (WID ("antialias_grayscale_sample"), ANTIALIAS_GRAYSCALE, HINT_FULL); - setup_font_sample (WID ("antialias_subpixel_sample"), ANTIALIAS_RGBA, HINT_FULL); - - enum_group_create (FONT_ANTIALIASING_KEY, antialias_enums, ANTIALIAS_GRAYSCALE, - WID ("antialias_none_radio"), ANTIALIAS_NONE, - WID ("antialias_grayscale_radio"), ANTIALIAS_GRAYSCALE, - WID ("antialias_subpixel_radio"), ANTIALIAS_RGBA, - NULL); - - setup_font_sample (WID ("hint_none_sample"), ANTIALIAS_GRAYSCALE, HINT_NONE); - setup_font_sample (WID ("hint_slight_sample"), ANTIALIAS_GRAYSCALE, HINT_SLIGHT); - setup_font_sample (WID ("hint_medium_sample"), ANTIALIAS_GRAYSCALE, HINT_MEDIUM); - setup_font_sample (WID ("hint_full_sample"), ANTIALIAS_GRAYSCALE, HINT_FULL); - - enum_group_create (FONT_HINTING_KEY, hint_enums, HINT_FULL, - WID ("hint_none_radio"), HINT_NONE, - WID ("hint_slight_radio"), HINT_SLIGHT, - WID ("hint_medium_radio"), HINT_MEDIUM, - WID ("hint_full_radio"), HINT_FULL, - NULL); - - gtk_image_set_from_file (GTK_IMAGE (WID ("subpixel_rgb_image")), - PIXMAPDIR "/subpixel-rgb.png"); - gtk_image_set_from_file (GTK_IMAGE (WID ("subpixel_bgr_image")), - PIXMAPDIR "/subpixel-bgr.png"); - gtk_image_set_from_file (GTK_IMAGE (WID ("subpixel_vrgb_image")), - PIXMAPDIR "/subpixel-vrgb.png"); - gtk_image_set_from_file (GTK_IMAGE (WID ("subpixel_vbgr_image")), - PIXMAPDIR "/subpixel-vbgr.png"); - - enum_group_create (FONT_RGBA_ORDER_KEY, rgba_order_enums, RGBA_RGB, - WID ("subpixel_rgb_radio"), RGBA_RGB, - WID ("subpixel_bgr_radio"), RGBA_BGR, - WID ("subpixel_vrgb_radio"), RGBA_VRGB, - WID ("subpixel_vbgr_radio"), RGBA_VBGR, - NULL); - - g_signal_connect (G_OBJECT (details_dialog), - "response", - G_CALLBACK (cb_details_response), NULL); - g_signal_connect (G_OBJECT (details_dialog), - "delete_event", - G_CALLBACK (gtk_true), NULL); - - g_object_unref (dialog); - g_object_unref (client); - } - - gtk_window_present (GTK_WINDOW (details_dialog)); -} -#endif /* HAVE_XFT2 */ - -int -main (int argc, char *argv[]) -{ - bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); - bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); - textdomain (GETTEXT_PACKAGE); - - gnome_program_init ("gnome-font-properties", VERSION, - LIBGNOMEUI_MODULE, argc, argv, - GNOME_PARAM_APP_DATADIR, GNOMECC_DATA_DIR, - NULL); - - activate_settings_daemon (); - - setup_dialog (); - - gtk_main (); - - return 0; -} diff --git a/capplets/font/subpixel-bgr.png b/capplets/font/subpixel-bgr.png deleted file mode 100644 index 7efd2624f7666150c974281a594353e273cdf471..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 125 zcmeAS@N?(olHy`uVBq!ia0vp^G9b*v3?%uJ&DntzPk>K|E0AVj_z#8*mzDdD19_YU z9+AZi4BP@B%(zy0Zz)hv+|$J|q~ca`LIcyqfc2r>|Nl#xnTRkjJYh(md1^%^E65m6 LS3j3^P6a891 diff --git a/capplets/font/subpixel-rgb.png b/capplets/font/subpixel-rgb.png deleted file mode 100644 index 58ac1eca6205b3666c60c593f28d8cd5c9f280dc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 125 zcmeAS@N?(olHy`uVBq!ia0vp^G9b*v3?%uJ&DntzPk>K|E0AVj_z#8*mzDdD19_YU z9+AZi4BP@B%(zy0Zz)hv+|$J|q~ca`LIcz9|I5R4d3YtwOhgzM%KX!3&Q-N}3o^#j L)z4*}Q$iB}!IvCh diff --git a/capplets/font/subpixel-vbgr.png b/capplets/font/subpixel-vbgr.png deleted file mode 100644 index abd8df01323e44cf774f18fabe4bd1a752848063..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 138 zcmeAS@N?(olHy`uVBq!ia0vp^G9b*v3?%uJ&DntzPk>K|E0AVj_z#8*mzDdD19_YU z9+AZi4BP@B%(zy0Zz)hv#nZ(xq~ca`LIcyq009og*=>w#LlrhOED diff --git a/capplets/font/subpixel-vrgb.png b/capplets/font/subpixel-vrgb.png deleted file mode 100644 index 6e6090601f1c50d8cffab749e227d104bf1cba22..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 138 zcmeAS@N?(olHy`uVBq!ia0vp^G9b*v3?%uJ&DntzPk>K|E0AVj_z#8*mzDdD19_YU z9+AZi4BP@B%(zy0Zz)hv#nZ(xq~ca`LIcz9{|X=4bEMd|gf$-E+LS3Fz{}bwuqji6 Zfnjw`a$ - - * gnome-theme-installer.desktop.in.in: - * gtk-theme-selector.desktop.in.in: renamed Bugzilla product. - -2007-04-10 Matthias Clasen - - * gnome-theme-installer.desktop.in.in: Use OnlyShowIn=; to - hide the theme installer from menus and menu editors. (#420154) - -2007-04-08 Jens Granseuer - - Based on a patch by: Kristof Vansant - - * gnome-theme-installer.c: (gnome_theme_installer_run): add filters - for theme packages to the file chooser and mark the file chooser - title for translation. Closes bug #424960. - -2007-04-03 Jens Granseuer - - * gnome-theme-details.c: (update_color_buttons_from_string): - don't crash if the color string is mangled, and close a small - memory leak - -2007-03-21 Frederic Crozat - - * gnome-theme-details.c: (update_color_scheme_tab): - Disable revert button when using theme engine defaults colors. - Close bug #417423. - -2007-03-04 Benjamin Berg - - * gnome-theme-details.c: (update_color_scheme_tab): - Free the engine and color scheme lists. - Removed some bogus old code that caused the current theme to be - checked instead of the new one. - -2007-03-04 Thomas Wood - - * Makefile.am: - * gtkrc-utils.c: - * gtkrc-utils.h: - Move gtkrc-utils into capplets/common - -2007-02-28 Thomas Wood - - * gnome-theme-details.c: (load_theme_names): Replace a deprecated function - (color_select), (gnome_theme_details_init): Rename color_select() to gtk_color_scheme_changed() - -2007-02-23 Jens Granseuer - - * gnome-theme-installer.c: (transfer_done_tarbz2_idle_cb): fix - harmless copy'n'paste error - -2007-02-22 Jens Granseuer - - * gnome-theme-details.c: (color_select): color components in - GdkColor are guint16 not guint8, so format accordingly. Fixes bug - 398331. - -2007-02-22 Jens Granseuer - - * gtkrc-utils.c: (gtkrc_find_named): - * gtkrc-utils.h: constify arg to fix a compiler warning - -2007-02-22 Jens Granseuer - - * gnome-theme-details.c: (color_select): update selected_fg_color - from the correct slot. Fixes bug 410764. - -2007-02-08 Thomas Wood - - Patch by: Matthias Clasen - - * gnome-theme-details.c: (gtk_theme_update_remove_button), - (update_color_scheme_tab), (gtk_theme_selection_changed), - (color_select), (revert_color_scheme_key), - (gnome_theme_details_init), (update_color_buttons_from_string), - (gnome_theme_details_update_from_gconf): Listens for changes in the - gtk-color-scheme property of GtkSettings. Fixes bug 405210. - -2007-01-29 Kjartan Maraas - - * gnome-theme-details.c: (update_color_scheme_tab), (remove_theme), - (gnome_theme_details_init): - * gnome-theme-installer.c: (extract_files_error_dialog): - * gnome-theme-manager.c: (get_lockdown_status): - Fix compiler warnings. Correct order of args to a gnome_vfs_xfer - function. - -2007-01-26 Thomas Wood - - Patch by: Alberto Ruiz - - * gnome-theme-installer.c: (transfer_done_cb), - (gnome_theme_install_from_uri): Fixes on the suffix checks. - -2007-01-23 Thomas Wood - - * gnome-theme-installer.c: (transfer_done_cb): Fix a compiler warning - -2007-01-19 Thomas Wood - - * gnome-theme-details.c: (update_color_scheme_tab), - (gnome_theme_details_update_from_gconf): - * gnome-theme-manager.c: (gtk_theme_key_changed): - * theme-properties.glade: - - Add a Revert button to the color schemes tab - -2007-01-19 Thomas Wood - - * gnome-theme-details.c: (update_color_scheme_tab), (color_select), - (toggle_color_scheme_key): - * gnome-theme-manager.c: (free_all), (load_meta_themes), - (meta_theme_setup_info), (meta_theme_selection_changed), - (update_themes_from_disk), (add_custom_row_to_meta_theme), - (themes_equal), (update_settings_from_gconf_idle), - (update_settings_from_gconf), (gtk_theme_key_changed), - (setup_dialog): - * gnome-theme-save.c: (write_theme_to_disk): - * theme-properties.glade: - - - Remove seperate color scheme saving UI - - Add support for gtk-color-scheme key in metatheme info - -2007-01-12 Thomas Wood - - Patch by: Jens Granseuer - - * gnome-theme-details.c: (color_scheme_combobox_changed): Fix build with - gcc 2 (c89 fixes). Fixes bug 394707. - -2007-01-08 Rodrigo Moya - - * Makefile.am: added missing EXTRA_DIST files. - -2007-01-08 Thomas Wood - - Patch by: Alberto Ruiz - - * gnome-theme-installer.c: (gnome_theme_install_from_uri): Accept .gtp - as a file extension - -2007-01-08 Jan Arne Petersen - - * Makefile.am: Updated CLEANFILES - * gnome-theme-package.xml: Removed from svn (built file). - * ./: Updated svn:ignore properties. - -2007-01-08 Thomas Wood - - * gnome-theme-details.c: (color_select), - (color_scheme_combobox_changed), (gnome_theme_details_init), - (update_color_buttons_from_string), - (gnome_theme_details_update_from_gconf): - * theme-properties.glade: - - Add Save/Delete dialogs for colour schemes. - -2007-01-08 Thomas Wood - - Patch by: Alberto Ruiz - - * Makefile.am: - * gnome-theme-installer.desktop.in.in: - * gnome-theme-package.xml: - * gnome-theme-package.xml.in: - - Add support for opening .gtp (application/x-gnome-theme-package) files. - Fixes bug 393697 (Theme packages should have their own mime type.) - -2007-01-08 Thomas Wood - - * gtkrc-utils.h: Correct function decleration - * gnome-theme-details.c: (update_color_scheme_tab), (color_select), - (toggle_color_scheme_key): - * theme-properties.glade: - - Add custom colour scheme saving UI - -2007-01-07 Thomas Wood - - * Makefile.am: - * gnome-theme-details.c: (gtk_theme_update_remove_button), - (remove_theme), (color_select), (toggle_color_scheme_key), - (gnome_theme_details_init): - * gnome-theme-manager.c: (main): - * gtkrc-utils.c: - * gtkrc-utils.h: - * theme-properties.glade: - - Enable a message when the current theme does not support colour schemes - -2007-01-07 Thomas Wood - - Based on patch by: Gabor Kelemen - - * gnome-theme-installer.c: (transfer_done_cb): Fixes bug 360449 (Avoid - markup in translatable messages) - -2007-01-07 Rodrigo Moya - - * gnome-theme-details.c (gtk_theme_update_remove_button): removed - double gnome_vfs_file_info_unref/g_free calls. - -2007-01-07 Thomas Wood - - * gnome-theme-details.c: (gtk_theme_update_remove_button): Applied patch - from bug 326337 (leaks in the theme manager) - -2007-01-11 Thomas Wood - - * gnome-theme-details.c: (gnome_theme_details_init): Applied theme - manager part of the patch from bug 382730 (fix build with c89 compilers) - -2007-01-11 Thomas Wood - - * theme-properties.glade: Set minimum size request on the treeview - rather than the entire window (fixes bug 393236). - -2007-01-05 Christian Persch - - Fixes #393117 - - * gnome-theme-manager.c (main): get a reference to the GnomeProgram - and free it when appropriate. Fixes leak. - - * gnome-theme-details.c (gtk_theme_update_remove_button): fixed leaks. - -2007-01-03 Thomas Wood - - * theme-properties.glade: Fix some HIG issues with strings - -2006-12-18 Thomas Wood - - * gnome-theme-details.c: - * theme-properties.glade: - - - HIG fixes to the color scheme tab, from suggestions in Bug 382517 - - Rename "Theme Details" button to "Customize" - -2006-12-08 Kjartan Maraas - - * gnome-theme-manager.c: (meta_theme_selection_changed): - Plug a few leaks. Bug #376949. - -2006-12-03 Thomas Wood - - * gnome-theme-installer.c: (theme_properties_free), - (file_theme_type), (missing_utility_message_dialog), - (extract_files_error_dialog), (transfer_done_targz_idle_cb), - (transfer_done_tarbz2_idle_cb), (transfer_done_cb), - (gnome_theme_install_from_uri), (gnome_theme_installer_run): - - - Cleanup some of the install code - - Implement bug 325300 - Theme manager should be able to handle archives - with icon, gtk+ and metacity themes - - Implement bug 326103 - Allow installing a theme from a directory - -2006-11-27 Thomas Wood - - * gnome-theme-installer.c: (file_theme_type): Applied patch from - bug 378680 (leak in file_theme_type() in theme-switcher) - -2006-11-13 Thomas Wood - - (gnome_theme_installer_run): Open transfer dialog with transient - parent set - - * gnome-theme-details.c: (remove_theme), (color_select), - (toggle_color_scheme_key), (gnome_theme_details_init), - (update_color_buttons_from_string), - (gnome_theme_details_update_from_gconf): - * gnome-theme-installer.c: (gnome_theme_install_from_uri), - * gnome-theme-installer.h: - * gnome-theme-manager.c: (free_all), - (gnome_theme_manager_drag_data_received_cb), (main): - * gnome-theme-manager.h: - * gnome-theme-save.c: (save_dialog_response): - * theme-properties.glade: - - - Add a colours tab to change gtk-color-scheme setting - -2006-10-27 Thomas Wood - - * gnome-theme-installer.c: (transfer_done_cb): Hopefully fix bug - 352490 - -2006-10-02 Thomas Wood - - * gnome-theme-manager.c: (load_meta_themes), (main): Add an - install-theme command line option. Fixes bug 354581 - Theme manager - has no CLI tool to install themes. - -2006-09-30 Thomas Wood - - * gnome-theme-details.c: (setup_tree_view): - * theme-properties.glade: - - Allows the text in the details dialog lists to ellipsise, and sets a minimum width - for the dialog. Fixes bug 355269 (Theme manager dialog width) - -2006-08-28 Thomas Wood - - * theme-properties.glade: Fixes bug 331835 (Missing maximize button) - by making the main window Normal rather than Dialog. - * ChangeLog: Converted to utf-8! - -2006-08-21 Thomas Wood - - * gnome-theme-manager.c: (queue_pixbuf_generation), - (pixbuf_idle_func), (load_meta_themes): Applied first two patches from bug 351521 - -2006-07-27 Rob Bradford - - Fixes #346041 - - * gnome-theme-manager.[ch]: - * theme-properties.glade: added support for locking down theme. - -2006-07-25 Thomas Wood - - * gnome-theme-details.c: (window_theme_selection_changed), - (gnome_theme_details_update_from_gconf): Don't attempt to load window - manager theme name from an unknown window manager (fixes bug 333276 - - gnome-theme-manager crashes with xgl/compiz) - -2006-07-23 Sebastien Bacher - - * gtk-theme-selector.desktop.in.in: don't list the Application - category, patch by Vincent Fretin - (Closes: #344321) - -2006-07-14 Thomas Wood - - * gnome-theme-installer.c: - (transfer_done_cb): Made the installation message dialog more HIG - compliant, as per comments from bug 167045. Also reinstated the fix - for bug 316800. - (gnome_theme_installer_run): Remove invalid, and also duplicate, check - for the tar utility. - -2006-06-13 Thomas Wood - - * gnome-theme-installer.c: (transfer_done_cb): Fix Bug 167045 - - Strange wording in gnome-control-center theme manager messages - -2006-04-28 Thomas Wood - - * gnome-theme-save.c: (write_theme_to_disk), (save_theme_to_disk), - (save_dialog_response): - * theme-properties.glade: - - - Added option to save current background when saving a custom theme. - Fixes bug 330302 - Saved themes should remember wallpaper. - - Also implements some of the UI changes for the save dialog, suggested - in bug 100622 - -2006-04-27 Thomas Wood - - * gnome-theme-save.c: (str_remove_slash), - (setup_directory_structure): - - Fix bug 317375 - theme-manager (saving) sometimes needlessly asks - whether to overwrite - -2006-04-26 Thomas Wood - - * gnome-theme-save.c: (str_remove_slash), - (setup_directory_structure), (write_theme_to_disk), - (gnome_theme_save_show_dialog): - - Fix bug 139692 - Some characters cannot be given as the theme name - -2006-04-25 Thomas Wood - - * Makefile.am: - * gnome-theme-installer.c: (gnome_theme_install_from_uri), - (gnome_theme_installer_run_cb), (gnome_theme_installer_run): - * gnome-theme-installer.h: - * gnome-theme-manager.c: - (gnome_theme_manager_drag_data_received_cb): - * theme-install.glade: - - - Remove redundant theme-install dialog - - Fix bug 138795 (file dialog forgets last browsed to or installed from - location) - -2006-04-19 Thomas Wood - - * gnome-theme-details.c: (gnome_theme_details_init), - (gnome_theme_details_reread_themes_from_disk): - * gnome-theme-installer.c: (gnome_theme_installer_run_cb): - * gnome-theme-installer.h: - * gnome-theme-manager.c: (setup_dialog): - * theme-properties.glade: - - Remove drag and drop information text, and add Install buttons to each - tab in the details window. Closes bug 99535 - [ui-review] Theme manager UI issues - -2006-04-10 Thomas Wood - - * gnome-theme-installer.c: (transfer_done_targz_idle_cb), - (transfer_done_tarbz2_idle_cb), (transfer_done_cb): Applied patch from - bug 170058 - bzip2 location hardcoded - -2006-04-09 Thomas Wood - - * gnome-theme-manager.c: (setup_meta_tree_view): Patch from Sergey Al. - Safonov to fix bug 314658 - Theme chooser main - window too wide for 800x600 - -2006-01-03 David SeseƱo - - * gnome-theme-manager.c (setup_dialog): Set the search column of the - treeview. Fixes #321379. - -2006-01-03 Guillaume Desmottes - - Fixes bug #147665 - - * gnome-theme-manager.[ch] (update_font_button_state, - update_background_button_state): new functions. - (background_key_changed): call the 2 above functions to update - the background from metathemes that include a background. - -2005-11-14 David SedeƱo - - * gnome-theme-details.c (gtk_theme_update_remove_button): Update the - sensivility of the button if the user can remove the theme. - (remove_theme): Remove the selected theme. - -2005-11-14 Kjartan Maraas - - * gnome-theme-details.c: (gnome_theme_details_init), - (gnome_theme_details_reread_themes_from_disk): - Remove some unused code. - * gnome-theme-installer.c: (transfer_done_cb), - (gnome_theme_installer_run): Don't declare variables more often than - needed. - * gnome-theme-manager.c: Mark some code static. - -2005-10-24 Ed Catmur - - Fixes #319358 - - * gnome-theme-installer.c (install_dialog_response): make it - work for file:// URIs. - -2005-10-11 Muktha - - * gnome-theme-manager.h: - * gnome-theme-manager.c (apply_font_clicked): Update the desktop - font in addition to the application font when 'apply font' in - large print themes is selected. Fixes #123551. - -2005-02-08 Sebastien Bacher - - * gnome-theme-installer.c: (file_theme_type), (transfer_done_cb), - (install_dialog_response), (gnome_theme_installer_run): - patch by Kjartan Maraas , remove a load of leaks - and make sure newly installed themes show up in the relevant lists - without having to close/open the dialog again (Closes: #166267). - -2005-02-07 Sebastien Bacher - - * gnome-theme-installer.c: (transfer_done_cb): fix some strings, - changes by David Lodge (Closes: #166550). - -2005-02-01 Elijah Newren - - Fix an infinite loop that was bringing single-CPU systems to their - knees. Approved by Kjartan. #160803 - - * gnome-theme-manager.c: (window_settings_changed): keep track of - the window manager theme last selected and just exit if we are - already using the one we want - -2005-02-01 David SedeƱo - - New install procedure: See bug #102216. - * gnome-theme-details.c: Remove gnome_theme_installer_run_cb, - gnome_icon_theme_installer_run_cb because gnome_theme_installer_run - function now detects if it is a icon or theme. - (gnome_theme_details_init): Remove install buttons in theme details - window. - * gnome-theme-installer.c (file_theme_type): Detects the type of the - theme inspecting the content of the file. - (transfer_done_targz_idle_cb, transfer_done_tarbz2_idle_cb): Install - the theme in the correct temp dir. - (transfer_done_cb): Detects if the file to install it is in the - correct format and informs the user if it is not supported. Unpack the - file (informs the user if there are not the correct utility in the - system) and install the theme in the correct directory. - (gnome_theme_installer_run): Remove parameter. Now we detect the file - type. - * gnome-theme-manager.c (gnome_meta_theme_installer_run_cb, - gnome_theme_manager_drag_data_received_cb): Call - gnome_theme_installer_run without the third parameter. Now we detect - the file type. - * theme-properties.glade: Removes install buttons in details window. - -2005-01-06 Sebastien Bacher - - * gnome-theme-installer.c: (install_dialog_response): check the - permission of the .icons/.themes dir instead of the files in it - (Closes: #161649). - -2005-01-03 Sebastien Bacher - - * gnome-theme-installer.c: (install_dialog_response): use a temporary - filename to not overwrite existant files in ~/.themes (Closes: #97180). - -2004-12-25 Kjartan Maraas - - * gnome-theme-details.c: Don't include twice. - * gnome-theme-installer.c: Same (comes in from -installer.h) - * gnome-theme-manager.c: Same. - -2004-11-09 Mark McLoughlin - - * Makefile.am: install .desktop file in $(datadir)/applications. - - * gtk-theme-selector.desktop.in: add OnlyShowIn=GNOME; - -Tue Nov 2 16:03:41 2004 Jonathan Blandford - - * theme-switcher.c (install_dialog_response): Patch from - Vijaykumar Patwari to warn when - .themes can't be written to. - -2004-10-28 Mike Newman - - * gnome-theme-installer.c: (transfer_done_cb) install themes named - .tgz correctly. Show a dialog and remove the file from .themes if the - theme could not be installed (Closes: #148895). - -2004-10-27 Sebastien Bacher - - * gnome-theme-installer.c: (transfer_done_targz_idle_cb), - (transfer_done_tarbz2_idle_cb): * - patch by Rajkumar to fix the themes - installation with the non GNU versions of tar (Closes: #114553). - -2004-10-27 Sebastien Bacher - - * gnome-theme-save.c: (setup_directory_structure): - patch by David SedeƱo FernƔndez to fix a - warning during the compilation (Closes: #148345). - -2004-10-14 Jody Goldberg - - * Release 2.8.1 - -2004-08-20 Frederic Crozat - - * gnome-theme-details.c: (gnome_theme_details_init): - * gnome-theme-manager.c: (setup_dialog): - * theme-switcher.c: (setup_dialog): - Use themed icon for WM hint. - -2004-07-31 Kjartan Maraas - - * gnome-theme-save.c: (setup_directory_structure): Remove - extra space in a string before question mark. - -2004-07-09 David SedeƱo - - (http://bugzilla.gnome.org/show_bug.cgi?id=122970) - * gnome-theme-save.c (setup_directory_structure): - If theme exists, show confirmation dialog to user. - -2004-06-20 David SedeƱo - - (http://bugzilla.gnome.org/show_bug.cgi?id=143958) - * gnome-theme-manager.c, theme-properties.glade: Revert option added. - Two now gboolean global var: 'themes_loaded' to check if its the first - time that has cold meta_theme_selection_changed. 'rervert' to known - in the same function if the selection has change because a revert. - (meta_theme_selection_changed): If it's the same time, save the - initial theme in initial_meta_theme_info. If the selection has change - because a revert click, set the sensitive of the revert button - to false. - (revert_theme_clicked): callback for the revert button clicked signal. - Set the initial_meta_theme and set sensitive to FALSE. - (setup_dialog): Added the revert button to the gtk_size_group, connect - the clicked callback and set sensitive initially to FALSE. - -2004-05-27 Padraig O'Briain - - * theme-properties.glade: Set accessible name for GtkTreeViews - in Theme Details dialog. Fixes bug #142402. - -2004-04-15 Jody Goldberg - - * Release 2.6.1 - -2004-04-07 Jody Goldberg - - * gnome-theme-manager.c (update_settings_from_gconf_idle) : fix the - selection when not running metacity. That was damn irritating. - -2004-03-10 Chris Lahey - - * gnome-theme-manager.c: (pixbuf_async_func): rename function. Use - broken_image. - (pixbuf_async_data_free): rename function. Use PixbufAsyncData instead - of a GList. - (pixbuf_idle_func): rename function. Handle the case that things - change again while we're updating. Stop what it's doing and start - from the beginning. - (add_pixbuf_idle): - (load_meta_themes): clean up. Remove model_meta_theme_info. - (update_themes_from_disk): Remove the code to check for - have_meta_theme here. It works with no metathemes installed. - (add_custom_row_to_meta_theme): handle the initial case too. - (remove_custom_row_from_meta_theme): removed. - (themes_equal): helper function for a fairly complicated comparison. - (update_settings_from_gconf_idle), (update_settings_from_gconf): - reamed. Instead of custom_theme_found to mean that there should be a - custom theme, we use current_theme_saved. - This means that there's a metatheme for the current theme. Its - meaning is almost exactly the boolean opposite of the old - one but it's more understandable. initial_theme_saved tells us - whether the initial theme has a metatheme for it now. - (theme_changed_idle), (theme_changed_func): Made this idle to reduce - rerunning - (setup_dialog): Load broken image. - (gnome_theme_manager_sort_func): Make it symmetric. - * gnome-theme-manager.h: Remove THEME_FLAG_INITIAL. - -2004-04-02 Padraig O'Briain - - * gnome-theme-details.c (update_list_something): Check that cursor - position has changed before calling gtk_tree_view_set_cursor. - * gnome-theme-manager.c (update_settings_from_gconf): Check that - cursor position has changed before calling gtk_tree_view_set_cursor. - - Fixes bug #131538. - -2004-04-01 Jody Goldberg - - * Release 2.6.0.3 - -2004-03-30 Jody Goldberg - - * Release 2.6.0.1 - -2004-03-23 Jody Goldberg - - * Release 2.6.0 - -2004-03-11 Jody Goldberg - - * Release 2.5.4 - -2004-03-02 Jody Goldberg - - * gnome-theme-manager.c (load_meta_themes) : revert the commit on - Wed Feb 4 00:05:11 2004 Jonathan Blandford - exit if it is a non-compliant wm (eg, anything but metacity) - -2004-02-25 Fernando Herrera - - http://bugzilla.gnome.org/show_bug.cgi?id=132902 - * theme-install.glade: use GtkFileChooser. - -2004-02-13 Jody Goldberg - - * Release 2.5.3 - -2004-02-12 Mark McLoughlin - - * gnome-theme-details.c: (cb_dialog_response): - * gnome-theme-installer.c: (install_dialog_response): - * gnome-theme-manager.c: (cb_dialog_response): - * theme-switcher.c: (install_dialog_response), - (cb_dialog_response): Update help links to point to user-guide.xml - -Sat Feb 7 00:34:45 2004 Jonathan Blandford - - * gnome-theme-manager.c (load_meta_themes): fix #106424 - -Fri Feb 6 20:49:25 2004 Jonathan Blandford - - * gnome-theme-details.c (gnome_theme_details_init): Patch from - Frederic Crozat to install themes in the right place. - -Wed Feb 4 00:05:11 2004 Jonathan Blandford - - * gnome-theme-manager.c (load_meta_themes): exit if it is a - non-compliant wm (eg, anything but metacity) - -Tue Feb 3 23:36:25 2004 Jonathan Blandford - - * gnome-theme-manager.c (load_meta_themes): use - g_markup_printf_escaped instead of g_strdup_printf, #110564 - -2004-01-14 Jody Goldberg - - * Release 2.5.2 - -2004-01-05 Muktha - - * theme-properties.glade: Add accessible name and description. - Fixes bug #128377. - -2003-12-30 Jody Goldberg - - * Release 2.5.1.1 - -2003-12-30 Jody Goldberg - - * Release 2.5.1 - -2003-12-05 Srinivasa Ragavan - - * gnome-theme-installer.c (install_dialog_response): Fix for bug - #127371, reporting invalid/ null file locations. - -2003-12-05 Srinivasa Ragavan - - * gnome-theme-installer.c (install_dialog_response): Fix for infinite - loop, when trying to install themes from ~/.themes , #116224 - -2003-10-28 Jody Goldberg - - * Release 2.5.0 - -Tue Aug 5 15:38:31 2003 Jonathan Blandford - - * theme-properties.glade: Fix from Christian Neumair to fix - default and focus, #116892 - - * theme-install.glade: ditto - -Mon Aug 4 14:14:53 2003 Jonathan Blandford - - * gnome-theme-manager.c (idle_async_func): make sure that we have - a valid theme_id, #104824 - -2003-07-07 Jody Goldberg - - * Release 2.3.4 - -2003-07-02 Mark McLoughlin - - * gnome-theme-manager.c: (idle_async_func), (load_meta_themes): - use the default image if the thumbnailer fails. - -2003-06-24 Jody Goldberg - - * Release 2.3.3 - -Wed Jun 18 15:46:27 2003 Jonathan Blandford - - * Makefile.am (EXTRA_DIST): add $(desktop_icons_DATA) - -2003-06-06 Mark Finlay - - * gnome-ccthemes.png - * Makefile.am - - Add icon for the theme applet from gnome-desktop - -2003-05-28 Christian Neumair - - * theme-install.glade - * theme-properties.glade: - - HIGified (#105004). - -2003-05-13 Andrew Sobala - - * Makefile.am: removed theme-thumbnail.[ch] - * gnome-theme-manager.c: (meta_theme_selection_changed): - theme-thumbnail is now in libcommon. Removed meta_theme_set; also now - in libcommon. - * theme-thumbnail.c: removed, now in libcommon - * theme-thumbnail.h: removed, now in libcommon - -2003-05-07 Jody Goldberg - - * Release 2.3.1 - -2003-05-03 Kjartan Maraas - - * theme-thumbnail.c: (create_image): Unref the - icon_theme after using it. - -2003-05-02 Kjartan Maraas - - * theme-properties.glade: Add a colon for consistency. - Fixes bug #103923. - -2003-04-29 Kjartan Maraas - - * gnome-theme-manager.c: (main): Fix a typo. Adapted version - of a patch from . Fixes bug #111849. - -2003-04-29 Kjartan Maraas - - * theme-thumbnail.c: (message_from_capplet), (message_from_child), - (generate_theme_thumbnail), (theme_thumbnail_factory_init): Plug - leaks and guard against invalid reads reported by valgrind. - -Wed Feb 5 17:03:26 2003 Jonathan Blandford - - * gnome-theme-manager.[ch] (get_default_string_from_key): get the - default from the schema and always sort it at the top. - - * gnome-theme-details.c: ditto - -Tue Feb 4 17:09:18 2003 Jonathan Blandford - - * Release 2.2.0.1 - -Tue Jan 21 01:15:14 2003 Jonathan Blandford - - * Release 2.2.0 - -Tue Jan 21 00:44:03 2003 Jonathan Blandford - - * gnome-theme-save.c (escape_string_and_dup): correctly escape the - file we're saving. - -Thu Jan 16 02:41:09 2003 Jonathan Blandford - - * Release 2.1.7 - -Thu Jan 16 02:32:39 2003 Jonathan Blandford - - * gnome-theme-details.c (gnome_theme_details_update_from_gconf): - make sure we're initted, as this function can be run - asynchronously. - - * gnome-theme-manager.c (gnome_meta_theme_installer_run_cb): hook - up the installer. - - * gnome-theme-installer.c: Try to handle icon themes. - -Wed Jan 15 20:15:31 2003 Jonathan Blandford - - * gnome-theme-manager.c (gnome_theme_manager_tree_sort_func): - remove this unneeded sort func. - - * gnome-theme-details.c (setup_tree_view): use the right sort - function. - -2003-01-14 Jody Goldberg - - * gnome-theme-manager.c (load_meta_themes) : yet another place to - handle NULL window manager. - -2003-01-14 Alex Duggan - - * gnome-theme-manager.c (main): - s/gnome-theme-properties/gnome-theme-manager/ Fixes #103525 - -Tue Jan 14 02:16:22 2003 Jonathan Blandford - - * gnome-theme-manager.c (load_meta_themes): set the correct row to - the new data. This was messing a lot up. Saving now works, so - long as you don't type bad data. - - * TODO: update. - -2003-01-13 Jody Goldberg - - * gnome-theme-manager.c (load_meta_themes) : handle yet another place - where gnome_wm_manager_get_current may be NULL. - -Mon Jan 13 15:20:17 2003 Jonathan Blandford - - * gnome-theme-manager.c (main): gnome_theme_init () - -2003-01-10 Jody Goldberg - - * Release 2.1.6 - -2003-01-10 Jody Goldberg - - * Makefile.am (EXTRA_DIST) : dist the pixmaps too. - -2003-01-08 Anders Carlsson - - * gnome-theme-manager.c: (update_font_button_state), - (font_key_changed), (apply_font_clicked), (setup_dialog): - * gnome-theme-manager.h: - Add support for applying fonts. - - * theme-thumbnail.c: (create_image): - Allow SVG files as icons. - -2003-01-08 Jody Goldberg - - * gnome-theme-details.c (gnome_theme_details_update_from_gconf) : - handle lack of metacity. - (window_theme_selection_changed) : ditto. - (gnome_theme_details_reread_themes_from_disk) : ditto. - -Wed Jan 8 01:57:09 2003 Jonathan Blandford - - * gnome-theme-manager.c (add_initial_row_to_meta_theme): handle - initial theme as custom. - - * TODO: update - -Tue Jan 7 03:10:36 2003 Jonathan Blandford - - * gnome-theme-save.c (save_dialog_response): add a description - entry. Still needs escaping. - - * theme-thumbnail.c (generate_theme_thumbnail): read the thumbnail - back from the child correctly. I think thumbnailing fully works. - - * TODO: Update - -2003-01-06 Seth Nickell - - * gnome-theme-manager.c: (load_meta_themes): - * theme-properties.glade: - - Removed #if 0'd code for hard-coding minimuum height - of the tree view. Use glade properties to set minimuum - height to a more reasonable value. Its hard to find - items when you only see two in the scroll-view at - any given time, and many people do not think to - resize windows (nor should they have to :-) - -2003-01-06 Seth Nickell - - * gnome-theme-manager.c: (add_custom_row_to_meta_theme): - - Don't mark internal string for translation so we don't - break string freeze. - -Mon Jan 6 10:55:39 2003 Jonathan Blandford - - * gnome-theme-manager.c (setup_dialog): fix default image. - Remove debugging g_prints. - -2003-01-05 Seth Nickell - - * gnome-theme-manager.c: (setup_dialog), (main): - * Makefile.am: - * theme-thumbnailing.png: - - Add a default image for when theme's are being - thumbnailed. - - * theme-properties.glade: - - Hide dialog by default so it doesn't come - up undrawn. - -2003-01-05 Seth Nickell - - * gnome-theme-manager.c: (add_custom_row_to_meta_theme), - (remove_custom_row_from_meta_theme): - * theme-thumbnail.c: (theme_thumbnail_invalidate_cache): - * theme-thumbnail.h: - - Generate thumbnails for the custom theme. - -Thu Jan 2 08:57:54 2003 Jonathan Blandford - - * gnome-theme-manager.c: correctly merge disk updates and the - current setup. - - * TODO: Add a TODO - -2002-12-31 Seth Nickell - - * theme-thumbnail.c: (create_image): - - Change the order of priority between folder icon names, - since gnome-fs-directory is in the backup theme and will - otherwise take precedence. This fix is a hack. - -2002-12-31 Seth Nickell - - * theme-thumbnail.c: (create_image): - - Thumbnail for themes (most currently) that use - "gnome-fs-directory" as the icon name for folders rather - than "folder". - -2002-12-30 Jody Goldberg - - Apply - http://bugzilla.gnome.org/show_bug.cgi?id=101752 - - * gnome-theme-details.c : Merge in Frederic's patch. - * gnome-theme-details.c : ditto. - -2002-12-28 Seth Nickell - - * gnome-theme-details.c: (path_to_theme_id), (load_theme_names), - (gnome_theme_details_reread_themes_from_disk): - - Use the theme directory name rather than the "printable" name - for icon themes. Does this need to be done for WM themes and - GTK themes as well? - -2002-12-28 Seth Nickell - - * gnome-theme-manager.c: (update_themes_from_disk): - - Fix crash when current WM isn't detected. - -2002-12-18 Jody Goldberg - - * Release 2.1.5 - -Fri Dec 6 16:54:14 2002 Jonathan Blandford - - * gnome-theme-save-data.c: New file. Really saves now. Doesn't - notice when a new metatheme is added, though. - -Tue Dec 3 20:45:17 2002 Jonathan Blandford - - * gnome-theme-save.c: Add saving support. Almost to a working - point w/ this capplet... - -Tue Dec 3 14:26:05 2002 Jonathan Blandford - - * gnome-theme-details.c (window_theme_selection_changed): Fix - g_assert_not_reached() that can be reached. - -Tue Dec 3 00:40:13 2002 Jonathan Blandford - - * .cvsignore: shut up, CVS - - * Makefile.am: build new objects - - * gnome-theme-details.[ch]: New file to encapsulate the details - dialog. - - * gnome-theme-manager.c: Restructure code. Less love, more work. - Prolly an improvement. - -2002-11-23 Jody Goldberg - - * Release 2.1.3 - -Sat Nov 16 00:55:58 2002 Jonathan Blandford - - * gnome-theme-manager.c (meta_theme_selection_changed): actually - set the theme. - -Thu Nov 14 19:30:02 2002 Jonathan Blandford - - * theme-thumbnail.c (setup_theme_thumbnail_factory): add G_IO_HUP - so the child can actually exit when the parent does. - -Thu Nov 14 17:14:00 2002 Jonathan Blandford - - * gnome-theme-manager.c: Use new theme system. Handle other - themes better. - - * theme-thumbnail.c: new file to draw themes. Currently - synchronous -- needs to be made async. - -Thu Nov 7 15:24:33 2002 Jonathan Blandford - - * gtk-theme-selector.desktop.in (Exec): change binary name. - -Tue Nov 5 15:48:20 2002 Jonathan Blandford - - * gnome-theme-manager.c (read_themes): make more robust. - -2002-11-02 Jody Goldberg - - * Release 2.1.2 - -2002-11-02 Jody Goldberg - - * Makefile.am : Add missing file - -Fri Nov 1 11:01:16 2002 Jonathan Blandford - - * gnome-theme-manager.c: Rewrote to handle metathemes and icon - themes. The WM stuff was previously broken, too. - - * gnome-theme-installer.[ch]: Extract this code out to it's own - file. - -2002-10-26 Havoc Pennington - - * theme-switcher.c (window_read_themes): adapt to gnome-wm-manager - API changes - -2002-10-21 Jody Goldberg - - * Release 2.1.1 - -2002-10-01 Yanko Kaneti - - * gtk-theme-switcher.schemas: reorder elements so that it validates. - -2002-10-01 Jody Goldberg - - * Release 2.1.0.1 - -2002-08-26 Jody Goldberg - - * theme-switcher.c (drag_data_received_cb) : unescape the string. - -2002-09-09 Mark McLoughlin - - * Makefile.am: use ../../libwindow-settings/libgnome-window-settings.la - instead of -L../../libwindow-settings -lgnome-window-settings. - Fixeds build breakage. - -2002-08-21 Jody Goldberg - - * Release 2.1.0 - -2002-08-01 Christophe Fergeau - - * theme-switcher.c : correctly deal with bzip2 - compressed theme files - -2002-08-19 Ross Burton - - * gtk-theme-selector.desktop.in: Fix the desktop file so that it - validates. - -2002-08-07 Jody Goldberg - Patch from JRB for 88443 - - * theme-switcher.c (read_themes) : store the current cursor - -2002-07-31 Federico Mena Quintero - - * theme-install.glade: Make the file entry modal. Fixes #89410. - -2002-07-10 Jody Goldberg - - * theme-switcher.c (show_install_dialog) : create and destroy the - dialog. - -2002-07-05 jacob berkman - - * theme-switcher.c (transfer_done_cb): do the real work in an idle - (transfer_done_idle_cb): do the real work - - this fixes bug #86141 - i don't understand why, but some very evil - things seem to have been happening. see that bug for details. - -2002-06-17 Jody Goldberg - - * Release 2.0.0 - -2002-05-28 Satyajit Kanungo - * theme-switcher.c : Changed the help file link - to get the help document from user-guide. - -2002-05-26 Jody Goldberg - - * theme-switcher.c (install_dialog_response) : improve handling of - help failures. - (cb_dialog_response) : ditto. - -Sun May 26 11:34:31 2002 Jonathan Blandford - - * theme-switcher.c (main): use APPID instead of argv[0] - -2002-05-16 Jody Goldberg - - * theme-switcher.c (install_dialog_response) : add some safety checks - for invalid files. - -2002-05-16 Jody Goldberg - - * theme-switcher.c (cb_dialog_response) : fix path. - (install_dialog_response) : add help link. - -Tue May 14 12:29:35 2002 Jonathan Blandford - - * theme-switcher.c (read_themes): try to scroll to theme. - Currently appears to be a little broken somewhere. - - * theme-properties.glade: clean up, and add an atk relation, #76416 - -2002-05-10 Anders Carlsson - - * theme-properties.glade: - Remove ellipsis after "Go to theme folder". - - * theme-switcher.c: (show_manage_themes): - Create the .themes directory if it doesn't exist. - -2002-05-10 Anders Carlsson - - * theme-properties.glade: - Remove ellipsis after "Go to theme folder". - - * theme-switcher.c: (show_manage_themes): - Create the .themes directory if it doesn't exist. - -2002-05-08 Jody Goldberg - - * theme-switcher.c (cb_dialog_response) : new. - (setup_dialog) : support help. - -Mon May 6 17:40:17 2002 Jonathan Blandford - - * theme-switcher.c: remove print statements - - * theme-properties.glade: Fix up UI. Not perfect, but better. - -2002-04-29 Rachel Hestilow - - * theme-properties.glade: Further revamp based on seth's suggestions. - -2002-04-29 Rachel Hestilow - - * theme-properties.glade: Hide checkbutton until we actually - implement that...put it on the backburner for now. - -2002-04-29 Rachel Hestilow - - * theme-properties.glade, theme-swither.c: Add support - for install/manage themes. - -2002-04-27 Seth Nickell - - * gtk-theme-selector.desktop.in: - - Change name, move out of Advanced category. - - * theme-properties.glade: - - Tweak padding / spacing. - - * gtk-theme-selector.desktop.in.in: - - Old cruft file, delete. - -2002-04-26 Seth Nickell - - * Makefile.am: - * gnome-font-and-theme-properties.c: - * gnome-font-and-theme-properties.glade: - * gtk-theme-selector.glade: - * main.c: - * theme-properties.glade: - * theme-switcher.c: (create_dialog), (theme_selection_changed), - (read_themes), (theme_key_changed), (theme_changed_func), - (sort_func), (setup_dialog), (main): - - Move the font code into a seperate capplet. - -Thu Apr 18 19:35:42 2002 Jonathan Blandford - - * gnome-font-and-theme-properties.c (setup_dialog): handle new - theme-changing code, and sort code. - -2002-04-12 jacob berkman - - * gnome-font-and-theme-properties.c (create_dialog): get the glade - file from GLADEDIR - - * Makefile.am (INCLUDES): define GLADEDIR - (glade_DATA): install the right glade file - -Wed Apr 10 18:03:25 2002 Jonathan Blandford - - * gtk-theme-selector.desktop.in (Exec): s/gtk2-theme-selector-capplet/gnome-font-and-theme-properties - -2002-04-10 Rachel Hestilow - - * gnome-font-and-theme-properties.glade: Add font options to UI. - - * gnome-font-and-theme-properties.c (setup_dialog): Add peditors - for fonts. - -2002-04-10 jacob berkman - - * Makefile.am (SUBDIRS): add back SUBDIRS - -2002-03-28 Richard Hestilow - - * control/control.c (create_form): Construct list example - from a single string. Fixes bug #72761. - -2002-03-09 Richard Hestilow - - * gtk-theme-selector.glade, main.c: Remove preview option - and button, this makes no sense with instant apply. - (select_cb): Just call apply_cb. - -2002-02-27 Kjartan Maraas - - * main.c: s/PACKAGE/GETTEXT_PACKAGE/g - -2002-02-18 Gediminas Paulauskas - - * main.c: fix i18n - -2002-02-11 Seth Nickell - - * gtk-theme-selector.glade: - * main.c: (call_apply), (response_cb), (main): - - Convert to instant apply. - -2002-02-04 Lauris Kaplinski - - * main.c (themes_list_refresh): Use g_path_get_basename - (get_selected_theme_name): Ditto - (install_cb): Use g_signal_connect - - * control/control.c (create_form): Use gtk_menu_shell_append - (create_form): Use gtk_radio_button_get_group, - set entry max length explicitly - -2002-01-28 Richard Hestilow - - * main.c: Include gconf-client.h, add trailing NULLs to all - gconf_client calls (for GError). - -2002-01-27 Seth Nickell - - * gtk-theme-selector.desktop.in.in: - - Add Categories field. - -2002-01-27 Richard Hestilow - - * control/control.c: Include string.h. - (create_form): Defer modifying default rc files until property is set. - (set_prop_cb): Set default files here instead. - -2002-01-21 Anders Carlsson - - * main.c: Get the theme name right. - - * control/control.c (create_form): Use a GtkTreeView instead of a - clist. - -2002-01-21 Richard Hestilow - - * Complete rewrite. - -2002-01-14 Bradford Hovinen - - * Makefile.am: Update - -2002-01-04 Bradford Hovinen - - * control/Makefile.am (gnome_theme_preview_LDADD): Use - $(CONTROL_{CFLAGS|LIBS}) rather than @CONTROL_{CFLAGS|LIBS}@ - -2001-12-08 Richard Hestilow - - * Port to GConf. - -2001-12-08 Richard Hestilow - - * Partial revamp to use bonobo control instead of bug-prone - custom socket; also port away from libcapplet. - -2001-10-13 Bradford Hovinen - - * lister.c (edit_file_to_use): Be paranoid about what we have read - from the input file -- make sure the string is always - NULL-terminated - -2001-09-29 Richard Hestilow - - * gui.c (sort_alpha): Use g_strcasecmp, not strcmp. - Fixes bug #13539. - -2001-09-29 Richard Hestilow - - * lister.c: (list_themes, list_system_themes, list_user_themes): - Return a GList of ThemeEntry*, and remove extraneous number argument. - Also, use g_strdup_printf instead of g_snprintf. - - * da.h (ThemeEntry): Add a "row" data member. - * gui.c: Change variables current_theme, current_global_theme, - initial_theme, and last_theme to ThemeEntry*. - (make_main): Change GtkList to a GtkCList to avoid scrolling bug. - (click_entry): Changed to "select_row" callback prototype. - (delete_entry): Removed. - (item_destroy_notify): Added in lieu of delete_entry. - (sort_alpha): Accept ThemeEntry* and not GtkBin*. - (add_theme_list): Added. - (update_theme_entries): Use clist functions. - -2001-07-27 Bradford Hovinen - - * RELEASE : 1.5.2 - -2001-07-27 Bradford Hovinen - - * Makefile.am: Remove empty SUBDIRS line - -2001-07-20 Chema Celorio - - * RELEASE : 1.5.0 - -2001-07-19 Richard Hestilow - - * Started. - - * main.c (main): Don't waitpid. I have no idea why it didn't work, - but this is at least better than waiting forever. diff --git a/capplets/theme-switcher/Makefile.am b/capplets/theme-switcher/Makefile.am deleted file mode 100644 index e867253ed..000000000 --- a/capplets/theme-switcher/Makefile.am +++ /dev/null @@ -1,66 +0,0 @@ -# This is used in GNOMECC_CAPPLETS_CFLAGS -cappletname = theme - -bin_PROGRAMS = gnome-theme-manager - -pixmapdir = $(pkgdatadir)/pixmaps -pixmap_DATA = \ - theme-thumbnailing.png - -gnome_theme_manager_LDADD = \ - $(GNOMECC_CAPPLETS_LIBS) \ - $(METACITY_LIBS) \ - $(top_builddir)/libwindow-settings/libgnome-window-settings.la \ - $(top_builddir)/capplets/common/libcommon.la - -gnome_theme_manager_SOURCES = \ - gnome-theme-save.c \ - gnome-theme-save.h \ - gnome-theme-manager.c \ - gnome-theme-manager.h \ - gnome-theme-details.c \ - gnome-theme-details.h \ - gnome-theme-installer.c \ - gnome-theme-installer.h - -gnome_theme_manager_LDFLAGS = -export-dynamic - - -@INTLTOOL_DESKTOP_RULE@ - -xml_in_files = gnome-theme-package.xml.in -xml_files = $(xml_in_files:.xml.in=.xml) - -@INTLTOOL_XML_RULE@ - -mimedir = $(datadir)/mime/packages -mime_DATA = $(xml_files) - -desktopdir = $(datadir)/applications -Desktop_in_files = gtk-theme-selector.desktop.in \ - gnome-theme-installer.desktop.in -desktop_DATA = $(Desktop_in_files:.desktop.in=.desktop) - -gladedir = $(pkgdatadir)/glade -glade_DATA = theme-properties.glade - -INCLUDES = \ - -I$(top_srcdir) \ - $(METACITY_CFLAGS) \ - $(GNOMECC_CAPPLETS_CFLAGS) \ - -DGLADEDIR=\""$(gladedir)"\" \ - -DGNOMELOCALEDIR="\"$(datadir)/locale\"" \ - -DGNOMECC_DATA_DIR="\"$(pkgdatadir)\"" - -CLEANFILES = $(GNOMECC_CAPPLETS_CLEANFILES) $(Desktop_in_files) $(desktop_DATA) $(xml_files) -EXTRA_DIST = $(glade_DATA) gnome-theme-save-data.c $(pixmap_DATA) $(xml_in_files) - -install-data-hook: -if ENABLE_UPDATE_MIMEDB - $(UPDATE_MIME_DATABASE) "$(DESTDIR)$(datadir)/mime" -endif - -uninstall-hook: -if ENABLE_UPDATE_MIMEDB - $(UPDATE_MIME_DATABASE) "$(DESTDIR)$(datadir)/mime" -endif diff --git a/capplets/theme-switcher/TODO b/capplets/theme-switcher/TODO deleted file mode 100644 index cbc040167..000000000 --- a/capplets/theme-switcher/TODO +++ /dev/null @@ -1,17 +0,0 @@ -Left TODO: - - * Change custom theme text to indicate what themes are being used. - - requires breaking string freeze - - * Sanity check saving. In particular, \n needs escaping. - - * Fix the collation of the Details dialog. Seems to be going on theme - name, not readable name. - - * When saving a theme that started as an initial custom theme, kill - that from the list. - - * Have the 'set Background' button do something. - - * make sure that installing themes go to the right place. - diff --git a/capplets/theme-switcher/gnome-ccthemes.png b/capplets/theme-switcher/gnome-ccthemes.png deleted file mode 100644 index e722d1a3a478138101202c2639ed957a3f9cbd34..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2826 zcmV+l3-$DgP)3m=u)F5dWBEBqTD}z-$&aWn{_3AAv0B)JUsF zeq=?&lo+Qm{1BA_rF2Nk^?KLd-S@uVXMfaduB9y?s9VB2`R0<#^L?K8`}2I>pXc-3 z!42HN4cx#e_{n!o;94*T_y^$qHWpK^^L+CZMcF)i_Uw;n zi5)w3$Uq>l|Jzvjdh9?AuqzY_{cP*jtrNrHuqPgm6Ap)`0!7zh{&AsR!@DN1&NR*6 zG&D3!-MDdMnb+&pW3d>CL;^)o{3lMF@MJQXmg_}!G<=;MFoECdx_KcqFp#pGTYQBhH$pFDYTS$}{3 zM*x99;BPLMt7GljwM{EltmqX&j7mN$>Pkf93Yflg=T5V(uFmWAj(rAYNoENHXqtv) zS?u4xpF@WZ@$kbBqbLgH<>fezQw3lcM!@BA75M#rW&8H+53g9U;*VpIzZwy_CXVdd zwd=O=$mdQfgh10YG)<$ctBX~uR`JwRPYtD#5Q1>VAp}03@AtZ{|42%Cr{g&F z2M!!49e1HCM6Q4j4jw#6Z*T9oFJ#H9s*0+r95`@*B}u$H(jiM+^R8@5whA~OgwC``&u;D2w<+YUYO9Zr@J$p9x^2;xeIxvw)aQ^&x+S}WC z?z!hkCX*M@zI(F{dc`TJm4IA{zE3Yth>Qo|;2<7GFG&D4@VZ#P2%c8Wjl;-AU z)~s1WSy>rbV+tW~949$2Frb>IxlY%0Mbk9gZZ|HM3tiWP7cXACYt^b%FO4VSay}V( zkUhI^-@e_?KKtyk+%M+9>A-O$i*;Ny=!o_6_oUy6|y4*=UIO`6nu=+L1D zBaz6MFJ>|s9LHf`V1T~9K6-n5iAJLwJ$jUl8#mI}*ho5^jz0F-W5@k||M!ByU_me# z#P9dx^ZBy70Dxf_?dQ**4|u)a7q@NOwmLsQKQWBtIF)GF4oE3`f%i|IJo&+zHEX)Z zQ=V-Za(6(}G+uxG^&x-s_4V}_hM^mV(W&b?rfFgr28Lk_jn_1dcsyQa+jj8OsZ%TF z%$f7~%$YMA*REX~9&i0o1$>3S0Qa3ccW&R_y?e(MkgY_y<@Cc3KOCx3U0q$OuImM+ zX$nmnJaP=fKvh)?!x)Ne_S3d)-LkAmS6A1DrlzK|E|;rIRn@l@MfoLgGlP9tn88c| zMsFn&!1Cti=FO_Ac2reWO$dhvgK^}@5z^^2RaI5Pga{#c?X}l<>7|$Ocs%%gK7$;B5=i`n$?qKoa#kgE9qR}YtzWXlw_U#)wKWy6uz;PT?N*NJC{Lpcn z89)r^2KEAnfPVvB!vy41kmJC**4EZXo0^(_x^CS%1K_5cZeroWh4}q`YHMpLEG*>k z;lsT5-g{&+8D`F$Nn2YRPdxDirfG8O)G15TG*j1gmuZ>=0s-#5_g+d%OHoyoa5zjR zli{6r-XWPxl1`^_9B0U1Qp)U80+f73^A=zNpaXAQvI9AWIT(#bt9S3-9bB+r!QJ!c z&sRgC5O2Kk2FsQ$WAoK&wA|8*^)6>J3Uw+B@_3NprsbS*8iCC63ti#R0=fIzV z%`nD=CZ|iZfi0hW@=4FKWy@NDx3XhQ(`4@4xh!3}l!Xfya`VkMW11!&j|Z>U%L^~O z@TsCGL0#8}Oq;DdS>I$^am%vEWHP9#N+1wm`SRssMgJ)9F@uGMF$LuA1aJ`8{pzc) zM(?`ou2Z9l6+)106TDt8?d|PHqtU2W2;r!zij0qAl7WE% z`uqDyBog%W^dO~V<;s;q`JaO*aQdsr+vD*bDIkj<17FnF*MAm|$7L3dUS6K;>gtkxeSH$heL8^s!0)bzc&>mEBD_L~zZVr1bu>0Mp6TrD942DV zo;`g&pRY>@@vlH2poYWY3lk?!ln*}mpj^Lxz1+HWt88g$k%>e?I*ucg$)s#*YLaDT zWil8HO2aVZqD713^Upt@OFqers;b9VuU>6G`skw_ZnwL%sHli=I80t%9zLHB+qPM>Xc70_cOU6=ntAi) zapcGmQmNEP<2t~nz#iaNUt7RP)YsS3+}w=U>qQ6=X0WvN0o}1!%)W5p0@c;kXqxtk z%jLQy6bcazhsn>+AG&VFVlnQ&|9&2N=pl|BJI1V8vv3?I*St3H8L;mw@}uVcRsF1z zjZAB6E9K?otX{pE&d$zmDdp#m=F@^WfxYjeqe2^C>mnii!$ZR#qlMp^)@=JW|(nxn;|iT+^NbHZs_> zT^3)<1D8XtsOswKn$xFGZ`XCbz;T>{Z0%2_QdpKXG6+4u7T^y+>e89NCFJhTgb5QU zE-wCgUS8huP$=}S+wGRRu1i%_rJ^Xgk&iM)rTI>f70}VqK` - -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "capplet-util.h" -#include "gnome-theme-manager.h" -#include "gnome-theme-details.h" -#include "gnome-theme-installer.h" -#include "gnome-theme-info.h" -#include "gtkrc-utils.h" - -#define MAX_ELEMENTS_BEFORE_SCROLLING 12 - -static gboolean theme_details_initted = FALSE; -static gboolean setting_model = FALSE; - -enum { - THEME_GTK, - THEME_WINDOW, - THEME_ICON -}; - - -/* Function Prototypes */ -static void cb_dialog_response (GtkDialog *dialog, - gint response_id); -static void setup_tree_view (GtkTreeView *tree_view, - GCallback changed_callback, - GladeXML *dialog); -static void gtk_theme_selection_changed (GtkTreeSelection *selection, - gpointer data); -static void window_theme_selection_changed (GtkTreeSelection *selection, - gpointer data); -static void icon_theme_selection_changed (GtkTreeSelection *selection, - gpointer data); -static void update_gconf_key_from_selection (GtkTreeSelection *selection, - const gchar *gconf_key); -static void load_theme_names (GtkTreeView *tree_view, - GList *theme_list, - const gchar *default_theme); -static char *path_to_theme_id (const char *path); -static void update_color_buttons_from_string (gchar *color_scheme); -static void color_scheme_changed (GObject *settings, - GParamSpec *pspec, - gpointer data); - -void revert_color_scheme_key (GtkWidget *checkbutton, gpointer *data); - -static char * -path_to_theme_id (const char *path) -{ - char *dirname; - char *result; - - dirname = g_path_get_dirname(path); - result = g_path_get_basename(dirname); - g_free(dirname); - - return result; -} - -static void -cb_dialog_response (GtkDialog *dialog, gint response_id) -{ - if (response_id == GTK_RESPONSE_HELP) - capplet_help (GTK_WINDOW (dialog), "user-guide.xml", "goscustdesk-12"); - else - gtk_widget_hide (GTK_WIDGET (dialog)); -} - -static gint -details_tree_sort_func (GtkTreeModel *model, - GtkTreeIter *a, - GtkTreeIter *b, - gpointer user_data) -{ - gchar *a_name = NULL; - gchar *b_name = NULL; - guint a_flag = FALSE; - guint b_flag = FALSE; - gint retval; - - gtk_tree_model_get (model, a, - THEME_NAME_COLUMN, &a_name, - THEME_FLAG_COLUMN, &a_flag, - -1); - gtk_tree_model_get (model, b, - THEME_NAME_COLUMN, &b_name, - THEME_FLAG_COLUMN, &b_flag, - -1); - - retval = gnome_theme_manager_sort_func (a_name, b_name, a_flag, b_flag); - - g_free (a_name); - g_free (b_name); - - return retval; -} - -static void -setup_tree_view (GtkTreeView *tree_view, - GCallback changed_callback, - GladeXML *dialog) -{ - GtkTreeModel *model; - GtkTreeSelection *selection; - GtkCellRenderer *renderer; - - model = (GtkTreeModel *) gtk_list_store_new (N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_UINT); - gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (model), 0, details_tree_sort_func, NULL, NULL); - gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (model), 0, GTK_SORT_ASCENDING); - gtk_tree_view_set_model (tree_view, model); - - selection = gtk_tree_view_get_selection (tree_view); - gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE); - g_signal_connect (G_OBJECT (selection), "changed", changed_callback, dialog); - - renderer = gtk_cell_renderer_text_new (); - gtk_tree_view_insert_column_with_attributes (tree_view, - -1, NULL, - renderer, - "text", THEME_NAME_COLUMN, - NULL); - g_object_set (renderer, "ellipsize", PANGO_ELLIPSIZE_END, NULL); -} - -static void -gtk_theme_update_remove_button (GtkTreeSelection *selection, - GtkWidget *remove_button, - gint theme_type) -{ - gchar *theme_selected; - GtkTreeModel *model; - GtkTreeIter iter; - GList *theme_list=NULL, *list; - gchar *theme_base=NULL; - GnomeVFSResult vfs_result; - GnomeVFSFileInfo *vfs_info; - - if (gtk_tree_selection_get_selected (selection, &model, &iter)) - gtk_tree_model_get (model, &iter, - THEME_NAME_COLUMN, &theme_selected, - -1); - else - theme_selected = NULL; - - if (theme_selected != NULL) - { - switch (theme_type) { - case THEME_GTK: theme_base = g_strdup("/gtk-2.0/"); - theme_list = gnome_theme_info_find_by_type (GNOME_THEME_GTK_2); - break; - case THEME_ICON: theme_list = gnome_theme_icon_info_find_all(); - break; - case THEME_WINDOW: theme_base = g_strdup("/metacity-1/"); - theme_list = gnome_theme_info_find_by_type (GNOME_THEME_METACITY); - break; - default: theme_list = NULL; - break; - } - } - - vfs_info = gnome_vfs_file_info_new (); - - for (list = theme_list; list; list = list->next) - { - GnomeThemeInfo *info = list->data; - gchar *theme_dir = NULL; - - if (!strcmp(info->name, theme_selected)) - { - if (theme_type == THEME_ICON) - theme_dir = g_strdup(info->path); - else - theme_dir = g_strdup_printf("%s/%s", info->path, theme_base); - - vfs_result = gnome_vfs_get_file_info (theme_dir, - vfs_info, - GNOME_VFS_FILE_INFO_GET_ACCESS_RIGHTS); - g_free (theme_dir); - - if (vfs_result == GNOME_VFS_OK) - { - if ((vfs_info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_ACCESS) && - !(vfs_info->permissions & GNOME_VFS_PERM_ACCESS_WRITABLE)) - gtk_widget_set_sensitive(remove_button, FALSE); - else - gtk_widget_set_sensitive(remove_button, TRUE); - } else { - gtk_widget_set_sensitive(remove_button, FALSE); - } - - } - } - gnome_vfs_file_info_unref(vfs_info); - g_free (theme_base); - g_free (theme_selected); -} - -static void -update_color_scheme_tab (const gchar *theme) -{ - GSList *symbolic_colors = NULL; - GSList *engines = NULL; - gboolean fg, bg, base, text, fg_s, bg_s, enable_colors, enable_revert; - gchar *filename; - gchar *theme_name = NULL; - gchar *color_scheme= NULL; - GtkSettings *settings; - GladeXML *dialog; - GConfClient *client; - - dialog = gnome_theme_manager_get_theme_dialog (); - - if (theme == NULL) { - settings = gtk_settings_get_default (); - g_object_get (G_OBJECT (settings), "gtk-theme-name", &theme_name, NULL); - theme = theme_name; - } - filename = gtkrc_find_named (theme); - - gtkrc_get_details (filename, &engines, &symbolic_colors); - fg = (g_slist_find_custom (symbolic_colors, "fg_color", g_str_equal) != NULL); - bg = (g_slist_find_custom (symbolic_colors, "bg_color", g_str_equal) != NULL); - base = (g_slist_find_custom (symbolic_colors, "base_color", g_str_equal) != NULL); - text = (g_slist_find_custom (symbolic_colors, "text_color", g_str_equal) != NULL); - fg_s = (g_slist_find_custom (symbolic_colors, "selected_fg_color", g_str_equal) != NULL); - bg_s = (g_slist_find_custom (symbolic_colors, "selected_bg_color", g_str_equal) != NULL); - - enable_colors = enable_revert = (fg && bg && base && text && fg_s && bg_s); - - client = gconf_client_get_default (); - color_scheme = gconf_client_get_string (client, COLOR_SCHEME_KEY, NULL); - if (color_scheme == NULL || strcmp (color_scheme, "") == 0) - enable_revert = FALSE; - g_free (color_scheme); - g_object_unref (client); - - gtk_widget_set_sensitive (WID ("color_scheme_table"), enable_colors); - gtk_widget_set_sensitive (WID ("color_scheme_revert_button"), enable_revert); - - if (enable_colors) - gtk_widget_hide (WID ("color_scheme_message_hbox")); - else - gtk_widget_show (WID ("color_scheme_message_hbox")); - - g_slist_foreach (engines, (GFunc) g_free, NULL); - g_slist_free (engines); - g_slist_foreach (symbolic_colors, (GFunc) g_free, NULL); - g_slist_free (symbolic_colors); - g_free (filename); - g_free (theme_name); -} - -static void -gtk_theme_selection_changed (GtkTreeSelection *selection, - gpointer data) -{ - GladeXML *dialog; - GtkTreeModel *model; - GtkTreeIter iter; - - dialog = gnome_theme_manager_get_theme_dialog (); - - update_gconf_key_from_selection (selection, GTK_THEME_KEY); - gtk_theme_update_remove_button(selection, WID("control_remove_button"), THEME_GTK); - - if (gtk_tree_selection_get_selected (selection, &model, &iter)) - { - gchar *theme; - - gtk_tree_model_get (model, &iter, - THEME_ID_COLUMN, &theme, - -1); - update_color_scheme_tab (theme); - g_free (theme); - } -} - -static void -window_theme_selection_changed (GtkTreeSelection *selection, - gpointer data) -{ - GnomeWindowManager *window_manager = NULL; - GnomeWMSettings wm_settings; - GtkTreeIter iter; - gchar *window_theme_name; - GtkTreeModel *model; - - if (setting_model) - return; - - if (gtk_tree_selection_get_selected (selection, &model, &iter)) - { - gtk_tree_model_get (model, &iter, - THEME_ID_COLUMN, &window_theme_name, - -1); - } - else - { - return; - } - - window_manager = gnome_wm_manager_get_current (gdk_display_get_default_screen (gdk_display_get_default ())); - if (window_manager != NULL && strcmp (gnome_window_manager_get_name (window_manager), "No name")) { - wm_settings.flags = GNOME_WM_SETTING_THEME; - wm_settings.theme = window_theme_name; - gnome_window_manager_change_settings (window_manager, &wm_settings); - } - g_free (window_theme_name); -} - -static void -icon_theme_selection_changed (GtkTreeSelection *selection, - gpointer data) -{ - GladeXML *dialog; - - dialog = gnome_theme_manager_get_theme_dialog (); - update_gconf_key_from_selection (selection, ICON_THEME_KEY); - gtk_theme_update_remove_button(selection, WID("icon_remove_button"), THEME_ICON); -} - -static void -load_theme_names (GtkTreeView *tree_view, - GList *theme_list, - const gchar *default_theme) -{ - GList *list; - GtkTreeModel *model; - GtkWidget *swindow; - gint i = 0; - - swindow = GTK_WIDGET (tree_view)->parent; - model = gtk_tree_view_get_model (tree_view); - g_assert (model); - - setting_model = TRUE; - gtk_list_store_clear (GTK_LIST_STORE (model)); - - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swindow), - GTK_POLICY_NEVER, GTK_POLICY_NEVER); - gtk_widget_set_size_request (swindow, -1, -1); - - for (list = theme_list; list; list = list->next->next) - { - const char *name = list->data; - const char *id = list->next->data; - GtkTreeIter iter; - gboolean is_default; - - gtk_list_store_prepend (GTK_LIST_STORE (model), &iter); - - if (default_theme && strcmp (default_theme, name) == 0) - is_default = TRUE; - else - is_default = FALSE; - - gtk_list_store_set (GTK_LIST_STORE (model), &iter, - THEME_NAME_COLUMN, name, - THEME_ID_COLUMN, id, - THEME_FLAG_COLUMN, is_default, - -1); - - if (i == MAX_ELEMENTS_BEFORE_SCROLLING) - { - GtkRequisition rectangle; - gtk_widget_size_request (GTK_WIDGET (tree_view), &rectangle); - gtk_widget_set_size_request (swindow, -1, rectangle.height); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swindow), - GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); - } - i++; - } - setting_model = FALSE; -} - -/* Shared by icons and gtk+ */ -static void -update_gconf_key_from_selection (GtkTreeSelection *selection, - const gchar *gconf_key) -{ - GtkTreeModel *model; - gchar *new_key; - GConfClient *client; - GtkTreeIter iter; - - if (setting_model) - return; - - client = gconf_client_get_default (); - - if (gtk_tree_selection_get_selected (selection, &model, &iter)) - { - gtk_tree_model_get (model, &iter, - THEME_ID_COLUMN, &new_key, - -1); - } - else - /* This shouldn't happen */ - { - new_key = NULL; - } - - if (new_key != NULL) - { - gchar *old_key; - - old_key = gconf_client_get_string (client, gconf_key, NULL); - if (old_key && strcmp (old_key, new_key)) - { - gconf_client_set_string (client, gconf_key, new_key, NULL); - } - g_free (old_key); - } - else - { - gconf_client_unset (client, gconf_key, NULL); - } - g_free (new_key); - g_object_unref (client); -} - -static void -remove_theme(GtkWidget *button, gpointer data) -{ - GladeXML *dialog; - GtkWidget *confirm_dialog, *info_dialog; - GList *theme_list, *string_list, *list; - GtkTreeSelection *selection; - GtkTreeModel *model; - GtkTreeIter iter; - gchar *theme_dir, *theme_selected, *treeview; - gint response, theme_type; - GList *uri_list; - GnomeVFSResult result; - - confirm_dialog = gtk_message_dialog_new (NULL, - GTK_DIALOG_MODAL, - GTK_MESSAGE_QUESTION, - GTK_BUTTONS_OK_CANCEL, - _("Would you like to remove this theme?")); - response = gtk_dialog_run (GTK_DIALOG (confirm_dialog)); - gtk_widget_destroy(confirm_dialog); - if (response == GTK_RESPONSE_CANCEL) - return; - - theme_type = (gint)data; - switch (theme_type) { - case THEME_GTK: theme_dir = g_strdup("/gtk-2.0/"); - theme_list = gnome_theme_info_find_by_type (GNOME_THEME_GTK_2); - treeview=g_strdup("control_theme_treeview"); - break; - case THEME_ICON: theme_list = gnome_theme_icon_info_find_all(); - treeview=g_strdup("icon_theme_treeview"); - theme_dir = NULL; - break; - case THEME_WINDOW: theme_dir = g_strdup("/metacity-1/"); - theme_list = gnome_theme_info_find_by_type (GNOME_THEME_METACITY); - treeview=g_strdup("window_theme_treeview"); - break; - default: theme_list = NULL; - theme_dir = NULL; - treeview = NULL; - break; - } - - - if (treeview != NULL) { - dialog = gnome_theme_manager_get_theme_dialog (); - selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(WID(treeview))); - if (gtk_tree_selection_get_selected (selection, &model, &iter)) - { - gtk_tree_model_get (model, &iter, - THEME_NAME_COLUMN, &theme_selected, - -1); - } else { - theme_selected = NULL; - } - - if (theme_selected!=NULL) - { - string_list = NULL; - - for (list = theme_list; list; list = list->next) - { - GnomeThemeInfo *info = list->data; - if (!strcmp(info->name, theme_selected)) - { - - if (theme_type == THEME_ICON) - theme_dir = g_strdup(g_path_get_dirname(info->path)); - else - theme_dir = g_strdup_printf("%s/%s", info->path, theme_dir); - - uri_list = g_list_prepend(NULL, gnome_vfs_uri_new (theme_dir)); - - result = gnome_vfs_xfer_delete_list (uri_list, GNOME_VFS_XFER_ERROR_MODE_ABORT, - GNOME_VFS_XFER_RECURSIVE, - NULL, NULL); - if (result == GNOME_VFS_OK) - { - info_dialog = gtk_message_dialog_new (NULL, - GTK_DIALOG_MODAL, - GTK_MESSAGE_INFO, - GTK_BUTTONS_OK_CANCEL, - _("Theme deleted succesfully. Please select another theme.")); - gtk_list_store_remove (GTK_LIST_STORE(model), &iter); - gtk_dialog_run (GTK_DIALOG (info_dialog)); - - } else { - info_dialog = gtk_message_dialog_new (NULL, - GTK_DIALOG_MODAL, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - _("Theme can not be deleted")); - gtk_dialog_run (GTK_DIALOG (info_dialog)); - } - gtk_widget_destroy (info_dialog); - gnome_vfs_uri_list_free (uri_list); - } - } - } - } -} - -static void -gtk_color_scheme_changed (GtkWidget *colorbutton, GladeXML *dialog) -{ - GConfClient *client = NULL; - gchar *new_scheme; - GdkColor colors[6]; - gchar *bg, *fg, *text, *base, *selected_fg, *selected_bg; - GtkWidget *widget; - - widget = WID ("fg_colorbutton"); - gtk_color_button_get_color (GTK_COLOR_BUTTON (widget), &colors[0]); - widget = WID ("bg_colorbutton"); - gtk_color_button_get_color (GTK_COLOR_BUTTON (widget), &colors[1]); - widget = WID ("text_colorbutton"); - gtk_color_button_get_color (GTK_COLOR_BUTTON (widget), &colors[2]); - widget = WID ("base_colorbutton"); - gtk_color_button_get_color (GTK_COLOR_BUTTON (widget), &colors[3]); - widget = WID ("selected_fg_colorbutton"); - gtk_color_button_get_color (GTK_COLOR_BUTTON (widget), &colors[4]); - widget = WID ("selected_bg_colorbutton"); - gtk_color_button_get_color (GTK_COLOR_BUTTON (widget), &colors[5]); - - fg = g_strdup_printf ("fg_color:#%04x%04x%04x\n", colors[0].red, colors[0].green, colors[0].blue); - bg = g_strdup_printf ("bg_color:#%04x%04x%04x\n", colors[1].red, colors[1].green, colors[1].blue); - text = g_strdup_printf ("text_color:#%04x%04x%04x\n", colors[2].red, colors[2].green, colors[2].blue); - base = g_strdup_printf ("base_color:#%04x%04x%04x\n", colors[3].red, colors[3].green, colors[3].blue); - selected_fg = g_strdup_printf ("selected_fg_color:#%04x%04x%04x\n", colors[4].red, colors[4].green, colors[4].blue); - selected_bg = g_strdup_printf ("selected_bg_color:#%04x%04x%04x", colors[5].red, colors[5].green, colors[5].blue); - - new_scheme = g_strconcat (fg, bg, text, base, selected_fg, selected_bg, NULL); - - client = gconf_client_get_default (); - - /* Currently we assume this has only been called when one of the colours has - * actually changed, so we don't check the original key first - */ - gconf_client_set_string (client, COLOR_SCHEME_KEY, new_scheme, NULL); - - g_object_unref (G_OBJECT (client)); - free_all (fg, bg, text, base, selected_fg, selected_bg, new_scheme, NULL); -} - -void -revert_color_scheme_key (GtkWidget *checkbutton, gpointer *data) -{ - GConfClient *client = NULL; - GladeXML *dialog; - - dialog = gnome_theme_manager_get_theme_dialog (); - - client = gconf_client_get_default (); - gconf_client_set_string (client, COLOR_SCHEME_KEY, "", NULL); - g_object_unref (G_OBJECT (client)); -} - -void -gnome_theme_details_init (void) -{ - GtkWidget *parent, *widget; - GladeXML *dialog; - gchar *theme; - - if (theme_details_initted) - return; - theme_details_initted = TRUE; - - dialog = gnome_theme_manager_get_theme_dialog (); - parent = WID ("theme_details_dialog"); - - setup_tree_view (GTK_TREE_VIEW (WID ("control_theme_treeview")), - (GCallback) gtk_theme_selection_changed, - dialog); - setup_tree_view (GTK_TREE_VIEW (WID ("window_theme_treeview")), - (GCallback) window_theme_selection_changed, - dialog); - setup_tree_view (GTK_TREE_VIEW (WID ("icon_theme_treeview")), - (GCallback) icon_theme_selection_changed, - dialog); - - /* gtk themes */ - widget = WID ("control_remove_button"); - g_signal_connect (G_OBJECT (widget), "clicked", G_CALLBACK (remove_theme), (gint*)THEME_GTK); - widget = WID ("control_install_button"); - g_signal_connect (G_OBJECT (widget), "clicked", G_CALLBACK (gnome_theme_installer_run_cb), parent); - - /* window manager themes */ - widget = WID ("window_remove_button"); - g_signal_connect (G_OBJECT (widget), "clicked", G_CALLBACK (remove_theme), (gint*)THEME_WINDOW); - widget = WID ("window_install_button"); - g_signal_connect (G_OBJECT (widget), "clicked", G_CALLBACK (gnome_theme_installer_run_cb), parent); - - /* icon themes */ - widget = WID ("icon_remove_button"); - g_signal_connect (G_OBJECT (widget), "clicked", G_CALLBACK (remove_theme), (gint*)THEME_ICON); - widget = WID ("icon_install_button"); - g_signal_connect (G_OBJECT (widget), "clicked", G_CALLBACK (gnome_theme_installer_run_cb), parent); - - /* color preferences */ - widget = WID ("fg_colorbutton"); - g_signal_connect (G_OBJECT (widget), "color_set", G_CALLBACK (gtk_color_scheme_changed), dialog); - widget = WID ("bg_colorbutton"); - g_signal_connect (G_OBJECT (widget), "color_set", G_CALLBACK (gtk_color_scheme_changed), dialog); - widget = WID ("text_colorbutton"); - g_signal_connect (G_OBJECT (widget), "color_set", G_CALLBACK (gtk_color_scheme_changed), dialog); - widget = WID ("base_colorbutton"); - g_signal_connect (G_OBJECT (widget), "color_set", G_CALLBACK (gtk_color_scheme_changed), dialog); - widget = WID ("selected_fg_colorbutton"); - g_signal_connect (G_OBJECT (widget), "color_set", G_CALLBACK (gtk_color_scheme_changed), dialog); - widget = WID ("selected_bg_colorbutton"); - g_signal_connect (G_OBJECT (widget), "color_set", G_CALLBACK (gtk_color_scheme_changed), dialog); - - widget = WID ("color_scheme_revert_button"); - g_signal_connect (G_OBJECT (widget), "clicked", G_CALLBACK (revert_color_scheme_key), parent); - - g_object_get (G_OBJECT (gtk_settings_get_default()), "gtk-color-scheme", &theme, NULL); - update_color_buttons_from_string (theme); - - g_signal_connect (gtk_settings_get_default(), "notify::gtk-color-scheme", - G_CALLBACK (color_scheme_changed), NULL); - - /* general signals */ - g_signal_connect (G_OBJECT (parent), "response", G_CALLBACK (cb_dialog_response), NULL); - g_signal_connect (G_OBJECT (parent), "delete-event", G_CALLBACK (gtk_true), NULL); - - gtk_drag_dest_set (parent, GTK_DEST_DEFAULT_ALL, - drop_types, n_drop_types, - GDK_ACTION_COPY | GDK_ACTION_LINK | GDK_ACTION_MOVE); - g_signal_connect (G_OBJECT (parent), "drag-motion", G_CALLBACK (gnome_theme_manager_drag_motion_cb), NULL); - g_signal_connect (G_OBJECT (parent), "drag-leave", G_CALLBACK (gnome_theme_manager_drag_leave_cb), NULL); - g_signal_connect (G_OBJECT (parent), "drag-data-received", G_CALLBACK (gnome_theme_manager_drag_data_received_cb), NULL); - - capplet_set_icon (parent, "gnome-settings-theme"); - - gnome_theme_details_reread_themes_from_disk (); -} - -void -gnome_theme_details_show (void) -{ - GladeXML *dialog; - GtkWidget *parent; - - gnome_theme_details_init (); - - dialog = gnome_theme_manager_get_theme_dialog (); - parent = WID ("theme_details_dialog"); - gtk_widget_show (parent); - gtk_window_present (GTK_WINDOW (parent)); -} - -static void -warn_about_no_themes (void) -{ - static GtkWidget *dialog; - - if (dialog == NULL) - { - dialog = gtk_message_dialog_new (NULL, - GTK_DIALOG_MODAL, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - _("No themes could be found on your system. This probably means that your \"Theme Preferences\" dialog was improperly installed, or you haven't installed the \"gnome-themes\" package.")); - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - exit (0); - } -} - -void -gnome_theme_details_reread_themes_from_disk (void) -{ - GladeXML *dialog; - GList *theme_list; - GList *string_list; - GList *list; - GnomeWindowManager *window_manager; - - gboolean have_gtk_theme; - gboolean have_window_theme; - gboolean have_icon_theme; - - - gnome_theme_details_init (); - - dialog = gnome_theme_manager_get_theme_dialog (); - window_manager = gnome_wm_manager_get_current (gdk_display_get_default_screen (gdk_display_get_default ())); - - /* First, we update the GTK+ themes page */ - theme_list = gnome_theme_info_find_by_type (GNOME_THEME_GTK_2); - string_list = NULL; - for (list = theme_list; list; list = list->next) - { - GnomeThemeInfo *info = list->data; - /* Use same string for ID as for name with GTK themes */ - string_list = g_list_prepend (string_list, info->name); - string_list = g_list_prepend (string_list, info->name); - } - - if (string_list == NULL) - { - have_gtk_theme = FALSE; - gtk_widget_hide (WID ("control_theme_hbox")); - } - else - { - have_gtk_theme = TRUE; - gtk_widget_show (WID ("control_theme_hbox")); - load_theme_names (GTK_TREE_VIEW (WID ("control_theme_treeview")), string_list, gtk_theme_default_name); - g_list_free (string_list); - } - g_list_free (theme_list); - - /* Next, we do the window managers */ - theme_list = window_manager ? gnome_window_manager_get_theme_list (window_manager) : NULL; - string_list = NULL; - for (list = theme_list; list; list = list->next) - { - /* Use same string for ID as for name with Window themes */ - string_list = g_list_prepend (string_list, list->data); - string_list = g_list_prepend (string_list, list->data); - } - if (string_list == NULL) - { - have_window_theme = FALSE; - gtk_widget_hide (WID ("window_theme_hbox")); - } - else - { - have_window_theme = TRUE; - gtk_widget_show (WID ("window_theme_hbox")); - load_theme_names (GTK_TREE_VIEW (WID ("window_theme_treeview")), string_list, window_theme_default_name); - g_list_free (string_list); - } - g_list_free (theme_list); - - /* Third, we do the icon theme */ - theme_list = gnome_theme_icon_info_find_all (); - string_list = NULL; - - for (list = theme_list; list; list = list->next) - { - GnomeThemeIconInfo *info = list->data; - string_list = g_list_prepend (string_list, path_to_theme_id(info->path)); - string_list = g_list_prepend (string_list, info->name); - } - - if (string_list == NULL) - { - have_icon_theme = FALSE; - gtk_widget_hide (WID ("icon_theme_hbox")); - } - else - { - have_icon_theme = TRUE; - gtk_widget_show (WID ("icon_theme_hbox")); - load_theme_names (GTK_TREE_VIEW (WID ("icon_theme_treeview")), string_list, icon_theme_default_name); - g_list_free (string_list); - } - g_list_free (theme_list); - - if (! have_gtk_theme && ! have_window_theme && ! have_icon_theme) - warn_about_no_themes (); - - gnome_theme_details_update_from_gconf (); - -} - -static void -update_list_something (GtkWidget *tree_view, const gchar *theme) -{ - GtkTreeModel *model; - GtkTreeIter iter; - GtkTreeIter next_iter; - gboolean valid; - gboolean theme_found; - - model = gtk_tree_view_get_model (GTK_TREE_VIEW (tree_view)); - g_assert (model); - - valid = gtk_tree_model_get_iter_first (model, &iter); - theme_found = FALSE; - - while (valid) - { - gchar *theme_id; - guint flags = 0; - - next_iter = iter; - valid = gtk_tree_model_iter_next (model, &next_iter); - - gtk_tree_model_get (model, &iter, - THEME_ID_COLUMN, &theme_id, - THEME_FLAG_COLUMN, &flags, - -1); - - if (! strcmp (theme, theme_id)) - { - GtkTreePath *path; - GtkTreePath *cursor_path; - gboolean cursor_same = FALSE; - - gtk_tree_view_get_cursor (GTK_TREE_VIEW (tree_view), &cursor_path, NULL); - path = gtk_tree_model_get_path (model, &iter); - if (cursor_path && gtk_tree_path_compare (path, cursor_path) == 0) - cursor_same = TRUE; - - gtk_tree_path_free (cursor_path); - - if (!cursor_same) - { - gtk_tree_view_set_cursor (GTK_TREE_VIEW (tree_view), path, NULL, FALSE); - } - gtk_tree_path_free (path); - theme_found = TRUE; - } - else - { - if (flags & THEME_FLAG_CUSTOM) - { - gtk_list_store_remove (GTK_LIST_STORE (model), &iter); - } - } - g_free (theme_id); - iter = next_iter; - if (theme_found) - break; - } - - if (theme_found == FALSE) - /* Never found the theme. */ - { - GtkTreePath *path; - - gtk_list_store_prepend (GTK_LIST_STORE (model), &iter); - gtk_list_store_set (GTK_LIST_STORE (model), &iter, - THEME_NAME_COLUMN, theme, - THEME_ID_COLUMN, theme, - THEME_FLAG_COLUMN, THEME_FLAG_CUSTOM, - -1); - path = gtk_tree_model_get_path (model, &iter); - gtk_tree_view_set_cursor (GTK_TREE_VIEW (tree_view), path, NULL, FALSE); - gtk_tree_path_free (path); - } -} - -static void -update_color_buttons_from_string (gchar *color_scheme) -{ - GdkColor color_scheme_colors[6]; - gchar **color_scheme_strings, **color_scheme_pair, *current_string; - gint i; - GtkWidget *widget; - GladeXML *dialog; - - if (!color_scheme) return; - if (!strcmp (color_scheme, "")) return; - - dialog = gnome_theme_manager_get_theme_dialog (); - - /* The color scheme string consists of name:color pairs, seperated by - * newlines, so first we split the string up by new line */ - - color_scheme_strings = g_strsplit (color_scheme, "\n", 0); - - /* loop through the name:color pairs, and save the colour if we recognise the name */ - i = 0; - while ((current_string = color_scheme_strings[i++])) - { - color_scheme_pair = g_strsplit (current_string, ":", 0); - - if (color_scheme_pair[0] != NULL && color_scheme_pair[1] != NULL) - { - g_strstrip (color_scheme_pair[0]); - g_strstrip (color_scheme_pair[1]); - - if (!strcmp ("fg_color", color_scheme_pair[0])) - gdk_color_parse (color_scheme_pair[1], &color_scheme_colors[0]); - else if (!strcmp ("bg_color", color_scheme_pair[0])) - gdk_color_parse (color_scheme_pair[1], &color_scheme_colors[1]); - else if (!strcmp ("text_color", color_scheme_pair[0])) - gdk_color_parse (color_scheme_pair[1], &color_scheme_colors[2]); - else if (!strcmp ("base_color", color_scheme_pair[0])) - gdk_color_parse (color_scheme_pair[1], &color_scheme_colors[3]); - else if (!strcmp ("selected_fg_color", color_scheme_pair[0])) - gdk_color_parse (color_scheme_pair[1], &color_scheme_colors[4]); - else if (!strcmp ("selected_bg_color", color_scheme_pair[0])) - gdk_color_parse (color_scheme_pair[1], &color_scheme_colors[5]); - } - - g_strfreev (color_scheme_pair); - } - - g_strfreev (color_scheme_strings); - - /* not sure whether we need to do this, but it can't hurt */ - for (i = 0; i < 6; i++) - gdk_colormap_alloc_color (gdk_colormap_get_system (), &color_scheme_colors[i], FALSE, TRUE); - - /* now set all the buttons to the correct settings */ - widget = WID ("fg_colorbutton"); - gtk_color_button_set_color (GTK_COLOR_BUTTON (widget), &color_scheme_colors[0]); - widget = WID ("bg_colorbutton"); - gtk_color_button_set_color (GTK_COLOR_BUTTON (widget), &color_scheme_colors[1]); - widget = WID ("text_colorbutton"); - gtk_color_button_set_color (GTK_COLOR_BUTTON (widget), &color_scheme_colors[2]); - widget = WID ("base_colorbutton"); - gtk_color_button_set_color (GTK_COLOR_BUTTON (widget), &color_scheme_colors[3]); - widget = WID ("selected_fg_colorbutton"); - gtk_color_button_set_color (GTK_COLOR_BUTTON (widget), &color_scheme_colors[4]); - widget = WID ("selected_bg_colorbutton"); - gtk_color_button_set_color (GTK_COLOR_BUTTON (widget), &color_scheme_colors[5]); - - -} - -void -gnome_theme_details_update_from_gconf (void) -{ - GConfClient *client; - GladeXML *dialog; - GtkWidget *tree_view; - gchar *theme = NULL; - GnomeWindowManager *window_manager = NULL; - GnomeWMSettings wm_settings; - - gnome_theme_details_init (); - - window_manager = gnome_wm_manager_get_current (gdk_display_get_default_screen (gdk_display_get_default ())); - - client = gconf_client_get_default (); - dialog = gnome_theme_manager_get_theme_dialog (); - - /* FIXME: What do we really do when there is no theme? Ask Havoc here. */ - tree_view = WID ("control_theme_treeview"); - theme = gconf_client_get_string (client, GTK_THEME_KEY, NULL); - update_list_something (tree_view, theme); - update_color_scheme_tab (theme); - g_free (theme); - - tree_view = WID ("window_theme_treeview"); - wm_settings.flags = GNOME_WM_SETTING_THEME; - if (window_manager != NULL && strcmp (gnome_window_manager_get_name (window_manager), "No name")) { - gnome_window_manager_get_settings (window_manager, &wm_settings); - update_list_something (tree_view, wm_settings.theme); - } - - tree_view = WID ("icon_theme_treeview"); - theme = gconf_client_get_string (client, ICON_THEME_KEY, NULL); - update_list_something (tree_view, theme); - g_free (theme); - - /* update colour scheme tab */ - theme = gconf_client_get_string (client, COLOR_SCHEME_KEY, NULL); - update_color_buttons_from_string (theme); - g_free (theme); - - g_object_unref (client); -} - -static void -color_scheme_changed (GObject *settings, - GParamSpec *pspec, - gpointer data) -{ - GConfClient *client; - gchar *theme; - - client = gconf_client_get_default (); - theme = gconf_client_get_string (client, COLOR_SCHEME_KEY, NULL); - if (theme == NULL || strcmp (theme, "") == 0) - g_object_get (settings, "gtk-color-scheme", &theme, NULL); - - update_color_buttons_from_string (theme); - g_free (theme); - g_object_unref (client); -} diff --git a/capplets/theme-switcher/gnome-theme-details.h b/capplets/theme-switcher/gnome-theme-details.h deleted file mode 100644 index 84369df0b..000000000 --- a/capplets/theme-switcher/gnome-theme-details.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef __GNOME_THEME_DETAILS_H__ -#define __GNOME_THEME_DETAILS_H__ - -void gnome_theme_details_init (void); -void gnome_theme_details_show (void); -void gnome_theme_details_reread_themes_from_disk (void); -void gnome_theme_details_update_from_gconf (void); - -#endif /* __GNOME_THEME_DETAILS_H__ */ diff --git a/capplets/theme-switcher/gnome-theme-installer.c b/capplets/theme-switcher/gnome-theme-installer.c deleted file mode 100644 index f7fa5d3f1..000000000 --- a/capplets/theme-switcher/gnome-theme-installer.c +++ /dev/null @@ -1,712 +0,0 @@ - -#include - -#include -#include -#include "gnome-theme-installer.h" -#include "gnome-theme-details.h" -#include -#include -#include -#include -#include -#include - -#include "gnome-theme-info.h" -#include "capplet-util.h" -#include "activate-settings-daemon.h" -#include "gconf-property-editor.h" -#include "file-transfer-dialog.h" -#include "gnome-theme-installer.h" -#include "gnome-theme-manager.h" - -enum { - THEME_INVALID, - THEME_ICON, - THEME_GNOME, - THEME_GTK, - THEME_ENGINE, - THEME_METACITY -}; - -enum { - TARGZ, - TARBZ, - DIRECTORY -}; - -typedef struct { - gint theme_type; - gint filetype; - gchar *theme_name; - gchar *filename; - gchar *target_dir; - gchar *theme_tmp_dir; - gchar *target_tmp_dir; - gchar *user_message; -} theme_properties; - - -static void -theme_properties_free (theme_properties *tp) -{ - g_free (tp->filename); - g_free (tp->target_dir); - g_free (tp->theme_tmp_dir); - g_free (tp->target_tmp_dir); - g_free (tp->user_message); - g_free (tp->theme_name); - g_free (tp); -} - -static void -cleanup_tmp_dir(theme_properties *theme_props) -{ - GList *list; - - if (gnome_vfs_remove_directory (theme_props->target_tmp_dir) == GNOME_VFS_ERROR_DIRECTORY_NOT_EMPTY) { - list = g_list_prepend (NULL, gnome_vfs_uri_new (theme_props->target_tmp_dir)); - gnome_vfs_xfer_delete_list (list, GNOME_VFS_XFER_RECURSIVE, - GNOME_VFS_XFER_ERROR_MODE_ABORT, NULL, NULL); - gnome_vfs_uri_list_free(list); - } -} - -static int -file_theme_type(gchar *dir) -{ - gchar *file_contents = NULL; - gchar *filename = NULL; - gint file_size; - GPatternSpec *pattern = NULL; - char *uri = NULL; - GnomeVFSURI *src_uri = NULL; - - if (!dir) return THEME_INVALID; - - filename = g_strdup_printf ("%s/index.theme",dir); - src_uri = gnome_vfs_uri_new (filename); - if (gnome_vfs_uri_exists(src_uri)) { - uri = gnome_vfs_get_uri_from_local_path (filename); - gnome_vfs_read_entire_file (uri,&file_size,&file_contents); - - pattern = g_pattern_spec_new ("*[Icon Theme]*"); - if (g_pattern_match_string(pattern,file_contents)) { - g_free (filename); - gnome_vfs_uri_unref (src_uri); - return THEME_ICON; - } - - pattern = g_pattern_spec_new ("*[X-GNOME-Metatheme]*"); - if (g_pattern_match_string(pattern,file_contents)) { - g_free (filename); - gnome_vfs_uri_unref (src_uri); - return THEME_GNOME; - } - } - g_free (filename); - gnome_vfs_uri_unref (src_uri); - - filename = g_strdup_printf ("%s/gtk-2.0/gtkrc",dir); - src_uri = gnome_vfs_uri_new (filename); - g_free (filename); - if (gnome_vfs_uri_exists(src_uri)) { - gnome_vfs_uri_unref (src_uri); - return THEME_GTK; - } - gnome_vfs_uri_unref (src_uri); - - filename = g_strdup_printf ("%s/metacity-1/metacity-theme-1.xml",dir); - src_uri = gnome_vfs_uri_new (filename); - g_free (filename); - if (gnome_vfs_uri_exists (src_uri)) { - gnome_vfs_uri_unref (src_uri); - return THEME_METACITY; - } - gnome_vfs_uri_unref (src_uri); - - - filename = g_strdup_printf ("%s/configure.in",dir); - src_uri = gnome_vfs_uri_new (filename); - g_free (filename); - if (gnome_vfs_uri_exists (src_uri)) { - gnome_vfs_uri_unref (src_uri); - return THEME_ENGINE; - } - gnome_vfs_uri_unref (src_uri); - - return THEME_INVALID; -} - -static void -transfer_cancel_cb (GtkWidget *dlg, gchar *path) -{ - gnome_vfs_unlink (path); - g_free (path); - gtk_widget_destroy (dlg); -} - -static void -missing_utility_message_dialog (gchar *utility) -{ - GtkWidget *dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, - _("Can not install theme. \nThe %s utility is not installed."), utility); - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); -} - -static void -extract_files_error_dialog (void) -{ - GtkWidget *dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, - _("Can not install theme. \nThere was a problem while extracting the theme")); - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); -} - -/* this works around problems when doing fork/exec in a threaded app - * with some locks being held/waited on in different threads. - * - * we do the idle callback so that the async xfer has finished and - * cleaned up its vfs job. otherwise it seems the slave thread gets - * woken up and it removes itself from the job queue before it is - * supposed to. very strange. - * - * see bugzilla.gnome.org #86141 for details - */ -static gchar* -transfer_done_targz_idle_cb (gpointer data) -{ - int status; - gchar *command, *filename, *gzip, *tar; - theme_properties *theme_props = data; - gchar *top_level_dir = NULL; - - if (!(gzip = g_find_program_in_path("gzip"))) { - missing_utility_message_dialog ("gzip"); - return NULL; - } - if (!(tar = g_find_program_in_path("tar"))) { - missing_utility_message_dialog ("tar"); - g_free(gzip); - return NULL; - } - - filename = g_shell_quote(theme_props->filename); - - command = g_strdup_printf ("sh -c '%s -d -c < \"%s\" | %s ft - | head -n 1'", gzip, filename, tar); - if (!g_spawn_command_line_sync (command, &top_level_dir, NULL, &status, NULL) || status != 0) - { - extract_files_error_dialog (); - g_free (top_level_dir); - g_free (command); - g_free (gzip); - g_free (tar); - g_free (filename); - return NULL; - } - - - /* this should be something more clever and nonblocking */ - command = g_strdup_printf ("sh -c 'cd \"%s\"; %s -d -c < \"%s\" | %s xf - '", - theme_props->target_tmp_dir, gzip, filename, tar); - g_free(filename); - if (g_spawn_command_line_sync (command, NULL, NULL, &status, NULL) && status == 0) { - g_free (command); - g_free (gzip); - g_free (tar); - return top_level_dir; - } else { - extract_files_error_dialog (); - g_free (command); - g_free (gzip); - g_free (tar); - g_free (top_level_dir); - return NULL; - } -} - - -/* this works around problems when doing fork/exec in a threaded app - * with some locks being held/waited on in different threads. - * - * we do the idle callback so that the async xfer has finished and - * cleaned up its vfs job. otherwise it seems the slave thread gets - * woken up and it removes itself from the job queue before it is - * supposed to. very strange. - * - * see bugzilla.gnome.org #86141 for details - */ -static gchar* -transfer_done_tarbz2_idle_cb (gpointer data) -{ - int status; - gchar *command, *filename, *bzip2, *tar; - theme_properties *theme_props = data; - gchar *top_level_dir = NULL; - - if (!(bzip2 = g_find_program_in_path("bzip2"))) - { - missing_utility_message_dialog ("bzip2"); - return NULL; - } - if (!(tar = g_find_program_in_path("tar"))) { - missing_utility_message_dialog ("tar"); - g_free(bzip2); - return NULL; - } - filename = g_shell_quote(theme_props->filename); - - command = g_strdup_printf ("sh -c '%s -d -c < \"%s\" | %s ft - | head -n 1'", bzip2, filename, tar); - if (!g_spawn_command_line_sync (command, &top_level_dir, NULL, &status, NULL) || status != 0) - { - extract_files_error_dialog (); - g_free (top_level_dir); - g_free (command); - g_free (bzip2); - g_free (tar); - g_free (filename); - return NULL; - } - - - /* this should be something more clever and nonblocking */ - command = g_strdup_printf ("sh -c 'cd \"%s\"; %s -d -c < \"%s\" | %s xf - '", - theme_props->target_tmp_dir, bzip2, filename, tar); - g_free (filename); - if (g_spawn_command_line_sync (command, NULL, NULL, &status, NULL) && status == 0) { - g_free (bzip2); - g_free (tar); - g_free (command); - return top_level_dir; - } else { - extract_files_error_dialog (); - g_free (bzip2); - g_free (tar); - g_free (command); - return NULL; - } -} - -static void -transfer_done_cb (GtkWidget *dlg, gchar *path) -{ - GtkWidget *dialog, *apply_button; - gchar **dir; - int theme_type, xfer_options; - theme_properties *theme_props; - GnomeVFSURI *theme_source_dir, *theme_dest_dir; - - /* XXX: path should be on the local filesystem by now? */ - - if (dlg) - gtk_widget_destroy (dlg); - - theme_props = g_new0 (theme_properties,1); - - theme_props->target_tmp_dir = g_strdup_printf ("%s/.themes/.theme-%u", - g_get_home_dir(), - g_random_int()); - - - if (g_str_has_suffix (path, ".tar.gz") || g_str_has_suffix (path, ".tgz") || g_str_has_suffix(path, ".gtp")) - theme_props->filetype=TARGZ; - else if (g_str_has_suffix (path, ".tar.bz2")) - theme_props->filetype=TARBZ; - else if (g_file_test (path, G_FILE_TEST_IS_DIR)) - theme_props->filetype=DIRECTORY; - else { - dialog = gtk_message_dialog_new (NULL, - GTK_DIALOG_MODAL, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - _("This theme is not in a supported format.")); - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - theme_properties_free (theme_props); - return; - } - - - if ((gnome_vfs_make_directory(theme_props->target_tmp_dir,0700)) != GNOME_VFS_OK) { - dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - _("Failed to create temporary directory")); - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - theme_properties_free (theme_props); - return; - } - - /* Uncompress the file in the temp directory */ - theme_props->filename=g_strdup(path); - - if (theme_props->filetype == TARBZ) - { - theme_props->theme_tmp_dir = transfer_done_tarbz2_idle_cb(theme_props); - if (!theme_props->theme_tmp_dir) - { - cleanup_tmp_dir (theme_props); - theme_properties_free (theme_props); - return; - } - } - - if (theme_props->filetype == TARGZ) - { - theme_props->theme_tmp_dir = transfer_done_targz_idle_cb(theme_props); - if (!theme_props->theme_tmp_dir) - { - cleanup_tmp_dir (theme_props); - theme_properties_free (theme_props); - return; - } - } - - if (theme_props->filetype == DIRECTORY) - { - theme_props->theme_name = g_path_get_basename (path); - theme_props->theme_tmp_dir = g_strdup (path); - } - else - { - /* create a full path for theme_tmp_dir */ - dir = g_strsplit(g_strchomp(theme_props->theme_tmp_dir),"/",0); - theme_props->theme_name = g_strdup (dir[0]); - g_strfreev (dir); - g_free (theme_props->theme_tmp_dir); - theme_props->theme_tmp_dir=g_build_filename(theme_props->target_tmp_dir,theme_props->theme_name,NULL); - } - - - /* What type of theme it is ? */ - theme_type = file_theme_type(theme_props->theme_tmp_dir); - gnome_vfs_unlink (theme_props->filename); - if (theme_type == THEME_ICON) { - theme_props->target_dir=g_strdup_printf("%s/.icons/%s",g_get_home_dir(), theme_props->theme_name); - } else if (theme_type == THEME_GNOME) { - theme_props->target_dir = g_strdup_printf("%s/.themes/%s",g_get_home_dir(), theme_props->theme_name); - theme_props->user_message=g_strdup_printf(_("GNOME Theme %s correctly installed"), theme_props->theme_name); - } else if (theme_type == THEME_METACITY) { - theme_props->target_dir = g_strdup_printf("%s/.themes/%s",g_get_home_dir(), theme_props->theme_name); - } else if (theme_type == THEME_GTK) { - theme_props->target_dir = g_strdup_printf("%s/.themes/%s",g_get_home_dir(), theme_props->theme_name); - } else if (theme_type == THEME_ENGINE) { - dialog = gtk_message_dialog_new (NULL, - GTK_DIALOG_MODAL, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - _("The theme is an engine. You need to compile the theme.")); - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - cleanup_tmp_dir(theme_props); - theme_properties_free (theme_props); - return; - } else { - dialog = gtk_message_dialog_new (NULL, - GTK_DIALOG_MODAL, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - _("The file format is invalid")); - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - theme_properties_free (theme_props); - return; - } - - /* see if there is an icon theme lurking in this package */ - if (theme_type == THEME_GNOME) - { - gchar *path = g_strconcat (theme_props->theme_tmp_dir, "/icons", NULL); - if (g_file_test (path, G_FILE_TEST_EXISTS) - && (file_theme_type (path) == THEME_ICON)) - { - gchar *new_path = - g_strdup_printf("%s/.icons/%s", g_get_home_dir(), theme_props->theme_name); - /* XXX: make some noise if we couldn't install it? */ - gnome_vfs_move (path, new_path, FALSE); - g_free (new_path); - } - g_free (path); - } - - /* Move the Dir to the target dir */ - theme_source_dir = gnome_vfs_uri_new (theme_props->theme_tmp_dir); - theme_dest_dir = gnome_vfs_uri_new (theme_props->target_dir); - - xfer_options = GNOME_VFS_XFER_DELETE_ITEMS | GNOME_VFS_XFER_RECURSIVE; - if (theme_props->filetype != DIRECTORY) - xfer_options = xfer_options | GNOME_VFS_XFER_REMOVESOURCE; - - if (gnome_vfs_xfer_uri (theme_source_dir,theme_dest_dir, xfer_options, - GNOME_VFS_XFER_ERROR_MODE_ABORT, - GNOME_VFS_XFER_OVERWRITE_MODE_REPLACE, - NULL,NULL) != GNOME_VFS_OK) { - dialog = gtk_message_dialog_new (NULL, - GTK_DIALOG_MODAL, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - _("Installation Failed")); - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - cleanup_tmp_dir(theme_props); - theme_properties_free (theme_props); - return; - } else { - /* Ask to apply theme (if we can) */ - if (theme_type == THEME_GTK || theme_type == THEME_METACITY || theme_type == THEME_ICON) - { - /* TODO: currently cannot apply "gnome themes" */ - gchar* str; - - str = g_strdup_printf(_("The theme \"%s\" has been installed."), theme_props->theme_name); - theme_props->user_message=g_strdup_printf("%s", str); - g_free(str); - - dialog = gtk_message_dialog_new_with_markup (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_NONE, theme_props->user_message ); - - gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG (dialog), _("Would you like to apply it now, or keep your current theme?")); - - gtk_dialog_add_button (GTK_DIALOG (dialog), _("Keep Current Theme"), GTK_RESPONSE_CLOSE); - - apply_button = gtk_button_new_with_label (_("Apply New Theme")); - gtk_button_set_image (GTK_BUTTON (apply_button), gtk_image_new_from_stock (GTK_STOCK_APPLY, GTK_ICON_SIZE_BUTTON)); - gtk_dialog_add_action_widget (GTK_DIALOG (dialog), apply_button, GTK_RESPONSE_APPLY); - GTK_WIDGET_SET_FLAGS (apply_button, GTK_CAN_DEFAULT); - gtk_widget_show (apply_button); - - gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_APPLY); - - if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_APPLY) - { - /* apply theme here! */ - GConfClient * gconf_client; - gconf_client = gconf_client_get_default (); - switch (theme_type) - { - case THEME_GTK: gconf_client_set_string (gconf_client, GTK_THEME_KEY, theme_props->theme_name, NULL); break; - case THEME_METACITY: gconf_client_set_string (gconf_client, METACITY_THEME_KEY, theme_props->theme_name, NULL); break; - case THEME_ICON: gconf_client_set_string (gconf_client, ICON_THEME_KEY, theme_props->theme_name, NULL); break; - } - - g_object_unref (gconf_client); - } - } else - { - dialog = gtk_message_dialog_new (NULL, - GTK_DIALOG_MODAL, - GTK_MESSAGE_INFO, - GTK_BUTTONS_OK, - theme_props->user_message ); - gtk_dialog_run (GTK_DIALOG (dialog)); - } - gtk_widget_destroy (dialog); - cleanup_tmp_dir (theme_props); - theme_properties_free (theme_props); - return; - } - theme_properties_free (theme_props); -} - -void -gnome_theme_install_from_uri (gchar * theme_filename, GtkWindow *parent) -{ - GtkWidget *dlg; - gchar *filename, *path, *base; - GList *src, *target; - GnomeVFSURI *src_uri; - gchar *temppath; - - - if (theme_filename == NULL || strlen (theme_filename) <= 0) { - GtkWidget *dialog; - - dialog = gtk_message_dialog_new (NULL, - GTK_DIALOG_MODAL, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - _("No theme file location specified to install")); - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - return; - } - - filename = g_strdup (theme_filename); - - if (filename == NULL) { - GtkWidget *dialog; - - dialog = gtk_message_dialog_new (NULL, - GTK_DIALOG_MODAL, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - _("The theme file location specified to install is invalid")); - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - return; - } - - /* see if someone dropped a directory */ - if (g_file_test (filename, G_FILE_TEST_IS_DIR)) - { - transfer_done_cb (NULL, filename); - return; - } - - src_uri = gnome_vfs_uri_new (filename); - base = gnome_vfs_uri_extract_short_name (src_uri); - src = g_list_append (NULL, src_uri); - /* we can't tell if this is an icon theme yet, so just make a - * temporary copy in .themes */ - path = g_build_filename (g_get_home_dir (), ".themes", NULL); - - if (access (path, X_OK | W_OK) != 0) { - GtkWidget *dialog; - - dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - _("Insufficient permissions to install the theme in:\n%s"), path); - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - g_free (path); - return; - } - - while(TRUE) { - gchar *file_tmp; - GtkWidget *dialog; - - if (g_str_has_suffix (base, ".tar.gz") || g_str_has_suffix (base, ".tgz") || g_str_has_suffix(base, ".gtp")) - file_tmp = g_strdup_printf("gnome-theme-%d.gtp", rand ()); - else if (g_str_has_suffix (base, ".tar.bz2")) - file_tmp = g_strdup_printf("gnome-theme-%d.tar.bz2", rand ()); - else { - dialog = gtk_message_dialog_new (NULL, - GTK_DIALOG_MODAL, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - _("The file format is invalid.")); - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - g_free (path); - return; - } - - path = g_build_filename (g_get_home_dir (), ".themes", file_tmp, NULL); - - g_free(file_tmp); - if (!gnome_vfs_uri_exists (gnome_vfs_uri_new (path))) - break; - } - - /* To avoid the copy of /root/.themes to /root/.themes/.themes - * which causes an infinite loop. The user asks to transfer the all - * contents of a folder, to a folder under itseld. So ignore the - * situation. - */ - temppath = g_build_filename (filename, ".themes", NULL); - if (!strcmp(temppath, path)) { - GtkWidget *dialog; - - dialog = gtk_message_dialog_new (NULL, - GTK_DIALOG_MODAL, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - _("%s is the path where the theme files will be installed. This can not be selected as the source location"), filename); - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - - g_free (base); - g_free (filename); - g_free(temppath); - g_free (path); - return; - } - g_free(temppath); - - - - target = g_list_append (NULL, gnome_vfs_uri_new (path)); - - dlg = file_transfer_dialog_new_with_parent (parent); - file_transfer_dialog_wrap_async_xfer (FILE_TRANSFER_DIALOG (dlg), - src, target, - GNOME_VFS_XFER_RECURSIVE, - GNOME_VFS_XFER_ERROR_MODE_QUERY, - GNOME_VFS_XFER_OVERWRITE_MODE_QUERY, - GNOME_VFS_PRIORITY_DEFAULT); - gnome_vfs_uri_list_unref (src); - gnome_vfs_uri_list_unref (target); - g_free (base); - g_free (filename); - g_signal_connect (G_OBJECT (dlg), "cancel", - G_CALLBACK (transfer_cancel_cb), path); - g_signal_connect (G_OBJECT (dlg), "done", - G_CALLBACK (transfer_done_cb), path); - gtk_widget_show (dlg); -} - -void -gnome_theme_installer_run_cb (GtkWidget *button, - GtkWindow *parent_window) -{ - gnome_theme_installer_run (parent_window, NULL); -} - - -void -gnome_theme_installer_run (GtkWindow *parent, gchar *filename) -{ - static gboolean running_theme_install = FALSE; - GtkWidget *dialog; - static char old_folder[1024] = ""; - gchar *filename_selected, *folder; - GtkFileFilter *filter; - - if (filename == NULL) - filename = old_folder; - - if (running_theme_install) - return; - - running_theme_install = TRUE; - - dialog = gtk_file_chooser_dialog_new (_("Select Theme"), parent, GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); - - filter = gtk_file_filter_new (); - gtk_file_filter_set_name (filter, _("Theme Packages")); - gtk_file_filter_add_mime_type (filter, "application/x-bzip-compressed-tar"); - gtk_file_filter_add_mime_type (filter, "application/x-compressed-tar"); - gtk_file_filter_add_mime_type (filter, "application/x-gnome-theme-package"); - - gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter); - - filter = gtk_file_filter_new (); - gtk_file_filter_set_name (filter, _("All Files")); - gtk_file_filter_add_pattern(filter, "*"); - - gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter); - - if (strcmp (old_folder, "")) - gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), old_folder); - - if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) - { - filename_selected = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); - gnome_theme_install_from_uri (filename_selected, parent); - g_free (filename_selected); - } - - - folder = gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER (dialog)); - g_strlcpy (old_folder, folder, 255); - g_free (folder); - - gnome_theme_details_reread_themes_from_disk(); - - - gtk_widget_destroy (dialog); - - running_theme_install = FALSE; -} diff --git a/capplets/theme-switcher/gnome-theme-installer.desktop.in.in b/capplets/theme-switcher/gnome-theme-installer.desktop.in.in deleted file mode 100644 index 7fe3b35c3..000000000 --- a/capplets/theme-switcher/gnome-theme-installer.desktop.in.in +++ /dev/null @@ -1,17 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -_Name=Theme Installer -_Comment=Installs themes packages for various parts of the desktop -Exec=gnome-theme-manager -i %u -Icon=gnome-settings-theme -Terminal=false -Type=Application -MimeType=application/x-gnome-theme-package; -StartupNotify=true -Categories=GNOME;GTK; -# we don't want to show this at all in the menus -OnlyShowIn=; -X-GNOME-Bugzilla-Bugzilla=GNOME -X-GNOME-Bugzilla-Product=gnome-control-center -X-GNOME-Bugzilla-Component=theme-manager -X-GNOME-Bugzilla-Version=@VERSION@ diff --git a/capplets/theme-switcher/gnome-theme-installer.h b/capplets/theme-switcher/gnome-theme-installer.h deleted file mode 100644 index 448d541aa..000000000 --- a/capplets/theme-switcher/gnome-theme-installer.h +++ /dev/null @@ -1,32 +0,0 @@ -/* gnome-theme-installer.h - * Copyright (C) 2002 Jonathan Blandford - * - * Written by: Jonathan Blandford - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -#ifndef GNOME_THEME_INSTALLER_H -#define GNOME_THEME_INSTALLER_H - -#include - -void gnome_theme_install_from_uri (gchar * filename, GtkWindow *parent); - -void gnome_theme_installer_run (GtkWindow *parent, gchar *filename); -void gnome_theme_installer_run_cb (GtkWidget *button, GtkWindow *parent_window); - -#endif /* GNOME_THEME_INSTALLER_H */ diff --git a/capplets/theme-switcher/gnome-theme-manager.c b/capplets/theme-switcher/gnome-theme-manager.c deleted file mode 100644 index 0606ab5a0..000000000 --- a/capplets/theme-switcher/gnome-theme-manager.c +++ /dev/null @@ -1,1713 +0,0 @@ -/* This program was written under the GPL by Jonathan Blandford - */ - -#include - -#include -#include -#include -#include -#include -#include - -#include - -#include "gnome-theme-info.h" -#include "gnome-theme-save.h" -#include "capplet-util.h" -#include "activate-settings-daemon.h" -#include "gconf-property-editor.h" -#include "file-transfer-dialog.h" -#include "gnome-theme-manager.h" -#include "gnome-theme-details.h" -#include "gnome-theme-installer.h" -#include -#include - -/* Events: There are two types of change events we worry about. The first is - * when the theme settings change. In this case, we can quickly update the UI - * to reflect. The other is when the themes themselves change. - * - * The code in gnome-theme-manager.c will update the main dialog and proxy the - * update notifications for the details dialog. - */ - -enum -{ - META_THEME_NAME_COLUMN = THEME_NAME_COLUMN, - META_THEME_ID_COLUMN = THEME_ID_COLUMN, - META_THEME_FLAG_COLUMN = THEME_FLAG_COLUMN, - META_THEME_PIXBUF_COLUMN, - META_N_COLUMNS -}; - -GtkTargetEntry drop_types[] = -{ - {"text/uri-list", 0, TARGET_URI_LIST}, - {"_NETSCAPE_URL", 0, TARGET_NS_URL} -}; - -gint n_drop_types = sizeof (drop_types) / sizeof (GtkTargetEntry); - -static gboolean setting_model = FALSE; -static guint update_settings_from_gconf_idle_id = 0; -static guint theme_changed_idle_id = 0; -static guint pixbuf_idle_id = 0; -static gboolean loading_themes; -static gboolean reload_themes; -static gboolean initial_meta_theme_set = FALSE; -static GdkPixbuf *default_image = NULL; -static GdkPixbuf *broken_image = NULL; -static gboolean themes_loaded = FALSE; -static gboolean reverted = FALSE; - -static GnomeThemeMetaInfo custom_meta_theme_info; -static GnomeThemeMetaInfo initial_meta_theme_info; - -const char *meta_theme_default_name = NULL; -const char *gtk_theme_default_name = NULL; -const char *window_theme_default_name = NULL; -const char *icon_theme_default_name = NULL; - - -/* Function Prototypes */ -static void add_pixbuf_idle (void); -static void load_meta_themes (GtkTreeView *tree_view, - GList *meta_theme_list); -static void meta_theme_setup_info (GnomeThemeMetaInfo *meta_theme_info, - GladeXML *dialog); -static void meta_theme_selection_changed (GtkTreeSelection *selection, - GladeXML *dialog); -static void update_themes_from_disk (GladeXML *dialog); -static void update_font_button_state (GladeXML *dialog); -static void update_background_button_state (GladeXML *dialog); -static void update_settings_from_gconf (void); -static void gtk_theme_key_changed (GConfClient *client, - guint cnxn_id, - GConfEntry *entry, - gpointer user_data); -static void window_settings_changed (GnomeWindowManager *window_manager, - GladeXML *dialog); -static void icon_key_changed (GConfClient *client, - guint cnxn_id, - GConfEntry *entry, - gpointer user_data); -static void font_key_changed (GConfClient *client, - guint cnxn_id, - GConfEntry *entry, - gpointer user_data); -static void background_key_changed (GConfClient *client, - guint cnxn_id, - GConfEntry *entry, - gpointer user_data); -static void theme_changed_func (gpointer uri, - gpointer user_data); -static void cb_dialog_response (GtkDialog *dialog, - gint response_id); -static void setup_meta_tree_view (GtkTreeView *tree_view, - GCallback changed_callback, - GladeXML *dialog); -static void setup_dialog (GladeXML *dialog); - - -typedef struct { - gchar *theme_id; - GtkTreeModel *model; - gboolean cancelled; -} PixbufAsyncData; - -/* helper functions */ -void free_all (gpointer a, ...) -{ - va_list list; - gpointer tmp; - va_start (list, a); - while ((tmp = va_arg (list, gpointer))) - g_free(tmp); - va_end (list); -} - -static gint -safe_strcmp (gchar *a_str, - gchar *b_str) -{ - if (a_str == NULL && b_str != NULL) - return -1; - if (a_str != NULL && b_str == NULL) - return 1; - if (a_str == NULL && b_str == NULL) - return 0; - return strcmp (a_str, b_str); -} - - - -static void -pixbuf_async_func (GdkPixbuf *pixbuf, - gpointer data) -{ - PixbufAsyncData *pixbuf_async_data = data; - gchar *theme_id; - GtkTreeModel *model; - GtkTreeIter iter; - gboolean valid; - - theme_id = pixbuf_async_data->theme_id; - model = pixbuf_async_data->model; - - for (valid = gtk_tree_model_get_iter_first (model, &iter); - valid; - valid = gtk_tree_model_iter_next (model, &iter)) - { - gchar *test_theme_id; - gtk_tree_model_get (model, &iter, - META_THEME_ID_COLUMN, &test_theme_id, - -1); - if (theme_id && test_theme_id && !strcmp (theme_id, test_theme_id)) - { - gtk_list_store_set (GTK_LIST_STORE (model), &iter, - META_THEME_PIXBUF_COLUMN, pixbuf ? pixbuf : broken_image, - -1); - g_free (test_theme_id); - break; - } - g_free (test_theme_id); - } - - add_pixbuf_idle (); -} - -static void -pixbuf_async_data_free (gpointer data) -{ - PixbufAsyncData *pixbuf_async_data = data; - - g_object_unref (pixbuf_async_data->model); - g_free (pixbuf_async_data->theme_id); - g_free (pixbuf_async_data); -} - -/* Checks if the preview pixbuf for iter needs to be generated and if so, it - * queues the generation. - * Returns: TRUE if the generation was queued, FALSE otherwise. - */ -static gboolean -queue_pixbuf_generation (GtkTreeModel *model, GtkTreeIter *iter) -{ - GdkPixbuf *pixbuf = NULL; - gchar *theme_id = NULL; - PixbufAsyncData *pixbuf_async_data; - GnomeThemeMetaInfo *meta_theme_info; - - gtk_tree_model_get (model, iter, - META_THEME_PIXBUF_COLUMN, &pixbuf, - -1); - if (pixbuf != default_image) - return FALSE; - - gtk_tree_model_get (model, iter, - META_THEME_ID_COLUMN, &theme_id, - -1); - if (theme_id == NULL) - { - meta_theme_info = &custom_meta_theme_info; - } - else - { - meta_theme_info = gnome_theme_meta_info_find (theme_id); - } - - /* We should always have a metatheme file */ - g_assert (meta_theme_info); - - pixbuf_async_data = g_new (PixbufAsyncData, 1); - pixbuf_async_data->theme_id = theme_id; - pixbuf_async_data->model = model; - pixbuf_async_data->cancelled = FALSE; - g_object_ref (model); - generate_theme_thumbnail_async (meta_theme_info, - pixbuf_async_func, - pixbuf_async_data, - pixbuf_async_data_free); - - return TRUE; -} - -static gboolean -pixbuf_idle_func (gpointer data) -{ - GladeXML *dialog; - GtkWidget *tree_view; - GtkTreeModel *model; - GtkTreeIter iter; - GtkTreePath *path, *end; - gboolean valid; - - pixbuf_idle_id = 0; - - if (reload_themes) { - GladeXML *dialog; - - reload_themes = FALSE; - loading_themes = FALSE; - - dialog = gnome_theme_manager_get_theme_dialog (); - update_themes_from_disk (dialog); - return FALSE; - } - - dialog = gnome_theme_manager_get_theme_dialog (); - tree_view = WID ("meta_theme_treeview"); - model = gtk_tree_view_get_model (GTK_TREE_VIEW (tree_view)); - - /* first, try to load previews for themes that are currently visible */ - if (gtk_tree_view_get_visible_range (GTK_TREE_VIEW (tree_view), &path, &end)) - { - for (; gtk_tree_path_compare (path, end) <= 0; gtk_tree_path_next (path)) - { - if (!gtk_tree_model_get_iter (model, &iter, path)) - break; - if (queue_pixbuf_generation (model, &iter)) - { - gtk_tree_path_free (path); - gtk_tree_path_free (end); - return FALSE; - } - } - gtk_tree_path_free (path); - gtk_tree_path_free (end); - } - - /* if all visible previews have been loaded, try to load the rest */ - for (valid = gtk_tree_model_get_iter_first (model, &iter); - valid; - valid = gtk_tree_model_iter_next (model, &iter)) - { - if (queue_pixbuf_generation (model, &iter)) - return FALSE; - } - - /* If we're done loading all the main themes, lets initialize the details - * dialog if it hasn't been done yet. If it has, then this call is harmless. - */ - gnome_theme_details_init (); - loading_themes = FALSE; - - if (reload_themes) { - GladeXML *dialog; - - reload_themes = FALSE; - loading_themes = FALSE; - - dialog = gnome_theme_manager_get_theme_dialog (); - update_themes_from_disk (dialog); - } - - return FALSE; -} - -/* FIXME: we need a way to cancel the pixbuf loading if we get a theme updating - * during the pixbuf generation. - */ -static void -add_pixbuf_idle (void) -{ - if (pixbuf_idle_id) - return; - - pixbuf_idle_id = g_idle_add_full (G_PRIORITY_LOW, - pixbuf_idle_func, - NULL, NULL); -} - -static gint -sort_meta_theme_list_func (gconstpointer a, - gconstpointer b) -{ - const GnomeThemeMetaInfo *a_meta_theme_info = a; - const GnomeThemeMetaInfo *b_meta_theme_info = b; - guint a_flag = 0; - guint b_flag = 0; - - g_assert (a_meta_theme_info->name); - g_assert (b_meta_theme_info->name); - - if (meta_theme_default_name && strcmp (meta_theme_default_name, a_meta_theme_info->name) == 0) - a_flag |= THEME_FLAG_DEFAULT; - if (meta_theme_default_name && strcmp (meta_theme_default_name, b_meta_theme_info->name) == 0) - b_flag |= THEME_FLAG_DEFAULT; - - return gnome_theme_manager_sort_func (a_meta_theme_info->readable_name, - b_meta_theme_info->readable_name, - a_flag, - b_flag); -} - - -/* Loads up a list of GnomeThemeMetaInfo. - */ -static void -load_meta_themes (GtkTreeView *tree_view, - GList *meta_theme_list) -{ - GList *list; - GtkTreeModel *model; - GtkWidget *swindow; - GtkTreeIter iter; - gchar *name; - gboolean valid; - guint flag; - gint i = 0; - GConfClient *client; - gchar *current_gtk_theme; - gchar *current_color_scheme; - gchar *current_window_theme; - gchar *current_icon_theme; - GnomeWindowManager *window_manager; - GnomeWMSettings wm_settings; - static gboolean first_time = TRUE; - - swindow = GTK_WIDGET (tree_view)->parent; - model = gtk_tree_view_get_model (tree_view); - g_assert (model); - - setting_model = TRUE; - - client = gconf_client_get_default (); - - current_gtk_theme = gconf_client_get_string (client, GTK_THEME_KEY, NULL); - current_color_scheme = gconf_client_get_string (client, COLOR_SCHEME_KEY, NULL); - current_icon_theme = gconf_client_get_string (client, ICON_THEME_KEY, NULL); - g_object_unref (client); - - window_manager = gnome_wm_manager_get_current (gdk_display_get_default_screen (gdk_display_get_default ())); - wm_settings.flags = GNOME_WM_SETTING_THEME; - - if (window_manager) - { - gnome_window_manager_get_settings (window_manager, &wm_settings); - current_window_theme = g_strdup (wm_settings.theme); - } - else - current_window_theme = g_strdup (window_theme_default_name); - - /* FIXME: What do we really do when there is no theme? */ - if (current_icon_theme == NULL) - current_icon_theme = g_strdup (icon_theme_default_name); - if (current_gtk_theme == NULL) - current_gtk_theme = g_strdup (gtk_theme_default_name); - - /* handle first time */ - if (first_time) - { - for (list = meta_theme_list; list; list = list->next) - { - GnomeThemeMetaInfo *theme_info = list->data; - - if ((theme_info->gtk_theme_name && !strcmp (theme_info->gtk_theme_name, gtk_theme_default_name)) && - (theme_info->metacity_theme_name && !strcmp (theme_info->metacity_theme_name, window_theme_default_name)) && - (theme_info->icon_theme_name && !strcmp (theme_info->icon_theme_name, icon_theme_default_name))) - { - meta_theme_default_name = g_strdup (theme_info->name); - break; - } - } - } - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swindow), - GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); - gtk_widget_set_usize (swindow, -1, -1); - - /* Sort meta_theme_list to be in the same order of the current data. This way - * we can walk through them together. */ - meta_theme_list = g_list_sort (meta_theme_list, sort_meta_theme_list_func); - list = meta_theme_list; - valid = gtk_tree_model_get_iter_first (model, &iter); - - while (valid || list != NULL) - { - GnomeThemeMetaInfo *list_meta_theme_info = NULL; - GnomeThemeMetaInfo *model_meta_theme_info = NULL; - gchar *blurb; - gboolean list_is_default = FALSE; - gboolean delete_it = FALSE; - gboolean set_it = FALSE; - GtkTreeIter iter_to_set; - - /* Check info on the list */ - if (list) - { - list_meta_theme_info = list->data; - if (meta_theme_default_name && strcmp (meta_theme_default_name, list_meta_theme_info->name) == 0) - list_is_default = TRUE; - else - list_is_default = FALSE; - } - - if (valid) - { - gtk_tree_model_get (model, &iter, - META_THEME_ID_COLUMN, &name, - META_THEME_FLAG_COLUMN, &flag, - -1); - if (name) - { - model_meta_theme_info = gnome_theme_meta_info_find (name); - g_free (name); - - /* The theme was removed, and we haven't removed it from the list yet. */ - if (model_meta_theme_info == NULL) - { - delete_it = TRUE; - goto end_of_loop; - } - } - } - - /* start comparing values */ - if (list && valid) - { - gint compare_val; - - if (flag & THEME_FLAG_CUSTOM) - { - /* We can always skip the custom row, as it's never in the list */ - valid = gtk_tree_model_iter_next (model, &iter); - i++; - goto end_of_loop; - } - - compare_val = gnome_theme_manager_sort_func (model_meta_theme_info->readable_name, list_meta_theme_info->readable_name, - flag, list_is_default ? THEME_FLAG_DEFAULT : 0); - - if (compare_val < 0) - { - delete_it = TRUE; - goto end_of_loop; - } - else if (compare_val == 0) - { - set_it = TRUE; - iter_to_set = iter; - valid = gtk_tree_model_iter_next (model, &iter); - } - else - { - /* we insert a new item */ - set_it = TRUE; - gtk_list_store_insert_before (GTK_LIST_STORE (model), &iter_to_set, &iter); - } - } - else if (list) - { - /* we append a new item */ - set_it = TRUE; - gtk_list_store_append (GTK_LIST_STORE (model), &iter_to_set); - } - else if (valid) - { - /* It's a dead item. */ - delete_it = TRUE; - } - - end_of_loop: - if (delete_it) - { - GtkTreeIter iter_to_remove; - iter_to_remove = iter; - valid = gtk_tree_model_iter_next (model, &iter); - gtk_list_store_remove (GTK_LIST_STORE (model), &iter_to_remove); - } - if (set_it) - { - /* We reset the blurb in case it has changed */ - blurb = g_markup_printf_escaped ("%s\n%s", - list_meta_theme_info->readable_name, list_meta_theme_info->comment); - - gtk_list_store_set (GTK_LIST_STORE (model), &iter_to_set, - META_THEME_PIXBUF_COLUMN, default_image, - META_THEME_NAME_COLUMN, blurb, - META_THEME_ID_COLUMN, list_meta_theme_info->name, - META_THEME_FLAG_COLUMN, list_is_default ? THEME_FLAG_DEFAULT : 0, - -1); - g_free (blurb); - - list = list->next; - i++; - } - } - - add_pixbuf_idle (); - - g_free (current_gtk_theme); - g_free (current_color_scheme); - g_free (current_icon_theme); - g_free (current_window_theme); - first_time = FALSE; - setting_model = FALSE; -} - -static void -meta_theme_setup_info (GnomeThemeMetaInfo *meta_theme_info, - GladeXML *dialog) -{ - GtkWidget *notebook; - - notebook = WID ("meta_theme_notebook"); - - if (meta_theme_info == NULL) - { - gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), 0); - } - else - { - if (meta_theme_info->application_font != NULL) - { - if (meta_theme_info->background_image != NULL) - gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), 3); - else - gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), 1); - } - else - { - if (meta_theme_info->background_image != NULL) - gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), 2); - else - gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), 0); - } - } -} - -static void -meta_theme_selection_changed (GtkTreeSelection *selection, - GladeXML *dialog) -{ - GnomeThemeMetaInfo *meta_theme_info; - GtkTreeIter iter; - gchar *meta_theme_name; - GtkTreeModel *model; - gchar *current_gtk_theme; - gchar *current_color_scheme; - gchar *current_window_theme; - gchar *current_icon_theme; - GConfClient *client; - GnomeWindowManager *window_manager; - GnomeWMSettings wm_settings; - - if (gtk_tree_selection_get_selected (selection, &model, &iter)) - { - gtk_tree_model_get (model, &iter, - META_THEME_ID_COLUMN, &meta_theme_name, - -1); - } - else - { - /* I probably just added a row. */ - return; - } - - if (meta_theme_name) - { - meta_theme_info = gnome_theme_meta_info_find (meta_theme_name); - g_free (meta_theme_name); - } - else - { - meta_theme_info = &custom_meta_theme_info; - } - meta_theme_setup_info (meta_theme_info, dialog); - - if (setting_model) - return; - - if (meta_theme_info) - gnome_meta_theme_set (meta_theme_info); - - if (!themes_loaded) { - client = gconf_client_get_default (); - - /* Get the settings */ - current_gtk_theme = gconf_client_get_string (client, GTK_THEME_KEY, NULL); - current_color_scheme = gconf_client_get_string (client, COLOR_SCHEME_KEY, NULL); - current_icon_theme = gconf_client_get_string (client, ICON_THEME_KEY, NULL); - g_object_unref (client); - - window_manager = gnome_wm_manager_get_current (gdk_display_get_default_screen (gdk_display_get_default ())); - wm_settings.flags = GNOME_WM_SETTING_THEME; - if (window_manager) { - gnome_window_manager_get_settings (window_manager, &wm_settings); - current_window_theme = g_strdup (wm_settings.theme); - } else - current_window_theme = g_strdup (""); - - initial_meta_theme_info.name = g_strdup ("__Initial Theme__"); - initial_meta_theme_info.gtk_theme_name = current_gtk_theme; - initial_meta_theme_info.gtk_color_scheme = current_color_scheme; - initial_meta_theme_info.metacity_theme_name = current_window_theme; - initial_meta_theme_info.icon_theme_name = current_icon_theme; - themes_loaded = TRUE; - } else { - if (!reverted) { - gtk_widget_set_sensitive(WID("meta_theme_revert_button"),TRUE); - } else { - reverted = FALSE; - } - } -} - -/* This function will adjust the list to reflect the current theme - * situation. It is called after the themes change on disk. Currently, it - * recreates the entire list. - */ -static void -update_themes_from_disk (GladeXML *dialog) -{ - GList *theme_list; - - if (loading_themes) { - reload_themes = TRUE; - return; - } - - loading_themes = TRUE; - - theme_list = gnome_theme_meta_info_find_all (); - gtk_widget_show (WID ("meta_theme_hbox")); - load_meta_themes (GTK_TREE_VIEW (WID ("meta_theme_treeview")), theme_list); - g_list_free (theme_list); - - update_settings_from_gconf (); -} - -static void -add_custom_row_to_meta_theme (const gchar *current_gtk_theme, - const gchar *current_color_scheme, - const gchar *current_window_theme, - const gchar *current_icon_theme, - gboolean select) -{ - GladeXML *dialog; - GtkWidget *tree_view; - GtkTreeModel *model; - GtkTreePath *path; - GtkTreeIter iter; - gboolean valid; - gchar *blurb; - GdkPixbuf *pixbuf; - - dialog = gnome_theme_manager_get_theme_dialog (); - tree_view = WID ("meta_theme_treeview"); - model = gtk_tree_view_get_model (GTK_TREE_VIEW (tree_view)); - - g_free (custom_meta_theme_info.gtk_theme_name); - custom_meta_theme_info.gtk_theme_name = g_strdup (current_gtk_theme); - g_free (custom_meta_theme_info.gtk_color_scheme); - custom_meta_theme_info.gtk_color_scheme = g_strdup (current_color_scheme); - g_free (custom_meta_theme_info.metacity_theme_name); - custom_meta_theme_info.metacity_theme_name = g_strdup (current_window_theme); - g_free (custom_meta_theme_info.icon_theme_name); - custom_meta_theme_info.icon_theme_name = g_strdup (current_icon_theme); - g_free (custom_meta_theme_info.name); - custom_meta_theme_info.name = g_strdup ("__Custom Theme__"); - - for (valid = gtk_tree_model_get_iter_first (model, &iter); - valid; - valid = gtk_tree_model_iter_next (model, &iter)) - { - guint theme_flags = 0; - - gtk_tree_model_get (model, &iter, - META_THEME_FLAG_COLUMN, &theme_flags, - -1); - if (theme_flags & THEME_FLAG_CUSTOM) - break; - - } - - /* if we found a custom row and broke out of the list above, valid will be - * TRUE. If we didn't, we need to add a new iter. - */ - if (!valid) - gtk_list_store_prepend (GTK_LIST_STORE (model), &iter); - - /* set the values of the Custom theme. */ - blurb = g_markup_printf_escaped ("%s\n%s", - _("Custom theme"), _("You can save this theme by pressing the Save Theme button.")); - - /* Invalidate the cache because the custom theme has potentially changed */ - /* Commented out because it does odd things */ - /*theme_thumbnail_invalidate_cache (&custom_meta_theme_info);*/ - - pixbuf = generate_theme_thumbnail (&custom_meta_theme_info, TRUE); - if (pixbuf == NULL) - pixbuf = default_image; - gtk_list_store_set (GTK_LIST_STORE (model), &iter, - META_THEME_PIXBUF_COLUMN, pixbuf, - META_THEME_NAME_COLUMN, blurb, - META_THEME_FLAG_COLUMN, THEME_FLAG_CUSTOM, - -1); - - gtk_widget_set_sensitive (WID ("meta_theme_save_button"), TRUE); - path = gtk_tree_model_get_path (model, &iter); - if (select) - gtk_tree_view_set_cursor (GTK_TREE_VIEW (tree_view), path, NULL, FALSE); - gtk_tree_path_free (path); - g_free (blurb); -} - -static void -remove_custom_row_from_meta_theme (void) -{ - GladeXML *dialog; - GtkWidget *tree_view; - GtkTreeModel *model; - GtkTreeIter iter; - GtkTreeIter next_iter; - gboolean valid; - - dialog = gnome_theme_manager_get_theme_dialog (); - tree_view = WID ("meta_theme_treeview"); - model = gtk_tree_view_get_model (GTK_TREE_VIEW (tree_view)); - - valid = gtk_tree_model_get_iter_first (model, &iter); - while (valid) - { - guint theme_flags = 0; - - next_iter = iter; - valid = gtk_tree_model_iter_next (model, &next_iter); - - gtk_tree_model_get (model, &iter, - META_THEME_FLAG_COLUMN, &theme_flags, - -1); - - if (theme_flags & THEME_FLAG_CUSTOM) - { - gtk_list_store_remove (GTK_LIST_STORE (model), &iter); - } - iter = next_iter; - } - g_free (custom_meta_theme_info.gtk_theme_name); - g_free (custom_meta_theme_info.metacity_theme_name); - g_free (custom_meta_theme_info.icon_theme_name); - g_free (custom_meta_theme_info.name); - - gtk_widget_set_sensitive (WID ("meta_theme_save_button"), FALSE); - - custom_meta_theme_info.gtk_theme_name = NULL; - custom_meta_theme_info.metacity_theme_name = NULL; - custom_meta_theme_info.icon_theme_name = NULL; - custom_meta_theme_info.name = NULL; -} - -static gboolean -themes_equal (GnomeThemeMetaInfo *a, GnomeThemeMetaInfo *b) -{ - if (!a->gtk_theme_name || - !b->gtk_theme_name || - strcmp (a->gtk_theme_name, b->gtk_theme_name)) - return FALSE; - if (!a->metacity_theme_name || - !b->metacity_theme_name || - strcmp (a->metacity_theme_name, b->metacity_theme_name)) - return FALSE; - if (!a->icon_theme_name || - !b->icon_theme_name || - strcmp (a->icon_theme_name, b->icon_theme_name)) - return FALSE; - return TRUE; -} - - -/* Sets the list to point to the current theme. Also creates the 'Custom Theme' - * field if needed */ -static gboolean -update_settings_from_gconf_idle (gpointer data) -{ - GConfClient *client; - gchar *current_gtk_theme; - gchar *current_window_theme; - gchar *current_icon_theme; - gchar *current_color_scheme; - GnomeWindowManager *window_manager; - GnomeWMSettings wm_settings; - GtkWidget *tree_view; - GtkTreeModel *model; - GtkTreeIter iter; - GladeXML *dialog; - gboolean valid; - gboolean current_theme_saved; - gboolean initial_theme_saved; - static gboolean first_time_run = TRUE; - - client = gconf_client_get_default (); - - /* Get the settings */ - current_gtk_theme = gconf_client_get_string (client, GTK_THEME_KEY, NULL); - current_icon_theme = gconf_client_get_string (client, ICON_THEME_KEY, NULL); - current_color_scheme = gconf_client_get_string (client, COLOR_SCHEME_KEY, NULL); - g_object_unref (client); - - window_manager = gnome_wm_manager_get_current (gdk_display_get_default_screen (gdk_display_get_default ())); - wm_settings.flags = GNOME_WM_SETTING_THEME; - if (window_manager) { - gnome_window_manager_get_settings (window_manager, &wm_settings); - current_window_theme = g_strdup (wm_settings.theme); - } else - current_window_theme = g_strdup (""); - - /* True if the current or initial theme has a meta theme that it matches. */ - current_theme_saved = FALSE; - initial_theme_saved = FALSE; - - /* Walk the tree looking for the current one. */ - dialog = gnome_theme_manager_get_theme_dialog (); - tree_view = WID ("meta_theme_treeview"); - g_assert (tree_view); - model = gtk_tree_view_get_model (GTK_TREE_VIEW (tree_view)); - - for (valid = gtk_tree_model_get_iter_first (model, &iter); - valid; - valid = gtk_tree_model_iter_next (model, &iter)) - { - gchar *row_theme_id = NULL; - guint row_theme_flags = 0; - GnomeThemeMetaInfo *meta_theme_info; - - gtk_tree_model_get (model, &iter, - META_THEME_ID_COLUMN, &row_theme_id, - META_THEME_FLAG_COLUMN, &row_theme_flags, - -1); - - if (row_theme_id) { - meta_theme_info = gnome_theme_meta_info_find (row_theme_id); - } - else { - continue; - } - g_free (row_theme_id); - if (row_theme_flags & THEME_FLAG_CUSTOM) { - continue; - } - - if (initial_meta_theme_set && themes_equal (&initial_meta_theme_info, meta_theme_info)) - initial_theme_saved = TRUE; - if (! strcmp (current_gtk_theme, meta_theme_info->gtk_theme_name) && - ! strcmp (current_icon_theme, meta_theme_info->icon_theme_name) && - (current_color_scheme == NULL || - ! strcmp (current_color_scheme, "") || - ! safe_strcmp (current_color_scheme, meta_theme_info->gtk_color_scheme)) && - (window_manager == NULL || - ! strcmp (current_window_theme, meta_theme_info->metacity_theme_name))) - { - GtkTreePath *path; - GtkTreePath *cursor_path; - gboolean cursor_same = FALSE; - - gtk_tree_view_get_cursor (GTK_TREE_VIEW (tree_view), &cursor_path, NULL); - path = gtk_tree_model_get_path (model, &iter); - if (cursor_path && gtk_tree_path_compare (path, cursor_path) == 0) - cursor_same = TRUE; - - gtk_tree_path_free (cursor_path); - - if (!cursor_same) - { - gtk_tree_view_set_cursor (GTK_TREE_VIEW (tree_view), path, NULL, FALSE); - } - gtk_tree_path_free (path); - current_theme_saved = TRUE; - - break; - } - } - - if (!current_theme_saved && first_time_run) - { - initial_meta_theme_set = TRUE; - initial_meta_theme_info.name = g_strdup ("__Initial Theme__"); - initial_meta_theme_info.gtk_theme_name = g_strdup (current_gtk_theme); - initial_meta_theme_info.gtk_color_scheme = g_strdup (current_color_scheme); - initial_meta_theme_info.metacity_theme_name = g_strdup (current_window_theme); - initial_meta_theme_info.icon_theme_name = g_strdup (current_icon_theme); - } - first_time_run = FALSE; - - - if (!current_theme_saved) - { - add_custom_row_to_meta_theme (current_gtk_theme, - current_color_scheme, - current_window_theme, - current_icon_theme, - TRUE); - } - else if (initial_meta_theme_set && !initial_theme_saved) - { - add_custom_row_to_meta_theme (initial_meta_theme_info.gtk_theme_name, - initial_meta_theme_info.gtk_color_scheme, - initial_meta_theme_info.metacity_theme_name, - initial_meta_theme_info.icon_theme_name, - FALSE); - } - else - { - remove_custom_row_from_meta_theme (); - } - g_free (current_gtk_theme); - g_free (current_color_scheme); - g_free (current_window_theme); - g_free (current_icon_theme); - update_settings_from_gconf_idle_id = 0; - update_font_button_state (dialog); - update_background_button_state (dialog); - return FALSE; -} - -static void -update_settings_from_gconf (void) -{ - if (update_settings_from_gconf_idle_id != 0) - return; - update_settings_from_gconf_idle_id = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, - update_settings_from_gconf_idle, - NULL, NULL); -} - -static void -gtk_theme_key_changed (GConfClient *client, - guint cnxn_id, - GConfEntry *entry, - gpointer user_data) -{ - /* this is called when the gtk theme name or gtk color scheme changes */ - update_settings_from_gconf (); - gnome_theme_details_update_from_gconf (); -} - -static void -window_settings_changed (GnomeWindowManager *window_manager, - GladeXML *dialog) -{ - static gchar *window_theme = NULL; - GnomeWMSettings wm_settings; - - wm_settings.flags = GNOME_WM_SETTING_THEME; - gnome_window_manager_get_settings (window_manager, &wm_settings); - if (window_theme == NULL || strcmp (wm_settings.theme, window_theme) != 0) - { - g_free (window_theme); - window_theme = g_strdup (wm_settings.theme); - } - else - return; - - update_settings_from_gconf (); - gnome_theme_details_update_from_gconf (); -} - -static void -update_font_button_state (GladeXML *dialog) -{ - GConfClient *client = gconf_client_get_default (); - GtkTreeSelection *selection; - GtkTreeModel *model; - GtkTreeIter iter; - - selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (WID ("meta_theme_treeview"))); - - if (gtk_tree_selection_get_selected (selection, &model, &iter)) - { - GnomeThemeMetaInfo *meta_theme_info; - char *meta_theme_name, *str; - - gtk_tree_model_get (model, &iter, - META_THEME_ID_COLUMN, &meta_theme_name, - -1); - if (!meta_theme_name) - return; - - meta_theme_info = gnome_theme_meta_info_find (meta_theme_name); - - g_assert (meta_theme_info); - g_free (meta_theme_name); - - str = gconf_client_get_string (client, FONT_KEY, NULL); - - if (meta_theme_info->application_font != NULL && str != NULL && - strcmp (meta_theme_info->application_font, str) == 0) - { - gtk_widget_set_sensitive (WID ("meta_theme_font1_button"), FALSE); - gtk_widget_set_sensitive (WID ("meta_theme_font2_button"), FALSE); - } - else - { - gtk_widget_set_sensitive (WID ("meta_theme_font1_button"), TRUE); - gtk_widget_set_sensitive (WID ("meta_theme_font2_button"), TRUE); - } - - g_free (str); - } - g_object_unref (client); -} - -static void -update_background_button_state (GladeXML *dialog) -{ - GConfClient *client = gconf_client_get_default (); - GtkTreeSelection *selection; - GtkTreeModel *model; - GtkTreeIter iter; - - selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (WID ("meta_theme_treeview"))); - - if (gtk_tree_selection_get_selected (selection, &model, &iter)) - { - GnomeThemeMetaInfo *meta_theme_info; - char *meta_theme_name, *str; - - gtk_tree_model_get (model, &iter, - META_THEME_ID_COLUMN, &meta_theme_name, - -1); - if (!meta_theme_name) - return; - - meta_theme_info = gnome_theme_meta_info_find (meta_theme_name); - - g_assert (meta_theme_info); - g_free (meta_theme_name); - - str = gconf_client_get_string (client, BACKGROUND_KEY, NULL); - - if (meta_theme_info->background_image != NULL && str != NULL && - strcmp (meta_theme_info->background_image, str) == 0) - { - gtk_widget_set_sensitive (WID ("meta_theme_background1_button"), FALSE); - gtk_widget_set_sensitive (WID ("meta_theme_background2_button"), FALSE); - } - else - { - gtk_widget_set_sensitive (WID ("meta_theme_background1_button"), TRUE); - gtk_widget_set_sensitive (WID ("meta_theme_background2_button"), TRUE); - } - - g_free (str); - } - -} - -static void -font_key_changed (GConfClient *client, - guint cnxn_id, - GConfEntry *entry, - gpointer user_data) -{ - GladeXML *dialog = user_data; - - update_font_button_state (dialog); -} - -static void -background_key_changed (GConfClient *client, - guint cnxn_id, - GConfEntry *entry, - gpointer user_data) -{ - GladeXML *dialog = user_data; - - update_background_button_state (dialog); -} - -static void -icon_key_changed (GConfClient *client, - guint cnxn_id, - GConfEntry *entry, - gpointer user_data) -{ - if (strcmp (entry->key, ICON_THEME_KEY)) - return; - - update_settings_from_gconf (); - gnome_theme_details_update_from_gconf (); -} - -static gboolean -theme_changed_idle (gpointer data) -{ - GladeXML *dialog; - dialog = gnome_theme_manager_get_theme_dialog (); - - update_themes_from_disk (dialog); - gnome_theme_details_reread_themes_from_disk (); - gtk_widget_grab_focus (WID ("meta_theme_treeview")); - theme_changed_idle_id = 0; - return FALSE; -} - -/* FIXME: We want a more sophisticated theme_changed func sometime */ -static void -theme_changed_func (gpointer uri, - gpointer user_data) -{ - if (theme_changed_idle_id != 0) - return; - theme_changed_idle_id = - g_idle_add_full (G_PRIORITY_HIGH_IDLE, - theme_changed_idle, - NULL, NULL); -} - -static void -cb_dialog_response (GtkDialog *dialog, gint response_id) -{ - if (response_id == GTK_RESPONSE_HELP) - capplet_help (GTK_WINDOW (dialog), "user-guide.xml", "goscustdesk-12"); - else - gtk_main_quit (); -} - -static void -setup_meta_tree_view (GtkTreeView *tree_view, - GCallback changed_callback, - GladeXML *dialog) -{ - GtkTreeModel *model; - GtkTreeSelection *selection; - GtkCellRenderer *renderer; - - renderer = g_object_new (GTK_TYPE_CELL_RENDERER_PIXBUF, - "xpad", 4, - "ypad", 4, - NULL); - - gtk_tree_view_insert_column_with_attributes (tree_view, - -1, NULL, - renderer, - "pixbuf", META_THEME_PIXBUF_COLUMN, - NULL); - renderer = gtk_cell_renderer_text_new (); - - g_object_set (renderer, "ellipsize", PANGO_ELLIPSIZE_END, NULL); - - gtk_tree_view_insert_column_with_attributes (tree_view, - -1, NULL, - renderer, - "markup", META_THEME_NAME_COLUMN, - NULL); - - model = (GtkTreeModel *) gtk_list_store_new (META_N_COLUMNS, - G_TYPE_STRING, /* META_THEME_NAME_COLUMN */ - G_TYPE_STRING, /* META_THEME_ID_COLUMN */ - G_TYPE_UINT, /* META_THEME_FLAG_COLUMN */ - GDK_TYPE_PIXBUF); /* META_THEME_PIXBUF_COLUMN */ - gtk_tree_view_set_model (tree_view, model); - selection = gtk_tree_view_get_selection (tree_view); - gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE); - g_signal_connect (G_OBJECT (selection), "changed", changed_callback, dialog); -} - - -static void -gnome_theme_save_clicked (GtkWidget *button, - gpointer data) -{ - GladeXML *dialog; - - dialog = gnome_theme_manager_get_theme_dialog (); - - gnome_theme_save_show_dialog (WID ("theme_dialog"), &custom_meta_theme_info); -} - -static void -apply_font_clicked (GtkWidget *button, - gpointer data) -{ - GladeXML *dialog = data; - GConfClient *client; - GtkTreeSelection *selection; - GtkTreeModel *model; - GtkTreeIter iter; - - client = gconf_client_get_default (); - selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (WID ("meta_theme_treeview"))); - - if (gtk_tree_selection_get_selected (selection, &model, &iter)) - { - GnomeThemeMetaInfo *meta_theme_info; - char *meta_theme_name; - - gtk_tree_model_get (model, &iter, - META_THEME_ID_COLUMN, &meta_theme_name, - -1); - meta_theme_info = gnome_theme_meta_info_find (meta_theme_name); - - g_assert (meta_theme_info); - g_free (meta_theme_name); - - gconf_client_set_string (client, FONT_KEY, meta_theme_info->application_font, NULL); - gconf_client_set_string (client, DESKTOP_FONT_KEY, meta_theme_info->desktop_font, NULL); - gconf_client_set_string (client, MONOSPACE_FONT_KEY, meta_theme_info->monospace_font, NULL); - - } - g_object_unref (client); -} - -static void -apply_background_clicked (GtkWidget *button, - gpointer data) -{ - GladeXML *dialog = data; - GConfClient *client; - GtkTreeSelection *selection; - GtkTreeModel *model; - GtkTreeIter iter; - - client = gconf_client_get_default (); - selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (WID ("meta_theme_treeview"))); - - if (gtk_tree_selection_get_selected (selection, &model, &iter)) - { - GnomeThemeMetaInfo *meta_theme_info; - char *meta_theme_name; - - gtk_tree_model_get (model, &iter, - META_THEME_ID_COLUMN, &meta_theme_name, - -1); - meta_theme_info = gnome_theme_meta_info_find (meta_theme_name); - - g_assert (meta_theme_info); - g_free (meta_theme_name); - - gconf_client_set_string (client, BACKGROUND_KEY, meta_theme_info->background_image, NULL); - } -} - -static void -revert_theme_clicked (GtkWidget *button, - gpointer data) -{ - GladeXML *dialog; - - gnome_meta_theme_set(&initial_meta_theme_info); - - dialog = gnome_theme_manager_get_theme_dialog (); - gtk_widget_set_sensitive(WID("meta_theme_revert_button"), FALSE); - reverted = TRUE; -} - - -/* Find out if the lockdown key has been set. Currently returns false on error... */ -static gboolean -get_lockdown_status (void) -{ - GConfClient *client; - gboolean result; - - client = gconf_client_get_default (); - result = gconf_client_get_bool (client, LOCKDOWN_KEY, NULL); - g_object_unref (client); - - return result; -} - -static void -setup_dialog (GladeXML *dialog) -{ - GConfClient *client; - GtkWidget *parent, *widget; - GnomeWindowManager *window_manager; - GtkSizeGroup *size_group; - - default_image = gdk_pixbuf_new_from_file(GNOMECC_DATA_DIR "/pixmaps/theme-thumbnailing.png", NULL); - broken_image = gdk_pixbuf_new_from_file(GNOMECC_DATA_DIR "/pixmaps/theme-thumbnailing.png", NULL); - - client = gconf_client_get_default (); - - window_manager = gnome_wm_manager_get_current (gdk_display_get_default_screen (gdk_display_get_default ())); - - parent = WID ("theme_dialog"); - - size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); - gtk_size_group_add_widget (size_group, WID ("meta_theme_details_button")); - gtk_size_group_add_widget (size_group, WID ("meta_theme_install_button")); - gtk_size_group_add_widget (size_group, WID ("meta_theme_save_button")); - gtk_size_group_add_widget (size_group, WID ("meta_theme_font1_button")); - gtk_size_group_add_widget (size_group, WID ("meta_theme_background1_button")); - gtk_size_group_add_widget (size_group, WID ("meta_theme_font2_button")); - gtk_size_group_add_widget (size_group, WID ("meta_theme_background2_button")); - gtk_size_group_add_widget (size_group, WID ("meta_theme_revert_button")); - g_object_unref (size_group); - - gtk_widget_set_sensitive(WID("meta_theme_revert_button"),FALSE); - - g_signal_connect (G_OBJECT (WID ("meta_theme_install_button")), "clicked", G_CALLBACK (gnome_theme_installer_run_cb), parent); - - g_signal_connect (G_OBJECT (WID ("meta_theme_details_button")), "clicked", gnome_theme_details_show, NULL); - - g_signal_connect (G_OBJECT (WID ("meta_theme_font1_button")), "clicked", G_CALLBACK (apply_font_clicked), dialog); - g_signal_connect (G_OBJECT (WID ("meta_theme_font2_button")), "clicked", G_CALLBACK (apply_font_clicked), dialog); - - g_signal_connect (G_OBJECT (WID ("meta_theme_revert_button")), "clicked", G_CALLBACK (revert_theme_clicked),NULL); - - g_signal_connect (G_OBJECT (WID ("meta_theme_background1_button")), "clicked", G_CALLBACK (apply_background_clicked), dialog); - g_signal_connect (G_OBJECT (WID ("meta_theme_background2_button")), "clicked", G_CALLBACK (apply_background_clicked), dialog); - - setup_meta_tree_view (GTK_TREE_VIEW (WID ("meta_theme_treeview")), - (GCallback) meta_theme_selection_changed, - dialog); - - gtk_tree_view_set_search_column (GTK_TREE_VIEW (WID ("meta_theme_treeview")), META_THEME_ID_COLUMN); - - gconf_client_add_dir (client, "/desktop/gnome/interface", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); - - gconf_client_notify_add (client, - GTK_THEME_KEY, - (GConfClientNotifyFunc) >k_theme_key_changed, - dialog, NULL, NULL); - gconf_client_notify_add (client, - COLOR_SCHEME_KEY, - (GConfClientNotifyFunc) >k_theme_key_changed, - dialog, NULL, NULL); - gconf_client_notify_add (client, - ICON_THEME_KEY, - (GConfClientNotifyFunc) &icon_key_changed, - dialog, NULL, NULL); - gconf_client_notify_add (client, - FONT_KEY, - (GConfClientNotifyFunc) &font_key_changed, - dialog, NULL, NULL); - gconf_client_notify_add (client, - BACKGROUND_KEY, - (GConfClientNotifyFunc) &background_key_changed, - dialog, NULL, NULL); - - g_object_unref (client); - - if (window_manager) - g_signal_connect (G_OBJECT (window_manager), - "settings_changed", - (GCallback) window_settings_changed, dialog); - - update_themes_from_disk (dialog); - gtk_widget_grab_focus (WID ("meta_theme_treeview")); - gnome_theme_info_register_theme_change (theme_changed_func, dialog); - - - - widget = WID ("meta_theme_save_button"); - g_signal_connect (G_OBJECT (widget), "clicked", G_CALLBACK (gnome_theme_save_clicked), NULL); - - -/* - g_signal_connect (G_OBJECT (WID ("install_dialog")), "response", - G_CALLBACK (install_dialog_response), dialog); - */ - - g_signal_connect (G_OBJECT (parent), "response", G_CALLBACK (cb_dialog_response), NULL); - - gtk_drag_dest_set (parent, GTK_DEST_DEFAULT_ALL, - drop_types, n_drop_types, - GDK_ACTION_COPY | GDK_ACTION_LINK | GDK_ACTION_MOVE); - g_signal_connect (G_OBJECT (parent), "drag-motion", G_CALLBACK (gnome_theme_manager_drag_motion_cb), NULL); - g_signal_connect (G_OBJECT (parent), "drag-leave", G_CALLBACK (gnome_theme_manager_drag_leave_cb), NULL); - g_signal_connect (G_OBJECT (parent), "drag-data-received",G_CALLBACK (gnome_theme_manager_drag_data_received_cb), NULL); - - capplet_set_icon (parent, "gnome-settings-theme"); - - update_font_button_state (dialog); - update_background_button_state (dialog); - - if (get_lockdown_status ()) - { - /* theme changing has been disabled by the system administrator */ - gtk_widget_set_sensitive (WID ("meta_theme_hbox"),FALSE); - gtk_widget_set_sensitive (WID ("meta_theme_notebook"),FALSE); - gtk_widget_show (WID ("lockdown_hbox")); - } - - - gtk_widget_show (parent); - -} - -/* Non static functions */ -GladeXML * -gnome_theme_manager_get_theme_dialog (void) -{ - static GladeXML *dialog = NULL; - - if (dialog == NULL) - dialog = glade_xml_new (GLADEDIR "/theme-properties.glade", NULL, NULL); - - return dialog; -} - -gint -gnome_theme_manager_sort_func (const gchar *a_str, - const gchar *b_str, - guint a_flag, - guint b_flag) -{ - gint retval; - gint agreater = FALSE, bgreater = FALSE; - - if (a_flag & THEME_FLAG_CUSTOM) - agreater = TRUE; - if (b_flag & THEME_FLAG_CUSTOM) - bgreater = TRUE; - - if (agreater && !bgreater) - return -1; - if (!agreater && bgreater) - return 1; - - if (a_flag & THEME_FLAG_DEFAULT) - agreater = TRUE; - if (b_flag & THEME_FLAG_DEFAULT) - bgreater = TRUE; - - if (agreater && !bgreater) - return -1; - if (!agreater && bgreater) - return 1; - - retval = g_utf8_collate (a_str?a_str:"", - b_str?b_str:""); - - return retval; -} - -/* Starts nautilus on the themes directory*/ -void -gnome_theme_manager_show_manage_themes (GtkWidget *button, gpointer data) -{ - gchar *path, *command; - GnomeVFSURI *uri; - - path = g_strdup_printf ("%s/.themes", g_get_home_dir ()); - uri = gnome_vfs_uri_new (path); - - if (!gnome_vfs_uri_exists (uri)) { - /* Create the directory */ - gnome_vfs_make_directory_for_uri (uri, 0775); - } - gnome_vfs_uri_unref (uri); - - command = g_strdup_printf ("nautilus --no-desktop %s", path); - g_free (path); - - g_spawn_command_line_async (command, NULL); - g_free (command); -} - -/* Starts nautilus on the icon themes directory*/ -void -gnome_theme_manager_icon_show_manage_themes (GtkWidget *button, gpointer data) -{ - gchar *path, *command; - GnomeVFSURI *uri; - - path = g_strdup_printf ("%s/.icons", g_get_home_dir ()); - uri = gnome_vfs_uri_new (path); - - if (!gnome_vfs_uri_exists (uri)) { - /* Create the directory */ - gnome_vfs_make_directory_for_uri (uri, 0775); - } - gnome_vfs_uri_unref (uri); - - command = g_strdup_printf ("nautilus --no-desktop %s", path); - g_free (path); - - g_spawn_command_line_async (command, NULL); - g_free (command); -} - -/* Show the nautilus themes window */ -void -gnome_theme_manager_window_show_manage_themes (GtkWidget *button, gpointer data) -{ - gchar *path, *command; - GnomeVFSURI *uri; - GnomeWindowManager *wm; - - wm = gnome_wm_manager_get_current (gdk_display_get_default_screen (gdk_display_get_default ())); - - path = gnome_window_manager_get_user_theme_folder (wm); - g_object_unref (G_OBJECT (wm)); - - uri = gnome_vfs_uri_new (path); - - if (!gnome_vfs_uri_exists (uri)) { - /* Create the directory */ - gnome_vfs_make_directory_for_uri (uri, 0775); - } - gnome_vfs_uri_unref (uri); - - - command = g_strdup_printf ("nautilus --no-desktop %s", path); - g_free (path); - - g_spawn_command_line_async (command, NULL); - g_free (command); -} - -/* Callback issued during drag movements */ -gboolean -gnome_theme_manager_drag_motion_cb (GtkWidget *widget, GdkDragContext *context, - gint x, gint y, guint time, gpointer data) -{ - return FALSE; -} - -/* Callback issued during drag leaves */ -void -gnome_theme_manager_drag_leave_cb (GtkWidget *widget, GdkDragContext *context, - guint time, gpointer data) -{ - gtk_widget_queue_draw (widget); -} - -/* Callback issued on actual drops. Attempts to load the file dropped. */ -void -gnome_theme_manager_drag_data_received_cb (GtkWidget *widget, GdkDragContext *context, - gint x, gint y, - GtkSelectionData *selection_data, - guint info, guint time, gpointer data) -{ - GList *uris; - gchar *filename = NULL; - GtkWidget *toplevel; - - if (!(info == TARGET_URI_LIST || info == TARGET_NS_URL)) - return; - - uris = gnome_vfs_uri_list_parse ((gchar *) selection_data->data); - if (uris != NULL && uris->data != NULL) { - GnomeVFSURI *uri = (GnomeVFSURI *) uris->data; - - if (gnome_vfs_uri_is_local (uri)) - filename = gnome_vfs_unescape_string ( - gnome_vfs_uri_get_path (uri), - G_DIR_SEPARATOR_S); - else - filename = gnome_vfs_unescape_string ( - gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_NONE), - G_DIR_SEPARATOR_S); - - gnome_vfs_uri_list_unref (uris); - } - toplevel = gtk_widget_get_toplevel (widget); - if (!GTK_WIDGET_TOPLEVEL (toplevel)) - toplevel = NULL; - gnome_theme_install_from_uri (filename, GTK_WINDOW (toplevel)); - g_free (filename); -} - - -static gchar * -get_default_string_from_key (const char *key) -{ - GConfClient *client; - GConfValue *value; - GError *error = NULL; - gchar *str = NULL; - - client = gconf_client_get_default (); - value = gconf_client_get_default_from_schema (client, key, &error); - g_object_unref (client); - - if (error) - { - g_clear_error (&error); - return NULL; - } - - if (value) - { - if (value->type == GCONF_VALUE_STRING) - str = gconf_value_to_string (value); - gconf_value_free (value); - } - - return str; -} - -int -main (int argc, char *argv[]) -{ - GladeXML *dialog; - gchar *install_filename = NULL; - GnomeProgram *program; - - GOptionEntry option_entries[] = { - { "install-theme", - 'i', - G_OPTION_FLAG_IN_MAIN, - G_OPTION_ARG_FILENAME, - &install_filename, - N_("Specify the filename of a theme to install"), - N_("filename") - }, - { NULL } - }; - GOptionContext *option_context; - - if (!g_thread_supported ()) - g_thread_init (NULL); - - /* We need to do this before we initialize anything else */ - theme_thumbnail_factory_init (argc, argv); - - bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); - bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); - textdomain (GETTEXT_PACKAGE); - - option_context = g_option_context_new (NULL); - g_option_context_add_main_entries (option_context, option_entries, GETTEXT_PACKAGE); - - program = gnome_program_init ("gnome-theme-manager", VERSION, - LIBGNOMEUI_MODULE, argc, argv, - GNOME_PARAM_APP_DATADIR, GNOMECC_DATA_DIR, - GNOME_PARAM_GOPTION_CONTEXT, option_context, - NULL); - - if (install_filename != NULL) - gnome_theme_install_from_uri (install_filename, NULL); - g_free (install_filename); - - gtk_theme_default_name = get_default_string_from_key (GTK_THEME_KEY); - window_theme_default_name = get_default_string_from_key (METACITY_THEME_KEY); - icon_theme_default_name = get_default_string_from_key (ICON_THEME_KEY); - - if (gtk_theme_default_name == NULL || - window_theme_default_name == NULL || - icon_theme_default_name == NULL) - { - GtkWidget *msg_dialog; - - msg_dialog = gtk_message_dialog_new (NULL, - GTK_DIALOG_MODAL, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - _("The default theme schemas could not be found on your system. This means that you probably don't have metacity installed, or that your gconf is configured incorrectly.")); - gtk_dialog_run (GTK_DIALOG (msg_dialog)); - gtk_widget_destroy (msg_dialog); - g_object_unref (program); - exit (0); - } - - gnome_theme_init (NULL); - - gnome_wm_manager_init (); - activate_settings_daemon (); - - dialog = gnome_theme_manager_get_theme_dialog (); - - setup_dialog (dialog); - - gtk_main (); - - g_object_unref (program); - - return 0; -} diff --git a/capplets/theme-switcher/gnome-theme-manager.h b/capplets/theme-switcher/gnome-theme-manager.h deleted file mode 100644 index 205971830..000000000 --- a/capplets/theme-switcher/gnome-theme-manager.h +++ /dev/null @@ -1,86 +0,0 @@ -#ifndef __GNOME_THEME_MANAGER_H__ -#define __GNOME_THEME_MANAGER_H__ - -#include -#include - - -#define GTK_THEME_KEY "/desktop/gnome/interface/gtk_theme" -#define ICON_THEME_KEY "/desktop/gnome/interface/icon_theme" -#define FONT_KEY "/desktop/gnome/interface/font_name" -#define DESKTOP_FONT_KEY "/apps/nautilus/preferences/desktop_font" -#define MONOSPACE_FONT_KEY "/desktop/gnome/interface/monospace_font_name" -#define BACKGROUND_KEY "/desktop/gnome/background/picture_filename" -#define LOCKDOWN_KEY "/desktop/gnome/lockdown/disable_theme_settings" -#define COLOR_SCHEME_KEY "/desktop/gnome/interface/gtk_color_scheme" - -#define METACITY_THEME_DIR "/apps/metacity/general" -#define METACITY_THEME_KEY METACITY_THEME_DIR "/theme" - -extern const char *meta_theme_default_name; -extern const char *gtk_theme_default_name; -extern const char *window_theme_default_name; -extern const char *icon_theme_default_name; - - -/* Drag and drop info */ -enum -{ - TARGET_URI_LIST, - TARGET_NS_URL -}; - -/* model info */ -enum -{ - THEME_NAME_COLUMN, - THEME_ID_COLUMN, - THEME_FLAG_COLUMN, - N_COLUMNS -}; - -enum -{ - THEME_FLAG_DEFAULT = 1 << 0, - THEME_FLAG_CUSTOM = 1 << 1 -}; - -extern GtkTargetEntry drop_types[]; -extern gint n_drop_types; - - -/* Prototypes */ -GladeXML *gnome_theme_manager_get_theme_dialog (void); -gint gnome_theme_manager_sort_func (const gchar *a_str, - const gchar *b_str, - guint a_flag, - guint b_flag); -void gnome_theme_manager_show_manage_themes (GtkWidget *button, - gpointer data); -void gnome_theme_manager_icon_show_manage_themes (GtkWidget *button, - gpointer data); -void gnome_theme_manager_window_show_manage_themes (GtkWidget *button, - gpointer data); -gboolean gnome_theme_manager_drag_motion_cb (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - guint time, - gpointer data); -void gnome_theme_manager_drag_leave_cb (GtkWidget *widget, - GdkDragContext *context, - guint time, - gpointer data); -void gnome_theme_manager_drag_data_received_cb (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - GtkSelectionData *selection_data, - guint info, - guint time, - gpointer data); - - -void free_all (gpointer, ...); - -#endif /* __GNOME_THEME_MANAGER_H__ */ diff --git a/capplets/theme-switcher/gnome-theme-package.xml.in b/capplets/theme-switcher/gnome-theme-package.xml.in deleted file mode 100644 index bb362fa18..000000000 --- a/capplets/theme-switcher/gnome-theme-package.xml.in +++ /dev/null @@ -1,9 +0,0 @@ - - - - - <_comment>Gnome Theme Package - - - - diff --git a/capplets/theme-switcher/gnome-theme-save-data.c b/capplets/theme-switcher/gnome-theme-save-data.c deleted file mode 100644 index e487194fc..000000000 --- a/capplets/theme-switcher/gnome-theme-save-data.c +++ /dev/null @@ -1,9 +0,0 @@ -static const gchar *theme_header = -"[Desktop Entry]\n\ -Name=%s\n\ -Type=X-GNOME-Metatheme\n\ -Comment=%s\n\ -Encoding=UTF-8\n\ -\n\ -[X-GNOME-Metatheme]\n\ -"; diff --git a/capplets/theme-switcher/gnome-theme-save.c b/capplets/theme-switcher/gnome-theme-save.c deleted file mode 100644 index abecdd1af..000000000 --- a/capplets/theme-switcher/gnome-theme-save.c +++ /dev/null @@ -1,361 +0,0 @@ -#include "gnome-theme-info.h" -#include "gnome-theme-save.h" -#include "gnome-theme-manager.h" -#include "capplet-util.h" -#include -#include - -#include "gnome-theme-save-data.c" - -static GQuark error_quark; -enum -{ - INVALID_THEME_NAME -}; - -/* taken from gnome-desktop-item.c */ -static char * -escape_string_and_dup (const char *s) -{ - char *return_value, *p; - const char *q; - int len = 0; - - if (s == NULL) - return g_strdup(""); - - q = s; - while (*q) - { - len++; - if (strchr ("\n\r\t\\", *q) != NULL) - len++; - q++; - } - return_value = p = (char *) g_malloc (len + 1); - do - { - switch (*s) - { - case '\t': - *p++ = '\\'; - *p++ = 't'; - break; - case '\n': - *p++ = '\\'; - *p++ = 'n'; - break; - case '\r': - *p++ = '\\'; - *p++ = 'r'; - break; - case '\\': - *p++ = '\\'; - *p++ = '\\'; - break; - default: - *p++ = *s; - } - } - while (*s++); - return return_value; -} - -static gboolean -check_theme_name (const gchar *theme_name, - GError **error) -{ - if (theme_name == NULL) - { - g_set_error (error, - error_quark, - INVALID_THEME_NAME, - _("Theme name must be present")); - return FALSE; - } - return TRUE; -} - -static gchar* -str_remove_slash (const gchar *src) -{ - const gchar *i; - gchar *rtn; - gint len = 0; - i = src; - - while (*i) - { - if (*i != '/') - len++; - i++; - } - - rtn = (gchar *) g_malloc (len + 1); - while (*src) - { - if (*src != '/') - { - *rtn = *src; - rtn++; - } - src++; - } - *rtn = '\0'; - return rtn - len; -} - - -static gboolean -setup_directory_structure (const gchar *theme_name, - GError **error) -{ - gchar *dir, *theme_name_dir; - GnomeVFSURI *uri; - - theme_name_dir = str_remove_slash (theme_name); - - dir = g_build_filename (g_get_home_dir (), ".themes", NULL); - uri = gnome_vfs_uri_new (dir); - if (!gnome_vfs_uri_exists (uri)) - gnome_vfs_make_directory_for_uri (uri, 0775); - gnome_vfs_uri_unref (uri); - g_free (dir); - - dir = g_build_filename (g_get_home_dir (), ".themes", theme_name_dir, NULL); - uri = gnome_vfs_uri_new (dir); - if (!gnome_vfs_uri_exists (uri)) - gnome_vfs_make_directory_for_uri (uri, 0775); - gnome_vfs_uri_unref (uri); - g_free (dir); - - dir = g_build_filename (g_get_home_dir (), ".themes", theme_name_dir, "index.theme", NULL); - uri = gnome_vfs_uri_new (dir); - - if (gnome_vfs_uri_exists (uri)) - { - GtkWidget *dialog; - gint response; - - dialog = gtk_message_dialog_new (NULL, - GTK_DIALOG_MODAL, - GTK_MESSAGE_QUESTION, - GTK_BUTTONS_OK_CANCEL, - _("The theme already exists. Would you like to replace it?")); - response = gtk_dialog_run(GTK_DIALOG(dialog)); - gtk_widget_destroy(dialog); - if (response == GTK_RESPONSE_CANCEL) - { - gnome_vfs_uri_unref (uri); - g_free (dir); - g_free (theme_name_dir); - return FALSE; - } - } - - gnome_vfs_uri_unref (uri); - g_free (dir); - g_free (theme_name_dir); - - return TRUE; -} - -static gboolean -write_theme_to_disk (GnomeThemeMetaInfo *meta_theme_info, - const gchar *theme_name, - const gchar *theme_description, - gboolean save_background, - GError **error) -{ - gchar *dir, *theme_name_dir; - GnomeVFSURI *uri; - GnomeVFSURI *target_uri; - GnomeVFSHandle *handle = NULL; - GnomeVFSFileSize bytes_written; - gchar *str, *current_background; - GConfClient *client; - - theme_name_dir = str_remove_slash (theme_name); - dir = g_build_filename (g_get_home_dir (), ".themes", theme_name_dir, "index.theme~", NULL); - g_free (theme_name_dir); - - uri = gnome_vfs_uri_new (dir); - dir [strlen (dir) - 1] = '\000'; - target_uri = gnome_vfs_uri_new (dir); - g_free (dir); - gnome_vfs_create_uri (&handle, uri, GNOME_VFS_OPEN_READ | GNOME_VFS_OPEN_WRITE, FALSE, 0644); - - gnome_vfs_truncate_handle (handle, 0); - - /* start making the theme file */ - str = g_strdup_printf (theme_header, theme_name, theme_description); - gnome_vfs_write (handle, str, strlen (str), &bytes_written); - g_free (str); - - str = g_strdup_printf ("GtkTheme=%s\n", meta_theme_info->gtk_theme_name); - gnome_vfs_write (handle, str, strlen (str), &bytes_written); - g_free (str); - - if (meta_theme_info->gtk_color_scheme) - { - gchar *a, *tmp; - tmp = g_strdup (meta_theme_info->gtk_color_scheme); - for (a = tmp; *a != '\0'; a++) - if (*a == '\n') - *a = ','; - str = g_strdup_printf ("GtkColorScheme=%s\n", tmp); - gnome_vfs_write (handle, str, strlen (str), &bytes_written); - g_free (str); - g_free (tmp); - } - - str = g_strdup_printf ("MetacityTheme=%s\n", meta_theme_info->metacity_theme_name); - gnome_vfs_write (handle, str, strlen (str), &bytes_written); - g_free (str); - - str = g_strdup_printf ("IconTheme=%s\n", meta_theme_info->icon_theme_name); - gnome_vfs_write (handle, str, strlen (str), &bytes_written); - g_free (str); - - if (save_background) - { - client = gconf_client_get_default (); - current_background = gconf_client_get_string (client, BACKGROUND_KEY, NULL); - str = g_strdup_printf ("BackgroundImage=%s\n", current_background); - - gnome_vfs_write (handle, str, strlen (str), &bytes_written); - - g_object_unref (client); - g_free (current_background); - g_free (str); - } - - gnome_vfs_close (handle); - - - gnome_vfs_move_uri (uri, target_uri, TRUE); - gnome_vfs_uri_unref (uri); - gnome_vfs_uri_unref (target_uri); - - return TRUE; -} - -static gboolean -save_theme_to_disk (GnomeThemeMetaInfo *meta_theme_info, - const gchar *theme_name, - const gchar *theme_description, - gboolean save_background, - GError **error) -{ - if (! check_theme_name (theme_name, error)) - return FALSE; - - if (! setup_directory_structure (theme_name, error)) - return FALSE; - - if (! write_theme_to_disk (meta_theme_info, theme_name, theme_description, save_background, error)) - return FALSE; - - return TRUE; -} - -static void -save_dialog_response (GtkWidget *save_dialog, - gint response_id, - gpointer data) -{ - GnomeThemeMetaInfo *meta_theme_info; - char *theme_description = NULL; - char *theme_name = NULL; - GError *error = NULL; - - if (response_id == GTK_RESPONSE_OK) - { - GladeXML *dialog; - GtkWidget *entry; - GtkWidget *text_view; - GtkTextBuffer *buffer; - GtkTextIter start_iter; - GtkTextIter end_iter; - gchar *buffer_text; - gboolean save_background; - - dialog = gnome_theme_manager_get_theme_dialog (); - entry = WID ("save_dialog_entry"); - theme_name = escape_string_and_dup (gtk_entry_get_text (GTK_ENTRY (entry))); - - text_view = WID ("save_dialog_textview"); - buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view)); - gtk_text_buffer_get_start_iter (buffer, &start_iter); - gtk_text_buffer_get_end_iter (buffer, &end_iter); - buffer_text = gtk_text_buffer_get_text (buffer, &start_iter, &end_iter, FALSE); - theme_description = escape_string_and_dup (buffer_text); - g_free (buffer_text); - meta_theme_info = (GnomeThemeMetaInfo *) g_object_get_data (G_OBJECT (save_dialog), "meta-theme-info"); - save_background = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (WID ("save_background_checkbutton"))); - if (! save_theme_to_disk (meta_theme_info, theme_name, theme_description, save_background, &error)) - { - goto out; - } - } - - out: - g_clear_error (&error); - gtk_widget_hide (save_dialog); - g_free (theme_name); - g_free (theme_description); -} - - -static void -entry_text_changed (GtkEditable *editable, - gpointer data) -{ - GladeXML *dialog = (GladeXML *) data; - const gchar *text; - - text = gtk_entry_get_text (GTK_ENTRY (editable)); - if (text != NULL && text[0] != '\000') - gtk_widget_set_sensitive (WID ("save_dialog_save_button"), TRUE); - else - gtk_widget_set_sensitive (WID ("save_dialog_save_button"), FALSE); -} - - -void -gnome_theme_save_show_dialog (GtkWidget *parent, - GnomeThemeMetaInfo *meta_theme_info) -{ - static GtkWidget *save_dialog = NULL; - GladeXML *dialog; - GtkWidget *entry; - GtkWidget *text_view; - GtkTextBuffer *text_buffer; - - dialog = gnome_theme_manager_get_theme_dialog (); - entry = WID ("save_dialog_entry"); - text_view = WID ("save_dialog_textview"); - - if (save_dialog == NULL) - { - save_dialog = WID ("save_dialog"); - g_assert (save_dialog); - - g_signal_connect (G_OBJECT (save_dialog), "response", G_CALLBACK (save_dialog_response), NULL); - g_signal_connect (G_OBJECT (save_dialog), "delete-event", G_CALLBACK (gtk_true), NULL); - g_signal_connect (G_OBJECT (entry), "changed", G_CALLBACK (entry_text_changed), dialog); - - error_quark = g_quark_from_string ("gnome-theme-save"); - gtk_widget_set_size_request (text_view, 300, 100); - } - - gtk_entry_set_text (GTK_ENTRY (entry), ""); - entry_text_changed (GTK_EDITABLE (entry), dialog); - gtk_widget_grab_focus (entry); - - text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view)); - gtk_text_buffer_set_text (text_buffer, "", strlen ("")); - g_object_set_data (G_OBJECT (save_dialog), "meta-theme-info", meta_theme_info); - gtk_window_set_transient_for (GTK_WINDOW (save_dialog), GTK_WINDOW (parent)); - gtk_widget_show (save_dialog); -} diff --git a/capplets/theme-switcher/gnome-theme-save.h b/capplets/theme-switcher/gnome-theme-save.h deleted file mode 100644 index 7ef427e86..000000000 --- a/capplets/theme-switcher/gnome-theme-save.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef __GNOME_THEME_SAVE_H__ -#define __GNOME_THEME_SAVE_H__ - - -#include -#include "gnome-theme-info.h" - -void gnome_theme_save_show_dialog (GtkWidget *parent, - GnomeThemeMetaInfo *meta_theme_info); - - -#endif /* __GNOME_THEME_SAVE_H__ */ diff --git a/capplets/theme-switcher/gtk-theme-selector-capplet.png b/capplets/theme-switcher/gtk-theme-selector-capplet.png deleted file mode 100644 index 4ceb86de66c9277b907b79ed9d3ad098670ee9f2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 527 zcmV+q0`UEbP)W^00006VoOIv0RI60 z0RN!9r;`8x0mMl}K~#9!?U+A`!ax|sUqrA97CC{f2T;7g6rLf4H%OmD1n~@>Aw{s% zLJ-6%g@r^Rh6DxwfFQ_hwZp1$Gb@=mS>`oyX7Z6A$>)2M07^<+(jLaNB%G)|PK-t) z=(;Wit*+~6Hk+wy)wGjat(NqyQYmYXEAWql*J?Foha&AzNwvzm$$7b45Jgcj&QPf! zNfI;~4IGchr}Zd`(CKvelJk5%BaY+3Ze@}rsMqV*@Apq@i^bw)T~(G|*zI=ccDros zx^6iF$S@2B>$)xs!;l~RcDvodXF;d7%4V~{d_FG}{B%0ua5%8>dc9`zDmj$|Jp%eh zT~Rf^`}lM^O`UJI+xT=%W&pkO?wLo8re*&Zr3s+HV89J64Y;Ohuq=x~Q%cJL{u7i3 zTB=PJFL3GYP)RB0T^E&&iQ84K*DHb`5Jo$hOwjA~xX0lQLXg*m zecuNm1cVUyz7GH(gxnqTRBi!eSr$CcW1!!^MSbcJ9{HweVmKU@58U%Sn5HRjt2mCs zdb!{4%j4tA - - - /schemas/apps/gtk-theme-switcher/auto - /apps/gtk-theme-switcher/auto - gtk-theme-switcher - bool - true - - Auto-preview - Whether to automatically preview selected themes - - - - /schemas/apps/gtk-theme-switcher/theme - /apps/gtk-theme-switcher/theme - gtk-theme-switcher - string - Default - - Current theme - The last set theme - - - - /schemas/apps/gtk-theme-switcher/font - /apps/gtk-theme-switcher/font - gtk-theme-switcher - string - - Current theme - The last set theme - - - - /schemas/apps/gtk-theme-switcher/use_theme_font - /apps/gtk-theme-switcher/use_theme_font - gtk-theme-switcher - bool - false - - Use custom font - Whether to use the custom specified font - - - - diff --git a/capplets/theme-switcher/theme-properties.glade b/capplets/theme-switcher/theme-properties.glade deleted file mode 100644 index f8882a016..000000000 --- a/capplets/theme-switcher/theme-properties.glade +++ /dev/null @@ -1,2207 +0,0 @@ - - - - - - - 5 - Theme Preferences - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_CENTER - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - True - False - False - - - - True - False - 2 - - - - True - GTK_BUTTONBOX_END - - - - True - True - gtk-help - True - GTK_RELIEF_NORMAL - True - -11 - - - - - - True - True - gtk-close - True - GTK_RELIEF_NORMAL - True - -7 - - - - - 0 - False - True - GTK_PACK_END - - - - - - 5 - True - False - 6 - - - - False - 6 - - - - True - gtk-dialog-warning - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - True - - - - - - True - <b>You do not have permission to change theme settings</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - 0 - False - False - - - - - - True - False - 6 - - - - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - 350 - True - True - False - False - False - True - False - False - False - - theme selection tree - Select theme for the desktop - - - - - - 0 - True - True - - - - - - True - False - 6 - - - - True - True - GTK_RELIEF_NORMAL - True - - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-add - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - _Install Theme... - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - - - - 0 - False - False - - - - - - True - True - GTK_RELIEF_NORMAL - True - - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-preferences - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - C_ustomize... - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - - - - 0 - False - False - - - - - - True - True - GTK_RELIEF_NORMAL - True - - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-save - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - _Save Theme... - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - - - - 0 - False - False - - - - - - True - True - GTK_RELIEF_NORMAL - True - - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-undo - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - _Revert - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - - - - 0 - False - False - - - - - 0 - False - True - - - - - 0 - True - True - - - - - - True - False - False - GTK_POS_TOP - False - False - - - - True - This theme does not suggest any particular font or background. - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - False - False - - - - - - True - label27 - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - True - False - 12 - - - - True - This theme suggests a font: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - Apply _Font - True - GTK_RELIEF_NORMAL - True - - - 0 - False - False - - - - - False - True - - - - - - True - label19 - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - True - False - 12 - - - - True - This theme suggests a background: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - Apply _Background - True - GTK_RELIEF_NORMAL - True - - - 0 - False - False - - - - - False - True - - - - - - True - label20 - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - True - False - 12 - - - - True - This theme suggests a font and a background: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - Apply _Font - True - GTK_RELIEF_NORMAL - True - - - 0 - True - True - - - - - - True - True - Apply _Background - True - GTK_RELIEF_NORMAL - True - - - 0 - False - False - - - - - False - True - - - - - - True - label21 - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - 0 - False - True - - - - - 0 - True - True - - - - - - - - 5 - Theme Details - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - False - - - - True - False - 2 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-help - True - GTK_RELIEF_NORMAL - True - -11 - - - - - - True - True - gtk-close - True - GTK_RELIEF_NORMAL - True - -7 - - - - - 0 - False - True - GTK_PACK_END - - - - - - 5 - True - True - True - True - GTK_POS_TOP - False - False - - - - 12 - True - False - 6 - - - - 60 - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - True - True - True - False - False - False - True - False - False - False - - - - - 0 - True - True - - - - - - True - False - 6 - - - - True - True - GTK_RELIEF_NORMAL - True - - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-add - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - _Install... - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - - - - 0 - False - False - - - - - - True - True - GTK_RELIEF_NORMAL - True - - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-delete - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - _Remove - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - - - - 0 - False - False - - - - - 0 - False - False - - - - - False - True - - - - - - True - Controls - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - 12 - True - False - 0 - - - - True - False - 6 - - - - True - gtk-dialog-info - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - True - - - - - - 245 - True - The current controls theme does not support color schemes - False - False - GTK_JUSTIFY_LEFT - True - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - 0 - False - True - - - - - - 12 - True - 4 - 3 - False - 12 - 12 - - - - True - _Input boxes: - True - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - base_colorbutton - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 2 - 3 - fill - - - - - - - True - _Selected items: - True - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - selected_bg_colorbutton - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 3 - 4 - fill - - - - - - - True - _Windows: - True - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - bg_colorbutton - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - Text - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 2 - 3 - 0 - 1 - fill - - - - - - - True - True - False - True - - - 1 - 2 - 2 - 3 - - - - - - - - True - True - False - True - - - 1 - 2 - 3 - 4 - - - - - - - - True - True - False - True - - - 2 - 3 - 2 - 3 - - - - - - - - True - True - False - True - - - 2 - 3 - 3 - 4 - - - - - - - - True - True - False - True - - - 2 - 3 - 1 - 2 - - - - - - - - True - True - False - True - - - 1 - 2 - 1 - 2 - - - - - - - - True - Background - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 0 - 1 - fill - fill - - - - - 0 - True - True - - - - - - True - GTK_BUTTONBOX_END - 0 - - - - True - True - True - gtk-revert-to-saved - True - GTK_RELIEF_NORMAL - True - - - - - 0 - False - False - - - - - False - True - - - - - - True - Colors - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - 12 - True - False - 6 - - - - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - False - False - False - True - False - False - False - - - - - 0 - True - True - - - - - - True - False - 6 - - - - True - True - GTK_RELIEF_NORMAL - True - - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-add - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - _Install... - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - - - - 0 - False - False - - - - - - True - True - GTK_RELIEF_NORMAL - True - - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-delete - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - _Remove - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - - - - 0 - False - False - - - - - 0 - False - False - - - - - False - True - - - - - - True - Window Border - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - 12 - True - False - 6 - - - - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - False - False - False - True - False - False - False - - - - - 0 - True - True - - - - - - True - False - 6 - - - - True - True - GTK_RELIEF_NORMAL - True - - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-add - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - _Install... - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - - - - 0 - False - False - - - - - - True - True - GTK_RELIEF_NORMAL - True - - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-delete - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - _Remove - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - - - - 0 - False - False - - - - - 0 - False - False - - - - - False - True - - - - - - True - Icons - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - 0 - True - True - - - - - - - - 6 - Save Theme As... - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - True - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - False - - - - True - False - 2 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - -6 - - - - - - True - True - True - True - gtk-save - True - GTK_RELIEF_NORMAL - True - -5 - - - - - 0 - False - True - GTK_PACK_END - - - - - - 6 - True - 3 - 2 - False - 6 - 12 - - - - True - True - True - True - 0 - - True - True - - - 1 - 2 - 0 - 1 - - - - - - - True - _Name: - True - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - save_dialog_entry - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - fill - - - - - - True - True - GTK_POLICY_NEVER - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - True - False - False - GTK_JUSTIFY_LEFT - GTK_WRAP_WORD - True - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - 1 - 2 - 1 - 2 - - - - - - True - _Description: - True - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0 - 0 - 0 - scrolledwindow1 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - fill - - - - - - True - True - Save _Background Image - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 1 - 2 - 2 - 3 - fill - - - - - - 0 - True - True - - - - - - - diff --git a/capplets/theme-switcher/theme-switcher-capplet.png b/capplets/theme-switcher/theme-switcher-capplet.png deleted file mode 100644 index 4ceb86de66c9277b907b79ed9d3ad098670ee9f2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 527 zcmV+q0`UEbP)W^00006VoOIv0RI60 z0RN!9r;`8x0mMl}K~#9!?U+A`!ax|sUqrA97CC{f2T;7g6rLf4H%OmD1n~@>Aw{s% zLJ-6%g@r^Rh6DxwfFQ_hwZp1$Gb@=mS>`oyX7Z6A$>)2M07^<+(jLaNB%G)|PK-t) z=(;Wit*+~6Hk+wy)wGjat(NqyQYmYXEAWql*J?Foha&AzNwvzm$$7b45Jgcj&QPf! zNfI;~4IGchr}Zd`(CKvelJk5%BaY+3Ze@}rsMqV*@Apq@i^bw)T~(G|*zI=ccDros zx^6iF$S@2B>$)xs!;l~RcDvodXF;d7%4V~{d_FG}{B%0ua5%8>dc9`zDmj$|Jp%eh zT~Rf^`}lM^O`UJI+xT=%W&pkO?wLo8re*&Zr3s+HV89J64Y;Ohuq=x~Q%cJL{u7i3 zTB=PJFL3GYP)RB0T^E&&iQ84K*DHb`5Jo$hOwjA~xX0lQLXg*m zecuNm1cVUyz7GH(gxnqTRBi!eSr$CcW1!!^MSbcJ9{HweVmKU@58U%Sn5HRjt2mCs zdb!{4%j4tA002t}0ssI2w=C_w00009a7bBm000XT z000XT0n*)m`~Uy|2XskIMF-OX1s63oCL;fN000M-Nkl%&2!RD7{@of1Syo# znKnh3D%6)zYGqVj)ETd8J>YorP7j^Yf1y3llYfDZQ~V#~>`@N|EKJc+TkG3crWELC z0|}6j{0?i^H3?~I2_V1kf!S;}+5PZ5&%Ut`&z?Q=dc9ykmCxr*Uaxm%W~SFI(MyFw z!KAV1=H?~<+ z;|5;%^XJc%O2uxst9&oowY9aiwY7!kgu`KU%j5CjCGpEc6SixvD2fzC!Gs_PtyZg6 zt9|6a|!A3(t|< zRk;NY(}f;UzX;{y>Ax=2Mg1mJarA#tXuy+>hl3|+9GXlfv)QauWnaF0>CS8$mz22x|23XP16 z{QUVdolcL8jL)9HlUXX5^D8qf3F+uP&g;{X7k z&zH~VXJ%&d`TW$>6iw3vK~$^N^XJch`}Qpm2=F|g%jJwlgw3on8)LJ^ytykr%zQ{kWQy(XJ@0)Xd;p5Jf8~T`1ttl?k=7~5QN!mK6UDp z#bN>2in~}W7K=rOVIq-;)oKL*P!t7MTZ@Z}a=cI|1OP~<(|BewnT*9^dO)@%^m@ID z8x5$}IdCnK$z&csevB@o(dgyNmmfTMfESpXn?tL%WHOn_WIFDyZRa!uK^T;zeK1^H zTtw-mrKLn7ar*RWyg)D*%;j>>r1D2PB?TM)`0=A7uSR}&>C&b9_wToR?eg++AP|r| z(m_cHKYsk!k;VSYmoHH|7!0njuLA%^M@Qu)-EMa%6hdstWHK6!9=!obQbLXUlLu;b zbrq$rUcIUww8xJhKYESrq}SR4_cy)AbaiRnYdfs){^P*z@%8K1DBba|LodSl`T6e0@p#9p=p|t+7DMxI0KoF{vL3bc zhOkg5NbnMggigx~y?PoI6$*trckbZxibNuzM+8Fkz=jJ83wZ45iU+z+_~gkG+&Sa% zxUP7hCxj@yw6vr*9_TV*GMU8vQ{$B2i0avBaplUD?o`zKIgQ>Le8R4dhrwVF?KLT` zA?o$|+S-~t-{EkaJ9qByD(xzv+wE5GJlEFNrl+TQo<})wxAy(}_Zu4YYPCj3N3UPM4v#hh?64!AuGi~*L8wKgQpw?PpnYeOB(Gh&M$DIP;s78w4laYiaPi_rk|g^&4vj{m!{LZTA`)klr17p2-NH|cNM74Vgy?*W_D66p zl_Ze*h!7~X@95ZXP34eR3wg3PC07*qoM6N<$f^kvrC;$Ke diff --git a/capplets/ui-properties/ChangeLog b/capplets/ui-properties/ChangeLog deleted file mode 100644 index 3090f17d0..000000000 --- a/capplets/ui-properties/ChangeLog +++ /dev/null @@ -1,374 +0,0 @@ -2007-04-27 Rodrigo Moya - - * gnome-ui-properties.desktop.in.in: renamed Bugzilla product. - -2007-02-08 Jens Granseuer - - * gnome-ui-properties.glade: change "Editable menu accelerators" to - "Editable menu shortcut keys" as per the style guide (Closes: #337624) - -2007-01-31 Jens Granseuer - - * gnome-ui-properties.c: (main): don't leak the references to the glade - dialog and GnomeProgram - -2006-08-07 Rodrigo Moya - - Fixes #348844 - - * gnome-ui-properties.desktop.in.in: fixed GNOME Bugzilla strings. - -2006-07-23 Sebastien Bacher - - * gnome-ui-properties.desktop.in.in: don't list the Application - category, patch by Vincent Fretin - (Closes: #344321) - -2005-07-24 Sebastien Bacher - - * gnome-ui-properties.glade: set the "is_important" property for one - of the buttons, so the label is showed for the "Text beside icons" mode - (Closes: #308845). - -2005-01-13 Sebastien Bacher - - * gnome-ui-properties.c: (setup_dialog): - * gnome-ui-properties.glade: - patch from Christian - Manny Calavera - Neumair , - add an option in the UI to activate menus accelators changes - (Closes: #148013). - -2005-01-02 Sebastien Bacher - - * gnome-ui-properties.glade: - patch from Heikki Paajanen (based on the patch - from Andrew Johnson ) - to not set "close" as the default button (Closes: #98202). - -2004-11-09 Mark McLoughlin - - * Makefile.am: install .desktop file in $(datadir)/applications - - * gnome-ui-properties.desktop.in: add OnlyShowIn=GNOME; - -2004-10-14 Jody Goldberg - - * Release 2.8.1 - -2004-08-20 Frederic Crozat - - * gnome-ui-properties.c: (setup_dialog): - Use themed icon for window hint. - -2004-04-15 Jody Goldberg - - * Release 2.6.1 - -2004-04-01 Jody Goldberg - - * Release 2.6.0.3 - -2004-03-30 Jody Goldberg - - * Release 2.6.0.1 - -2004-03-23 Jody Goldberg - - * Release 2.6.0 - -2004-03-11 Jody Goldberg - - * Release 2.5.4 - -2004-02-13 Jody Goldberg - - * Release 2.5.3 - -2004-02-12 Mark McLoughlin - - * gnome-ui-properties.c: (dialog_button_clicked_cb): Update help link - to point to user-guide.xml - -2004-01-14 Jody Goldberg - - * Release 2.5.2 - -2003-12-30 Jody Goldberg - - * Release 2.5.1.1 - -2003-12-30 Rodney Dawes - - * gnome-ui-properties.glade: Fix border width of example toolbar, - fixes #130064 - -2003-12-30 Jody Goldberg - - * Release 2.5.1 - -2003-10-28 Jody Goldberg - - * Release 2.5.0 - -2003-08-01 Dennis Cranston - - * gnome-ui-properties.glade: Patch to fix spacing between action - area and vbox of preferences dialog. - -2003-07-18 Dennis Cranston - - * gnome-ui-properties.c, gnome-ui-properties.glade: - Apply patch from Christian - Manny Calavera - Neumair - for ui-review bug # 99537. - -2003-07-11 Dennis Cranston - - * gnome-ui-properties.glade: UI-Review fixes for bug - report #99537. - -2003-07-07 Jody Goldberg - - * Release 2.3.4 - -2003-06-24 Jody Goldberg - - * Release 2.3.3 - -2003-05-07 Jody Goldberg - - * Release 2.3.1 - -2003-05-05 Kjartan Maraas - - * gnome-ui-properties.c: Fix for both-horiz property - with eggtoolbar and bonobo. Fixes bug #104979. - -Tue Feb 4 17:09:18 2003 Jonathan Blandford - - * Release 2.2.0.1 - -Tue Jan 21 01:15:14 2003 Jonathan Blandford - - * Release 2.2.0 - -Thu Jan 16 02:41:09 2003 Jonathan Blandford - - * Release 2.1.7 - -2003-01-10 Jody Goldberg - - * Release 2.1.6 - -2002-12-18 Jody Goldberg - - * Release 2.1.5 - -2002-11-23 Jody Goldberg - - * Release 2.1.3 - -2002-11-02 Jody Goldberg - - * Release 2.1.2 - -2002-10-21 Jody Goldberg - - * Release 2.1.1 - -2002-10-01 Jody Goldberg - - * Release 2.1.0.1 - -2002-10-01 Jody Goldberg - - * gnome-ui-properties.glade : avoid conflicting mnemonics - * gnome-ui-properties.c (set_have_icons) : the menus no longer have - images, silence the warnings. - -2002-09-10 Jody Goldberg - - http://bugzilla.gnome.org/show_bug.cgi?id=76419 - * gnome-ui-properties.glade : tweak layout slightly - -2002-08-23 Jody Goldberg - - * gnome-ui-properties.glade : Priority text was a bonobo-ism. - This is really 'text beside icon' - -2002-08-21 Jody Goldberg - - * Release 2.1.0 - -2002-08-19 Ross Burton - - * behavior.desktop.in: Fix the desktop file so that it validates. - -2002-07-17 Jody Goldberg - - * gnome-ui-properties.glade : Use stock names - and a 2nd menu item, as per ui-review - -2002-06-17 Jody Goldberg - - * Release 2.0.0 - -2002-05-29 Jody Goldberg - - http://bugzilla.gnome.org/show_bug.cgi?id=82802 - * gnome-ui-properties.c (setup_dialog) : disable resize. - -2002-05-28 Satyajit Kanungo - - * gnome-ui-properties.c : Changed the help file link - to get the help document from user-guide. - -2002-05-26 Jody Goldberg - - * gnome-ui-properties.c (dialog_button_clicked_cb) : Improve handling - of help failures. - -Sun May 26 11:37:08 2002 Jonathan Blandford - - * gnome-ui-properties.c (main): use APPID instead of argv[0] - -2002-05-14 Michael Meeks - - * gnome-ui-properties.c - (toolbar_to_widget, set_toolbar_style): tolerate - bogus values sanely. - Update string to describe bonobo priority text - -2002-05-09 Jody Goldberg - - * gnome-ui-properties.glade : add a help button. - * gnome-ui-properties.c (dialog_button_clicked_cb) : ditto. - -2002-05-06 jacob berkman - - * ui-properties.glade.h: remove unused file - -2002-05-06 Anders Carlsson - - * gnome-ui-properties.c: (create_dialog): - Fix the support for both_horiz as the toolbar style. - - * gnome-ui-properties.glade: - Re-add all option menu items; Somehow they got lost. - -2002-04-29 Kjartan Maraas - - * ui-properties.glade: Remove translatable="yes" for a wrong case. - -2002-04-25 Seth Nickell - - * behavior.desktop.in: - - Move out of advanced, add nicer tooltip (still crummy, but better). - -2002-04-25 Jody Goldberg - - * gnome-ui-properties.c (set_toolbar_style) : Add GTK_TOOLBAR_BOTH_HORIZ - -2002-04-10 Seth Nickell - - * gnome-ui-properties.glade: - - Change "Menu items have icons" to "Menu items can have icons" - -2002-04-02 Jody Goldberg - - * gnome-ui-properties.c (setup_dialog) : suppress warnings. - -2002-04-10 Seth Nickell - - * gnome-ui-properties.c: (create_dialog): - * gnome-ui-properties.glade: - * ui-properties.glade: - - Somebody started rennaming the glade file but didn't follow - through. Fixing the build by finishing the change. - -2002-03-21 Lauris Kaplinski - - * gnome-ui-properties.c (toolbar_to_widget): Check GConf value type - -2002-03-21 Dave Camp - - * gnome-ui-properties.c: (show_handlebar), (set_toolbar_style), - (toolbar_style_cb), (set_have_icons): New functions. - (toolbar_detachable_cb): Call show_handlebar. - (menus_have_icons_cb): Call set_have_icons. - (setup_dialog): Connect to the style peditor's value_changed signal, - and set the initial states of the example widgets. - -2002-03-19 Richard Hestilow - - * gnome-ui-properties.c (*_to/from_widget): Convert to new signature. - -2002-02-27 Kjartan Maraas - - * main.c: s/PACKAGE/GETTEXT_PACKAGE/g - * gnome-ui-properties.c: Same here. - -2002-02-10 Richard Hestilow - - * gnome-ui-properties.c (main): Create changeset. - -2002-02-10 Richard Hestilow - - * Make dialog Apply/Close. - -2002-02-04 Lauris Kaplinski - - * gnome-ui-properties.c (dialog_button_clicked_cb): Use GtkDialog - -2002-02-01 Seth Nickell - - * behavior-capplet.png: - - Change to Jimmac's alternate behavior icon. - -Mon Jan 28 22:18:34 2002 Jonathan Blandford - - * gnome-ui-properties.c (create_dialog): install globally - -Mon Jan 28 22:09:30 2002 Jonathan Blandford - - * gnome-ui-properties.c: completely rethink this dialog - -2002-01-27 Seth Nickell - - * behavior.desktop.in: - - Add Categories field. - -2002-01-14 Bradford Hovinen - - * Makefile.am: Update - - * main.c (main): Remove Ximian archiver stuff - -2002-01-14 Richard Hestilow - - * Gnome 2 port. (Settings only halfway work right now.) - -2001-09-29 Richard Hestilow - - * prefs-widget.c (prefs_widget_set_arg): Register - callbacks after loading the preferences; otherwise they will - get triggered unnecessarily. - (selected_cb): Only trigger a change if there really was one. - Fixes bug #9161. - -2001-07-27 Bradford Hovinen - - * RELEASE : 1.5.2 - -2001-07-20 Chema Celorio - - * RELEASE : 1.5.0 - -2001-07-19 Chema Celorio - - * Makefile.am (cappletname): distcheck fixes - diff --git a/capplets/ui-properties/Makefile.am b/capplets/ui-properties/Makefile.am deleted file mode 100644 index c741277ba..000000000 --- a/capplets/ui-properties/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -# This is used in GNOMECC_CAPPLETS_CFLAGS -cappletname = ui - -bin_PROGRAMS = gnome-ui-properties - -gnome_ui_properties_LDADD = $(GNOMECC_CAPPLETS_LIBS) -gnome_ui_properties_SOURCES = \ - gnome-ui-properties.c - -@INTLTOOL_DESKTOP_RULE@ - -desktopdir = $(datadir)/applications -Desktop_in_files = gnome-ui-properties.desktop.in -desktop_DATA = $(Desktop_in_files:.desktop.in=.desktop) - -Gladedir = $(pkgdatadir)/glade -Glade_DATA = gnome-ui-properties.glade - -INCLUDES = \ - $(GNOMECC_CAPPLETS_CFLAGS) \ - -DGNOMELOCALEDIR="\"$(datadir)/locale\"" \ - -DGNOMECC_DATA_DIR="\"$(pkgdatadir)\"" \ - -DGNOMECC_GLADE_DIR="\"$(pkgdatadir)/glade\"" -CLEANFILES = $(GNOMECC_CAPPLETS_CLEANFILES) $(Desktop_in_files) $(desktop_DATA) -EXTRA_DIST = $(Glade_DATA) diff --git a/capplets/ui-properties/gnome-ui-properties.c b/capplets/ui-properties/gnome-ui-properties.c deleted file mode 100644 index aefe23432..000000000 --- a/capplets/ui-properties/gnome-ui-properties.c +++ /dev/null @@ -1,313 +0,0 @@ -/* gnome-ui-properties.c - * Copyright (C) 2002 Jonathan Blandford - * - * Written by: Jonathan Blandford - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#include -#include -#include - -#include "capplet-util.h" -#include "gconf-property-editor.h" - -enum -{ - RESPONSE_APPLY = 1, - RESPONSE_CLOSE -}; - -static GConfEnumStringPair toolbar_style_enums[] = { - { 0, "both" }, - { 1, "both-horiz" }, - { 2, "icons" }, - { 3, "text" }, - { -1, NULL } -}; - -static GConfValue * -toolbar_from_widget (GConfPropertyEditor *peditor, GConfValue *value) -{ - GConfValue *new_value; - - new_value = gconf_value_new (GCONF_VALUE_STRING); - gconf_value_set_string (new_value, - gconf_enum_to_string (toolbar_style_enums, gconf_value_get_int (value))); - - return new_value; -} - -static GConfValue * -toolbar_to_widget (GConfPropertyEditor *peditor, GConfValue *value) -{ - GConfValue *new_value; - const gchar *str; - gint val = 2; - - str = (value && (value->type == GCONF_VALUE_STRING)) ? gconf_value_get_string (value) : NULL; - new_value = gconf_value_new (GCONF_VALUE_INT); - if (!gconf_string_to_enum (toolbar_style_enums, str, &val)) - val = 0; - gconf_value_set_int (new_value, val); - - return new_value; -} - - -static void -dialog_button_clicked_cb (GtkDialog *dialog, gint response_id, GConfChangeSet *changeset) -{ - if (response_id == GTK_RESPONSE_HELP) - capplet_help (GTK_WINDOW (dialog), - "user-guide.xml", - "goscustuserinter-2"); - else - gtk_main_quit (); -} - -static GladeXML * -create_dialog (void) -{ - GladeXML *dialog; - - dialog = glade_xml_new (GNOMECC_GLADE_DIR "/gnome-ui-properties.glade", "gnome_ui_properties_dialog", NULL); - return dialog; -} - -static void -show_handlebar (GladeXML *dialog, gboolean show) -{ - GtkWidget *handlebox; - GtkWidget *toolbar; - GtkWidget *align; - - handlebox = WID ("toolbar_handlebox"); - toolbar = WID ("toolbar_toolbar"); - align = WID ("toolbar_align"); - - g_object_ref (handlebox); - g_object_ref (toolbar); - - if (GTK_BIN (align)->child) - gtk_container_remove (GTK_CONTAINER (align), GTK_BIN (align)->child); - if (GTK_BIN (handlebox)->child) - gtk_container_remove (GTK_CONTAINER (handlebox), GTK_BIN (handlebox)->child); - if (show) - { - gtk_container_add (GTK_CONTAINER (align), handlebox); - gtk_container_add (GTK_CONTAINER (handlebox), toolbar); - g_object_unref (handlebox); - } - else - { - gtk_container_add (GTK_CONTAINER (align), toolbar); - } - g_object_unref (toolbar); - - -} - -static void -set_toolbar_style (GladeXML *dialog, const char *value) -{ - static const GtkToolbarStyle gtk_toolbar_styles[] = - { GTK_TOOLBAR_BOTH, GTK_TOOLBAR_BOTH_HORIZ, GTK_TOOLBAR_ICONS, GTK_TOOLBAR_TEXT }; - - int enum_val; - - if (!gconf_string_to_enum (toolbar_style_enums, value, &enum_val)) - enum_val = 0; - - gtk_toolbar_set_style (GTK_TOOLBAR (WID("toolbar_toolbar")), - gtk_toolbar_styles[enum_val]); -} - -static void -toolbar_detachable_cb (GConfPropertyEditor *peditor, - gchar *key, - GConfValue *value, - GladeXML *dialog) -{ - show_handlebar (dialog, gconf_value_get_bool (value)); -} - -static void -toolbar_style_cb (GConfPropertyEditor *peditor, - gchar *key, - GConfValue *value, - GladeXML *dialog) -{ - set_toolbar_style (dialog, gconf_value_get_string (value)); -} - -static void -set_have_icons (GladeXML *dialog, gboolean value) -{ - static char *menu_item_names[] = - { - "menu_item_1", - "menu_item_2", - "menu_item_3", - "menu_item_4", - "menu_item_5", - "cut1", - "copy1", - "paste1", - NULL - }; - - char **name; - - for (name = menu_item_names; *name != NULL; name++) - { - GtkImageMenuItem *item = GTK_IMAGE_MENU_ITEM (WID (*name)); - GtkWidget *image; - if (value) - { - image = g_object_get_data (G_OBJECT (item), "image"); - if (image) - { - gtk_image_menu_item_set_image (item, image); - g_object_unref (image); - } - } - else - { - image = gtk_image_menu_item_get_image (item); - g_object_set_data (G_OBJECT (item), "image", image); - g_object_ref (image); - gtk_image_menu_item_set_image (item, NULL); - } - } -} - -static void -menus_have_icons_cb (GConfPropertyEditor *peditor, - gchar *key, - GConfValue *value, - GladeXML *dialog) -{ - set_have_icons (dialog, gconf_value_get_bool (value)); -} - -static gint -button_press_blocker (GtkWidget *toolbar, - GdkEvent *event, - gpointer data) -{ - return TRUE; -} - -static void -setup_dialog (GladeXML *dialog, GConfChangeSet *changeset) -{ - GtkWidget *widget; - GObject *peditor; - char *toolbar_style; - GConfClient *client = gconf_client_get_default (); - - peditor = gconf_peditor_new_boolean - (changeset, "/desktop/gnome/interface/toolbar_detachable", WID ("detachable_toolbars_toggle"), NULL); - g_signal_connect (peditor, - "value_changed", - G_CALLBACK (toolbar_detachable_cb), dialog); - - peditor = gconf_peditor_new_boolean - (changeset, "/desktop/gnome/interface/can_change_accels", WID ("menu_accel_toggle"), NULL); - - peditor = gconf_peditor_new_boolean - (changeset, "/desktop/gnome/interface/menus_have_icons", WID ("menu_icons_toggle"), NULL); - g_signal_connect (peditor, - "value_changed", - G_CALLBACK (menus_have_icons_cb), dialog); - - set_have_icons (dialog, - gconf_client_get_bool (client, - "/desktop/gnome/interface/menus_have_icons", - NULL)); - - peditor = gconf_peditor_new_select_menu - (changeset, "/desktop/gnome/interface/toolbar_style", WID ("toolbar_style_omenu"), - "conv-to-widget-cb", toolbar_to_widget, - "conv-from-widget-cb", toolbar_from_widget, - NULL); - g_signal_connect (peditor, - "value_changed", - G_CALLBACK (toolbar_style_cb), dialog); - - widget = WID ("toolbar_handlebox"); - g_signal_connect (G_OBJECT (widget), - "button_press_event", - G_CALLBACK (button_press_blocker), NULL); - - widget = WID ("gnome_ui_properties_dialog"); - g_signal_connect (G_OBJECT (widget), - "response", - G_CALLBACK (dialog_button_clicked_cb), changeset); - - show_handlebar (dialog, - gconf_client_get_bool (client, - "/desktop/gnome/interface/toolbar_detachable", - NULL)); - - toolbar_style = gconf_client_get_string (client, - "/desktop/gnome/interface/toolbar_style", - NULL); - g_object_unref (client); - - set_toolbar_style (dialog, toolbar_style); - - g_free (toolbar_style); - - gtk_window_set_resizable (GTK_WINDOW (widget), FALSE); - capplet_set_icon (widget, "gnome-settings-ui-behavior"); - gtk_widget_show_all (widget); -} - -int -main (int argc, char **argv) -{ - GnomeProgram *program; - GConfClient *client; - GConfChangeSet *changeset = NULL; - GladeXML *dialog; - - bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); - bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); - textdomain (GETTEXT_PACKAGE); - - program = gnome_program_init ("gnome-ui-properties", VERSION, - LIBGNOMEUI_MODULE, argc, argv, - GNOME_PARAM_APP_DATADIR, GNOMECC_DATA_DIR, - NULL); - - client = gconf_client_get_default (); - gconf_client_add_dir (client, "/desktop/gnome/interface", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); - g_object_unref (client); - dialog = create_dialog (); - setup_dialog (dialog, changeset); - gtk_main (); - - g_object_unref (dialog); - g_object_unref (program); - return 0; -} diff --git a/capplets/ui-properties/gnome-ui-properties.desktop.in.in b/capplets/ui-properties/gnome-ui-properties.desktop.in.in deleted file mode 100644 index deff61d70..000000000 --- a/capplets/ui-properties/gnome-ui-properties.desktop.in.in +++ /dev/null @@ -1,15 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -_Name=Menus & Toolbars -_Comment=Customize the appearance of toolbars and menubars in applications -Exec=gnome-ui-properties -Icon=gnome-settings-ui-behavior -Terminal=false -Type=Application -StartupNotify=true -Categories=GNOME;GTK;Settings;DesktopSettings; -OnlyShowIn=GNOME; -X-GNOME-Bugzilla-Bugzilla=GNOME -X-GNOME-Bugzilla-Product=gnome-control-center -X-GNOME-Bugzilla-Component=other capplets -X-GNOME-Bugzilla-Version=@VERSION@ diff --git a/capplets/ui-properties/gnome-ui-properties.glade b/capplets/ui-properties/gnome-ui-properties.glade deleted file mode 100644 index 6827c5421..000000000 --- a/capplets/ui-properties/gnome-ui-properties.glade +++ /dev/null @@ -1,709 +0,0 @@ - - - - - - - 5 - Menu and Toolbar Preferences - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - 400 - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - - - - True - False - 2 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-help - True - GTK_RELIEF_NORMAL - True - -11 - - - - - - True - True - True - gtk-close - True - GTK_RELIEF_NORMAL - True - 2 - - - - - 0 - False - True - GTK_PACK_END - - - - - - 5 - True - False - 18 - - - - True - False - 6 - - - - True - <b>Behavior and Appearance</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 0 - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 6 - - - - True - True - Show _icons in menus - True - GTK_RELIEF_NORMAL - True - True - False - True - - - 0 - False - False - - - - - - True - True - _Editable menu shortcut keys - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - _Detachable toolbars - True - GTK_RELIEF_NORMAL - True - True - False - True - - - 0 - False - False - - - - - - True - False - 12 - - - - True - Toolbar _button labels: - True - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - toolbar_style_omenu - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - 0 - - - - True - - - - True - Text below icons - True - - - - - - True - Text beside icons - True - - - - - - True - Icons only - True - - - - - - True - Text only - True - - - - - - - - 0 - False - False - - - - - 0 - False - False - - - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - True - False - 6 - - - - True - <b>Preview</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 0 - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 0 - - - - True - - - - True - _File - True - - - - - - - True - _New - True - - - - - True - gtk-new - 1 - 0.5 - 0.5 - 0 - 0 - - - - - - - - True - _Open - True - - - - - True - gtk-open - 1 - 0.5 - 0.5 - 0 - 0 - - - - - - - - True - _Save - True - - - - True - gtk-save - 1 - 0.5 - 0.5 - 0 - 0 - - - - - - - - True - - - - - - True - _Print - True - - - - True - gtk-print - 1 - 0.5 - 0.5 - 0 - 0 - - - - - - - - True - - - - - - True - _Quit - True - - - - True - gtk-quit - 1 - 0.5 - 0.5 - 0 - 0 - - - - - - - - - - - - True - _Edit - True - - - - - - - - True - C_ut - True - - - - - True - gtk-cut - 1 - 0.5 - 0.5 - 0 - 0 - - - - - - - - True - _Copy - True - - - - - True - gtk-copy - 1 - 0.5 - 0.5 - 0 - 0 - - - - - - - - True - _Paste - True - - - - - True - gtk-paste - 1 - 0.5 - 0.5 - 0 - 0 - - - - - - - - - - - 0 - False - False - - - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 0 - 0 - - - - True - GTK_SHADOW_OUT - GTK_POS_LEFT - GTK_POS_TOP - - - - True - GTK_ORIENTATION_HORIZONTAL - GTK_TOOLBAR_BOTH - True - True - - - - True - New File - gtk-new - True - True - True - - - False - True - - - - - - True - Open File - gtk-open - True - True - False - - - False - True - - - - - - True - Save File - gtk-save - True - True - False - - - False - True - - - - - - - - - 0 - False - True - - - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - - diff --git a/capplets/ui-properties/gnome-warning.png b/capplets/ui-properties/gnome-warning.png deleted file mode 100644 index 5c533b2491decd94994fce06b4117087b806884f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 771 zcmV+e1N{7nP){4-Ou6%-3D zBw|#s%L+kV6cHDK8>JhUS#{x7a4lU}x@h<9M%)$`B_j1tF%bWYiJeT8nasQQxJZR4 zL)5wv&-(s8{O;kvXETp$<-#AsrD%G3`s1<2m*w>{qrHD!tQOC2OQYOcZ|%FVr?pc2 zZ{X7PcG&9;yB6Eb+-PMt{}=eURuT`VW}5zNV(oMJ`gY6zwitA&Q^u?X#>nQm zc9_;dO#h^?anjJAv*UXT@o~U?5cqJsWEO({IOnxucEkSDb?#eFX-G^hiB62=+~9kI zKMxd%MGnp`hws+!H{A7}g}M?D1`b%hi0sIYG(JX$m30IU72^EEOwTRE8gJMuI0Ka) zA$CG>Sg4E`8OcQ_fxhTuK@H_@!^;-zti@O(s2HMDs9&dC58>K_@$)hZs@f)GHCMW{HjoFM} zuQaJIDM42v#W6!~!K6cRH07L2UmLO-yg6R^=1$9BZ6un+T>?fZ3<^=V(C|vBxbkIH z0fZ;lJb(VvzW>wn#^kf*>^8i0oIgBTy7wdtzjqm#=yNtHIpgxPVq!6pH-aUI%1Q@C zP@tt+Rb>Zo2hcYf0!~D>h{!fz5U55Xm00MBAa6yAfYnujw$fY*{(=ws3lQE00Z5X> zv|23-7!h$Il8Q*=y-)vJ)9ai99++3vMknjjn^(73)E(N5Y(M}2002ovPDHLkV1f|7 BV&4D& diff --git a/capplets/ui-properties/preferences.h b/capplets/ui-properties/preferences.h deleted file mode 100644 index 98645ff7d..000000000 --- a/capplets/ui-properties/preferences.h +++ /dev/null @@ -1,156 +0,0 @@ -/* -*- mode: c; style: linux -*- */ - -/* preferences.h - * Copyright (C) 2000 Helix Code, Inc. - * - * Written by Bradford Hovinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -#ifndef __PREFERENCES_H -#define __PREFERENCES_H - -#include -#include - -#define PREFERENCES(obj) GTK_CHECK_CAST (obj, preferences_get_type (), Preferences) -#define PREFERENCES_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, preferences_get_type (), PreferencesClass) -#define IS_PREFERENCES(obj) GTK_CHECK_TYPE (obj, preferences_get_type ()) - -typedef struct _Preferences Preferences; -typedef struct _PreferencesClass PreferencesClass; - -struct _Preferences -{ - GtkObject object; - - gint frozen; - guint timeout_id; - - struct { - enum { DEFAULT, SPREAD, EDGE, START, END } dialog_buttons_style; - gboolean dialog_icons; - gboolean dialog_centered; - GtkWindowPosition dialog_position; - GtkWindowType dialog_type; - gboolean menus_show_icons; - gboolean menus_have_tearoff; - gboolean toolbar_labels; - gboolean toolbar_detachable; - gboolean toolbar_relief; - gboolean toolbar_separator; - gboolean toolbar_popup; - gboolean menubar_detachable; - gboolean menubar_relief; - gboolean statusbar_meter_on_right; - gboolean statusbar_is_interactive; - GnomeMDIMode mdi_mode; - GtkPositionType mdi_tab_pos; - } gnome_prefs; -}; - -struct _PreferencesClass -{ - GtkObjectClass klass; -}; - -GType preferences_get_type (void); - -GtkObject *preferences_new (void); -GtkObject *preferences_clone (Preferences *prefs); -void preferences_destroy (GtkObject *object); - -void preferences_load (Preferences *prefs); -void preferences_save (Preferences *prefs); -void preferences_changed (Preferences *prefs); -void preferences_apply_now (Preferences *prefs); - -void preferences_freeze (Preferences *prefs); -void preferences_thaw (Preferences *prefs); - -/* get/set functions. It's really stupid that we need these */ - -int preferences_get_menubar_detachable (Preferences *prefs); -int preferences_get_menubar_relief (Preferences *prefs); -int preferences_get_menus_have_tearoff (Preferences *prefs); -int preferences_get_menus_have_icons (Preferences *prefs); - -int preferences_get_statusbar_is_interactive (Preferences *prefs); -int preferences_get_statusbar_meter_on_left (Preferences *prefs); -int preferences_get_statusbar_meter_on_right (Preferences *prefs); - -int preferences_get_toolbar_detachable (Preferences *prefs); -int preferences_get_toolbar_relief (Preferences *prefs); -int preferences_get_toolbar_icons_only (Preferences *prefs); -int preferences_get_toolbar_text_below (Preferences *prefs); - -int preferences_get_dialog_icons (Preferences *prefs); -int preferences_get_dialog_centered (Preferences *prefs); - -GtkWindowPosition preferences_get_dialog_position (Preferences *prefs); -GtkWindowType preferences_get_dialog_type (Preferences *prefs); -int preferences_get_dialog_buttons_style (Preferences *prefs); - -GnomeMDIMode preferences_get_mdi_mode (Preferences *prefs); -GtkPositionType preferences_get_mdi_tab_pos (Preferences *prefs); - -#if 0 -int preferences_get_property_box_buttons_ok (Preferences *prefs); -int preferences_get_property_box_buttons_apply (Preferences *prefs); -int preferences_get_property_box_buttons_close (Preferences *prefs); -int preferences_get_property_box_buttons_help (Preferences *prefs); -int preferences_get_disable_imlib_cache (Preferences *prefs); -#endif - - - - - - -void preferences_set_menubar_detachable (Preferences *prefs, int i); -void preferences_set_menubar_relief (Preferences *prefs, int i); -void preferences_set_menus_have_tearoff (Preferences *prefs, int i); -void preferences_set_menus_have_icons (Preferences *prefs, int i); - -void preferences_set_statusbar_is_interactive (Preferences *prefs, int i); -void preferences_set_statusbar_meter_on_left (Preferences *prefs, int i); -void preferences_set_statusbar_meter_on_right (Preferences *prefs, int i); - -void preferences_set_toolbar_detachable (Preferences *prefs, int i); -void preferences_set_toolbar_relief (Preferences *prefs, int i); -void preferences_set_toolbar_icons_only (Preferences *prefs, int i); -void preferences_set_toolbar_text_below (Preferences *prefs, int i); - -void preferences_set_dialog_icons (Preferences *prefs, int i); -void preferences_set_dialog_centered (Preferences *prefs, int i); - -void preferences_set_dialog_position (Preferences *prefs, int i); -void preferences_set_dialog_type (Preferences *prefs, int i); -void preferences_set_dialog_buttons_style (Preferences *prefs, int i); - -void preferences_set_mdi_mode (Preferences *prefs, int i); -void preferences_set_mdi_tab_pos (Preferences *prefs, int i); - -#if 0 -void preferences_set_property_box_buttons_ok (Preferences *prefs, int i); -void preferences_set_property_box_buttons_apply (Preferences *prefs, int i); -void preferences_set_property_box_buttons_close (Preferences *prefs, int i); -void preferences_set_property_box_buttons_help (Preferences *prefs, int i); -void preferences_set_disable_imlib_cache (Preferences *prefs, int i); -#endif - -#endif /* __PREFERENCES_H */