port from gnome-vfs to gio (part of bug #524401)

2008-05-01  Jens Granseuer  <jensgr@gmx.net>

	* gnome-theme-apply.c:
	* gnome-theme-info.c: (get_file_type), (add_theme_to_hash_by_name),
	(get_theme_from_hash_by_name), (gnome_theme_read_meta_theme),
	(read_icon_theme), (gdk_pixbuf_from_xcursor_image),
	(read_cursor_theme), (handle_change_signal), (update_theme_index),
	(update_gtk2_index), (update_keybinding_index),
	(update_metacity_index), (update_common_theme_dir_index),
	(update_meta_theme_index), (update_icon_theme_index),
	(update_cursor_theme_index), (gtk2_dir_changed),
	(keybinding_dir_changed), (metacity_dir_changed),
	(common_theme_dir_changed), (common_icon_theme_dir_changed),
	(add_common_theme_dir_monitor),
	(add_common_icon_theme_dir_monitor),
	(remove_common_theme_dir_monitor),
	(remove_common_icon_theme_dir_monitor), (top_theme_dir_changed),
	(top_icon_theme_dir_changed), (real_add_top_theme_dir_monitor),
	(add_top_theme_dir_monitor), (add_top_icon_theme_dir_monitor),
	(gnome_theme_init):
	* gnome-theme-info.h:
	* gnome-theme-test.c: (main): port from gnome-vfs to gio (part of
	bug #524401)

2008-05-01  Jens Granseuer  <jensgr@gmx.net>

	* appearance-themes.c: (themes_init): update for changes in the
	theme-info API

2008-05-01  Jens Granseuer  <jensgr@gmx.net>

	* theme-method.c: (vfs_module_init):
	* themus-properties-view.c: (themus_properties_view_init),
	(themus_properties_view_set_location):
	* themus-theme-applier.c: (main): update users of the theme-info
	API

svn path=/trunk/; revision=8681
This commit is contained in:
Jens Granseuer 2008-05-01 09:08:07 +00:00 committed by Jens Granseuer
parent 79d007e929
commit d714ff7e49
11 changed files with 615 additions and 778 deletions

View file

@ -1,3 +1,8 @@
2008-05-01 Jens Granseuer <jensgr@gmx.net>
* appearance-themes.c: (themes_init): update for changes in the
theme-info API
2008-04-20 Jens Granseuer <jensgr@gmx.net> 2008-04-20 Jens Granseuer <jensgr@gmx.net>
* appearance-style.c: (update_thumbnail_in_treeview): * appearance-style.c: (update_thumbnail_in_treeview):

View file

@ -1056,7 +1056,7 @@ themes_init (AppearanceData *data)
GtkSettings *settings; GtkSettings *settings;
/* initialise some stuff */ /* initialise some stuff */
gnome_theme_init (NULL); gnome_theme_init ();
gnome_wm_manager_init (); gnome_wm_manager_init ();
data->revert_application_font = NULL; data->revert_application_font = NULL;

View file

@ -1,3 +1,27 @@
2008-05-01 Jens Granseuer <jensgr@gmx.net>
* gnome-theme-apply.c:
* gnome-theme-info.c: (get_file_type), (add_theme_to_hash_by_name),
(get_theme_from_hash_by_name), (gnome_theme_read_meta_theme),
(read_icon_theme), (gdk_pixbuf_from_xcursor_image),
(read_cursor_theme), (handle_change_signal), (update_theme_index),
(update_gtk2_index), (update_keybinding_index),
(update_metacity_index), (update_common_theme_dir_index),
(update_meta_theme_index), (update_icon_theme_index),
(update_cursor_theme_index), (gtk2_dir_changed),
(keybinding_dir_changed), (metacity_dir_changed),
(common_theme_dir_changed), (common_icon_theme_dir_changed),
(add_common_theme_dir_monitor),
(add_common_icon_theme_dir_monitor),
(remove_common_theme_dir_monitor),
(remove_common_icon_theme_dir_monitor), (top_theme_dir_changed),
(top_icon_theme_dir_changed), (real_add_top_theme_dir_monitor),
(add_top_theme_dir_monitor), (add_top_icon_theme_dir_monitor),
(gnome_theme_init):
* gnome-theme-info.h:
* gnome-theme-test.c: (main): port from gnome-vfs to gio (part of
bug #524401)
2008-04-20 Jens Granseuer <jensgr@gmx.net> 2008-04-20 Jens Granseuer <jensgr@gmx.net>
* file-transfer-dialog.c: (file_transfer_dialog_finalize), * file-transfer-dialog.c: (file_transfer_dialog_finalize),

View file

@ -17,6 +17,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <string.h> #include <string.h>
#include <gconf/gconf-client.h> #include <gconf/gconf-client.h>
#include <gnome-wm-manager.h> #include <gnome-wm-manager.h>

File diff suppressed because it is too large Load diff

View file

@ -23,10 +23,8 @@
#ifndef GNOME_THEME_INFO_H #ifndef GNOME_THEME_INFO_H
#define GNOME_THEME_INFO_H #define GNOME_THEME_INFO_H
#include <config.h>
#include <glib.h> #include <glib.h>
#include <libgnomevfs/gnome-vfs.h> #include <gio/gio.h>
#include <gdk-pixbuf/gdk-pixbuf.h> #include <gdk-pixbuf/gdk-pixbuf.h>
#include <gdk/gdk.h> #include <gdk/gdk.h>
@ -157,15 +155,14 @@ gint gnome_theme_cursor_info_compare (GnomeThemeCursorInfo
/* Meta themes*/ /* Meta themes*/
GnomeThemeMetaInfo *gnome_theme_meta_info_new (void); GnomeThemeMetaInfo *gnome_theme_meta_info_new (void);
void gnome_theme_meta_info_free (GnomeThemeMetaInfo *meta_theme_info); void gnome_theme_meta_info_free (GnomeThemeMetaInfo *meta_theme_info);
void gnome_theme_meta_info_print (GnomeThemeMetaInfo *meta_theme_info);
GnomeThemeMetaInfo *gnome_theme_meta_info_find (const gchar *meta_theme_name); GnomeThemeMetaInfo *gnome_theme_meta_info_find (const gchar *meta_theme_name);
GList *gnome_theme_meta_info_find_all (void); GList *gnome_theme_meta_info_find_all (void);
gint gnome_theme_meta_info_compare (GnomeThemeMetaInfo *a, gint gnome_theme_meta_info_compare (GnomeThemeMetaInfo *a,
GnomeThemeMetaInfo *b); GnomeThemeMetaInfo *b);
GnomeThemeMetaInfo *gnome_theme_read_meta_theme (GnomeVFSURI *meta_theme_uri); GnomeThemeMetaInfo *gnome_theme_read_meta_theme (GFile *meta_theme_uri);
/* Other */ /* Other */
void gnome_theme_init (gboolean *monitor_not_added); void gnome_theme_init (void);
void gnome_theme_info_register_theme_change (ThemeChangedCallback func, void gnome_theme_info_register_theme_change (ThemeChangedCallback func,
gpointer data); gpointer data);

View file

@ -10,13 +10,12 @@
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
gboolean monitor_not_added = FALSE;
GList *themes, *list; GList *themes, *list;
g_thread_init (NULL); g_thread_init (NULL);
gtk_init (&argc, &argv); gtk_init (&argc, &argv);
gnome_vfs_init (); gnome_vfs_init ();
gnome_theme_init (&monitor_not_added); gnome_theme_init ();
themes = gnome_theme_meta_info_find_all (); themes = gnome_theme_meta_info_find_all ();
if (themes == NULL) if (themes == NULL)

View file

@ -1,3 +1,11 @@
2008-05-01 Jens Granseuer <jensgr@gmx.net>
* theme-method.c: (vfs_module_init):
* themus-properties-view.c: (themus_properties_view_init),
(themus_properties_view_set_location):
* themus-theme-applier.c: (main): update users of the theme-info
API
2008-03-11 Jens Granseuer <jensgr@gmx.net> 2008-03-11 Jens Granseuer <jensgr@gmx.net>
* theme-thumbnailer.c: (main): handle failed thumbnailing attempts * theme-thumbnailer.c: (main): handle failed thumbnailing attempts

View file

@ -675,7 +675,7 @@ static GnomeVFSMethod method = {
GnomeVFSMethod* GnomeVFSMethod*
vfs_module_init (const char *method_name, const char *args) vfs_module_init (const char *method_name, const char *args)
{ {
gnome_theme_init (NULL); gnome_theme_init ();
if (!strcmp (method_name, "themes")) if (!strcmp (method_name, "themes"))
{ {
gnome_theme_info_register_theme_change (theme_changed_callback, NULL); gnome_theme_info_register_theme_change (theme_changed_callback, NULL);

View file

@ -20,9 +20,10 @@
#include <config.h> #include <config.h>
#include "themus-properties-view.h" #include "themus-properties-view.h"
#include <gnome-theme-info.h> #include "gnome-theme-info.h"
#include <glib/gi18n-lib.h> #include <glib/gi18n-lib.h>
#include <gio/gio.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
#define LOAD_BUFFER_SIZE 8192 #define LOAD_BUFFER_SIZE 8192
@ -118,7 +119,7 @@ themus_properties_view_init (ThemusPropertiesView *self)
THEMUS_TYPE_PROPERTIES_VIEW, THEMUS_TYPE_PROPERTIES_VIEW,
ThemusPropertiesViewDetails); ThemusPropertiesViewDetails);
gnome_theme_init (NULL); gnome_theme_init ();
gtk_table_resize (GTK_TABLE (self), 3, 2); gtk_table_resize (GTK_TABLE (self), 3, 2);
gtk_table_set_homogeneous (GTK_TABLE (self), FALSE); gtk_table_set_homogeneous (GTK_TABLE (self), FALSE);
@ -215,16 +216,16 @@ void
themus_properties_view_set_location (ThemusPropertiesView *self, themus_properties_view_set_location (ThemusPropertiesView *self,
const char *location) const char *location)
{ {
GnomeVFSURI *uri;
GnomeThemeMetaInfo *theme;
g_assert (THEMUS_IS_PROPERTIES_VIEW (self)); g_assert (THEMUS_IS_PROPERTIES_VIEW (self));
if (location) { if (location) {
uri = gnome_vfs_uri_new (location); GFile *file;
GnomeThemeMetaInfo *theme;
theme = gnome_theme_read_meta_theme (uri); file = g_file_new_for_path (location);
gnome_vfs_uri_unref (uri);
theme = gnome_theme_read_meta_theme (file);
g_object_unref (file);
gtk_label_set_text (GTK_LABEL (self->details->description), gtk_label_set_text (GTK_LABEL (self->details->description),
theme->comment); theme->comment);
@ -243,4 +244,3 @@ themus_properties_view_set_location (ThemusPropertiesView *self,
gtk_label_set_text (GTK_LABEL (self->details->icon_theme), ""); gtk_label_set_text (GTK_LABEL (self->details->icon_theme), "");
} }
} }

View file

@ -1,6 +1,6 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* /*
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -22,11 +22,11 @@
#include <stdlib.h> #include <stdlib.h>
#include <glib/gi18n.h> #include <glib/gi18n.h>
#include <gio/gio.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <glade/glade.h> #include <glade/glade.h>
#include <libgnome/libgnome.h> #include <libgnome/libgnome.h>
#include <libgnomeui/gnome-ui-init.h> #include <libgnomeui/gnome-ui-init.h>
#include <libgnomevfs/gnome-vfs.h>
#include <gconf/gconf-client.h> #include <gconf/gconf-client.h>
#include <gnome-theme-info.h> #include <gnome-theme-info.h>
@ -58,7 +58,7 @@ run_apply_font_dialog (GnomeThemeMetaInfo *theme)
_("ABCDEFG"), _("ABCDEFG"),
"</span>", "</span>",
NULL)); NULL));
if (gtk_dialog_run (GTK_DIALOG(font_dialog)) == GTK_RESPONSE_OK) if (gtk_dialog_run (GTK_DIALOG(font_dialog)) == GTK_RESPONSE_OK)
apply_font = TRUE; apply_font = TRUE;
@ -74,7 +74,7 @@ run_apply_font_dialog (GnomeThemeMetaInfo *theme)
int int
main (int argc, char **argv) main (int argc, char **argv)
{ {
GnomeVFSURI *uri; GFile *file;
GnomeThemeMetaInfo *theme; GnomeThemeMetaInfo *theme;
GnomeProgram *program; GnomeProgram *program;
gboolean apply_font; gboolean apply_font;
@ -107,16 +107,13 @@ main (int argc, char **argv)
goto error; goto error;
} }
uri = gnome_vfs_uri_new (arguments[0]); file = g_file_new_for_path (arguments[0]);
g_strfreev (arguments); g_strfreev (arguments);
if (!uri) gnome_theme_init ();
goto error;
gnome_theme_init (NULL); theme = gnome_theme_read_meta_theme (file);
g_object_unref (file);
theme = gnome_theme_read_meta_theme (uri);
gnome_vfs_uri_unref (uri);
if (!theme) if (!theme)
goto error; goto error;