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

thomas at sita.openmoko.org thomas at sita.openmoko.org
Tue Apr 17 16:55:56 CEST 2007


Author: thomas
Date: 2007-04-17 16:55:55 +0200 (Tue, 17 Apr 2007)
New Revision: 1787

Modified:
   trunk/src/target/OM-2007/applications/openmoko-contacts/ChangeLog
   trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-contact-pane.c
Log:
* src/contacts-contact-pane.c: (choose_photo_cb), (update_ui): Make
sure the contact is committed when the photo is changed.


Modified: trunk/src/target/OM-2007/applications/openmoko-contacts/ChangeLog
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-contacts/ChangeLog	2007-04-17 14:38:18 UTC (rev 1786)
+++ trunk/src/target/OM-2007/applications/openmoko-contacts/ChangeLog	2007-04-17 14:55:55 UTC (rev 1787)
@@ -1,5 +1,10 @@
 2007-04-17  Thomas Wood  <thomas at openedhand.com>
 
+	* src/contacts-contact-pane.c: (choose_photo_cb), (update_ui): Make
+	sure the contact is committed when the photo is changed.
+
+2007-04-17  Thomas Wood  <thomas at openedhand.com>
+
 	* src/contacts-contact-pane.c: (make_widget), (update_ui): Add photo chooser. Closes bug 473.
 
 2007-04-16  Thomas Wood  <thomas at openedhand.com>

Modified: trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-contact-pane.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-contact-pane.c	2007-04-17 14:38:18 UTC (rev 1786)
+++ trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-contact-pane.c	2007-04-17 14:55:55 UTC (rev 1787)
@@ -633,6 +633,13 @@
   return box;
 }
 
+static void
+choose_photo_cb (GtkWidget *button, ContactsContactPane *pane)
+{
+	pane->priv->dirty = TRUE;
+	contacts_choose_photo (button, pane->priv->contact);
+}
+
 /*
  * Update the widgets, called when the contact or editable mode has changed.
  */
@@ -641,7 +648,7 @@
 {
   int i;
   GtkWidget *w;
-    EVCardAttribute *attr;
+  EVCardAttribute *attr;
 
   g_assert (CONTACTS_IS_CONTACT_PANE (pane));
 
@@ -691,17 +698,17 @@
     has_org_field = TRUE;
   }
 
-  GtkWidget *photo = contacts_load_photo (pane->priv->contact);
+  GtkImage *photo = contacts_load_photo (pane->priv->contact);
   if (pane->priv->editable)
   {
     w = gtk_button_new ();
     gtk_widget_set_name (w, "mokofingerbutton-big");
-    gtk_container_add (GTK_CONTAINER (w), photo);
-    g_signal_connect (w, "clicked", contacts_choose_photo, pane->priv->contact);
+    gtk_container_add (GTK_CONTAINER (w), GTK_WIDGET (photo));
+    g_signal_connect (w, "clicked", (GCallback) choose_photo_cb, pane);
   }
   else
   {
-    w = photo;
+    w = GTK_WIDGET (photo);
   }
   if (has_org_field)
     gtk_table_attach (GTK_TABLE (table), w, 0, 1, 0, 2, 0, 0, 6, 6);





More information about the commitlog mailing list