eel r2190 - in trunk: . eel



Author: alexl
Date: Tue Oct  7 19:34:32 2008
New Revision: 2190
URL: http://svn.gnome.org/viewvc/eel?rev=2190&view=rev

Log:
2008-10-07  Alexander Larsson  <alexl redhat com>

        * configure.in:
        * eel-2.0-uninstalled.pc.in:
        * eel-2.0.pc.in:
	Remove deps on startup-notify, libgnome* and libglade

        * eel/eel-gnome-extensions.[ch]:
	Remove GnomeIconSelector functions.
	Remove glade functions
	
        * eel/eel-preferences-glade.c: Removed.
        * eel/eel-preferences-builder.c: Added.
        * eel/eel-preferences-glade.h: Removed
        * eel/eel-preferences.h:
	Move eel-preferences-glade.c to eel-preferences-builder.c and use
	GtkBuilder instead of Glade.
	Remove eel-preferences-glade.h and move GtkBuilder functions
	into eel-preferences.h

        * eel/Makefile.am:
	Update for file renamed/deletions
	
        * eel/check-program.c:
        * eel/eel-stock-dialogs.c:
	Don't include libgnome headers.




Added:
   trunk/eel/eel-preferences-builder.c
      - copied, changed from r2188, /trunk/eel/eel-preferences-glade.c
Removed:
   trunk/eel/eel-preferences-glade.c
   trunk/eel/eel-preferences-glade.h
Modified:
   trunk/ChangeLog
   trunk/configure.in
   trunk/eel-2.0-uninstalled.pc.in
   trunk/eel-2.0.pc.in
   trunk/eel/Makefile.am
   trunk/eel/check-program.c
   trunk/eel/eel-gnome-extensions.c
   trunk/eel/eel-gnome-extensions.h
   trunk/eel/eel-preferences.h
   trunk/eel/eel-stock-dialogs.c

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Tue Oct  7 19:34:32 2008
@@ -5,24 +5,17 @@
 GCONF_REQUIRED=1.1.11
 GDK_PIXBUF_REQUIRED=2
 GLIB_REQUIRED=2.15.0
-GNOME_REQUIRED=2.23.0
-GNOME_UI_REQUIRED=2.7.92
 GTK_REQUIRED=2.9.4
 XML_REQUIRED=2.4.7
 GAIL_REQUIRED=0.16
-LIBGLADE_REQUIRED=2.0.0
-LIBGNOME_DESKTOP_REQUIRED=2.23.3
-STARTUP_NOTIFICATION_REQUIRED=0.8
+LIBGNOME_DESKTOP_REQUIRED=2.25.1
 
 AC_SUBST(GCONF_REQUIRED)
 AC_SUBST(GDK_PIXBUF_REQUIRED)
 AC_SUBST(GLIB_REQUIRED)
-AC_SUBST(GNOME_REQUIRED)
-AC_SUBST(GNOME_UI_REQUIRED)
 AC_SUBST(GTK_REQUIRED)
 AC_SUBST(XML_REQUIRED)
 AC_SUBST(GAIL_REQUIRED)
-AC_SUBST(LIBGLADE_REQUIRED)
 
 dnl ===========================================================================
 
@@ -62,16 +55,6 @@
 AC_PROG_MAKE_SET
 AC_C_CONST
 
-OPTIONAL_MODULES=""
-
-PKG_CHECK_MODULES(STARTUP_NOTIFICATION,
-    [libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_REQUIRED],
-    AC_DEFINE(HAVE_STARTUP_NOTIFICATION, 1,
-              [define to enable startup notification support])
-    OPTIONAL_MODULES="$OPTIONAL_MODULES libstartup-notification-1.0",
-    echo "***** WARNING: Building without libstartup-notification"
-)
-
 PKG_CHECK_MODULES(EEL, [
 	gail			>= $GAIL_REQUIRED
 	gconf-2.0		>= $GCONF_REQUIRED
@@ -80,12 +63,8 @@
 	gio-2.0
 	gthread-2.0		>= $GLIB_REQUIRED
 	gtk+-2.0		>= $GTK_REQUIRED
-	libglade-2.0		>= $LIBGLADE_REQUIRED
-	libgnome-2.0		>= $GNOME_REQUIRED
-	libgnomeui-2.0		>= $GNOME_UI_REQUIRED
 	gnome-desktop-2.0	>= $LIBGNOME_DESKTOP_REQUIRED
 	libxml-2.0		>= $XML_REQUIRED
-	$OPTIONAL_MODULES
 ])
 
 

Modified: trunk/eel-2.0-uninstalled.pc.in
==============================================================================
--- trunk/eel-2.0-uninstalled.pc.in	(original)
+++ trunk/eel-2.0-uninstalled.pc.in	Tue Oct  7 19:34:32 2008
@@ -6,6 +6,6 @@
 Name: eel
 Description: Eazel Extensions Library
 Version: @VERSION@
-Requires: gconf-2.0 gdk-pixbuf-2.0 glib-2.0 gmodule-no-export-2.0 gio-2.0 gthread-2.0 gtk+-2.0 libgnome-2.0 libgnomeui-2.0 libxml-2.0 gail libglade-2.0
+Requires: gconf-2.0 gdk-pixbuf-2.0 glib-2.0 gmodule-no-export-2.0 gio-2.0 gthread-2.0 gtk+-2.0libxml-2.0 gail
 Libs: ${pc_top_builddir}/${pcfiledir}/eel/libeel-2.la
 Cflags: -I${pc_top_builddir}/${pcfiledir}

Modified: trunk/eel-2.0.pc.in
==============================================================================
--- trunk/eel-2.0.pc.in	(original)
+++ trunk/eel-2.0.pc.in	Tue Oct  7 19:34:32 2008
@@ -6,6 +6,6 @@
 Name: eel
 Description: Eazel Extensions Library
 Version: @VERSION@
