Re: [evolution-patches] Re: Patch to remove deprecated calls (patch this time)



On Mon, 2005-06-06 at 12:19 +0200, Rodrigo Moya wrote:
> the GtkFileChooserButton should probably be in the glade file. It was
> creating the GnomeFileEntry in the code because I did have a version of
> Glade with non-working GNOME support, so couldn't add it.

Good point, I keep on forgetting I've a sane Glade now.  New patch
attached.

Ross
-- 
Ross Burton                                 mail: ross burtonini com
                                          jabber: ross burtonini com
                                     www: http://www.burtonini.com./
 PGP Fingerprint: 1A21 F5B0 D8D0 CFE3 81D4 E25A 2D09 E447 D0B4 33DF

Index: test-source-list.c
===================================================================
--- test-source-list.c	(.../upstream/current/libedataserver)	(revision 61)
+++ test-source-list.c	(.../trunk/libedataserver)	(revision 61)
@@ -25,8 +25,6 @@
 #endif
 
 #include <glib.h>
-#include <libgnome/gnome-program.h>
-#include <libgnome/gnome-init.h>
 #include "e-source-list.h"
 
 /* Globals. */
@@ -56,47 +54,27 @@
 static gboolean unset_value = FALSE;
 static gboolean unset_color = FALSE;
 
