r2168 - trunk/src/target/OM-2007/applications/openmoko-dialer/src

njp at sita.openmoko.org njp at sita.openmoko.org
Tue Jun 5 17:45:29 CEST 2007


Author: njp
Date: 2007-06-05 17:45:28 +0200 (Tue, 05 Jun 2007)
New Revision: 2168

Modified:
   trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-window-history.c
   trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-window-outgoing.c
Log:
Outgoing calls are also added to the journal; History view fixes

Modified: trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-window-history.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-window-history.c	2007-06-05 15:15:00 UTC (rev 2167)
+++ trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-window-history.c	2007-06-05 15:45:28 UTC (rev 2168)
@@ -41,7 +41,7 @@
   INCOMING
 } CallFilter;
 
-#define HISTORY_MAX_ENTRIES 25
+#define HISTORY_MAX_ENTRIES 50
 
 #define HISTORY_CALL_INCOMING_ICON "moko-history-call-in"
 #define HISTORY_CALL_OUTGOING_ICON "moko-history-call-out"
@@ -819,7 +819,7 @@
                         
   
   n_entries = moko_journal_get_nb_entries (p_dialer_data->journal);
-  g_print ("Journal entries = %d", n_entries);
+  g_print ("Journal entries = %d\n", n_entries);
   if (n_entries < 1)
   {
     g_print ("there are no entries in the journal\n");
@@ -1007,6 +1007,8 @@
     
   g_return_if_fail (p_dialer_data);
   
+  g_print ("A new entry has been added\n");
+  
   /* We're not interested in anything other than voice entrys */
   if (moko_journal_entry_get_type (j_entry) != VOICE_JOURNAL_ENTRY)
   {

Modified: trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-window-outgoing.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-window-outgoing.c	2007-06-05 15:15:00 UTC (rev 2167)
+++ trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-window-outgoing.c	2007-06-05 15:45:28 UTC (rev 2168)
@@ -143,14 +143,29 @@
 void
 window_outgoing_dial (MokoDialerData *data, gchar *number)
 {
+  MokoJournalEntry *entry = NULL;
+  MokoJournalVoiceInfo *info = NULL;
+  
   gulong progress_handler;
+  
+  /* create the journal entry for this call and add it to the journal */
+  entry = moko_journal_entry_new (VOICE_JOURNAL_ENTRY);
+  moko_journal_entry_set_direction (entry, DIRECTION_OUT);
+  moko_journal_entry_get_voice_info (entry, &info);
+  moko_journal_entry_set_dtstart (entry, moko_time_new_today ());
+  moko_journal_add_entry (data->journal, entry);
+  moko_journal_voice_info_set_distant_number (info, number);
+  /* FIXME: We should be able to associate a number with a number, and add that
+            info to the entry */
 
   /* connect our handler to track call progress */
   progress_handler = g_signal_connect (data->connection, "call-progress", 
-                    G_CALLBACK (call_progress_cb), data);
+                                       G_CALLBACK (call_progress_cb), data);
   g_object_set_data (G_OBJECT (data->window_outgoing), "current-number", number);
   moko_gsmd_connection_voice_dial (data->connection, number);
-  moko_message_dialog_set_message (MOKO_MESSAGE_DIALOG (data->window_outgoing), "Calling %s", number);
+  moko_message_dialog_set_message (MOKO_MESSAGE_DIALOG (data->window_outgoing),
+                                   "Calling %s", number);               
+  
   if (gtk_dialog_run (GTK_DIALOG (data->window_outgoing)) == GTK_RESPONSE_OK)
   {
     /* call has connected, so open the talking window */
@@ -169,4 +184,7 @@
 
   /* disconnect the call progress handler since we no longer need it */
   g_signal_handler_disconnect (data->connection, progress_handler);
+  
+  /* commit the journal entry */
+  moko_journal_write_to_storage (data->journal);
 }





More information about the commitlog mailing list