-Requires: gconf-2.0 gdk-pixbuf-2.0 glib-2.0 gmodule-no-export-2.0 gio-2.0 gthread-2.0 gtk+-2.0 libgnome-2.0 libgnomeui-2.0 libxml-2.0 gail libglade-2.0
+Requires: gconf-2.0 gdk-pixbuf-2.0 glib-2.0 gmodule-no-export-2.0 gio-2.0 gthread-2.0 gtk+-2.0 libxml-2.0 gail
 Libs: -L${libdir} -leel-2
 Cflags: -I${includedir}

Modified: trunk/eel/Makefile.am
==============================================================================
--- trunk/eel/Makefile.am	(original)
+++ trunk/eel/Makefile.am	Tue Oct  7 19:34:32 2008
@@ -59,7 +59,7 @@
 	eel-labeled-image.c			\
 	eel-lib-self-check-functions.c		\
 	eel-pango-extensions.c			\
-	eel-preferences-glade.c			\
+	eel-preferences-builder.c		\
 	eel-preferences.c			\
 	eel-self-checks.c			\
 	eel-stock-dialogs.c			\
@@ -101,7 +101,6 @@
 	eel-image-table.h			\
 	eel-labeled-image.h			\
 	eel-pango-extensions.h			\
-	eel-preferences-glade.h			\
 	eel-preferences.h			\
 	eel-self-checks.h			\
 	eel-stock-dialogs.h			\

Modified: trunk/eel/check-program.c
==============================================================================
--- trunk/eel/check-program.c	(original)
+++ trunk/eel/check-program.c	Tue Oct  7 19:34:32 2008
@@ -30,7 +30,6 @@
 #include <eel/eel-self-checks.h>
 #include <gdk/gdkrgb.h>
 #include <gtk/gtk.h>
-#include <libgnomeui/gnome-ui-init.h>
 #include <libxml/parser.h>
 #include <stdlib.h>
 

Modified: trunk/eel/eel-gnome-extensions.c
==============================================================================
--- trunk/eel/eel-gnome-extensions.c	(original)
+++ trunk/eel/eel-gnome-extensions.c	Tue Oct  7 19:34:32 2008
@@ -25,8 +25,10 @@
 */
 
 #include <config.h>
-#include "eel-gnome-extensions.h"
 
+#define GNOME_DESKTOP_USE_UNSTABLE_API
+
+#include "eel-gnome-extensions.h"
 #include "eel-art-extensions.h"
 #include "eel-gdk-extensions.h"
 #include "eel-glib-extensions.h"
@@ -38,13 +40,7 @@
 #include <fcntl.h>
 #include <gdk/gdkx.h>
 #include <gtk/gtk.h>
-#include <libgnome/gnome-exec.h>
-#include <libgnome/gnome-util.h>
-#include <libgnomeui/gnome-file-entry.h>
-#include <libgnomeui/gnome-icon-list.h>
-#include <libgnomeui/gnome-icon-sel.h>
-#include <bonobo/bonobo-exception.h>
-#include <bonobo-activation/bonobo-activation.h>
+#include <libgnome/gnome-desktop-utils.h>
 #include <limits.h>
 #include <signal.h>
 #include <stdio.h>
@@ -54,20 +50,6 @@
 #include <sys/wait.h>
 #include <unistd.h>
 
-/* structure for the icon selection dialog */
-struct IconSelectionData {
-	GtkWidget *dialog;
-        GtkWidget *icon_selection;
-	GtkWidget *file_entry;
-	GtkWindow *owning_window;
-	gboolean dismissed;
-	EelIconSelectionFunction selection_function;
-	gpointer callback_data;
-};
-
-typedef struct IconSelectionData IconSelectionData;
-
-
 /* Return a command string containing the path to a terminal on this system. */
 
 static char *
@@ -144,7 +126,7 @@
 	 */
 	argc = 0;
 	argv = g_new0 (char *, 1);
