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. r2166 -
      trunk/src/target/OM-2007/applications/openmoko-dialer/src
      ([EMAIL PROTECTED])
   2. r2167 -
      trunk/src/target/OM-2007/applications/openmoko-dialer/src
      ([EMAIL PROTECTED])
   3. r2168 -
      trunk/src/target/OM-2007/applications/openmoko-dialer/src
      ([EMAIL PROTECTED])
   4. r2169 -
      trunk/src/target/OM-2007/applications/openmoko-dialer/src
      ([EMAIL PROTECTED])
   5. r2170 - in
      trunk/src/target/OM-2007/applications/openmoko-today: . src
      ([EMAIL PROTECTED])
   6. r2171 -
      trunk/src/target/OM-2007/applications/openmoko-dialer/src
      ([EMAIL PROTECTED])
--- Begin Message ---
Author: njp
Date: 2007-06-05 16:56:52 +0200 (Tue, 05 Jun 2007)
New Revision: 2166

Modified:
   
trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-window-history.c
Log:
fixed segfault in 'delete call' dialog

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 13:59:46 UTC (rev 2165)
+++ 
trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-window-history.c
   2007-06-05 14:56:52 UTC (rev 2166)
@@ -234,6 +234,9 @@
   
   gtk_tree_model_get (model, &iter, HISTORY_ENTRY_POINTER, &entry, -1);
   
+  if (entry == NULL)
+        return;
+  
   if (!(uid = moko_journal_entry_get_uid (entry))) 
   {
     g_print ("Unable to get entry\n");
@@ -259,6 +262,7 @@
       break;
     default:
       gtk_widget_destroy (dialog);
+      return;
       break;
   }
   
@@ -840,6 +844,7 @@
       j++;
     i++;
   }
+  
   return 1;
 }
 




--- End Message ---
--- Begin Message ---
Author: njp
Date: 2007-06-05 17:15:00 +0200 (Tue, 05 Jun 2007)
New Revision: 2167

Modified:
   
trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-window-history.c
Log:
'Delete call' code cleanup; Added a variable, to limit number of entries that 
are shown in the history view

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 14:56:52 UTC (rev 2166)
+++ 
trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-window-history.c
   2007-06-05 15:15:00 UTC (rev 2167)
@@ -41,6 +41,8 @@
   INCOMING
 } CallFilter;
 
+#define HISTORY_MAX_ENTRIES 25
+
 #define HISTORY_CALL_INCOMING_ICON "moko-history-call-in"
 #define HISTORY_CALL_OUTGOING_ICON "moko-history-call-out"
 #define HISTORY_CALL_MISSED_ICON "moko-history-call-missed"
@@ -219,7 +221,6 @@
   GtkTreeSelection *selection;
   GtkTreeView *treeview;
   GtkTreePath *path;
-  MokoJournalEntry *entry = NULL;
   const gchar *uid;
   gint result = 0;
   
@@ -232,16 +233,10 @@
     return;
   }
   
-  gtk_tree_model_get (model, &iter, HISTORY_ENTRY_POINTER, &entry, -1);
+  gtk_tree_model_get (model, &iter, HISTORY_ENTRY_POINTER, &uid, -1);
   
-  if (entry == NULL)
+  if (uid == NULL)
         return;
-  
-  if (!(uid = moko_journal_entry_get_uid (entry))) 
-  {
-    g_print ("Unable to get entry\n");
-    return;
-  }
   /* We need to show a dialog to make sure this is what the user wants */
   dialog = moko_message_dialog_new ();
   
@@ -720,7 +715,7 @@
       HISTORY_ICON_NAME_COLUMN, icon,
       HISTORY_DISPLAY_TEXT_COLUMN, display_text,
       HISTORY_CALL_TYPE_COLUMN, type,
-      HISTORY_ENTRY_POINTER, (gpointer)j_entry,
+      HISTORY_ENTRY_POINTER, uid,
       -1);
   return TRUE;
 }
