Send commitlog mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.openmoko.org/mailman/listinfo/commitlog
or, via email, send a message with subject or body 'help' to
[EMAIL PROTECTED]
You can reach the person managing the list at
[EMAIL PROTECTED]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of commitlog digest..."
Today's Topics:
1. r2614 - in
trunk/src/target/OM-2007.2/applications/openmoko-dialer2: . src
([EMAIL PROTECTED])
2. r2615 - in
trunk/src/target/OM-2007.2/applications/openmoko-dialer2: . src
([EMAIL PROTECTED])
3. r2616 - in
trunk/src/target/OM-2007.2/libraries/libmokojournal2: .
mokojournal ([EMAIL PROTECTED])
4. r2617 - in
trunk/src/target/OM-2007.2/libraries/libmokojournal2: .
mokojournal ([EMAIL PROTECTED])
5. r2618 - in
trunk/src/target/OM-2007.2/applications/openmoko-dialer2: . src
([EMAIL PROTECTED])
--- Begin Message ---
Author: njp
Date: 2007-08-03 12:39:58 +0200 (Fri, 03 Aug 2007)
New Revision: 2614
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-contacts.c
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-dialer.c
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-talking.c
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-talking.h
Log:
2007-08-03 Neil J. Patel <[EMAIL PROTECTED]>
* src/moko-contacts.c: (moko_contacts_get_photo),
(moko_contacts_lookup), (moko_contacts_add_contact),
(moko_contacts_init):
When searching for a contact, it it doesn't have a photo, look for it.
* src/moko-dialer.c: (on_incoming_call), (on_incoming_clip),
(register_network_cb):
Set the incoming clip on the 'talking' widget.
* src/moko-talking.c: (moko_talking_set_clip),
(moko_talking_outgoing_call), (moko_talking_accepted_call):
* src/moko-talking.h:
Add a method to update the UI with an incomig clip.
2007-08-02 Neil J. Patel <[EMAIL PROTECTED]>
Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
2007-08-03 08:48:20 UTC (rev 2613)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
2007-08-03 10:39:58 UTC (rev 2614)
@@ -1,3 +1,19 @@
+2007-08-03 Neil J. Patel <[EMAIL PROTECTED]>
+
+ * src/moko-contacts.c: (moko_contacts_get_photo),
+ (moko_contacts_lookup), (moko_contacts_add_contact),
+ (moko_contacts_init):
+ When searching for a contact, it it doesn't have a photo, look for it.
+
+ * src/moko-dialer.c: (on_incoming_call), (on_incoming_clip),
+ (register_network_cb):
+ Set the incoming clip on the 'talking' widget.
+
+ * src/moko-talking.c: (moko_talking_set_clip),
+ (moko_talking_outgoing_call), (moko_talking_accepted_call):
+ * src/moko-talking.h:
+ Add a method to update the UI with an incomig clip.
+
2007-08-02 Neil J. Patel <[EMAIL PROTECTED]>
* src/moko-dialer.c: (on_incoming_call), (on_pin_requested),
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-contacts.c
===================================================================
---
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-contacts.c
2007-08-03 08:48:20 UTC (rev 2613)
+++
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-contacts.c
2007-08-03 10:39:58 UTC (rev 2614)
@@ -35,21 +35,64 @@
struct _MokoContactsPrivate
{
+ EBook *book;
+
GList *contacts;
GList *entries;
GHashTable *prefixes;
};
+static void
+moko_contacts_get_photo (MokoContacts *contacts, MokoContact *m_contact)
+{
+ MokoContactsPrivate *priv;
+ EContact *e_contact;
+ EContactPhoto *photo;
+ GError *err = NULL;
+ GdkPixbufLoader *loader;
+
+ g_return_if_fail (MOKO_IS_CONTACTS (contacts));
+ priv = contacts->priv;
+
+ if (!e_book_get_contact (priv->book, m_contact->uid, &e_contact, &err))
+ {
+ g_warning ("%s\n", err->message);
+ m_contact->photo = gdk_pixbuf_new_from_file (PKGDATADIR"/person.png",
NULL);
+ g_object_ref (m_contact->photo);
+ return;
+ }
+ photo = e_contact_get (e_contact, E_CONTACT_PHOTO);
+
+ loader = gdk_pixbuf_loader_new ();
+ gdk_pixbuf_loader_write (loader,
+ photo->data.inlined.data,
+ photo->data.inlined.length,
+ NULL);
+ gdk_pixbuf_loader_close (loader, NULL);
+
+ m_contact->photo = gdk_pixbuf_loader_get_pixbuf (loader);
+ if (GDK_IS_PIXBUF (m_contact->photo))
+ g_object_ref (m_contact->photo);
+
+ g_object_unref (loader);
+}
+
MokoContactEntry*
moko_contacts_lookup (MokoContacts *contacts, const gchar *number)
{
MokoContactsPrivate *priv;
+ MokoContactEntry *entry;
g_return_val_if_fail (MOKO_IS_CONTACTS (contacts), NULL);
priv = contacts->priv;
- return g_hash_table_lookup (priv->prefixes, number);
+ entry = g_hash_table_lookup (priv->prefixes, number);
+
+ if (!GDK_IS_PIXBUF (entry->contact->photo))
+ moko_contacts_get_photo (contacts, entry->contact);
+
+ return entry;
}
GList*
@@ -100,7 +143,7 @@
name = e_contact_get_const (e_contact, E_CONTACT_NAME_OR_ORG);
if (!name || (g_utf8_strlen (name, -1) <= 0))
- name = "Unnamed";
+ name = "Unknown";
/* Create the contact & append to the list */
m_contact = g_new0 (MokoContact, 1);
@@ -197,7 +240,7 @@
EBook *book;
EBookView *view;
EBookQuery *query;
- GList *contact, *c, *e;
+ GList *contact, *c;
priv = contacts->priv = MOKO_CONTACTS_GET_PRIVATE (contacts);
@@ -208,7 +251,7 @@
query = e_book_query_any_field_contains ("");
/* Open the system book and check that it is valid */
- book = e_book_new_system_addressbook (NULL);
+ book = priv->book = e_book_new_system_addressbook (NULL);
if (!book)
{
g_warning ("Failed to create system book\n");
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-dialer.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-dialer.c
2007-08-03 08:48:20 UTC (rev 2613)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-dialer.c
2007-08-03 10:39:58 UTC (rev 2614)
@@ -353,7 +353,7 @@
/* We sometimes get the signals multiple times */
if (priv->status == DIALER_STATUS_INCOMING)
{
- g_print ("We are already showing the incoming page");
+ g_print ("We are already showing the incoming page\n");
return;
}
g_print ("Status = %d\n", priv->status);
@@ -381,7 +381,16 @@
const gchar *number,
MokoDialer *dialer)
{
- g_print ("Number = %s\n", number);
+ MokoDialerPrivate *priv;
+ MokoContactEntry *entry;
+
+ g_return_if_fail (MOKO_IS_DIALER (dialer));
+ priv = dialer->priv;
+
+ entry = moko_contacts_lookup (priv->contacts, number);
+ moko_talking_set_clip (MOKO_TALKING (priv->talking), number, entry);
+
+ g_print ("Incoming Number = %s\n", number);
}
static void
@@ -458,7 +467,7 @@
{
/* We have yet to request registration, so lets do it */
/* FIXME: do the pin stuff */
- g_print ("Requesting registration");
+ g_print ("Requesting registration\n");
moko_gsmd_connection_network_register (priv->connection);
}
else
@@ -468,12 +477,12 @@
*/
if (priv->registered)
{
- g_print ("Netwok Registered");
+ g_print ("Netwok Registered\n");
return FALSE;
}
else
{
- g_print ("Requesting registration");
+ g_print ("Requesting registration\n");
moko_gsmd_connection_network_register (priv->connection);
}
}
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-talking.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-talking.c
2007-08-03 08:48:20 UTC (rev 2613)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-talking.c
2007-08-03 10:39:58 UTC (rev 2614)
@@ -62,6 +62,34 @@
static guint talking_signals[LAST_SIGNAL] = {0, };
+
+void
+moko_talking_set_clip (MokoTalking *talking,
+ const gchar *number,
+ MokoContactEntry *entry)
+{
+ MokoTalkingPrivate *priv;
+ gchar *markup;
+
+ g_return_if_fail (MOKO_IS_TALKING (talking));
+ priv = talking->priv;
+
+ if (entry)
+ markup = g_strdup_printf ("<b>%s</b>\n%s", entry->contact->name, number);
+ else
+ markup = g_strdup (number);
+
+ gtk_label_set_markup (GTK_LABEL (priv->status), markup);
+
+ if (entry && GDK_IS_PIXBUF (entry->contact->photo))
+ gtk_image_set_from_pixbuf (GTK_IMAGE (priv->person),
entry->contact->photo);
+ else
+ gtk_image_set_from_file (GTK_IMAGE (priv->person),
+ PKGDATADIR"/unkown.png");
+
+ g_free (markup);
+}
+
static gboolean
incoming_timeout (MokoTalking *talking)
{
@@ -148,8 +176,12 @@
gtk_label_set_text (GTK_LABEL (priv->title), "Outgoing Call");
gtk_label_set_markup (GTK_LABEL (priv->status), markup);
- gtk_image_set_from_file (GTK_IMAGE (priv->person),
- PKGDATADIR"/unkown.png");
+
+ if (entry && GDK_IS_PIXBUF (entry->contact->photo))
+ gtk_image_set_from_pixbuf (GTK_IMAGE (priv->person),
entry->contact->photo);
+ else
+ gtk_image_set_from_file (GTK_IMAGE (priv->person),
+ PKGDATADIR"/unkown.png");
g_source_remove (priv->timeout);
priv->timeout = g_timeout_add (1000,
@@ -201,10 +233,9 @@
gtk_image_set_from_file (GTK_IMAGE (priv->icon),
PKGDATADIR"/talking_3.png");
- gtk_label_set_text (GTK_LABEL (priv->status), number);
- gtk_image_set_from_file (GTK_IMAGE (priv->person),
- PKGDATADIR"/unkown.png");
-
+ /* We don't change the status or person widgets, as incoming call has already
+ * set them for us.
+ */
g_source_remove (priv->timeout);
priv->timeout = g_timeout_add (1000,
(GSourceFunc)talking_timeout,
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-talking.h
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-talking.h
2007-08-03 08:48:20 UTC (rev 2613)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-talking.h
2007-08-03 10:39:58 UTC (rev 2614)
@@ -1,6 +1,5 @@
/*
- * moko-talking; a GObject wrapper for the talking which exports method and
- * signals over dbus
+ * moko-talking; a GObject wrapper for the talking/incoming/outgoing page
*
* Authored by OpenedHand Ltd <[EMAIL PROTECTED]>
*
@@ -89,6 +88,11 @@
const gchar *number,
MokoContactEntry *entry);
+void
+moko_talking_set_clip (MokoTalking *talking,
+ const gchar *number,
+ MokoContactEntry *entry);
+
G_END_DECLS
#endif /* _HAVE_MOKO_TALKING_H */
--- End Message ---
--- Begin Message ---
Author: njp
Date: 2007-08-03 12:56:59 +0200 (Fri, 03 Aug 2007)
New Revision: 2615
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-contacts.c
Log:
2007-08-03 Neil J. Patel <[EMAIL PROTECTED]>
* src/moko-contacts.c: (moko_contacts_finalize):
Free lists/structs properly.
Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
2007-08-03 10:39:58 UTC (rev 2614)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
2007-08-03 10:56:59 UTC (rev 2615)
@@ -1,5 +1,10 @@
2007-08-03 Neil J. Patel <[EMAIL PROTECTED]>
+ * src/moko-contacts.c: (moko_contacts_finalize):
+ Free lists/structs properly.
+
+2007-08-03 Neil J. Patel <[EMAIL PROTECTED]>
+
* src/moko-contacts.c: (moko_contacts_get_photo),
(moko_contacts_lookup), (moko_contacts_add_contact),
(moko_contacts_init):
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-contacts.c
===================================================================
---
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-contacts.c
2007-08-03 10:39:58 UTC (rev 2614)
+++
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-contacts.c
2007-08-03 10:56:59 UTC (rev 2615)
@@ -218,6 +218,39 @@
static void
moko_contacts_finalize (GObject *contacts)
{
+ MokoContactsPrivate *priv;
+ GList *l;
+
+ g_return_if_fail (MOKO_IS_CONTACTS (contacts));
+ priv = MOKO_CONTACTS (contacts)->priv;
+
+ g_hash_table_destroy (priv->prefixes);
+
+ for (l = priv->contacts; l != NULL; l = l->next)
+ {
+ MokoContact *contact = (MokoContact*)l->data;
+ if (contact)
+ {
+ g_free (contact->uid);
+ g_free (contact->name);
+ if (G_IS_OBJECT (contact->photo))
+ g_object_unref (contact->photo);
+ }
+ }
+ g_list_free (priv->contacts);
+
+ for (l = priv->entries; l != NULL; l = l->next)
+ {
+ MokoContactEntry *entry = (MokoContactEntry*)l->data;
+ if (entry)
+ {
+ g_free (entry->desc);
+ g_free (entry->number);
+ entry->contact = NULL;
+ }
+ }
+ g_list_free (priv->entries);
+
G_OBJECT_CLASS (moko_contacts_parent_class)->finalize (contacts);
}
--- End Message ---
--- Begin Message ---
Author: chris
Date: 2007-08-03 13:21:43 +0200 (Fri, 03 Aug 2007)
New Revision: 2616
Modified:
trunk/src/target/OM-2007.2/libraries/libmokojournal2/ChangeLog
trunk/src/target/OM-2007.2/libraries/libmokojournal2/configure.ac
trunk/src/target/OM-2007.2/libraries/libmokojournal2/mokojournal/moko-journal.c
Log:
Check for existence of ECalComponentId
Modified: trunk/src/target/OM-2007.2/libraries/libmokojournal2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/libraries/libmokojournal2/ChangeLog
2007-08-03 10:56:59 UTC (rev 2615)
+++ trunk/src/target/OM-2007.2/libraries/libmokojournal2/ChangeLog
2007-08-03 11:21:43 UTC (rev 2616)
@@ -1,3 +1,9 @@
+2007-08-03 Chris Lord,,, <[EMAIL PROTECTED]>
+
+ * configure.ac:
+ * mokojournal/moko-journal.c: (on_entries_removed_cb):
+ Check for existence of ECalComponentId
+
2007-07-29 Holger Freyther <[EMAIL PROTECTED]>
Refer to version two of this library
Modified: trunk/src/target/OM-2007.2/libraries/libmokojournal2/configure.ac
===================================================================
--- trunk/src/target/OM-2007.2/libraries/libmokojournal2/configure.ac
2007-08-03 10:56:59 UTC (rev 2615)
+++ trunk/src/target/OM-2007.2/libraries/libmokojournal2/configure.ac
2007-08-03 11:21:43 UTC (rev 2616)
@@ -15,6 +15,16 @@
# base deps
PKG_CHECK_MODULES(DEPS, libecal-1.2 >= $LIBECAL_VERSION)
+# Check for existence of ECalComponentId
+old_cflags=$CFLAGS
+CFLAGS=$DEPS_CFLAGS
+AC_CHECK_TYPE(ECalComponentId, [], [], [#include <libecal/e-cal.h>])
+
+if test $ac_cv_type_ECalComponentId = yes; then
+ AC_DEFINE(HAVE_ECALCOMPONENTID, 1, [Defined if ECalComponentId exists])
+fi
+CFLAGS=$old_cflags
+
if test x$MOKO_DEVEL = xon ; then
AC_MSG_NOTICE([removing -O2 from CFLAGS])
CFLAGS="-g -Wall"
Modified:
trunk/src/target/OM-2007.2/libraries/libmokojournal2/mokojournal/moko-journal.c
===================================================================
---
trunk/src/target/OM-2007.2/libraries/libmokojournal2/mokojournal/moko-journal.c
2007-08-03 10:56:59 UTC (rev 2615)
+++
trunk/src/target/OM-2007.2/libraries/libmokojournal2/mokojournal/moko-journal.c
2007-08-03 11:21:43 UTC (rev 2616)
@@ -24,6 +24,9 @@
#include <libical/icaltypes.h>
#include <libecal/e-cal.h>
#include <libecal/e-cal-component.h>
+#ifdef HAVE_CONFIG
+# include <config.h>
+#endif
#include "moko-journal.h"
#include "moko-time-priv.h"
@@ -1449,13 +1452,18 @@
*/
for (cur = a_uids ; cur ; cur = cur->next)
{
- if (cur->data)
+ const gchar *uid;
+
+#ifdef HAVE_ECALCOMPONENTID
+ ECalComponentId *id = cur->data;
+ uid = id->uid;
+#else
+ uid = cur->data;
+#endif
+
+ if (!moko_journal_remove_entry_by_uid (a_journal, uid))
{
- if (!moko_journal_remove_entry_by_uid (a_journal, cur->data))
- {
- g_message ("failed to remove entry of uid %s\n",
- (const char*)cur->data) ;
- }
+ g_message ("failed to remove entry of uid %s\n", uid) ;
}
}
}
--- End Message ---
--- Begin Message ---
Author: njp
Date: 2007-08-03 13:30:50 +0200 (Fri, 03 Aug 2007)
New Revision: 2617
Modified:
trunk/src/target/OM-2007.2/libraries/libmokojournal2/ChangeLog
trunk/src/target/OM-2007.2/libraries/libmokojournal2/mokojournal/moko-journal.c
trunk/src/target/OM-2007.2/libraries/libmokojournal2/mokojournal/moko-journal.h
Log:
2007-08-03 Neil J. Patel <[EMAIL PROTECTED]>
* mokojournal/moko-journal.c:
(moko_journal_voice_info_set_distant_number):
* mokojournal/moko-journal.h:
Use const when accepting string arguments.
Modified: trunk/src/target/OM-2007.2/libraries/libmokojournal2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/libraries/libmokojournal2/ChangeLog
2007-08-03 11:21:43 UTC (rev 2616)
+++ trunk/src/target/OM-2007.2/libraries/libmokojournal2/ChangeLog
2007-08-03 11:30:50 UTC (rev 2617)
@@ -1,14 +1,21 @@
-2007-08-03 Chris Lord,,, <[EMAIL PROTECTED]>
+2007-08-03 Neil J. Patel <[EMAIL PROTECTED]>
+ * mokojournal/moko-journal.c:
+ (moko_journal_voice_info_set_distant_number):
+ * mokojournal/moko-journal.h:
+ Use const when accepting string arguments.
+
+2007-08-03 Chris Lord <[EMAIL PROTECTED]>
+
* configure.ac:
* mokojournal/moko-journal.c: (on_entries_removed_cb):
Check for existence of ECalComponentId
2007-07-29 Holger Freyther <[EMAIL PROTECTED]>
- Refer to version two of this library
+ Refer to version two of this library
- * libmokojournal2.pc.in:
+ * libmokojournal2.pc.in:
2007-07-28 Michael Lauer <[EMAIL PROTECTED]>
Modified:
trunk/src/target/OM-2007.2/libraries/libmokojournal2/mokojournal/moko-journal.c
===================================================================
---
trunk/src/target/OM-2007.2/libraries/libmokojournal2/mokojournal/moko-journal.c
2007-08-03 11:21:43 UTC (rev 2616)
+++
trunk/src/target/OM-2007.2/libraries/libmokojournal2/mokojournal/moko-journal.c
2007-08-03 11:30:50 UTC (rev 2617)
@@ -1966,7 +1966,7 @@
void
moko_journal_voice_info_set_distant_number (MokoJournalEntry *journal_entry,
- gchar *a_number)
+ const gchar *a_number)
{
MokoJournalVoiceInfo *a_info = NULL;
moko_journal_entry_get_voice_info (journal_entry, &a_info) ;
Modified:
trunk/src/target/OM-2007.2/libraries/libmokojournal2/mokojournal/moko-journal.h
===================================================================
---
trunk/src/target/OM-2007.2/libraries/libmokojournal2/mokojournal/moko-journal.h
2007-08-03 11:21:43 UTC (rev 2616)
+++
trunk/src/target/OM-2007.2/libraries/libmokojournal2/mokojournal/moko-journal.h
2007-08-03 11:30:50 UTC (rev 2617)
@@ -450,7 +450,7 @@
* @info: the extra property set attached to the voice call
*/
void moko_journal_voice_info_set_distant_number (MokoJournalEntry *info,
- gchar *number) ;
+ const gchar *number) ;
const gchar* moko_journal_voice_info_get_distant_number
(MokoJournalEntry *info) ;
--- End Message ---
--- Begin Message ---
Author: njp
Date: 2007-08-03 13:52:37 +0200 (Fri, 03 Aug 2007)
New Revision: 2618
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-dialer.c
Log:
2007-08-03 Neil J. Patel <[EMAIL PROTECTED]>
* src/moko-dialer.c: (on_keypad_dial_clicked),
(on_talking_accept_call), (on_talking_reject_call),
(on_incoming_call), (on_incoming_clip), (on_call_progress_changed):
Create MokoJournalEntry's for all events.
Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
2007-08-03 11:30:50 UTC (rev 2617)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
2007-08-03 11:52:37 UTC (rev 2618)
@@ -1,5 +1,12 @@
2007-08-03 Neil J. Patel <[EMAIL PROTECTED]>
+ * src/moko-dialer.c: (on_keypad_dial_clicked),
+ (on_talking_accept_call), (on_talking_reject_call),
+ (on_incoming_call), (on_incoming_clip), (on_call_progress_changed):
+ Create MokoJournalEntry's for all events.
+
+2007-08-03 Neil J. Patel <[EMAIL PROTECTED]>
+
* src/moko-contacts.c: (moko_contacts_finalize):
Free lists/structs properly.
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-dialer.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-dialer.c
2007-08-03 11:30:50 UTC (rev 2617)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-dialer.c
2007-08-03 11:52:37 UTC (rev 2618)
@@ -19,6 +19,9 @@
#include <gtk/gtk.h>
+#include <stdio.h>
+#include <string.h>
+
#include <dbus/dbus-glib.h>
#include <dbus/dbus-glib-bindings.h>
@@ -58,6 +61,10 @@
MokoJournal *journal;
MokoContacts *contacts;
+ /* The shared MokoJournalEntry which is constantly created */
+ MokoJournalEntry *entry;
+ MokoTime *time;
+
/* Registration variables */
gboolean reg_request;
gboolean registered;
@@ -227,6 +234,21 @@
priv->status = DIALER_STATUS_DIALING;
entry = moko_contacts_lookup (moko_contacts_get_default (), number);
+
+ /* Prepare a voice journal entry */
+ priv->entry = moko_journal_entry_new (VOICE_JOURNAL_ENTRY);
+ priv->time = moko_time_new_today ();
+ moko_journal_entry_set_direction (priv->entry, DIRECTION_IN);
+ moko_journal_entry_set_dtstart (priv->entry, priv->time);
+ moko_journal_entry_set_source (priv->entry, "Openmoko Dialer");
+ moko_journal_voice_info_set_distant_number (priv->entry, number);
+ if (entry)
+ moko_journal_entry_set_contact_uid (priv->entry, entry->contact->uid);
+ moko_journal_add_entry (priv->journal, priv->entry);
+ moko_time_free (priv->time);
+ priv->entry = NULL;
+ priv->time = NULL;
+
moko_talking_outgoing_call (MOKO_TALKING (priv->talking), number, entry);
gtk_notebook_insert_page (GTK_NOTEBOOK (priv->notebook), priv->talking,
@@ -260,6 +282,16 @@
priv->status = DIALER_STATUS_TALKING;
+ /* Finalise and add the journal entry */
+ if (priv->entry)
+ {
+ moko_journal_add_entry (priv->journal, priv->entry);
+ if (priv->time)
+ moko_time_free (priv->time);
+ priv->entry = NULL;
+ priv->time = NULL;
+ }
+
moko_talking_accepted_call (MOKO_TALKING (priv->talking), NULL, NULL);
moko_gsmd_connection_voice_accept (priv->connection);
@@ -277,6 +309,16 @@
priv->status = DIALER_STATUS_NORMAL;
+ /* Finalise and add the journal entry */
+ if (priv->entry)
+ {
+ moko_journal_add_entry (priv->journal, priv->entry);
+ if (priv->time)
+ moko_time_free (priv->time);
+ priv->entry = NULL;
+ priv->time = NULL;
+ }
+
gtk_notebook_remove_page (GTK_NOTEBOOK (priv->notebook), 0);
moko_gsmd_connection_voice_hangup (priv->connection);
@@ -353,13 +395,19 @@
/* We sometimes get the signals multiple times */
if (priv->status == DIALER_STATUS_INCOMING)
{
- g_print ("We are already showing the incoming page\n");
+ /*g_print ("We are already showing the incoming page\n");*/
return;
}
- g_print ("Status = %d\n", priv->status);
-
priv->status = DIALER_STATUS_INCOMING;
+ /* Prepare a voice journal entry */
+ priv->entry = moko_journal_entry_new (VOICE_JOURNAL_ENTRY);
+ priv->time = moko_time_new_today ();
+ moko_journal_entry_set_direction (priv->entry, DIRECTION_IN);
+ moko_journal_entry_set_dtstart (priv->entry, priv->time);
+ moko_journal_entry_set_source (priv->entry, "Openmoko Dialer");
+
+ /* Set up the user interface */
moko_talking_incoming_call (MOKO_TALKING (priv->talking), NULL, NULL);
gtk_notebook_insert_page (GTK_NOTEBOOK (priv->notebook), priv->talking,
@@ -368,9 +416,8 @@
gtk_container_child_set (GTK_CONTAINER (priv->notebook), priv->talking,
"tab-expand", TRUE,
NULL);
+ gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->notebook), 0);
- gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->notebook), 0);
-
gtk_window_present (GTK_WINDOW (priv->window));
g_signal_emit (G_OBJECT (dialer), dialer_signals[INCOMING_CALL], 0, NULL);
@@ -383,13 +430,33 @@
{
MokoDialerPrivate *priv;
MokoContactEntry *entry;
+ static gint timestamp = 0;
+ static gchar *last = NULL;
g_return_if_fail (MOKO_IS_DIALER (dialer));
priv = dialer->priv;
+
+ if (last
+ && (strcmp (number, last) == 0)
+ && ((GDK_CURRENT_TIME - timestamp) < 1500))
+ {
+ timestamp = GDK_CURRENT_TIME;
+ return;
+ }
+ if (last)
+ g_free (last);
+ last = g_strdup (number);
+ timestamp = GDK_CURRENT_TIME;
entry = moko_contacts_lookup (priv->contacts, number);
moko_talking_set_clip (MOKO_TALKING (priv->talking), number, entry);
+ /* Add the info to the journal entry */
+ moko_journal_voice_info_set_distant_number (priv->entry, number);
+ if (entry)
+ moko_journal_entry_set_contact_uid (priv->entry, entry->contact->uid);
+
+ g_signal_emit (G_OBJECT (dialer), dialer_signals[INCOMING_CALL], 0, number);
g_print ("Incoming Number = %s\n", number);
}
@@ -404,13 +471,13 @@
g_print ("Incoming pin request for type %d\n", type);
}
-
static void
on_call_progress_changed (MokoGsmdConnection *conn,
int type,
MokoDialer *dialer)
{
MokoDialerPrivate *priv;
+ enum MessageDirection dir;
g_return_if_fail (MOKO_IS_DIALER (dialer));
priv = dialer->priv;
@@ -421,6 +488,19 @@
case MOKO_GSMD_PROG_RELEASE:
moko_dialer_hung_up (dialer);
moko_keypad_set_talking (MOKO_KEYPAD (priv->keypad), FALSE);
+ if (priv->entry)
+ {
+ moko_journal_entry_get_direction (priv->entry, &dir);
+ if (dir == DIRECTION_IN)
+ moko_journal_voice_info_set_was_missed (priv->entry, TRUE);
+
+ moko_journal_add_entry (priv->journal, priv->entry);
+ if (priv->time)
+ moko_time_free (priv->time);
+ priv->entry = NULL;
+ priv->time = NULL;
+ }
+ moko_journal_write_to_storage (priv->journal);
g_print ("mokogsmd disconnect\n");
break;
--- End Message ---
_______________________________________________
commitlog mailing list
[email protected]
http://lists.openmoko.org/mailman/listinfo/commitlog