-	gnome_prepend_terminal_to_vector (&argc, &argv);
+	gnome_desktop_prepend_terminal_to_vector (&argc, &argv);
 
 	command = NULL;
 	if (argc != 0) {
@@ -219,62 +201,3 @@
 {
 	eel_gnome_open_terminal_on_screen (command, NULL);
 }
-
-/**
- * eel_glade_get_file:
- * @filename: the XML file name.
- * @root: the widget node in @fname to start building from (or %NULL)
- * @domain: the translation domain for the XML file (or %NULL for default)
- * @first_required_widget: the name of the first widget we require
- * @: NULL terminated list of name, GtkWidget ** pairs.
- * 
- * Loads and parses the glade file, returns widget pointers for the names,
- * ensures that all the names are found.
- * 
- * Return value: the XML file, or NULL.
- **/
-GladeXML *
-eel_glade_get_file (const char *filename,
-		    const char *root,
-		    const char *domain,
-		    const char *first_required_widget, ...)
-{
-	va_list     args;
-	GladeXML   *gui;
-	const char *name;
-	GtkWidget **widget_ptr;
-	GList      *ptrs, *l;
-
-	va_start (args, first_required_widget);
-
-	if (!(gui = glade_xml_new (filename, root, domain))) {
-		g_warning ("Couldn't find necessary glade file '%s'", filename);
-		va_end (args);
-		return NULL;
-	}
-
-	ptrs = NULL;
-	for (name = first_required_widget; name; name = va_arg (args, char *)) {
-		widget_ptr = va_arg (args, void *);
-		
-		*widget_ptr = glade_xml_get_widget (gui, name);
-
-		if (!*widget_ptr) {
-			g_warning ("Glade file '%s' is missing widget '%s', aborting",
-				   filename, name);
-			
-			for (l = ptrs; l; l = l->next) {
-				*((gpointer *)l->data) = NULL;
-			}
-			g_list_free (ptrs);
-			g_object_unref (gui);
-			return NULL;
-		} else {
-			ptrs = g_list_prepend (ptrs, widget_ptr);
-		}
-	}
-
-	va_end (args);
-
-	return gui;
-}

Modified: trunk/eel/eel-gnome-extensions.h
==============================================================================
--- trunk/eel/eel-gnome-extensions.h	(original)
+++ trunk/eel/eel-gnome-extensions.h	Tue Oct  7 19:34:32 2008
@@ -27,7 +27,6 @@
 #ifndef EEL_GNOME_EXTENSIONS_H
 #define EEL_GNOME_EXTENSIONS_H
 
-#include <glade/glade.h>
 #include <gtk/gtk.h>
 
 /* icon selection callback function. */
@@ -42,12 +41,4 @@
 void          eel_gnome_open_terminal_on_screen                       (const char               *command,
 								       GdkScreen                *screen);
 								 
-char         *eel_bonobo_make_registration_id                         (const char               *iid);
-
-GladeXML     *eel_glade_get_file                                      (const char               *filename,
-								       const char               *root,
-								       const char               *domain,
-								       const char               *first_required_widget,
-								       ...);
-
 #endif /* EEL_GNOME_EXTENSIONS_H */

Copied: trunk/eel/eel-preferences-builder.c (from r2188, /trunk/eel/eel-preferences-glade.c)
==============================================================================
--- /trunk/eel/eel-preferences-glade.c	(original)
+++ trunk/eel/eel-preferences-builder.c	Tue Oct  7 19:34:32 2008
@@ -22,38 +22,36 @@
    Authors: Jan Arne Petersen <jpetersen uni-bonn de>
 */
 
-#include "eel-preferences-glade.h"
-
 #include <glib.h>
 #include <gtk/gtk.h>
 
 #include "eel-preferences.h"
 
-#define EEL_PREFERENCES_GLADE_DATA_KEY "eel_preferences_glade_data_key"
-#define EEL_PREFERENCES_GLADE_DATA_VALUE "eel_preferences_glade_data_value"
-#define EEL_PREFERENCES_GLADE_DATA_MAP "eel_preferences_glade_data_map"
-#define EEL_PREFERENCES_GLADE_DATA_WIDGETS "eel_preferences_glade_data_widgets"
+#define EEL_PREFERENCES_BUILDER_DATA_KEY "eel_preferences_builder_data_key"
+#define EEL_PREFERENCES_BUILDER_DATA_VALUE "eel_preferences_builder_data_value"
+#define EEL_PREFERENCES_BUILDER_DATA_MAP "eel_preferences_builder_data_map"
+#define EEL_PREFERENCES_BUILDER_DATA_WIDGETS "eel_preferences_builder_data_widgets"
 
 /* helper */
 
 static void
-eel_preferences_glade_combo_box_update (GtkComboBox *combo_box,
-					  gpointer value,
-					  GCallback change_callback)
+eel_preferences_builder_combo_box_update (GtkComboBox *combo_box,
+					gpointer value,
+					GCallback change_callback)
 {
 	GHashTable *map;
 	int active;
 	gpointer key;
 
 	map = (GHashTable *) g_object_get_data (G_OBJECT (combo_box),
-						EEL_PREFERENCES_GLADE_DATA_MAP);
+						EEL_PREFERENCES_BUILDER_DATA_MAP);
 	active = GPOINTER_TO_INT (g_hash_table_lookup (map, value));
 
 	if (active == -1) {
 		return;
 	}
 
-	key = g_object_get_data (G_OBJECT (combo_box), EEL_PREFERENCES_GLADE_DATA_KEY);
+	key = g_object_get_data (G_OBJECT (combo_box), EEL_PREFERENCES_BUILDER_DATA_KEY);
 
 	g_signal_handlers_block_by_func (combo_box, change_callback, key);
 	gtk_combo_box_set_active (combo_box, active);
@@ -67,7 +65,7 @@
 }
 
 static void