@@ -781,7 +776,7 @@
                                       GDK_TYPE_PIXBUF, 
                                       G_TYPE_STRING,
                                       G_TYPE_INT,
-                                      G_TYPE_POINTER);
+                                      G_TYPE_STRING);
                                       
   p_dialer_data->g_list_store = list_store;
   
@@ -832,17 +827,17 @@
   }
   
   i = j = 0;
-  while (moko_journal_get_entry_at (p_dialer_data->journal, i, &j_entry))
+  for (i = 0; i < n_entries && j < HISTORY_MAX_ENTRIES; i++)
   {
+    moko_journal_get_entry_at (p_dialer_data->journal, i, &j_entry);
+    
     /* We're not interested in anything other than voice entrys */
     if (moko_journal_entry_get_type (j_entry) != VOICE_JOURNAL_ENTRY)
     {
-      i++;
       continue;
     }
     if (history_add_entry (list_store, j_entry))
       j++;
-    i++;
   }
   
   return 1;




--- End Message ---
--- Begin Message ---
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);
 }




--- End Message ---
--- Begin Message ---
Author: thomas
Date: 2007-06-05 18:19:47 +0200 (Tue, 05 Jun 2007)
New Revision: 2169

Modified:
   trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-main.c
   
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.h
Log:
openmoko-dialer: Add --show-missed command line option to show the history
window filtered by missed calls


Modified: 
trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-main.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-main.c     
2007-06-05 15:45:28 UTC (rev 2168)
+++ trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-main.c     
2007-06-05 16:19:47 UTC (rev 2169)
@@ -48,7 +48,6 @@
 static void
 handle_sigusr1 (int value)
 {
-  DBG_ENTER ();
   MokoDialerData *p_data = moko_get_app_data ();
   if (!p_data)
     return;
@@ -62,11 +61,33 @@
   }
   gtk_widget_show_all (mainwindow);
   gtk_window_present (GTK_WINDOW (mainwindow));
-  DBG_TRACE ();
   signal (SIGUSR1, handle_sigusr1);
-  DBG_LEAVE ();
 }
 
+static void
+handle_sigusr2 (int value)
+{
+  /* Show missed calls */
+  MokoDialerData *p_data = moko_get_app_data ();
+  if (!p_data)
+    return;
+  GtkWidget *window = p_data->window_history;
+
+  if (!window)
+    return;
+
+  /*
+   * Filter history on missed calls
+   */
+  window_history_filter (p_data, CALLS_MISSED);
+
+  gtk_widget_show_all (window);
+  gtk_window_present (GTK_WINDOW (window));
+  signal (SIGUSR2, handle_sigusr2);
+}
+
+
+
 static pid_t
 testlock (char *fname)
 {
@@ -130,11 +151,14 @@
   }
 }
 
-static gboolean show_gui;
+static gboolean show_dialer;
+static gboolean show_missed;
 
 static GOptionEntry entries[] = {
-  {"show-gui", 's', 0, G_OPTION_ARG_NONE, &show_gui,
-   "Show the GUI at startup (default off)", "N"},
+  {"show-dialer", 's', 0, G_OPTION_ARG_NONE, &show_dialer,
+   "Show the dialer at startup", "N"},
+  {"show-missed", 'm', 0, G_OPTION_ARG_NONE, &show_missed,
+   "Show the history window filtered by the missed, none.", "N"},
   {NULL}
 };
 
@@ -160,9 +184,13 @@
 
   //FIXME: the following lines to enable unique instance will be changed.
   lockapp = testlock ("/tmp/dialer.lock");
