gconf-editor r1403 - in trunk: . src



Author: cosimoc
Date: Thu Sep 25 15:12:55 2008
New Revision: 1403
URL: http://svn.gnome.org/viewvc/gconf-editor?rev=1403&view=rev

Log:
2008-09-25  Cosimo Cecchi  <cosimoc gnome org>

	* configure.in:
	* src/gconf-bookmarks-dialog.c: (gconf_bookmarks_dialog_init):
	* src/gconf-editor-window.c: (help_cb):
	* src/main.c: (build_accel_filename), (load_accel_map),
	(save_accel_map), (main):
	Drop dependency on libgnome and libgnome-ui.
	Thanks to Kristof Vansant (#342635).


Modified:
   trunk/ChangeLog
   trunk/configure.in
   trunk/src/gconf-bookmarks-dialog.c
   trunk/src/gconf-editor-window.c
   trunk/src/main.c

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Thu Sep 25 15:12:55 2008
@@ -30,9 +30,7 @@
 
 PKG_CHECK_MODULES(GCONF_EDITOR,
 		  gconf-2.0 >= 2.9.2
-		  gtk+-2.0 >= 2.5.5
-		  libgnome-2.0 >= 2.14.0
-		  libgnomeui-2.0 >= 2.5.4)
+		  gtk+-2.0 >= 2.10.0)
 
 AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
 
@@ -41,6 +39,9 @@
 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [The gettext package])
 
 AM_GLIB_GNU_GETTEXT
+GNOME_COMMON_INIT
+GNOME_COMPILE_WARNINGS([maximum])
+GNOME_MAINTAINER_MODE_DEFINES
 
 dnl Get the GConf defaults source, and sed it to make the mandatory source.
 GCONF_DEFAULTS_SOURCE=`gconftool-2 --get-default-source`

Modified: trunk/src/gconf-bookmarks-dialog.c
==============================================================================
--- trunk/src/gconf-bookmarks-dialog.c	(original)
+++ trunk/src/gconf-bookmarks-dialog.c	Thu Sep 25 15:12:55 2008
@@ -176,7 +176,6 @@
 	GtkWidget *scrolled_window, *hbox, *vbox;
 	GtkCellRenderer *cell;
 	GtkTreeViewColumn *column;
-	GdkPixbuf *pixbuf;
 	GConfClient *client;
        
 	hbox = gtk_hbox_new (FALSE, 6);
@@ -209,11 +208,9 @@
 	column = gtk_tree_view_column_new ();
 
 	cell = gtk_cell_renderer_pixbuf_new ();
-	pixbuf = gtk_widget_render_icon (dialog->tree_view, STOCK_BOOKMARK, GTK_ICON_SIZE_MENU, NULL);
 	g_object_set (G_OBJECT (cell),
-		      "pixbuf", pixbuf,
+		      "stock-id", STOCK_BOOKMARK,
 		      NULL);
-	g_object_unref (pixbuf);
 	gtk_tree_view_column_pack_start (column, cell, FALSE);
 	
 	cell = gtk_cell_renderer_text_new ();

Modified: trunk/src/gconf-editor-window.c
==============================================================================
--- trunk/src/gconf-editor-window.c	(original)
+++ trunk/src/gconf-editor-window.c	Thu Sep 25 15:12:55 2008
@@ -18,8 +18,6 @@
 
 #include <config.h>
 
-#include <gnome.h>
-
 #include "gconf-editor-window.h"
 
 #include "gconf-bookmarks.h"
@@ -33,9 +31,11 @@
 #include "gconf-util.h"
 #include "gedit-output-window.h"
 #include "gconf-search-dialog.h"
+
 #include <gconf/gconf.h>
+#include <glib/gi18n.h>
 #include <string.h>
-
+#include <stdlib.h>
 
 /* Property IDs */
 enum
@@ -360,12 +360,14 @@
 help_cb (GtkAction *action, GtkWidget *callback_data)
 {
         GError *error = NULL;
-                                                                                
-        gnome_help_display_desktop (NULL, "gconf-editor", "gconf-editor", NULL, &error);
+
+	gtk_show_uri (gtk_widget_get_screen (callback_data),
+		      "ghelp:gconf-editor", gtk_get_current_event_time (), &error);
                                                                                 
         if (error != NULL) {
                 gconf_editor_window_popup_error_dialog (GTK_WINDOW (GCONF_EDITOR_WINDOW (callback_data)),
                                                         _("Couldn't display help: %s"), error);
+		g_error_free (error);
         }
 }
 

Modified: trunk/src/main.c
==============================================================================
--- trunk/src/main.c	(original)
+++ trunk/src/main.c	Thu Sep 25 15:12:55 2008
@@ -25,14 +25,40 @@
 #include "gconf-stock-icons.h"
 #include "gconf-editor-window.h"
 
+static char *
+build_accel_filename (void)
+{
+	return g_build_filename (g_get_home_dir (), ".gnome2", "accels", PACKAGE, NULL);
+}
+
+static void
+load_accel_map (void)
+{
+	char *map;
+
+	map = build_accel_filename ();
+	gtk_accel_map_load (map);
+
+	g_free (map);
+}
+
+static void
+save_accel_map (void)
+{
+	char *map;
+
+	map = build_accel_filename ();
+	gtk_accel_map_save (map);
+
+	g_free (map);
+}
 
 gint
 main (gint argc, gchar **argv)
 {
-	
-	GnomeProgram *program;
 	GOptionContext *context;
 	GtkWidget *window;
+	GError *error = NULL;
 
 	static gchar **remaining_args = NULL;
 	gchar *initial_key = NULL;
@@ -50,18 +76,22 @@
 	context = g_option_context_new (N_("- Directly edit your entire configuration database"));
 
 	g_option_context_set_translation_domain (context, GETTEXT_PACKAGE);
-
 	g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
+	g_option_context_add_group (context, gtk_get_option_group (TRUE));
+
+	if (!g_option_context_parse (context, &argc, &argv, &error)) {
+		g_critical ("Failed to parse arguments: %s", error->message);
+		g_error_free (error);
+		g_option_context_free (context);
+		exit (1);
+	}
 
-	program = gnome_program_init (PACKAGE, VERSION, LIBGNOMEUI_MODULE,
-									argc, argv,
-									GNOME_PARAM_GOPTION_CONTEXT, context,								
-									GNOME_PARAM_APP_DATADIR, DATADIR,
-									GNOME_PARAM_NONE);
+	g_option_context_free (context);
 
 	/* Register our stock icons */
         gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (), ICONDIR);
 	gconf_stock_icons_register ();
+	load_accel_map ();
 
         gtk_window_set_default_icon_name ("gconf-editor");
 
@@ -76,10 +106,7 @@
 	
 	gtk_main ();
 
-	gnome_accelerators_sync();
-	
-	g_object_unref(program);
-
+	save_accel_map ();
 	g_strfreev (remaining_args);
 
 	return 0;



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