-eel_preferences_glade_set_never_sensitive (GtkWidget *widget)
+eel_preferences_builder_set_never_sensitive (GtkWidget *widget)
 {
 	gtk_widget_set_sensitive (GTK_WIDGET (widget), FALSE);
 	g_signal_connect (G_OBJECT (widget), "state_changed",
@@ -78,90 +76,91 @@
 /* bool preference */
 
 static void
-eel_preferences_glade_bool_toggled (GtkToggleButton *toggle_button,
+eel_preferences_builder_bool_toggled (GtkToggleButton *toggle_button,
 				    char *key)
 {
 	eel_preferences_set_boolean (key, gtk_toggle_button_get_active (toggle_button));
 }
 
 static void
-eel_preferences_glade_bool_update (GtkToggleButton *toggle_button)
+eel_preferences_builder_bool_update (GtkToggleButton *toggle_button)
 {
 	gboolean value;
 	gpointer key;
 
-	key = g_object_get_data (G_OBJECT (toggle_button), EEL_PREFERENCES_GLADE_DATA_KEY);
+	key = g_object_get_data (G_OBJECT (toggle_button), EEL_PREFERENCES_BUILDER_DATA_KEY);
 
 	value = eel_preferences_get_boolean (key);
-	g_signal_handlers_block_by_func (toggle_button, eel_preferences_glade_bool_toggled, key);
+	g_signal_handlers_block_by_func (toggle_button, eel_preferences_builder_bool_toggled, key);
 	gtk_toggle_button_set_active (toggle_button, value);
-	g_signal_handlers_unblock_by_func (toggle_button, eel_preferences_glade_bool_toggled, key);
+	g_signal_handlers_unblock_by_func (toggle_button, eel_preferences_builder_bool_toggled, key);
 }
 
 void
-eel_preferences_glade_connect_bool (GladeXML *dialog,
-				    const char *component,
-				    const char *key)
+eel_preferences_builder_connect_bool (GtkBuilder *builder,
+				      const char *component,
+				      const char *key)
 {
 	GtkToggleButton *toggle_button;
 
-	g_return_if_fail (dialog != NULL);
+	g_return_if_fail (builder != NULL);
 	g_return_if_fail (component != NULL);
 	g_return_if_fail (key != NULL);
 
-	toggle_button = GTK_TOGGLE_BUTTON (glade_xml_get_widget (dialog, component));
-	g_object_set_data_full (G_OBJECT (toggle_button), EEL_PREFERENCES_GLADE_DATA_KEY,
+	toggle_button = GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, component));
+	g_object_set_data_full (G_OBJECT (toggle_button), EEL_PREFERENCES_BUILDER_DATA_KEY,
 				g_strdup (key), (GDestroyNotify) g_free);
 
 	eel_preferences_add_callback_while_alive (key,
-				      		  (EelPreferencesCallback) eel_preferences_glade_bool_update,
+				      		  (EelPreferencesCallback) eel_preferences_builder_bool_update,
 				      		  toggle_button, G_OBJECT (toggle_button));
 
 	if (!eel_preferences_key_is_writable (key)) {
-		eel_preferences_glade_set_never_sensitive (GTK_WIDGET (toggle_button));
+		eel_preferences_builder_set_never_sensitive (GTK_WIDGET (toggle_button));
 	}
 	
 	g_signal_connect (G_OBJECT (toggle_button), "toggled",
-			  G_CALLBACK (eel_preferences_glade_bool_toggled),
+			  G_CALLBACK (eel_preferences_builder_bool_toggled),
 			  g_object_get_data (G_OBJECT (toggle_button),
-				  		       EEL_PREFERENCES_GLADE_DATA_KEY));
+				  		       EEL_PREFERENCES_BUILDER_DATA_KEY));
 
-	eel_preferences_glade_bool_update (toggle_button);
+	eel_preferences_builder_bool_update (toggle_button);
 }
 
 void
-eel_preferences_glade_connect_bool_slave (GladeXML *dialog,
-					  const char *component,
-					  const char *key)
+eel_preferences_builder_connect_bool_slave (GtkBuilder *builder,
+					    const char *component,
+					    const char *key)
 {
 	GtkToggleButton *toggle_button;
 
-	g_return_if_fail (dialog != NULL);
+	g_return_if_fail (builder != NULL);
 	g_return_if_fail (component != NULL);
 	g_return_if_fail (key != NULL);
 
-	toggle_button = GTK_TOGGLE_BUTTON (glade_xml_get_widget (dialog, component));
+	toggle_button = GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, component));
 
 	if (!eel_preferences_key_is_writable (key)) {
-		eel_preferences_glade_set_never_sensitive (GTK_WIDGET (toggle_button));
+		eel_preferences_builder_set_never_sensitive (GTK_WIDGET (toggle_button));
 	}
 	
 	g_signal_connect_data (G_OBJECT (toggle_button), "toggled",
-			       G_CALLBACK (eel_preferences_glade_bool_toggled),
+			       G_CALLBACK (eel_preferences_builder_bool_toggled),
 			       g_strdup (key), (GClosureNotify) g_free, 0);
 }
+
 /* string enum (ComboBox) preference */
 
 static void
-eel_preferences_glade_string_enum_combo_box_changed (GtkComboBox *combo_box,
-						       char *key)
+eel_preferences_builder_string_enum_combo_box_changed (GtkComboBox *combo_box,
+						     char *key)
 {
 	int active;
 	char **values;
 	int i;
 
 	active = gtk_combo_box_get_active  (combo_box);
-	values = g_object_get_data (G_OBJECT (combo_box), EEL_PREFERENCES_GLADE_DATA_VALUE);
+	values = g_object_get_data (G_OBJECT (combo_box), EEL_PREFERENCES_BUILDER_DATA_VALUE);
 
 	i = 0;
 	while (i < active && values[i] != NULL) {
@@ -176,21 +175,21 @@
 }
 
 static void
-eel_preferences_glade_string_enum_combo_box_update (GtkComboBox *combo_box)
+eel_preferences_builder_string_enum_combo_box_update (GtkComboBox *combo_box)
 {
 	char *value;
 
 	value = eel_preferences_get (g_object_get_data (G_OBJECT (combo_box),
-							EEL_PREFERENCES_GLADE_DATA_KEY));
+							EEL_PREFERENCES_BUILDER_DATA_KEY));
 
-	eel_preferences_glade_combo_box_update (combo_box, value,
-						  G_CALLBACK (eel_preferences_glade_string_enum_combo_box_changed));
+	eel_preferences_builder_combo_box_update (combo_box, value,
+						  G_CALLBACK (eel_preferences_builder_string_enum_combo_box_changed));
 
 	g_free (value);
 }
 
 void
-eel_preferences_glade_connect_string_enum_combo_box (GladeXML *dialog,
+eel_preferences_builder_connect_string_enum_combo_box (GtkBuilder *builder,
 						       const char *component,
 						       const char *key,
 						       const char **values)
@@ -199,12 +198,12 @@
 	GHashTable *map;
 	int i;
 
-	g_return_if_fail (dialog != NULL);
+	g_return_if_fail (builder != NULL);
 	g_return_if_fail (component != NULL);
 	g_return_if_fail (key != NULL);
 	g_return_if_fail (values != NULL);
 	
-	combo_box = glade_xml_get_widget (dialog, component);
+	combo_box = GTK_WIDGET (gtk_builder_get_object (builder, component));
 
 	map = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify) g_free, NULL);
 
