r1888 - in trunk/src/target/OM-2007/applications/openmoko-contacts: . src

thomas at sita.openmoko.org thomas at sita.openmoko.org
Tue May 1 10:36:43 CEST 2007


Author: thomas
Date: 2007-05-01 10:36:41 +0200 (Tue, 01 May 2007)
New Revision: 1888

Modified:
   trunk/src/target/OM-2007/applications/openmoko-contacts/ChangeLog
   trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-callbacks-ebook.c
   trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-callbacks-ui.c
   trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-main.c
   trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-utils.c
Log:
* src/contacts-callbacks-ebook.c: (contacts_added_cb):
* src/contacts-callbacks-ui.c: (contacts_delete_cb):
* src/contacts-main.c: (main):
* src/contacts-utils.c: (contacts_string_list_as_string):

Merge in changes from mainline Contacts, including:
  - Miscellaneous memory fixes
  - Add error dialogs if there are problems opening the address book or saving
    a contact


Modified: trunk/src/target/OM-2007/applications/openmoko-contacts/ChangeLog
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-contacts/ChangeLog	2007-05-01 07:39:08 UTC (rev 1887)
+++ trunk/src/target/OM-2007/applications/openmoko-contacts/ChangeLog	2007-05-01 08:36:41 UTC (rev 1888)
@@ -1,5 +1,17 @@
 2007-05-01  Thomas Wood  <thomas at openedhand.com>
 
+	* src/contacts-callbacks-ebook.c: (contacts_added_cb):
+	* src/contacts-callbacks-ui.c: (contacts_delete_cb):
+	* src/contacts-main.c: (main):
+	* src/contacts-utils.c: (contacts_string_list_as_string):
+
+	Merge in changes from mainline Contacts, including:
+		- Miscellaneous memory fixes
+		- Add error dialogs if there are problems opening the address book or saving
+		  a contact
+
+2007-05-01  Thomas Wood  <thomas at openedhand.com>
+
 	* src/contacts-omoko.c: (create_contacts_list): Change "Cell Phone" to more
 	generic "Mobile"
 	(create_main_window): Set application name to "Contacts". Fixes bug 490.

Modified: trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-callbacks-ebook.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-callbacks-ebook.c	2007-05-01 07:39:08 UTC (rev 1887)
+++ trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-callbacks-ebook.c	2007-05-01 08:36:41 UTC (rev 1888)
@@ -95,7 +95,7 @@
 							 (GCompareFunc) strcmp))
 				{
 					data->contacts_groups = g_list_prepend
-					   (data->contacts_groups, group->data);
+					   (data->contacts_groups, g_strdup (group->data));
 				}
 			}
 			g_list_foreach (contact_groups, (GFunc) g_free, NULL);

Modified: trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-callbacks-ui.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-callbacks-ui.c	2007-05-01 07:39:08 UTC (rev 1887)
+++ trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-callbacks-ui.c	2007-05-01 08:36:41 UTC (rev 1888)
@@ -253,9 +253,11 @@
 		default:
 			break;
 	}
+	g_list_foreach (contact_list, (GFunc) g_free, NULL);
 	g_list_free (contact_list);
 	gtk_widget_destroy (dialog);
 	contacts_set_widgets_sensitive (widgets);
+	g_list_free (widgets);
 }
 
 void
