r1113 - in trunk/src/target/OM-2007/applications/openmoko-contacts: . src
thomas at sita.openmoko.org
thomas at sita.openmoko.org
Sun Feb 25 12:02:03 CET 2007
Author: thomas
Date: 2007-02-25 12:02:02 +0100 (Sun, 25 Feb 2007)
New Revision: 1113
Modified:
trunk/src/target/OM-2007/applications/openmoko-contacts/ChangeLog
trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-contact-pane.c
trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-groups-editor.c
Log:
* src/contacts-contact-pane.c: (make_widget): Support custom field types
* src/contacts-groups-editor.c: (contacts_groups_new_cb): Ensure the
add groups dialog will close
Modified: trunk/src/target/OM-2007/applications/openmoko-contacts/ChangeLog
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-contacts/ChangeLog 2007-02-25 06:29:09 UTC (rev 1112)
+++ trunk/src/target/OM-2007/applications/openmoko-contacts/ChangeLog 2007-02-25 11:02:02 UTC (rev 1113)
@@ -1,3 +1,9 @@
+2007-02-25 Thomas Wood <thomas at openedhand.com>
+
+ * src/contacts-contact-pane.c: (make_widget): Support custom field types
+ * src/contacts-groups-editor.c: (contacts_groups_new_cb): Ensure the
+ add groups dialog will close
+
2007-02-21 Thomas Wood <thomas at openedhand.com>
* src/contacts-main.c: (main): Fix some compiler warnings
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-02-25 06:29:09 UTC (rev 1112)
+++ trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-contact-pane.c 2007-02-25 11:02:02 UTC (rev 1113)
@@ -369,6 +369,7 @@
box = gtk_hbox_new (FALSE, 0);
type = get_type (attr);
+
if (type == NULL && info->types != NULL)
type = info->types[0];
@@ -404,17 +405,27 @@
gtk_box_pack_start (GTK_BOX (box), type_label, FALSE, FALSE, 4);
g_free (s);
}
+
if (info->types && pane->priv->editable)
{
GtkWidget *combo;
+ gboolean *is_custom_type = TRUE;
combo = gtk_combo_box_new_text ();
gtk_widget_set_size_request (combo, -1, 46);
i = 0;
for (s = info->types[i]; (s = info->types[i]); i++) {
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), s);
- if (!strcmp (s, type))
+ if (!strcmp (s, type)) {
gtk_combo_box_set_active (GTK_COMBO_BOX (combo), i);
+ is_custom_type = FALSE;
+ }
}
+ if (is_custom_type) {
+ /* type isn't in our list of types, so add it now */
+ gtk_combo_box_append_text (GTK_COMBO_BOX (combo), type);
+ gtk_combo_box_set_active (GTK_COMBO_BOX (combo), i);
+ }
+
g_object_set_data (G_OBJECT (combo), "contact-pane", pane);
g_signal_connect (G_OBJECT (combo), "changed", G_CALLBACK (set_type_cb), attr);
if (size)
Modified: trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-groups-editor.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-groups-editor.c 2007-02-25 06:29:09 UTC (rev 1112)
+++ trunk/src/target/OM-2007/applications/openmoko-contacts/src/contacts-groups-editor.c 2007-02-25 11:02:02 UTC (rev 1113)
@@ -105,10 +105,13 @@
gtk_widget_show (widget);
if (gtk_dialog_run (GTK_DIALOG (input_dialog)) != GTK_RESPONSE_ACCEPT)
+ {
+ gtk_widget_destroy (input_dialog);
return;
+ }
text = g_strdup (gtk_entry_get_text (GTK_ENTRY (widget)));
- gtk_widget_hide (input_dialog);
+ gtk_widget_destroy (input_dialog);
if (!text || !strcmp (text, ""))
return;
More information about the commitlog
mailing list