@@ -212,48 +211,48 @@
 		g_hash_table_insert (map, g_strdup (values[i]), GINT_TO_POINTER (i));
 	}
 
-	g_object_set_data_full (G_OBJECT (combo_box), EEL_PREFERENCES_GLADE_DATA_MAP, map,
+	g_object_set_data_full (G_OBJECT (combo_box), EEL_PREFERENCES_BUILDER_DATA_MAP, map,
 				(GDestroyNotify) g_hash_table_destroy);
-	g_object_set_data (G_OBJECT (combo_box), EEL_PREFERENCES_GLADE_DATA_VALUE, values);
-	g_object_set_data_full (G_OBJECT (combo_box), EEL_PREFERENCES_GLADE_DATA_KEY,
+	g_object_set_data (G_OBJECT (combo_box), EEL_PREFERENCES_BUILDER_DATA_VALUE, values);
+	g_object_set_data_full (G_OBJECT (combo_box), EEL_PREFERENCES_BUILDER_DATA_KEY,
 				g_strdup (key), (GDestroyNotify) g_free);
 
 	eel_preferences_add_callback_while_alive (key,
-				 		  (EelPreferencesCallback) eel_preferences_glade_string_enum_combo_box_update,
+				 		  (EelPreferencesCallback) eel_preferences_builder_string_enum_combo_box_update,
 						  combo_box, G_OBJECT (combo_box));
 
 	if (!eel_preferences_key_is_writable (key)) {
-		eel_preferences_glade_set_never_sensitive (GTK_WIDGET (combo_box));
+		eel_preferences_builder_set_never_sensitive (GTK_WIDGET (combo_box));
 	}
 
 	g_signal_connect (G_OBJECT (combo_box), "changed",
-			  G_CALLBACK (eel_preferences_glade_string_enum_combo_box_changed),
-			  g_object_get_data (G_OBJECT (combo_box), EEL_PREFERENCES_GLADE_DATA_KEY));
+			  G_CALLBACK (eel_preferences_builder_string_enum_combo_box_changed),
+			  g_object_get_data (G_OBJECT (combo_box), EEL_PREFERENCES_BUILDER_DATA_KEY));
 
-	eel_preferences_glade_string_enum_combo_box_update (GTK_COMBO_BOX (combo_box));
+	eel_preferences_builder_string_enum_combo_box_update (GTK_COMBO_BOX (combo_box));
 }
 
 void
-eel_preferences_glade_connect_string_enum_combo_box_slave (GladeXML *dialog,
+eel_preferences_builder_connect_string_enum_combo_box_slave (GtkBuilder *builder,
 							     const char *component,
 							     const char *key)
 {
 	GtkWidget *combo_box;
 
-	g_return_if_fail (dialog != NULL);
+	g_return_if_fail (builder != NULL);
 	g_return_if_fail (component != NULL);
 	g_return_if_fail (key != NULL);
 	
-	combo_box = glade_xml_get_widget (dialog, component);
+	combo_box = GTK_WIDGET (gtk_builder_get_object (builder, component));
 
-	g_assert (g_object_get_data (G_OBJECT (combo_box), EEL_PREFERENCES_GLADE_DATA_MAP) != NULL);
+	g_assert (g_object_get_data (G_OBJECT (combo_box), EEL_PREFERENCES_BUILDER_DATA_MAP) != NULL);
 
 	if (!eel_preferences_key_is_writable (key)) {
-		eel_preferences_glade_set_never_sensitive (GTK_WIDGET (combo_box));
+		eel_preferences_builder_set_never_sensitive (GTK_WIDGET (combo_box));
 	}
 
 	g_signal_connect_data (G_OBJECT (combo_box), "changed",
-			       G_CALLBACK (eel_preferences_glade_string_enum_combo_box_changed),
+			       G_CALLBACK (eel_preferences_builder_string_enum_combo_box_changed),
 			       g_strdup (key), (GClosureNotify) g_free, 0);
 }
 
@@ -261,7 +260,7 @@
 /* int enum preference */
 
 static void
-eel_preferences_glade_int_enum_changed (GtkComboBox *combo_box,
+eel_preferences_builder_int_enum_changed (GtkComboBox *combo_box,
 					char *key)
 {
 	int active;
@@ -270,7 +269,7 @@
 
 	active = gtk_combo_box_get_active (combo_box);
 	value_list = (GSList *) g_object_get_data (G_OBJECT (combo_box),
-						   EEL_PREFERENCES_GLADE_DATA_VALUE);
+						   EEL_PREFERENCES_BUILDER_DATA_VALUE);
 
 	i = 0;
 	while (i < active && value_list->next != NULL) {
@@ -286,22 +285,22 @@
 }
 
 static void
-eel_preferences_glade_int_enum_update (GtkComboBox *combo_box)
+eel_preferences_builder_int_enum_update (GtkComboBox *combo_box)
 {
 	int value;
 
 	value = eel_preferences_get_integer (g_object_get_data (G_OBJECT (combo_box),
-								EEL_PREFERENCES_GLADE_DATA_KEY));
+								EEL_PREFERENCES_BUILDER_DATA_KEY));
 
-	eel_preferences_glade_combo_box_update (combo_box, GINT_TO_POINTER (value),
-						  G_CALLBACK (eel_preferences_glade_int_enum_changed));
+	eel_preferences_builder_combo_box_update (combo_box, GINT_TO_POINTER (value),
+						  G_CALLBACK (eel_preferences_builder_int_enum_changed));
 }
 
 void
