[evolution-patches] use of new categories dialog in addressbook



The attached patch makes the addressbook use the new ECategoriesDialog
widget instead of the GAL one.

The dialog is only missing one thing, which is the
addition/removal/edition of categories, which will be added in a few
days once I sort out the GUI for it. Any ideas on how the GUI should be?
-- 
Rodrigo Moya <rodrigo novell com>
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/ChangeLog,v
retrieving revision 1.1887
diff -u -p -r1.1887 ChangeLog
--- ChangeLog	6 Jan 2005 23:23:52 -0000	1.1887
+++ ChangeLog	7 Jan 2005 17:18:45 -0000
@@ -1,3 +1,8 @@
+2005-01-07  Rodrigo Moya <rodrigo novell com>
+
+	* gui/contact-editor/e-contact-editor.c (categories_clicked): use the
+	new ECategoriesDialog widget.
+
 2005-01-06  JP Rosevear  <jpr novell com>
 
 	* gui/component/Makefile.am: install schemas properly
Index: gui/contact-editor/e-contact-editor.c
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/gui/contact-editor/e-contact-editor.c,v
retrieving revision 1.226
diff -u -p -r1.226 e-contact-editor.c
--- gui/contact-editor/e-contact-editor.c	9 Dec 2004 01:42:37 -0000	1.226
+++ gui/contact-editor/e-contact-editor.c	7 Jan 2005 17:18:45 -0000
@@ -40,15 +40,13 @@
 #include <libgnome/gnome-help.h>
 
 #include <gdk-pixbuf/gdk-pixbuf.h>
-#include <gal/widgets/e-categories.h>
+#include <libedataserverui/e-categories-dialog.h>
 #include <gal/widgets/e-gui-utils.h>
 #include <gal/e-text/e-entry.h>
 
 #include <libebook/e-address-western.h>
 #include <libedataserverui/e-source-option-menu.h>
 
-#include <e-util/e-categories-master-list-wombat.h>
-
 #include <camel/camel.h>
 
 #include "addressbook/gui/component/addressbook.h"
@@ -2446,37 +2444,27 @@ categories_clicked (GtkWidget *button, E
 	GtkDialog *dialog;
 	int result;
 	GtkWidget *entry = glade_xml_get_widget(editor->gui, "entry-categories");
-	ECategoriesMasterList *ecml;
+
 	if (entry && GTK_IS_ENTRY(entry))
 		categories = g_strdup (gtk_entry_get_text(GTK_ENTRY(entry)));
 	else if (editor->contact)
 		categories = e_contact_get (editor->contact, E_CONTACT_CATEGORIES);
 
-	if (!(dialog = GTK_DIALOG (e_categories_new (categories)))) {
+	if (!(dialog = GTK_DIALOG (e_categories_dialog_new (categories)))) {
 		e_error_run (NULL, "addressbook:edit-categories", NULL);
 		g_free (categories);
 		return;
 	}
 	
-	ecml = e_categories_master_list_wombat_new ();
-	g_object_set (dialog,
-		       "header", _("This contact belongs to these categories:"),
-		       "ecml", ecml,
-		       NULL);
-	g_object_unref (ecml);
 	gtk_widget_show(GTK_WIDGET(dialog));
 	result = gtk_dialog_run (dialog);
 	g_free (categories);
 	if (result == GTK_RESPONSE_OK) {
-		g_object_get (dialog,
-			      "categories", &categories,
-			      NULL);
+		categories = e_categories_dialog_get_categories (E_CATEGORIES_DIALOG (dialog));
 		if (entry && GTK_IS_ENTRY(entry))
 			gtk_entry_set_text (GTK_ENTRY (entry), categories);
 		else
 			e_contact_set (editor->contact, E_CONTACT_CATEGORIES, categories);
-
-		g_free(categories);
 	}
 	gtk_widget_destroy(GTK_WIDGET(dialog));
 }


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