+
   if (lockapp > 0)
   {
-    kill (lockapp, SIGUSR1);
+    if (show_missed)
+      kill (lockapp, SIGUSR2);
+    else
+      kill (lockapp, SIGUSR1);
 
     /* make sure startup notifaction is terminated */
     gdk_init(&argc, &argv);
@@ -200,7 +228,9 @@
   p_dialer_data->journal = moko_journal_open_default ();
   moko_journal_load_from_storage (p_dialer_data->journal);
 
+  /* set up signal handling */
   signal (SIGUSR1, handle_sigusr1);
+  signal (SIGUSR2, handle_sigusr2);
 
   //init the dialer windows
   window_dialer_init (p_dialer_data);
@@ -209,11 +239,16 @@
   window_outgoing_init (p_dialer_data);
   window_history_init (p_dialer_data);
 
-  if (show_gui)
+  if (show_dialer)
   {
     handle_sigusr1 (SIGUSR1);
   }
-  
+
+  if (show_missed)
+  {
+    handle_sigusr2 (SIGUSR2);
+  }
+ 
   gtk_main ();
   
   //release everything

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:45:28 UTC (rev 2168)
+++ 
trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-window-history.c
   2007-06-05 16:19:47 UTC (rev 2169)
@@ -33,14 +33,6 @@
 #include "dialer-window-history.h"
 #include "dialer-window-outgoing.h"
 
-/* call types */
-typedef enum {
-  ALL =0,
-  MISSED,
-  OUTGOING,
-  INCOMING
-} CallFilter;
-
 #define HISTORY_MAX_ENTRIES 50
 
 #define HISTORY_CALL_INCOMING_ICON "moko-history-call-in"
@@ -74,7 +66,7 @@
 
 static int
 history_view_change_filter (MokoDialerData * p_dialer_data,
-                            CallFilter type)
+                            CallHistoryFilter type)
 {
  p_dialer_data->g_history_filter_type = type;
  gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER
@@ -89,7 +81,7 @@
   MokoDialerData *p_dialer_data = (MokoDialerData *) user_data;
   GtkWidget *label = p_dialer_data->label_filter_history;
   gtk_label_set_text (GTK_LABEL (label), "All");
-  history_view_change_filter (p_dialer_data, ALL);
+  history_view_change_filter (p_dialer_data, CALLS_ALL);
   history_update_counter (p_dialer_data);
 }
 
@@ -100,7 +92,7 @@
   MokoDialerData *p_dialer_data = (MokoDialerData *) user_data;
   GtkWidget *label = p_dialer_data->label_filter_history;
   gtk_label_set_text (GTK_LABEL (label), "Missed");
-  history_view_change_filter (p_dialer_data, MISSED);
+  history_view_change_filter (p_dialer_data, CALLS_MISSED);
   history_update_counter (p_dialer_data);
 }
 
@@ -111,7 +103,7 @@
   MokoDialerData *p_dialer_data = (MokoDialerData *) user_data;
   GtkWidget *label = p_dialer_data->label_filter_history;
   gtk_label_set_text (GTK_LABEL (label), "Dialed");
-  history_view_change_filter (p_dialer_data, OUTGOING);
+  history_view_change_filter (p_dialer_data, CALLS_OUTGOING);
   history_update_counter (p_dialer_data);
 }
 
@@ -122,10 +114,24 @@
   MokoDialerData *p_dialer_data = (MokoDialerData *) user_data;
   GtkWidget *label = p_dialer_data->label_filter_history;
   gtk_label_set_text (GTK_LABEL (label), "Received");
-  history_view_change_filter (p_dialer_data, INCOMING);
+  history_view_change_filter (p_dialer_data, CALLS_INCOMING);
   history_update_counter (p_dialer_data);
 }
 