-eel_preferences_glade_connect_int_enum (GladeXML *dialog,
-					const char *component,
-					const char *key,
-					const int *values)
+eel_preferences_builder_connect_int_enum (GtkBuilder *builder,
+					  const char *component,
+					  const char *key,
+					  const int *values)
 {
 	GHashTable *map;
 	int i;
@@ -309,12 +308,12 @@
 	GtkComboBox *combo_box;
 	GSList *value_list;
 
-	g_return_if_fail (dialog != NULL);
+	g_return_if_fail (builder != NULL);
 	g_return_if_fail (component != NULL);
 	g_return_if_fail (key != NULL);
 	g_return_if_fail (values != NULL);
 	
-	combo_box = GTK_COMBO_BOX (glade_xml_get_widget (dialog, component));
+	combo_box = GTK_COMBO_BOX (gtk_builder_get_object (builder, component));
 
 	map = g_hash_table_new (g_direct_hash, g_direct_equal);
 	value_list = NULL;
@@ -325,32 +324,33 @@
 		g_hash_table_insert (map, GINT_TO_POINTER (value), GINT_TO_POINTER (i));
 	}
 
-	g_object_set_data_full (G_OBJECT (combo_box), EEL_PREFERENCES_GLADE_DATA_MAP, map,
+	g_object_set_data_full (G_OBJECT (combo_box), EEL_PREFERENCES_BUILDER_DATA_MAP, map,
 				(GDestroyNotify) g_hash_table_destroy);
-	g_object_set_data_full (G_OBJECT (combo_box), EEL_PREFERENCES_GLADE_DATA_VALUE, value_list,
+	g_object_set_data_full (G_OBJECT (combo_box), EEL_PREFERENCES_BUILDER_DATA_VALUE, value_list,
 				(GDestroyNotify) g_slist_free);
-	g_object_set_data_full (G_OBJECT (combo_box), EEL_PREFERENCES_GLADE_DATA_KEY,
+	g_object_set_data_full (G_OBJECT (combo_box), EEL_PREFERENCES_BUILDER_DATA_KEY,
 				g_strdup (key), (GDestroyNotify) g_free);
 
 	if (!eel_preferences_key_is_writable (key)) {
-		eel_preferences_glade_set_never_sensitive (GTK_WIDGET (combo_box));
+		eel_preferences_builder_set_never_sensitive (GTK_WIDGET (combo_box));
 	}
 
 	g_signal_connect (G_OBJECT (combo_box), "changed",
-			  G_CALLBACK (eel_preferences_glade_int_enum_changed),
-			  g_object_get_data (G_OBJECT (combo_box), EEL_PREFERENCES_GLADE_DATA_KEY));
+			  G_CALLBACK (eel_preferences_builder_int_enum_changed),
+			  g_object_get_data (G_OBJECT (combo_box), EEL_PREFERENCES_BUILDER_DATA_KEY));
 
 	eel_preferences_add_callback_while_alive (key,
-				 		  (EelPreferencesCallback) eel_preferences_glade_int_enum_update,
+				 		  (EelPreferencesCallback) eel_preferences_builder_int_enum_update,
 						  combo_box, G_OBJECT (combo_box));
 
-	eel_preferences_glade_int_enum_update (combo_box);
+	eel_preferences_builder_int_enum_update (combo_box);
 }
 
+
 /* String Enum (RadioButton) preference */
 
 static void
-eel_preferences_glade_string_enum_radio_button_toggled (GtkToggleButton *toggle_button,
+eel_preferences_builder_string_enum_radio_button_toggled (GtkToggleButton *toggle_button,
 							char *key)
 {
 	if (gtk_toggle_button_get_active (toggle_button) == FALSE) {
@@ -359,20 +359,20 @@
 
 	eel_preferences_set (key,
 			     g_object_get_data (G_OBJECT (toggle_button),
-				     		EEL_PREFERENCES_GLADE_DATA_VALUE));
+				     		EEL_PREFERENCES_BUILDER_DATA_VALUE));
 }
 
 static void
-eel_preferences_glade_string_enum_radio_button_update (GtkWidget *widget)
+eel_preferences_builder_string_enum_radio_button_update (GtkWidget *widget)
 {
 	gpointer key;
 	char *value;
 	GHashTable *map;
 	gpointer object;
 
-	key = g_object_get_data (G_OBJECT (widget), EEL_PREFERENCES_GLADE_DATA_KEY);
+	key = g_object_get_data (G_OBJECT (widget), EEL_PREFERENCES_BUILDER_DATA_KEY);
 	value = eel_preferences_get (key);
-	map = g_object_get_data (G_OBJECT (widget), EEL_PREFERENCES_GLADE_DATA_MAP);
+	map = g_object_get_data (G_OBJECT (widget), EEL_PREFERENCES_BUILDER_DATA_MAP);
 	object = g_hash_table_lookup (map, value);
 	g_free (value);
 	if (object == NULL) {
@@ -380,26 +380,26 @@
 	}
 
 	g_signal_handlers_block_by_func (widget,
-					 eel_preferences_glade_string_enum_radio_button_toggled,
+					 eel_preferences_builder_string_enum_radio_button_toggled,
 					 key);
 	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (object), TRUE);
 	g_signal_handlers_unblock_by_func (widget,
-					   eel_preferences_glade_string_enum_radio_button_toggled,
+					   eel_preferences_builder_string_enum_radio_button_toggled,
 					   key);
 }
 
 void
