r3072 - in trunk/src/target/OM-2007.2/applications/openmoko-dialer2: . src
thomas at sita.openmoko.org
thomas at sita.openmoko.org
Tue Oct 2 12:58:15 CEST 2007
Author: thomas
Date: 2007-10-02 12:58:14 +0200 (Tue, 02 Oct 2007)
New Revision: 3072
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-history.c
Log:
Patch by: Roman Moravcik <roman.moravcik at gmail.com>
* src/moko-history.c: (moko_history_load_entries): History list wasn't
corectly filled with moko journal entries,
(on_delete_clicked), (history_add_entry): Function
moko_journal_remove_entry_by_uid need uid value instead of contact_uid,
(history_add_entry): Replace phone number with name of contact if there
is a entry in addressbook. Display "Unknown number" if phone number is
NULL.
Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog 2007-10-02 10:47:05 UTC (rev 3071)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog 2007-10-02 10:58:14 UTC (rev 3072)
@@ -2,6 +2,18 @@
Patch by: Roman Moravcik <roman.moravcik at gmail.com>
+ * src/moko-history.c: (moko_history_load_entries): History list wasn't
+ corectly filled with moko journal entries,
+ (on_delete_clicked), (history_add_entry): Function
+ moko_journal_remove_entry_by_uid need uid value instead of contact_uid,
+ (history_add_entry): Replace phone number with name of contact if there
+ is a entry in addressbook. Display "Unknown number" if phone number is
+ NULL.
+
+2007-10-02 Thomas Wood <thomas at openedhand.com>
+
+ Patch by: Roman Moravcik <roman.moravcik at gmail.com>
+
* src/moko-dialer.c: (on_keypad_dial_clicked), (on_incoming_call),
(on_network_registered): Store network information (LocationAreaCode,
CellID) in moko journal.
Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-history.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-history.c 2007-10-02 10:47:05 UTC (rev 3071)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-history.c 2007-10-02 10:58:14 UTC (rev 3072)
@@ -21,11 +21,14 @@
#include <gtk/gtk.h>
+#include <string.h>
+
#include <moko-gsmd-connection.h>
#include <moko-journal.h>
#include <moko-stock.h>
#include <moko-finger-scroll.h>
+#include "moko-contacts.h"
#include "moko-history.h"
G_DEFINE_TYPE (MokoHistory, moko_history, GTK_TYPE_VBOX)
@@ -158,9 +161,9 @@
selection = gtk_tree_view_get_selection (treeview);
if (!gtk_tree_selection_get_selected (selection, &filtered, &iter0))
- ;
+ return;
- /*gtk_tree_model_get (filtered, &iter0, ENTRY_POINTER_COLUMN, &uid, -1);*/
+ gtk_tree_model_get (filtered, &iter0, ENTRY_POINTER_COLUMN, &uid, -1);
/* Create a dialog */
dialog = gtk_message_dialog_new (GTK_WINDOW (
@@ -228,6 +231,7 @@
{
GtkTreeIter iter;
const gchar *uid, *number;
+ MokoContactEntry *contacts;
GdkPixbuf *icon = NULL;
const gchar *display_text;
time_t dstart;
@@ -236,7 +240,7 @@
const MokoTime *time;
gint type;
- uid = moko_journal_entry_get_contact_uid (entry);
+ uid = moko_journal_entry_get_uid (entry);
moko_journal_entry_get_direction (entry, &direction);
time = moko_journal_entry_get_dtstart (entry);
dstart = moko_time_as_timet (time);
@@ -265,10 +269,18 @@
}
/* display text should be the contact name or the number dialed */
- /* FIXME: look up contact uid if stored */
- display_text = number;
+ contacts = moko_contacts_lookup (moko_contacts_get_default (), number);
+ if (contacts)
+ display_text = contacts->contact->name;
+ else
+ {
+ if (number == NULL || !strcmp(number, "") || !strcmp(number, "NULL"))
+ display_text = "Unknown number";
+ else
+ display_text = number;
+ }
- if ( number == NULL || display_text == NULL || uid == NULL)
+ if (display_text == NULL || uid == NULL)
{
/*g_debug ("Not adding");
return FALSE;*/
@@ -434,7 +446,7 @@
for (e = entries; e != NULL; e = e->next)
{
- if (history_add_entry (store, entry))
+ if (history_add_entry (store, e->data))
j++;
}
}
More information about the commitlog
mailing list