+void window_history_filter (MokoDialerData *data, CallHistoryFilter filter)
+{
+  /* FIXME: this is ugly */
+  switch (filter)
+  {
+    case CALLS_INCOMING: on_received_calls_activate (NULL, data); break;
+    case CALLS_OUTGOING: on_dialed_calls_activate (NULL, data); break;
+    case CALLS_MISSED: on_missed_calls_activate (NULL, data); break;
+    case CALLS_ALL:
+    default:
+         on_all_calls_activate (NULL, data);
+  }
+}
+
 static gboolean
 on_eventboxTop_button_release_event (GtkWidget * widget,
                                      GdkEventButton * event,
@@ -638,8 +644,8 @@
                                       GtkTreeIter * iter, gpointer data)
 {
   MokoDialerData *p_dialer_data = (MokoDialerData *) data;
-  CallFilter type;
-  if (p_dialer_data->g_history_filter_type == ALL)
+  CallHistoryFilter type;
+  if (p_dialer_data->g_history_filter_type == CALLS_ALL)
     return TRUE;
   
   gtk_tree_model_get (model, iter, HISTORY_CALL_TYPE_COLUMN, &type, -1);
@@ -665,7 +671,7 @@
   gboolean was_missed;
   const MokoTime *time;
   MokoJournalVoiceInfo *info = NULL;
-  CallFilter type;
+  CallHistoryFilter type;
     
   /* We're not interested in anything other than voice entrys */
   if (moko_journal_entry_get_type (j_entry) != VOICE_JOURNAL_ENTRY)
@@ -689,19 +695,19 @@
   if (direction == DIRECTION_OUT)
   {
     icon = history_out_icon;
-    type = OUTGOING;
+    type = CALLS_OUTGOING;
   }
   else
   {
     if (was_missed)
     {
       icon = history_missed_icon;
-      type = MISSED;
+      type = CALLS_MISSED;
     }
     else
     { 
       icon = history_in_icon;
-      type = INCOMING;      
+      type = CALLS_INCOMING;
     }
   }
   /* display text should be either the contact name, or the number if the
@@ -787,7 +793,7 @@
                                         GTK_SORT_DESCENDING);
   
   /* We setup the default filter */
-  p_dialer_data->g_history_filter_type = ALL;
+  p_dialer_data->g_history_filter_type = CALLS_ALL;
   
   //we will use a filter to facilitate the filtering in treeview without 
rebuilding the database.  p_dialer_data->g_list_store_filter =
   p_dialer_data->g_list_store_filter = 

Modified: 
trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-window-history.h
===================================================================
--- 
trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-window-history.h
   2007-06-05 15:45:28 UTC (rev 2168)
+++ 
trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-window-history.h
   2007-06-05 16:19:47 UTC (rev 2169)
@@ -29,9 +29,16 @@
   HISTORY_ENTRY_POINTER /*  needed for deletes */
 };
 
+typedef enum {
+  CALLS_ALL = 0,
+  CALLS_MISSED,
+  CALLS_OUTGOING,
+  CALLS_INCOMING
+} CallHistoryFilter;
 
+
 gint window_history_init (MokoDialerData * p_dialer_data);
-
+void window_history_filter (MokoDialerData *data, CallHistoryFilter filter);
 #define _OPENMOKO_DIALER_WINDOW_HISTORY_H
 
 #endif




--- End Message ---
--- Begin Message ---
Author: thomas
Date: 2007-06-06 10:00:36 +0200 (Wed, 06 Jun 2007)
New Revision: 2170

Modified:
   trunk/src/target/OM-2007/applications/openmoko-today/ChangeLog
   trunk/src/target/OM-2007/applications/openmoko-today/src/today-main.c
Log:
* src/today-main.c: (today_infoline_new), (child_setup),
(today_launcher_clicked_cb), (create_ui):
Use argv array to start applications. Open the dialer with --show-missed when
missed call info is clicked


Modified: trunk/src/target/OM-2007/applications/openmoko-today/ChangeLog
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-today/ChangeLog      
2007-06-05 16:19:47 UTC (rev 2169)
+++ trunk/src/target/OM-2007/applications/openmoko-today/ChangeLog      
2007-06-06 08:00:36 UTC (rev 2170)
@@ -1,3 +1,10 @@
+2007-06-06  Thomas Wood  <[EMAIL PROTECTED]>
+
+       * src/today-main.c: (today_infoline_new), (child_setup),
+       (today_launcher_clicked_cb), (create_ui):
+       Use argv array to start applications. Open the dialer with 
--show-missed when
+       missed call info is clicked
+
 2007-06-05  Thomas Wood  <[EMAIL PROTECTED]>
 
        * src/today-main.c: (today_launcher_clicked_cb), (create_ui): Update 