-eel_preferences_glade_connect_string_enum_radio_button (GladeXML *dialog,
-							const char **components,
-							const char *key,
-							const char **values)
+eel_preferences_builder_connect_string_enum_radio_button (GtkBuilder *builder,
+							  const char **components,
+							  const char *key,
+							  const char **values)
 {
 	GHashTable *map;
 	int i;
 	GtkWidget *widget;
 	gboolean writable;
 
-	g_return_if_fail (dialog != NULL);
+	g_return_if_fail (builder != NULL);
 	g_return_if_fail (components != NULL);
 	g_return_if_fail (key != NULL);
 	g_return_if_fail (values != NULL);
@@ -410,44 +410,45 @@
 
 	widget = NULL;
 	for (i = 0; components[i] != NULL && values[i] != NULL; i++) {
-		widget = glade_xml_get_widget (dialog, components[i]);
+		widget = GTK_WIDGET (gtk_builder_get_object (builder, components[i]));
 		g_hash_table_insert (map, g_strdup (values[i]), widget);
 		if (i == 0) {
 			g_object_set_data_full (G_OBJECT (widget),
-						EEL_PREFERENCES_GLADE_DATA_MAP, map,
+						EEL_PREFERENCES_BUILDER_DATA_MAP, map,
 					        (GDestroyNotify) g_hash_table_destroy);
 		} else {
 			g_object_set_data (G_OBJECT (widget),
-					   EEL_PREFERENCES_GLADE_DATA_MAP, map);
+					   EEL_PREFERENCES_BUILDER_DATA_MAP, map);
 		}
 		g_object_set_data_full (G_OBJECT (widget),
-					EEL_PREFERENCES_GLADE_DATA_VALUE, g_strdup (values[i]),
+					EEL_PREFERENCES_BUILDER_DATA_VALUE, g_strdup (values[i]),
 					(GDestroyNotify) g_free);
 		g_object_set_data_full (G_OBJECT (widget),
-					EEL_PREFERENCES_GLADE_DATA_KEY, g_strdup (key),
+					EEL_PREFERENCES_BUILDER_DATA_KEY, g_strdup (key),
 					(GDestroyNotify) g_free);
 
 		if (!writable) {
-			eel_preferences_glade_set_never_sensitive (widget);
+			eel_preferences_builder_set_never_sensitive (widget);
 		}
 
 		g_signal_connect (G_OBJECT (widget), "toggled",
-				  G_CALLBACK (eel_preferences_glade_string_enum_radio_button_toggled),
+				  G_CALLBACK (eel_preferences_builder_string_enum_radio_button_toggled),
 				  g_object_get_data (G_OBJECT (widget),
-					  	     EEL_PREFERENCES_GLADE_DATA_KEY));
+					  	     EEL_PREFERENCES_BUILDER_DATA_KEY));
 	}
 
 	eel_preferences_add_callback_while_alive (key,
-						  (EelPreferencesCallback) eel_preferences_glade_string_enum_radio_button_update,
+						  (EelPreferencesCallback) eel_preferences_builder_string_enum_radio_button_update,
 						  widget, G_OBJECT (widget));
 
-	eel_preferences_glade_string_enum_radio_button_update (widget);
+	eel_preferences_builder_string_enum_radio_button_update (widget);
 }
 
+
 /* list enum preference */
 
 static void
-eel_preferences_glade_list_enum_changed (GtkComboBox *combo_box,
+eel_preferences_builder_list_enum_changed (GtkComboBox *combo_box,
 					 char *key)
 {
 	GSList *widgets;
@@ -456,13 +457,13 @@
 	int i;
 	GPtrArray *v;
 
-	widgets = g_object_get_data (G_OBJECT (combo_box), EEL_PREFERENCES_GLADE_DATA_WIDGETS);
+	widgets = g_object_get_data (G_OBJECT (combo_box), EEL_PREFERENCES_BUILDER_DATA_WIDGETS);
 
 	v = g_ptr_array_new ();
 	for (; widgets != NULL; widgets = widgets->next) {
 		active = gtk_combo_box_get_active (GTK_COMBO_BOX (widgets->data));
 		values = g_object_get_data (G_OBJECT (combo_box),
-					    EEL_PREFERENCES_GLADE_DATA_VALUE);
+					    EEL_PREFERENCES_BUILDER_DATA_VALUE);
 
 		i = 0;
 		while (i < active && values[i] != NULL) {
@@ -480,29 +481,29 @@
 }
 
 static void
-eel_preferences_glade_list_enum_update (GtkWidget *widget)
+eel_preferences_builder_list_enum_update (GtkWidget *widget)
 {
 	char **values;
 	GSList *components;
 	int i;
 
 	values = eel_preferences_get_string_array (g_object_get_data (G_OBJECT (widget),
-								      EEL_PREFERENCES_GLADE_DATA_KEY));
-	components = g_object_get_data (G_OBJECT (widget), EEL_PREFERENCES_GLADE_DATA_WIDGETS);
+								      EEL_PREFERENCES_BUILDER_DATA_KEY));
+	components = g_object_get_data (G_OBJECT (widget), EEL_PREFERENCES_BUILDER_DATA_WIDGETS);
 	for (i = 0; values[i] != NULL && components != NULL; i++, components = components->next) {
-		eel_preferences_glade_combo_box_update (GTK_COMBO_BOX (components->data), 
+		eel_preferences_builder_combo_box_update (GTK_COMBO_BOX (components->data), 
 							values[i],
-							G_CALLBACK (eel_preferences_glade_list_enum_changed));
+							G_CALLBACK (eel_preferences_builder_list_enum_changed));
 	}
 
 	g_strfreev (values);
 }
 
 void 