-static struct poptOption options[] = {
-	{ "key", '\0', POPT_ARG_STRING, &key_arg, 0,
-	  "Name of the GConf key to use", "PATH" },
-	{ "source", '\0', POPT_ARG_STRING, &source_arg, 0, 
-	  "UID of source to apply operation to", "UID" },
-	{ "group", '\0', POPT_ARG_STRING, &group_arg, 0, 
-	  "UID of group to apply operation to", "UID" },
-	{ "add-group", '\0', POPT_ARG_STRING, &add_group_arg, 0,
-	  "Add group of specified name", "NAME" },
-	{ "add-source", '\0', POPT_ARG_STRING, &add_source_arg, 0,
-	  "Add source of specified name", "NAME" },
-	{ "remove-group", '\0', POPT_ARG_STRING, &remove_group_arg, 0,
-	  "Remove group of specified name", "NAME" },
-	{ "remove-source", '\0', POPT_ARG_STRING, &remove_source_arg, 0,
-	  "Remove source of specified name", "NAME" },
-	{ "property", '\0', POPT_ARG_STRING, &property_arg, 0,
-	  "Name of source property to apply operation to", "PROPERTY" },
-	{ "set-name", '\0', POPT_ARG_STRING, &set_name_arg, 0,
-	  "Set name of source or group.  When used with --group, it sets the name of a group.  "
-	  "When used with both --group and --source, it sets the name of a source.", "NAME" },
-	{ "set-relative-uri", '\0', POPT_ARG_STRING, &set_relative_uri_arg, 0,
-	  "Set relative URI of a source.  Use with --source or --add-source.", "NAME" },
-	{ "set-base-uri", '\0', POPT_ARG_STRING, &set_base_uri_arg, 0,
-	  "Set base URI of a group.  Use with --group or --add-group.", "NAME" },
-	{ "set-color", '\0', POPT_ARG_STRING, &set_color_arg, 0,
-	  "Set the color of a source.  Use with --source or --add-source.", "COLOR (rrggbb)" },
-	{ "unset-color", '\0', POPT_ARG_NONE, &unset_color, 0,
-	  "Unset the color of a source.  Use with --source or --add-source.", NULL },
-	{ "set-value", '\0', POPT_ARG_STRING, &set_value_arg, 0,
-	  "Set a property on a source.  Use with --source and --property.", NULL },
-	{ "unset-value", '\0', POPT_ARG_NONE, &unset_value, 0,
-	  "Unset a property on a source.  Use with --source and --property.", NULL },
-	{ "listen", '\0', POPT_ARG_NONE, &listen, 0,
-	  "Wait and listen for changes.", "" },
-	{ "dump", '\0', POPT_ARG_NONE, &dump, 0,
-	  "List the current configured sources.", "" },
-	POPT_AUTOHELP
+static GOptionEntry entries[] = {
+	{ "key", '\0', 0, G_OPTION_ARG_STRING, &key_arg, "Name of the GConf key to use", "PATH" },
+	{ "source", '\0', 0, G_OPTION_ARG_STRING, &source_arg, "UID of source to apply operations too", "UID"},
+	{ "group", '\0', 0, G_OPTION_ARG_STRING, &group_arg, "UID of group to apply operations too", "UID" },
+	{ "add-group", '\0', 0, G_OPTION_ARG_STRING, &add_group_arg, "Add group of specified name", "GROUP" },
+	{ "add-source", '\0', 0, G_OPTION_ARG_STRING, &add_source_arg, "Add source of specified name", "SOURCE" },
+	{ "remove-group", '\0', 0, G_OPTION_ARG_STRING, &remove_group_arg, "Remove group of specified name", "GROUP" },
+	{ "remove-source", '\0', 0, G_OPTION_ARG_STRING, &remove_source_arg, "Remove source of specified name", "SOURCE" },
+	{ "property", '\0', 0, G_OPTION_ARG_STRING, &property_arg, "Name of source property to apply operation to", "PROPERTY" },
+	{ "set-name", '\0', 0, G_OPTION_ARG_STRING, &set_name_arg, "Set name of source or group.  When used with --group, it sets the name of a group. When used with both --group and --source, it sets the name of a source.", "NAME" },
+	{ "set-relative-uri", '\0', 0, G_OPTION_ARG_STRING, &set_relative_uri_arg, "Set relative URI of a source.  Use with --source or --add-source.", "NAME" },
+	{ "set-base-uri", '\0', 0, G_OPTION_ARG_STRING, &set_base_uri_arg, "Set base URI of a group.  Use with --group or --add-group.", "NAME" },
+	{ "set-color", '\0', 0, G_OPTION_ARG_STRING, &set_color_arg, "Set the color of a source.  Use with --source or --add-source.", "COLOR (rrggbb)" },
+	{ "unset-color", '\0', 0, G_OPTION_ARG_NONE, &unset_color, "Unset the color of a source.  Use with --source or --add-source.", NULL },
+	{ "set-value", '\0', 0, G_OPTION_ARG_STRING, &set_value_arg, "Set a property on a source.  Use with --source and --property.", NULL },
+	{ "unset-value", '\0', 0, G_OPTION_ARG_NONE, &unset_value, "Unset a property on a source.  Use with --source and --property.", NULL },
+	{ "listen", '\0', 0, G_OPTION_ARG_NONE, &listen, "Wait and listen for changes.", NULL },
+	{ "dump", '\0', 0, G_OPTION_ARG_NONE, &dump, "List the current configured sources.", NULL },
 	{ NULL }
 };
 
-
 /* Forward decls.  */
 static void group_added_callback (ESourceList *list, ESourceGroup *group);
 static void group_removed_callback (ESourceList *list, ESourceGroup *group);
@@ -562,15 +540,14 @@
 
 
 int
-main (int argc,
-      char **argv)
+main (int argc, char **argv)
 {
-	GnomeProgram *program;
+	GOptionContext *context;
+	GError *error = NULL;
 
-	program = gnome_program_init ("test-source-list", "0.0",
-				      LIBGNOME_MODULE, argc, argv,
-				      GNOME_PARAM_POPT_TABLE, options,
-				      NULL);
+	context = g_option_context_new ("- test source lists");
+	g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
+	g_option_context_parse (context, &argc, &argv, &error);
 
 	g_idle_add (on_idle_do_stuff, NULL);
 
Index: e-categories-dialog.glade
===================================================================
--- e-categories-dialog.glade	(.../upstream/current/libedataserverui)	(revision 61)
+++ e-categories-dialog.glade	(.../trunk/libedataserverui)	(revision 61)
@@ -474,6 +503,25 @@
 	      <property name="y_options"></property>
 	    </packing>
 	  </child>
+
+	  <child>
+	    <widget class="GtkFileChooserButton" id="category-icon">
+	      <property name="visible">True</property>
+	      <property name="title" translatable="yes">Category Icon</property>
+	      <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property>
+	      <property name="local_only">True</property>
+	      <property name="show_hidden">False</property>
+	      <property name="width_chars">-1</property>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">1</property>
+	      <property name="right_attach">2</property>
+	      <property name="top_attach">2</property>
+	      <property name="bottom_attach">3</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options">fill</property>
+	    </packing>
+	  </child>
 	</widget>
 	<packing>
 	  <property name="padding">0</property>
Index: test-name-selector.c
===================================================================
--- test-name-selector.c	(.../upstream/current/libedataserverui)	(revision 61)
+++ test-name-selector.c	(.../trunk/libedataserverui)	(revision 61)
@@ -29,8 +29,6 @@
 #include "e-name-selector-dialog.h"
 #include "e-name-selector-entry.h"
 #include <gtk/gtk.h>
-#include <libgnomeui/gnome-ui-init.h>
-#include <bonobo/bonobo-main.h>
 #include <camel/camel.h>
 
 static void
@@ -39,7 +37,7 @@
 	GtkWidget *dialog = data;
 	
 	gtk_widget_destroy (dialog);
-	bonobo_main_quit ();
+	gtk_main_quit ();
 }
 
 static gboolean
@@ -79,20 +77,14 @@
 int
 main (int argc, char **argv)
 {
-	GnomeProgram *program;
+	gtk_init (&argc, &argv);
+	g_thread_init (NULL);
 
-	program = gnome_program_init ("test-name-selector", "0.0",
-				      LIBGNOMEUI_MODULE, argc, argv,
-				      NULL);
-
-	if (bonobo_init (&argc, argv) == FALSE)
-		g_error ("Could not initialize Bonobo.");
-
 	camel_init (NULL, 0);
 
 	g_idle_add ((GSourceFunc) start_test, NULL);
 
-	bonobo_main ();
+	gtk_main ();
 
 	return 0;
 }
Index: test-contact-store.c
===================================================================
--- test-contact-store.c	(.../upstream/current/libedataserverui)	(revision 61)
+++ test-contact-store.c	(.../trunk/libedataserverui)	(revision 61)
@@ -27,7 +27,6 @@
 
 #include "e-contact-store.h"
 #include <gtk/gtk.h>
-#include <libgnomeui/gnome-ui-init.h>
 
 static void
 entry_changed (GtkWidget *entry, EContactStore *contact_store)
@@ -66,7 +65,6 @@
 	GtkTreeModel *model_sort;
 	GtkWidget *scrolled_window;
 	GtkWidget *window;
-	GtkWidget *select_names_entry;
 	GtkWidget *tree_view;
 	GtkWidget *box;
 	GtkWidget *entry;
@@ -120,16 +118,10 @@
 int
 main (int argc, char **argv)
 {
-	GnomeProgram *program;
 	const char *gconf_path;
 
-	program = gnome_program_init ("test-source-selector", "0.0",
-				      LIBGNOMEUI_MODULE, argc, argv,
-				      NULL);
+	gtk_init (&argc, &argv);
 
-	if (bonobo_init (&argc, argv) == FALSE)
-		g_error ("Could not initialize Bonobo.");
-
 	if (argc < 2)
 		gconf_path = "/apps/evolution/addressbook/sources";
 	else
@@ -137,7 +129,7 @@
 
 	g_idle_add ((GSourceFunc) start_test, (void *) gconf_path);
 
-	bonobo_main ();
+	gtk_main ();
 
 	return 0;
 }
Index: e-categories-dialog.c
===================================================================
--- e-categories-dialog.c	(.../upstream/current/libedataserverui)	(revision 61)
+++ e-categories-dialog.c	(.../trunk/libedataserverui)	(revision 61)
@@ -28,6 +28,7 @@
 #include <gtk/gtkcellrenderertext.h>
 #include <gtk/gtkcellrenderertoggle.h>
 #include <gtk/gtkentry.h>
+#include <gtk/gtkfilechooserbutton.h>
 #include <gtk/gtkliststore.h>
 #include <gtk/gtkmain.h>
 #include <gtk/gtkmessagedialog.h>
@@ -35,7 +36,6 @@
 #include <gtk/gtkstock.h>
 #include <gtk/gtktreeselection.h>
 #include <gtk/gtktreeview.h>
-#include <libgnomeui/gnome-file-entry.h>
 #include <glade/glade-xml.h>
 #include <libedataserver/e-categories.h>
 #include "e-categories-dialog.h"
@@ -85,15 +85,8 @@
 
 	prop_dialog->category_name = glade_xml_get_widget (prop_dialog->gui, "category-name");
 	prop_dialog->category_color = glade_xml_get_widget (prop_dialog->gui, "category-color");
+	prop_dialog->category_icon = glade_xml_get_widget (prop_dialog->gui, "category-icon");
 
-	/* create the icon file entry */
-	table = glade_xml_get_widget (prop_dialog->gui, "table-category-properties");
-	prop_dialog->category_icon = gnome_file_entry_new ("category-icon-history-id", _("Category Icon"));
-	g_object_set (G_OBJECT (prop_dialog->category_icon), "use_filechooser", TRUE, NULL);
-	gtk_table_attach (GTK_TABLE (table), prop_dialog->category_icon, 1, 2, 2, 3, GTK_FILL, GTK_FILL, 3, 3);
-	gtk_widget_show (prop_dialog->category_icon);
-	gnome_file_entry_set_modal ((GnomeFileEntry *)prop_dialog->category_icon, TRUE);
-
 	return prop_dialog;
 }
 