launcher

Modified: trunk/src/target/OM-2007/applications/openmoko-today/src/today-main.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-today/src/today-main.c       
2007-06-05 16:19:47 UTC (rev 2169)
+++ trunk/src/target/OM-2007/applications/openmoko-today/src/today-main.c       
2007-06-06 08:00:36 UTC (rev 2170)
@@ -45,7 +45,7 @@
 
 
 /*** functions ***/
-static void today_launcher_clicked_cb (GtkWidget *widget, gchar *command);
+static void today_launcher_clicked_cb (GtkWidget *widget, gchar **argv);
 
 
 /*** configuration options ***/
@@ -99,7 +99,9 @@
 static void
 today_infoline_clicked_cb (GtkWidget *widget, GdkEventButton *button, gchar 
*data)
 {
-  today_launcher_clicked_cb (widget, data);
+  gchar *argv[1];
+  argv[0] = data;
+  today_launcher_clicked_cb (widget, argv);
 }
 
 /**
@@ -113,7 +115,7 @@
  */
 
 static GtkWidget *
-today_infoline_new (gchar * exec, gchar * message)
+today_infoline_new (gchar **argv, gchar * message)
 {
   GtkWidget *eventbox, *hbox, *icon, *label;
   GtkIconTheme *icon_theme = gtk_icon_theme_get_default ();
@@ -125,14 +127,14 @@
 
   gtk_widget_add_events (eventbox, GDK_BUTTON_PRESS_MASK);
 
-  g_signal_connect (G_OBJECT (eventbox), "button-press-event", (GCallback) 
today_infoline_clicked_cb, exec);
+  g_signal_connect (G_OBJECT (eventbox), "button-press-event", (GCallback) 
today_infoline_clicked_cb, argv);
 
   hbox = gtk_hbox_new (FALSE, 0);
   gtk_container_add (GTK_CONTAINER (eventbox), hbox);
 
-  if (gtk_icon_theme_has_icon (icon_theme, exec))
+  if (gtk_icon_theme_has_icon (icon_theme, argv[0]))
   {
-    pb = gtk_icon_theme_load_icon (icon_theme, exec, 32, 
GTK_ICON_LOOKUP_NO_SVG, NULL);
+    pb = gtk_icon_theme_load_icon (icon_theme, argv[0], 32, 
GTK_ICON_LOOKUP_NO_SVG, NULL);
   }
   else
   {
@@ -169,7 +171,7 @@
 }
 
 static void
-today_launcher_clicked_cb (GtkWidget *widget, gchar *command)
+today_launcher_clicked_cb (GtkWidget *widget, gchar **argv)
 {
   /* The following code is a modified version of code from launcher-util.c in
    * matchbox-desktop-2 and is copyright (C) 2007 OpenedHand Ltd, made 
available
@@ -180,7 +182,6 @@
   Display *display;
   int screen;
   GError *error = NULL;
-  gchar *argv[1];
 
   display = gdk_x11_display_get_xdisplay (gtk_widget_get_display (widget));
   sn_dpy = sn_display_new (display, NULL, NULL);
@@ -190,15 +191,14 @@
   sn_display_unref (sn_dpy);
 
   /* sn_launcher_context_set_name (context, data->name); */
-  sn_launcher_context_set_binary_name (context, command);
-  sn_launcher_context_initiate (context, "openmoko-today", command, 
CurrentTime);
+  sn_launcher_context_set_binary_name (context, argv[0]);
+  sn_launcher_context_initiate (context, "openmoko-today", argv[0], 
CurrentTime);
 
-  argv[0] = command;
   if (!g_spawn_async (NULL, argv, NULL,
                             G_SPAWN_SEARCH_PATH, child_setup, context,
                             NULL, &error))
   {
-    g_warning ("Cannot launch %s: %s", command, error->message);
+    g_warning ("Cannot launch %s: %s", argv[0], error->message);
     g_error_free (error);
     sn_launcher_context_complete (context);
   }
@@ -273,6 +273,9 @@
   GtkWidget *infoline;
   GtkWidget *button_box;
 
+  gchar *missed_calls_cmd[] = { "openmoko-dialer", "--show-missed" };
+  gchar *messages_inbox_cmd[] = { "openmoko-messages" };
+
   /* main window */
   window = moko_window_new ();
   gtk_widget_set_name (window, "today-application-window");
@@ -312,11 +315,11 @@
 
 
   /* unread messages */
-  infoline = today_infoline_new ("openmoko-messages", "Unread Messages");
+  infoline = today_infoline_new (messages_inbox_cmd, "Unread Messages");
   gtk_box_pack_start (GTK_BOX (vbox), infoline, FALSE, FALSE, 0);
 
   /* missed calls */
-  infoline = today_infoline_new ("openmoko-dialer", "Missed Calls");
+  infoline = today_infoline_new (missed_calls_cmd, "Missed Calls");
   gtk_box_pack_start (GTK_BOX (vbox), infoline, FALSE, FALSE, 0);
 
   /* upcoming events */




--- End Message ---
--- Begin Message ---
Author: njp
Date: 2007-06-06 11:39:52 +0200 (Wed, 06 Jun 2007)
New Revision: 2171

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:
Fix call ordering in history; Clean up journal code for outgoing calls

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-06 08:00:36 UTC (rev 2170)
+++ 
trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-window-history.c
   2007-06-06 09:39:52 UTC (rev 2171)
@@ -726,7 +726,23 @@
   return TRUE;
 }
 
+/* Sort two entries by date */
+static gint
+sort_by_date (MokoJournalEntry *a, MokoJournalEntry *b)
+{
+  const MokoTime *at, *bt;
+  time_t ta, tb;
+  
+  at = moko_journal_entry_get_dtstart (a);
+  bt = moko_journal_entry_get_dtstart (b);
+  
+  ta = moko_time_as_timet (at);
+  tb = moko_time_as_timet (bt);
+  
+  return (gint)difftime (ta, tb);
+}
 
+
 /**
  * @brief find the treeview in the window, fill-in the data and show it on the 
screen.
  *
@@ -749,6 +765,7 @@
   GtkWidget *contactview = NULL;
   int i = 0, j =0, n_entries;
   MokoJournalEntry *j_entry;
+  GList *entries = NULL, *e;
   //DBG_ENTER();
 
   //DBG_TRACE();
@@ -833,15 +850,20 @@
   }
   
   i = j = 0;
-  for (i = 0; i < n_entries && j < HISTORY_MAX_ENTRIES; i++)
+  for (i = 0; i < n_entries; i++)
   {
     moko_journal_get_entry_at (p_dialer_data->journal, i, &j_entry);
     
     /* We're not interested in anything other than voice entrys */
     if (moko_journal_entry_get_type (j_entry) != VOICE_JOURNAL_ENTRY)
-    {
       continue;
-    }
+
+    entries = g_list_insert_sorted (entries, 
+                                    (gpointer)j_entry,
+                                    (GCompareFunc)sort_by_date);
+  }
+  for (e = entries; e != NULL && j < HISTORY_MAX_ENTRIES; e = e->next) 
+  {
     if (history_add_entry (list_store, j_entry))
       j++;
   }

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-06 08:00:36 UTC (rev 2170)
+++ 
trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-window-outgoing.c
  2007-06-06 09:39:52 UTC (rev 2171)
@@ -153,10 +153,10 @@
   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_voice_info_set_distant_number (info, number);
   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 */
+  /* FIXME: We should be able to associate a number with a contact uid, and 
+            add that info to the entry */
 
   /* connect our handler to track call progress */
   progress_handler = g_signal_connect (data->connection, "call-progress", 




--- End Message ---
_______________________________________________
commitlog mailing list
[email protected]
http://lists.openmoko.org/mailman/listinfo/commitlog

Reply via email to