add capplets/appearance/gnome-theme-package.xml to generated files

2007-06-05  Jens Granseuer  <jensgr@gmx.net>

	* configure.in: add capplets/appearance/gnome-theme-package.xml
	to generated files

	* capplets/appearance/Makefile.am:
	* capplets/appearance/gnome-theme-package.xml.in: move theme
	package mime type over from the theme-manager (closes bug #444336)

svn path=/trunk/; revision=7693
This commit is contained in:
Jens Granseuer 2007-06-05 18:32:05 +00:00 committed by Jens Granseuer
parent 9fac3c0c5a
commit f5fe47e66e
6 changed files with 95 additions and 29 deletions

View file

@ -1,3 +1,8 @@
2007-06-05 Jens Granseuer <jensgr@gmx.net>
* configure.in: add capplets/appearance/gnome-theme-package.xml
to generated files
2007-06-05 Ross Burton <ross@openedhand.com>
* configure.in:

View file

@ -1,3 +1,9 @@
2007-06-05 Jens Granseuer <jensgr@gmx.net>
* Makefile.am:
* gnome-theme-package.xml.in: move theme package mime type over
from the theme-manager (closes bug #444336)
2007-06-04 Jens Granseuer <jensgr@gmx.net>
* appearance-desktop.c: (desktop_init), (desktop_shutdown):

View file

@ -28,41 +28,58 @@ gnome_appearance_properties_SOURCES = \
wp-cellrenderer.h
gnome_appearance_properties_LDADD = \
$(GNOMECC_CAPPLETS_LIBS) \
$(FONT_CAPPLET_LIBS) \
$(METACITY_LIBS) \
$(top_builddir)/libwindow-settings/libgnome-window-settings.la \
$(GNOMECC_CAPPLETS_LIBS) \
$(FONT_CAPPLET_LIBS) \
$(METACITY_LIBS) \
$(top_builddir)/libwindow-settings/libgnome-window-settings.la \
$(top_builddir)/capplets/common/libcommon.la
gnome_appearance_properties_LDFLAGS = -export-dynamic
@INTLTOOL_DESKTOP_RULE@
gladedir = $(pkgdatadir)/glade
glade_DATA = appearance.glade
dist_glade_DATA = appearance.glade
pixmapdir = $(pkgdatadir)/pixmaps
pixmap_DATA = \
theme-thumbnailing.png \
subpixel-bgr.png \
subpixel-rgb.png \
dist_pixmap_DATA = \
theme-thumbnailing.png \
subpixel-bgr.png \
subpixel-rgb.png \
subpixel-vbgr.png \
subpixel-vrgb.png
wallpaperdir = $(datadir)/gnome-background-properties
@INTLTOOL_DESKTOP_RULE@
desktopdir = $(datadir)/applications
desktop_in_files = gnome-appearance-properties.desktop.in
desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
INCLUDES = \
$(METACITY_CFLAGS) \
$(GNOMECC_CAPPLETS_CFLAGS) \
@INTLTOOL_XML_RULE@
xml_in_files = gnome-theme-package.xml.in
mimedir = $(datadir)/mime/packages
mime_DATA = $(xml_in_files:.xml.in=.xml)
INCLUDES = \
$(METACITY_CFLAGS) \
$(GNOMECC_CAPPLETS_CFLAGS) \
$(FONT_CAPPLET_CFLAGS) \
-DGNOMELOCALEDIR="\"$(datadir)/locale\"" \
-DGNOMECC_DATA_DIR="\"$(pkgdatadir)\"" \
-DGNOMECC_GLADE_DIR="\"$(gladedir)\"" \
-DGNOMECC_PIXMAP_DIR="\"$(pixmapdir)\"" \
-DGNOMELOCALEDIR="\"$(datadir)/locale\"" \
-DGNOMECC_DATA_DIR="\"$(pkgdatadir)\"" \
-DGNOMECC_GLADE_DIR="\"$(gladedir)\"" \
-DGNOMECC_PIXMAP_DIR="\"$(pixmapdir)\"" \
-DWALLPAPER_DATADIR="\"$(wallpaperdir)\""
CLEANFILES = $(GNOMECC_CAPPLETS_CLEANFILES) $(desktop_in_files) $(desktop_DATA)
EXTRA_DIST = $(glade_DATA) $(pixmap_DATA)
CLEANFILES = $(GNOMECC_CAPPLETS_CLEANFILES) $(desktop_in_files) $(desktop_DATA) $(mime_DATA)
EXTRA_DIST = $(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

View file

@ -78,7 +78,8 @@ find_in_model (GtkTreeModel *model, const gchar *value, gint column, GtkTreeIter
g_free (test);
if (!cmp) {
*hit = iter;
if (hit)
*hit = iter;
return TRUE;
}
}
@ -152,9 +153,13 @@ theme_selection_changed_cb (GtkWidget *icon_view, AppearanceData *data)
static void
theme_custom_cb (GtkWidget *button, AppearanceData *data)
{
GtkWidget *w, *parent;
GtkWidget *w, *parent, *icon_view;
w = glade_xml_get_widget (data->xml, "theme_details");
parent = glade_xml_get_widget (data->xml, "appearance_window");
icon_view = glade_xml_get_widget (data->xml, "themes_list");
/* select the "custom" metatheme */
theme_set_custom_from_selected (icon_view, data);
gtk_window_set_transient_for (GTK_WINDOW (w), GTK_WINDOW (parent));
gtk_widget_show_all (w);
@ -203,13 +208,33 @@ theme_queue_for_thumbnail (GnomeThemeMetaInfo *theme, AppearanceData *data)
data->theme_queue = g_slist_append (data->theme_queue, theme);
}
static GnomeThemeMetaInfo *
theme_get_selected (GtkIconView *icon_view)
{
GnomeThemeMetaInfo *theme = NULL;
GList *selected = gtk_icon_view_get_selected_items (icon_view);
if (selected) {
theme = selected->data;
g_list_foreach (selected, gtk_tree_path_free, NULL);
g_list_free (selected);
}
return theme;
}
static void
theme_add_custom (GtkIconView *icon_view, GnomeThemeMetaInfo *info, AppearanceData *data)
theme_set_custom_from_selected (GtkIconView *icon_view, AppearanceData *data)
{
GnomeThemeMetaInfo *custom = data->theme_custom;
GnomeThemeMetaInfo *theme = theme_get_selected (icon_view);
if (theme == custom)
return;
/* if info is not NULL, we'll copy those theme settings over */
if (info != NULL) {
if (theme != NULL) {
g_free (custom->gtk_theme_name);
g_free (custom->icon_theme_name);
g_free (custom->metacity_theme_name);
@ -240,11 +265,14 @@ theme_add_custom (GtkIconView *icon_view, GnomeThemeMetaInfo *info, AppearanceDa
custom->gtk_color_scheme = get_default_string_from_key (data->client, COLOR_SCHEME_KEY);
}
gtk_list_store_insert_with_values (data->theme_store, NULL, 0,
COL_LABEL, custom->readable_name,
COL_NAME, custom->name,
-1);
if (!find_in_model (data->theme_store, custom->name, COL_NAME, NULL)) {
gtk_list_store_insert_with_values (data->theme_store, NULL, 0,
COL_LABEL, custom->readable_name,
COL_NAME, custom->name,
-1);
}
/* update the theme thumbnail */
theme_queue_for_thumbnail (custom, data);
}

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/x-gnome-theme-package">
<sub-class-of type="application/x-compressed-tar"/>
<_comment>Gnome Theme Package</_comment>
<glob pattern="*.gtp"/>
</mime-type>
</mime-info>

View file

@ -478,6 +478,7 @@ capplets/accessibility/keyboard/Makefile
capplets/accessibility/keyboard/accessibility-keyboard.desktop.in
capplets/appearance/Makefile
capplets/appearance/gnome-appearance-properties.desktop.in
capplets/appearance/gnome-theme-package.xml
capplets/common/Makefile
capplets/default-applications/Makefile
capplets/default-applications/default-applications.desktop.in