@@ -271,8 +264,7 @@
 				g_free (correct_category_name);
 			} else {
 				/* FIXME: get color */
-				category_icon = gtk_entry_get_text (
-					GTK_ENTRY (gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (prop_dialog->category_icon))));
+				category_icon = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (prop_dialog->category_icon));
 
 				e_categories_add (correct_category_name, NULL, category_icon ? category_icon : NULL, TRUE);
 
@@ -324,16 +316,14 @@
 	gtk_tree_model_get (model, &iter, 1, &category_name, -1);
 	gtk_entry_set_text (GTK_ENTRY (prop_dialog->category_name), category_name);
 	gtk_widget_set_sensitive (prop_dialog->category_name, FALSE);
-	gtk_entry_set_text (
-		GTK_ENTRY (gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (prop_dialog->category_icon))),
-		e_categories_get_icon_file_for (category_name));
+	gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (prop_dialog->category_icon), 
+				       e_categories_get_icon_file_for (category_name));
 
 	if (gtk_dialog_run (GTK_DIALOG (prop_dialog->the_dialog)) == GTK_RESPONSE_OK) {
 		const char *category_icon;
 
 		/* FIXME: get color */
-		category_icon = gtk_entry_get_text (
-			GTK_ENTRY (gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (prop_dialog->category_icon))));
+		category_icon = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (prop_dialog->category_icon));
 
 		if (category_icon)
 			e_categories_set_icon_file_for (category_name, category_icon);
Index: libedataserverui/e-passwords.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/libedataserverui/e-passwords.c,v
retrieving revision 1.26
diff -u -r1.26 e-passwords.c
--- libedataserverui/e-passwords.c	23 Feb 2005 18:52:12 -0000	1.26
+++ libedataserverui/e-passwords.c	5 Jun 2005 16:16:46 -0000
@@ -744,10 +797,10 @@
 
 
 
-static char *base64_alphabet =
+static const char base64_alphabet[] =
 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
 
-static unsigned char camel_mime_base64_rank[256] = {
+static const unsigned char camel_mime_base64_rank[256] = {
 	255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
 	255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
 	255,255,255,255,255,255,255,255,255,255,255, 62,255,255,255, 63,


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