-eel_preferences_glade_connect_list_enum (GladeXML *dialog,
-					 const char **components,
-					 const char *key,
-					 const char **values)
+eel_preferences_builder_connect_list_enum (GtkBuilder *builder,
+					   const char **components,
+					   const char *key,
+					   const char **values)
 {
 	GtkWidget *combo_box;
 	GHashTable *map;
@@ -510,7 +511,7 @@
 	GSList *widgets;
 	gboolean writable;
 
- 	g_return_if_fail (dialog != NULL);
+ 	g_return_if_fail (builder != NULL);
 	g_return_if_fail (components != NULL);
 	g_return_if_fail (key != NULL);
 	g_return_if_fail (values != NULL);
@@ -526,40 +527,41 @@
 	combo_box = NULL;
 	widgets = NULL;
 	for (i = 0; components[i] != NULL; i++) {
-		combo_box = glade_xml_get_widget (dialog, components[i]);
+		combo_box = GTK_WIDGET (gtk_builder_get_object (builder, components[i]));
 		widgets = g_slist_append (widgets, combo_box);
 		if (i == 0) {
 			g_object_set_data_full (G_OBJECT (combo_box),
-						EEL_PREFERENCES_GLADE_DATA_MAP, map,
+						EEL_PREFERENCES_BUILDER_DATA_MAP, map,
 						(GDestroyNotify) g_hash_table_destroy);
 			g_object_set_data_full (G_OBJECT (combo_box),
-						EEL_PREFERENCES_GLADE_DATA_WIDGETS,
+						EEL_PREFERENCES_BUILDER_DATA_WIDGETS,
 						widgets, (GDestroyNotify) g_slist_free);
 		} else {
 			g_object_set_data (G_OBJECT (combo_box),
-					   EEL_PREFERENCES_GLADE_DATA_MAP, map);
+					   EEL_PREFERENCES_BUILDER_DATA_MAP, map);
 			g_object_set_data (G_OBJECT (combo_box),
-					   EEL_PREFERENCES_GLADE_DATA_WIDGETS, widgets);
+					   EEL_PREFERENCES_BUILDER_DATA_WIDGETS, widgets);
 		}
 		g_object_set_data (G_OBJECT (combo_box),
-				   EEL_PREFERENCES_GLADE_DATA_VALUE, values);
+				   EEL_PREFERENCES_BUILDER_DATA_VALUE, values);
 		g_object_set_data_full (G_OBJECT (combo_box),
-				        EEL_PREFERENCES_GLADE_DATA_KEY, g_strdup (key),
+				        EEL_PREFERENCES_BUILDER_DATA_KEY, g_strdup (key),
 					(GDestroyNotify) g_free);
 
 		if (!writable) {
-			eel_preferences_glade_set_never_sensitive (combo_box);
+			eel_preferences_builder_set_never_sensitive (combo_box);
 		}
 
 		g_signal_connect (G_OBJECT (combo_box), "changed",
-			  	  G_CALLBACK (eel_preferences_glade_list_enum_changed),
+			  	  G_CALLBACK (eel_preferences_builder_list_enum_changed),
 				  g_object_get_data (G_OBJECT (combo_box),
-					  	     EEL_PREFERENCES_GLADE_DATA_KEY));
+					  	     EEL_PREFERENCES_BUILDER_DATA_KEY));
 	}
 
 	eel_preferences_add_callback_while_alive (key,
-						  (EelPreferencesCallback) eel_preferences_glade_list_enum_update,
+						  (EelPreferencesCallback) eel_preferences_builder_list_enum_update,
 						  combo_box, G_OBJECT (combo_box));
 	
-	eel_preferences_glade_list_enum_update (combo_box);
+	eel_preferences_builder_list_enum_update (combo_box);
 }
+

Modified: trunk/eel/eel-preferences.h
==============================================================================
--- trunk/eel/eel-preferences.h	(original)
+++ trunk/eel/eel-preferences.h	Tue Oct  7 19:34:32 2008
@@ -27,6 +27,7 @@
 
 #include <glib.h>
 #include <eel/eel-gconf-extensions.h>
+#include <gtk/gtk.h>
 
 G_BEGIN_DECLS
 
@@ -119,6 +120,34 @@
 gboolean       eel_preferences_is_visible                      (const char              *name);
 void           eel_preferences_init                      (const char              *storage_path);
 
+void eel_preferences_builder_connect_bool		         (GtkBuilder *builder,
+								  const char  *component,
+								  const char  *key);
+void eel_preferences_builder_connect_bool_slave			 (GtkBuilder *builder,
+								  const char  *component,
+								  const char  *key);
+void eel_preferences_builder_connect_string_enum_combo_box	 (GtkBuilder *builder,
+								  const char  *component,
+								  const char  *key,
+								  const char **values);
+void eel_preferences_builder_connect_string_enum_combo_box_slave (GtkBuilder *builder,
+								  const char  *component,
+								  const char  *key);
+
+void eel_preferences_builder_connect_int_enum			 (GtkBuilder *builder,
+								  const char  *component,
+								  const char  *key,
+								  const int   *values);
+void eel_preferences_builder_connect_string_enum_radio_button	 (GtkBuilder *builder,
+								  const char **components,
+								  const char  *key,
+								  const char **values);
+void eel_preferences_builder_connect_list_enum			 (GtkBuilder *builder,
+						   		  const char **components,
+								  const char  *key,
+								  const char **values);
+
+
 G_END_DECLS
 
 #endif /* EEL_PREFERENCES_H */

Modified: trunk/eel/eel-stock-dialogs.c
==============================================================================
--- trunk/eel/eel-stock-dialogs.c	(original)
+++ trunk/eel/eel-stock-dialogs.c	Tue Oct  7 19:34:32 2008
@@ -31,8 +31,6 @@
 #include "eel-string.h"
 #include "eel-i18n.h"
 #include <gtk/gtk.h>
-#include <libgnomeui/gnome-uidefs.h>
-#include <libgnomeui/gnome-authentication-manager.h>
 
 #define TIMED_WAIT_STANDARD_DURATION 2000
 #define TIMED_WAIT_MIN_TIME_UP 3000



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]