@@ -612,25 +614,42 @@
 void
 contacts_about_cb (GtkWidget *parent)
 {
-	gchar *authors[] = {"Chris Lord <chris at o-hand.com>", NULL};
+	const char *authors[] = {"Chris Lord <chris at openedhand.com>",
+			    "Ross Burton <ross at openedhand.com>",
+			    "Matthew Allum <mallum at openedhand.com>",
+			    "Thomas Wood <thomas at openedhand.com>",
+			    NULL};
+	const char *license = {
+	  N_(
+	     "Contacts is free software; you can redistribute it and/or modify "
+	     "it under the terms of the GNU General Public License as published by "
+	     "the Free Software Foundation; either version 2 of the License, or "
+	     "(at your option) any later version.\n\n"
+	     "Contacts is distributed in the hope that it will be useful, "
+	     "but WITHOUT ANY WARRANTY; without even the implied warranty of "
+	     "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the "
+	     "GNU General Public License for more details.\n\n"
+	     "You should have received a copy of the GNU General Public License "
+	     "along with Contacts; if not, write to the Free Software Foundation, Inc., "
+	     "51 Franklin St, Fifth Floor, Boston, MA 0110-1301, USA"
+	     )
+	};
 	/* Translators: please translate this as your own name and optionally email
 	   like so: "Your Name <your at email.com>" */
-	const gchar *translator_credits = _("translator-credits");
-	GdkPixbuf *icon;
+	const char *translator_credits = _("translator-credits");
 
-	icon = gdk_pixbuf_new_from_file (DATADIR"/pixmaps/oh-contacts.png", NULL);
 	gtk_show_about_dialog (GTK_WINDOW (parent),
 		"name", GETTEXT_PACKAGE,
 		"version", VERSION,
 		"authors", authors,
-		"logo", icon,
+		"logo-icon-name", "contacts",
 		"website", "http://projects.o-hand.com/contacts/",
-		"copyright", "(c) 2006 OpenedHand Ltd",
+		"copyright", "\302\251 2006 OpenedHand Ltd",
 		"translator-credits", translator_credits,
+		"license", license,
+		"wrap-license", TRUE,
 		NULL);
 
-	if (icon != NULL)
-		g_object_unref (icon);
 }
 
 gboolean

Modified: trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-main.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-main.c	2007-05-01 07:39:08 UTC (rev 1887)
+++ trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-main.c	2007-05-01 08:36:41 UTC (rev 1888)
@@ -136,11 +136,8 @@
 int
 main (int argc, char **argv)
 {
+	GError *error = NULL;
 	BaconMessageConnection *mc;
-#ifdef HAVE_GCONF
-	const char *search;
-	GConfClient *client;
-#endif
 	ContactsData *data;	/* Variable for passing around data -
 					 * see contacts-defs.h.
 					 */
@@ -182,9 +179,11 @@
 	//g_log_set_always_fatal (G_LOG_LEVEL_CRITICAL);
 
 	/* Load the system addressbook */
-	data->book = e_book_new_system_addressbook (NULL);
-	if (!data->book)
-		g_critical ("Could not load system addressbook");
+	data->book = e_book_new_system_addressbook (&error);
+	if (!data->book) {
+		g_critical ("Could not load system addressbook: %s", error->message);
+		g_error_free (error);
+	}
 
 	data->contacts_table = g_hash_table_new_full (g_str_hash,
 						g_str_equal, NULL, 
@@ -228,9 +227,6 @@
 		gtk_widget_show_all (widget);
 	}
 
-	/* fix icon sizes to 16x16 for the moment... */
-	gtk_rc_parse_string ("gtk_icon_sizes=\"gtk-button=16,16:gtk-menu=16,16\"");
-
 	gtk_main ();
 
 	/* if we have modified the current contact, but not saved it, do so now */

Modified: trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-utils.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-utils.c	2007-05-01 07:39:08 UTC (rev 1887)
+++ trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-utils.c	2007-05-01 08:36:41 UTC (rev 1888)
@@ -161,8 +161,9 @@
 	{ "EMAIL", 0, N_("Email"), FALSE, 30, FALSE },
 	{ "ADR", 0, N_("Address"), FALSE, 40, FALSE },
 	{ "NICKNAME", E_CONTACT_NICKNAME, NULL, FALSE, 110, TRUE },
-	{ "URL", E_CONTACT_HOMEPAGE_URL, N_("Homepage"), FALSE, 120, FALSE },
-	{ "NOTE", E_CONTACT_NOTE, NULL, TRUE, 130, TRUE },
+	{ "BDAY", E_CONTACT_BIRTH_DATE, NULL, FALSE, 120, TRUE },
+	{ "URL", E_CONTACT_HOMEPAGE_URL, N_("Homepage"), FALSE, 130, FALSE },
+	{ "NOTE", E_CONTACT_NOTE, NULL, TRUE, 140, TRUE },
 	{ NULL }
 };
 
@@ -469,7 +470,7 @@
 contacts_string_list_as_string (GList *list, const gchar *separator,
 				gboolean include_empty)
 {
-	gchar *old_string, *new_string;
+	gchar *old_string, *new_string = NULL;
 	GList *c;
 	
 	if (!include_empty)





More information about the commitlog mailing list