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. r2692 - in
      trunk/src/target/OM-2007.2/applications/openmoko-dialer2: . src
      ([EMAIL PROTECTED])
   2. r2693 - in
      trunk/src/target/OM-2007/applications/openmoko-dialer: .  src
      ([EMAIL PROTECTED])
   3. r2694 - in
      trunk/src/target/OM-2007.2/applications/openmoko-dialer2: . src
      ([EMAIL PROTECTED])
   4. r2695 - in
      trunk/src/target/OM-2007.2/libraries/libmokojournal2: .
      mokojournal mokojournal-tool ([EMAIL PROTECTED])
   5. r2696 -
      trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0
      ([EMAIL PROTECTED])
--- Begin Message ---
Author: njp
Date: 2007-08-13 12:11:58 +0200 (Mon, 13 Aug 2007)
New Revision: 2692

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-13  Neil J. Patel  <[EMAIL PROTECTED]>

        * src/moko-dialer.c: (on_keypad_dial_clicked),
        (on_talking_accept_call), (on_incoming_call), (on_incoming_clip),
        (on_call_progress_changed), (moko_dialer_dispose),
        (moko_dialer_init):
        Check if moko_journal_load_from_storage () worked, otherwise don't 
create
        journal objects.

Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog  
2007-08-10 17:04:14 UTC (rev 2691)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog  
2007-08-13 10:11:58 UTC (rev 2692)
@@ -1,3 +1,12 @@
+2007-08-13  Neil J. Patel  <[EMAIL PROTECTED]>
+
+       * src/moko-dialer.c: (on_keypad_dial_clicked),
+       (on_talking_accept_call), (on_incoming_call), (on_incoming_clip),
+       (on_call_progress_changed), (moko_dialer_dispose),
+       (moko_dialer_init):
+       Check if moko_journal_load_from_storage () worked, otherwise don't 
create
+       journal objects.
+
 2007-08-10  Neil J. Patel  <[EMAIL PROTECTED]>
 
        * src/moko-dialer.c: (on_keypad_pin_entry),

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-10 17:04:14 UTC (rev 2691)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-dialer.c  
2007-08-13 10:11:58 UTC (rev 2692)
@@ -241,20 +241,22 @@
   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_journal_write_to_storage (priv->journal);
-  moko_time_free (priv->time);
-  priv->entry = NULL;
-  priv->time = NULL;
-
+  if (priv->journal)
+  {
+    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_journal_write_to_storage (priv->journal);
+    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,
@@ -308,7 +310,7 @@
   moko_notify_stop (priv->notify);  
   
   /* Finalise and add the journal entry */
-  if (priv->entry)
+  if (priv->journal && priv->entry)
   {
     moko_journal_add_entry (priv->journal, priv->entry);
     if (priv->time) 
@@ -427,12 +429,14 @@
   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");
-
+  if (priv->journal)
+  {
+    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);
 
@@ -480,10 +484,12 @@
   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);
-
+  if (priv->journal && priv->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);
 }
@@ -516,7 +522,7 @@
     case MOKO_GSMD_PROG_RELEASE:
       moko_dialer_hung_up (dialer);
       moko_keypad_set_talking (MOKO_KEYPAD (priv->keypad), FALSE);
-      if (priv->entry)
+      if (priv->journal && priv->entry)
       {
         moko_journal_entry_get_direction (priv->entry, &dir);
         if (dir == DIRECTION_IN)
@@ -610,8 +616,11 @@
   priv = dialer->priv;
 
   /* Close journal */
-  moko_journal_write_to_storage (priv->journal);
-  moko_journal_close (priv->journal);
+  if (priv->journal)
+  {
+    moko_journal_write_to_storage (priv->journal);
+    moko_journal_close (priv->journal);
+  }
 
   /* Free contacts list */
   //contact_release_contact_list (&(priv->data->g_contactlist));
@@ -728,7 +737,8 @@
 
   /* Set up the journal */
   priv->journal = moko_journal_open_default ();
-  moko_journal_load_from_storage (priv->journal);
+  if (!moko_journal_load_from_storage (priv->journal))
+    priv->journal = NULL;
 
   /* Load the contacts store */
   priv->contacts = moko_contacts_get_default ();




--- End Message ---
--- Begin Message ---
Author: njp
Date: 2007-08-13 12:19:54 +0200 (Mon, 13 Aug 2007)
New Revision: 2693

Modified:
   trunk/src/target/OM-2007/applications/openmoko-dialer/ChangeLog
   
trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-window-history.c
Log:
Check the string is valid before using strcmp.



Modified: trunk/src/target/OM-2007/applications/openmoko-dialer/ChangeLog
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-dialer/ChangeLog     
2007-08-13 10:11:58 UTC (rev 2692)
+++ trunk/src/target/OM-2007/applications/openmoko-dialer/ChangeLog     
2007-08-13 10:19:54 UTC (rev 2693)
@@ -0,0 +1,6 @@
+2007-08-13  Neil J. Patel  <[EMAIL PROTECTED]>
+
+       reviewed by: <delete if not using a buddy>
+
+       * src/dialer-window-history.c: (history_add_entry):
+

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-08-13 10:11:58 UTC (rev 2692)
+++ 
trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-window-history.c
   2007-08-13 10:19:54 UTC (rev 2693)
@@ -686,7 +686,7 @@
   number = moko_journal_voice_info_get_distant_number (info);
     
   /* If the number is null, the number may have been stored in the summary*/
-  if (strcmp (number, "NULL") == 0) 
+  if (number == NULL || strcmp (number, "NULL") == 0) 
     number = moko_journal_entry_get_summary (j_entry);
   
   /* Load the correct icon */




--- End Message ---
--- Begin Message ---
Author: njp
Date: 2007-08-13 17:54:20 +0200 (Mon, 13 Aug 2007)
New Revision: 2694

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-13  Neil J. Patel  <[EMAIL PROTECTED]>

        * src/moko-dialer.c: (moko_dialer_init):
        Warn when unable to load journal.

Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog  
2007-08-13 10:19:54 UTC (rev 2693)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog  
2007-08-13 15:54:20 UTC (rev 2694)
@@ -1,5 +1,10 @@
 2007-08-13  Neil J. Patel  <[EMAIL PROTECTED]>
 
+       * src/moko-dialer.c: (moko_dialer_init):
+       Warn when unable to load journal.
+
+2007-08-13  Neil J. Patel  <[EMAIL PROTECTED]>
+
        * src/moko-dialer.c: (on_keypad_dial_clicked),
        (on_talking_accept_call), (on_incoming_call), (on_incoming_clip),
        (on_call_progress_changed), (moko_dialer_dispose),

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-13 10:19:54 UTC (rev 2693)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-dialer.c  
2007-08-13 15:54:20 UTC (rev 2694)
@@ -738,7 +738,12 @@
   /* Set up the journal */
   priv->journal = moko_journal_open_default ();
   if (!moko_journal_load_from_storage (priv->journal))
+  {
+    g_warning ("Cannot load journal");
     priv->journal = NULL;
+  }
+  else
+    g_print ("Journal Loaded\n");
 
   /* Load the contacts store */
   priv->contacts = moko_contacts_get_default ();




--- End Message ---
--- Begin Message ---
Author: njp
Date: 2007-08-13 18:03:52 +0200 (Mon, 13 Aug 2007)
New Revision: 2695

Added:
   trunk/src/target/OM-2007.2/libraries/libmokojournal2/mokojournal-tool/
   
trunk/src/target/OM-2007.2/libraries/libmokojournal2/mokojournal-tool/Makefile.am
   
trunk/src/target/OM-2007.2/libraries/libmokojournal2/mokojournal-tool/mokojournal-tool.c
Modified:
   trunk/src/target/OM-2007.2/libraries/libmokojournal2/ChangeLog
   trunk/src/target/OM-2007.2/libraries/libmokojournal2/Makefile.am
   trunk/src/target/OM-2007.2/libraries/libmokojournal2/configure.ac
   
trunk/src/target/OM-2007.2/libraries/libmokojournal2/mokojournal/moko-journal.c
Log:
2007-08-13  Neil J. Patel  <[EMAIL PROTECTED]>

        * Makefile.am:
        * configure.ac:
        * mokojournal-tool/Makefile.am:
        * mokojournal-tool/mokojournal-tool.c: (main), (_add), (_list):
        Add a simple tool to query and manipulate the journal from the shell. It
        will help with debugging. List method implemented so far.

        * mokojournal/moko-journal.c: (moko_journal_load_from_storage),
        If an error is detected, return FALSE.
        (moko_journal_entry_has_voice_info):
        Keep the type check inline, to avoid unnecessary throwing of warnings.

Modified: trunk/src/target/OM-2007.2/libraries/libmokojournal2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/libraries/libmokojournal2/ChangeLog      
2007-08-13 15:54:20 UTC (rev 2694)
+++ trunk/src/target/OM-2007.2/libraries/libmokojournal2/ChangeLog      
2007-08-13 16:03:52 UTC (rev 2695)
@@ -1,3 +1,17 @@
+2007-08-13  Neil J. Patel  <[EMAIL PROTECTED]>
+
+       * Makefile.am:
+       * configure.ac:
+       * mokojournal-tool/Makefile.am:
+       * mokojournal-tool/mokojournal-tool.c: (main), (_add), (_list):
+       Add a simple tool to query and manipulate the journal from the shell. It
+       will help with debugging. List method implemented so far.
+
+       * mokojournal/moko-journal.c: (moko_journal_load_from_storage),
+       If an error is detected, return FALSE.
+       (moko_journal_entry_has_voice_info):
+       Keep the type check inline, to avoid unnecessary throwing of warnings.
+
 2007-08-03  Neil J. Patel  <[EMAIL PROTECTED]>
 
        * mokojournal/moko-journal.c:

Modified: trunk/src/target/OM-2007.2/libraries/libmokojournal2/Makefile.am
===================================================================
--- trunk/src/target/OM-2007.2/libraries/libmokojournal2/Makefile.am    
2007-08-13 15:54:20 UTC (rev 2694)
+++ trunk/src/target/OM-2007.2/libraries/libmokojournal2/Makefile.am    
2007-08-13 16:03:52 UTC (rev 2695)
@@ -1,4 +1,4 @@
-SUBDIRS = mokojournal tests
+SUBDIRS = mokojournal mokojournal-tool tests
 
 pcdata_DATA= libmokojournal2.pc
 pcdatadir= $(libdir)/pkgconfig

Modified: trunk/src/target/OM-2007.2/libraries/libmokojournal2/configure.ac
===================================================================
--- trunk/src/target/OM-2007.2/libraries/libmokojournal2/configure.ac   
2007-08-13 15:54:20 UTC (rev 2694)
+++ trunk/src/target/OM-2007.2/libraries/libmokojournal2/configure.ac   
2007-08-13 16:03:52 UTC (rev 2695)
@@ -40,6 +40,7 @@
 Makefile
 libmokojournal2.pc
 mokojournal/Makefile
+mokojournal-tool/Makefile
 tests/Makefile
 ])
 

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-13 15:54:20 UTC (rev 2694)
+++ 
trunk/src/target/OM-2007.2/libraries/libmokojournal2/mokojournal/moko-journal.c 
    2007-08-13 16:03:52 UTC (rev 2695)
@@ -1536,6 +1536,7 @@
     g_warning ("got error %s\n", error->message) ;
     g_error_free (error) ;
     error = NULL ;
+    return FALSE;
   }
   if (objs)
   {
@@ -2043,9 +2044,11 @@
 moko_journal_entry_has_voice_info (MokoJournalEntry *entry)
 {
   g_return_val_if_fail (entry, FALSE);
-
-  MokoJournalVoiceInfo *info = NULL;
-  return moko_journal_entry_get_voice_info (entry, &info) && info;
+  
+  if (entry->type == VOICE_JOURNAL_ENTRY)
+    return TRUE;
+  else
+    return FALSE;
 }
 
 gboolean

Added: 
trunk/src/target/OM-2007.2/libraries/libmokojournal2/mokojournal-tool/Makefile.am
===================================================================
--- 
trunk/src/target/OM-2007.2/libraries/libmokojournal2/mokojournal-tool/Makefile.am
   2007-08-13 15:54:20 UTC (rev 2694)
+++ 
trunk/src/target/OM-2007.2/libraries/libmokojournal2/mokojournal-tool/Makefile.am
   2007-08-13 16:03:52 UTC (rev 2695)
@@ -0,0 +1,7 @@
+bin_PROGRAMS=mokojournal-tool
+
+mokojournal_tool_SOURCES=mokojournal-tool.c
[EMAIL PROTECTED]@ $(top_srcdir)/mokojournal/libmokojournal2.la
+
+INCLUDES= -I $(top_srcdir)/mokojournal
+

Added: 
trunk/src/target/OM-2007.2/libraries/libmokojournal2/mokojournal-tool/mokojournal-tool.c
===================================================================
--- 
trunk/src/target/OM-2007.2/libraries/libmokojournal2/mokojournal-tool/mokojournal-tool.c
    2007-08-13 15:54:20 UTC (rev 2694)
+++ 
trunk/src/target/OM-2007.2/libraries/libmokojournal2/mokojournal-tool/mokojournal-tool.c
    2007-08-13 16:03:52 UTC (rev 2695)
@@ -0,0 +1,369 @@
+/* vi: set sw=2: */
+/*
+ * Copyright (C) 2007 by OpenMoko, Inc.
+ * Written by OpenedHand Ltd <[EMAIL PROTECTED]>
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <glib.h>
+#include <glib-object.h>
+
+#include "moko-journal.h"
+
+static GMainLoop *mainloop = NULL;
+
+/* Forwards */
+static gboolean _list (MokoJournal *journal);
+static void     _add (MokoJournal *journal);
+
+/* Command line params */
+static gchar *action = NULL;
+static gchar *type   = NULL;
+static gchar *number = NULL;
+static gboolean missed = FALSE;
+static gchar *direction = NULL;
+
+static GOptionEntry entries[] =
+{
+  {
+    "action",
+    'a', 0,
+    G_OPTION_ARG_STRING,
+    &action,
+    "The action to take [list|size]",
+    NULL
+  },
+  {
+    "type",
+    't', 0,
+    G_OPTION_ARG_STRING,
+    &type,
+    "The type of entry [all|voice]",
+    NULL
+  },
+  {
+    "number",
+    'n', 0,
+    G_OPTION_ARG_STRING,
+    &number,
+    "The number to add or search for",
+    NULL
+  },
+  {
+    "missed",
+    'm', 0,
+    G_OPTION_ARG_NONE,
+    &missed,
+    "Whether the call was missed",
+    NULL
+  },
+  {
+    "direction",
+    'd', 0,
+    G_OPTION_ARG_STRING,
+    &direction,
+    "The direction of the call",
+    NULL
+  }
+
+
+};
+
+
+int
+main (int argc, gchar *argv[])
+{
+  MokoJournal *journal = NULL;
+  GOptionContext *context;
+
+  g_type_init ();
+
+  /* Load options */
+  context = g_option_context_new (" - mokojournal-tool Options");
+  g_option_context_add_main_entries (context, entries, NULL);
+  g_option_context_parse (context, &argc, &argv, NULL);
+
+  /* Do the right thing */
+  if (!action)
+  {
+    g_print ("You must specify an action\n");
+    return EXIT_FAILURE;
+  }
+
+  /* Load the journal */
+  journal = moko_journal_open_default ();
+  g_return_val_if_fail (MOKO_IS_JOURNAL (journal), EXIT_FAILURE);
+
+  /* Load all journal entries from the journal on storage */
+  if (!moko_journal_load_from_storage (journal))
+  {
+    g_message ("Failed to load journal from storage\n") ;
+    return EXIT_FAILURE;
+  }
+
+  if (strcmp (action, "list") == 0)
+  {
+    g_timeout_add (5000, (GSourceFunc)_list, (gpointer)journal);
+  }
+  else if (strcmp (action, "size") == 0)
+  {
+    g_timeout_add (5000, (GSourceFunc)_list, (gpointer)journal);
+  }
+  else
+  {
+    g_print ("%s is not a valid action\n", action);
+    return EXIT_FAILURE;
+  }
+
+  mainloop =  g_main_loop_new (g_main_context_default (), FALSE); 
+  g_main_loop_run (mainloop);
+
+  moko_journal_close (journal) ;
+  
+  return 0;
+}
+
+static void
+_add (MokoJournal *journal)
+{
+  if (strcmp (type, "voice") == 0)
+  {
+    MokoJournalEntry *entry = moko_journal_entry_new (VOICE_JOURNAL_ENTRY);
+    
+    if (strcmp (direction, "in") == 0)
+      moko_journal_entry_set_direction (entry, DIRECTION_IN);
+    else
+      moko_journal_entry_set_direction (entry, DIRECTION_OUT);
+
+    if (missed)
+      moko_journal_entry_set_was_missed (entry, TRUE);
+
+    moko_journal_voice_info_set_distant_number (entry, number);
+
+    moko_journal_add_entry (journal, entry);
+
+    moko_journal_write_to_storage (journal);
+  }
+
+  g_main_loop_quit (mainloop);
+}
+
+static gboolean
+_list (MokoJournal *journal)
+{
+  gint len, i, t;
+
+  if (!type || strcmp (type, "all") == 0)
+    t = 0;
+  else if (strcmp (type, "voice") == 0)
+    t = VOICE_JOURNAL_ENTRY;
+  else
+    t = VOICE_JOURNAL_ENTRY;
+  
+  len = moko_journal_get_nb_entries (journal);
+  g_print ("Journal size = %d\n", len);
+
+  if (strcmp (action, "size"))
+    g_main_loop_quit (mainloop);
+
+  for (i = 0; i < len; i++)
+  {
+    MokoJournalEntry *entry = NULL;
+
+    moko_journal_get_entry_at (journal, i, &entry);
+    
+    if (!entry)
+      continue;
+
+    if (t == VOICE_JOURNAL_ENTRY)
+    {
+      if (moko_journal_entry_has_voice_info (entry))
+      {
+        g_print ("Voice Entry\t%20s\t%s\n", 
+                 moko_journal_voice_info_get_distant_number (entry),
+                moko_journal_voice_info_get_was_missed (entry) ? "missed":"");
+      }
+    }
+
+  }
+  g_main_loop_quit (mainloop);
+  return FALSE;
+}
+
+#if 0
+int
+main (int argc, gchar **argv)
+{
+    MokoJournal *journal=NULL ;
+    MokoJournalEntry *entry=NULL ;
+    MokoLocation loc ;
+   MokoGSMLocation gsm_loc ;
+    int result = 1 ;
+    gchar *contact_uid;
+
+    if (argc == 2)
+      contact_uid = argv[1];
+    else
+      contact_uid = "foobarbazuid";
+
+    g_type_init () ;
+
+    /*open the journal*/
+    journal = moko_journal_open_default () ;
+    g_return_val_if_fail (MOKO_IS_JOURNAL (journal),1) ;
+
+    /*load all journal entries from the journal on storage*/
+    if (!moko_journal_load_from_storage (journal))
+    {
+        g_message ("failed to load journal from storage\n") ;
+        goto out ;
+    }
+    g_message ("loaded journal from storage okay\n") ;
+    g_message ("number journal entries: %d\n",
+                moko_journal_get_nb_entries (journal)) ;
+
+    /*create a journal entry of type 'email journal entry'*/
+    entry = moko_journal_entry_new (EMAIL_JOURNAL_ENTRY) ;
+    if (!entry)
+    {
+        g_warning ("failed to create journal entry\n") ;
+        goto out ;
+    }
+
+    /*****************************
+     * <fill the entry with data>
+     *****************************/
+    moko_journal_entry_set_contact_uid (entry, contact_uid) ;
+    moko_journal_entry_set_summary (entry, "back from fostel") ;
+    moko_journal_entry_set_dtstart (entry, moko_time_new_today ()) ;
+    moko_journal_entry_set_direction (entry, DIRECTION_OUT) ;
+    loc.latitude = 37.386013;
+    loc.longitude =  10.082932;
+    moko_journal_entry_set_start_location (entry, &loc) ;
+    gsm_loc.lac = 68 ;
+    gsm_loc.cid = 100 ;
+    moko_journal_entry_set_gsm_location (entry, &gsm_loc) ;
+    if (!moko_journal_entry_has_email_info (entry))
+    {
+        g_warning ("failed to get email extra info from journal entry\n") ;
+        goto out ;
+    }
+    /*****************************
+     * </fill the entry with data>
+     *****************************/
+
+    /*add the entry we created to the journal*/
+    if (!moko_journal_add_entry (journal, entry))
+    {
+        g_warning ("could not add entry to journal\n") ;
+        goto out ;
+    }
+    /*
+     * the entry is now owned by the journal, make sure we won't ever
+     * free it ourselves (by accident)
+     */
+    entry = NULL ;
+
+    /*create a journal entry of type 'voice call journal entry'*/
+    entry = moko_journal_entry_new (VOICE_JOURNAL_ENTRY) ;
+    if (!entry)
+    {
+        g_warning ("failed to create journal entry\n") ;
+        goto out ;
+    }
+
+    /*****************************
+     * <fill the entry with data>
+     *****************************/
+    moko_journal_entry_set_contact_uid (entry, contact_uid) ;
+    moko_journal_entry_set_summary (entry, "this was a call") ;
+    moko_journal_entry_set_dtstart (entry, moko_time_new_today ()) ;
+    moko_journal_entry_set_direction (entry, DIRECTION_OUT) ;
+    loc.latitude = 43.386013;
+    loc.longitude =  15.082932;
+    moko_journal_entry_set_start_location (entry, &loc) ;
+    gsm_loc.lac = 67 ;
+    gsm_loc.cid = 200 ;
+    moko_journal_entry_set_gsm_location (entry, &gsm_loc) ;
+    if (!moko_journal_entry_has_voice_info (entry))
+    {
+        g_warning ("failed to get voice extra info from journal entry\n") ;
+        goto out ;
+    }
+    /*****************************
+     * </fill the entry with data>
+     *****************************/
+
+    /*add the entry we created to the journal*/
+    if (!moko_journal_add_entry (journal, entry))
+    {
+        g_warning ("could not add entry to journal\n") ;
+        goto out ;
+    }
+    /*
+     * the entry is now owned by the journal, make sure we won't ever
+     * free it ourselves (by accident)
+     */
+    entry = NULL ;
+
+    /*sync the journal to persistent storage*/
+    if (!moko_journal_write_to_storage (journal))
+    {
+        g_warning ("Could not write journal to storage") ;
+        goto out ;
+    }
+
+    /*
+     * sleep a bit to wait for possible notifications, in case
+     * another process has added new journal entries as well
+     * this is not mandatory, but is there for the sake of testing.
+     */
+    sleep (2) ;
+
+    /*
+     * notifications of new journal entries being added to the journal
+     * is done via dbus, using the glib event loop to dispatch the
+     * notifications. So let's give the event loop a chance to
+     * let us notified of new entries that could have been added.
+     * Note that when using gtk+, you usually don't have to do this,
+     * as gtk+ does it for you magically.
+     */
+    while (g_main_context_pending (g_main_context_default ()))
+    {
+        g_main_context_iteration (g_main_context_default (), FALSE) ;
+    }
+    g_message ("number journal entries after two got added: %d\n",
+                moko_journal_get_nb_entries (journal)) ;
+
+    /*if we reached this point, the test has probably succeeded*/
+    result = 0;
+    g_print ("test succeeded\n") ;
+
+out:
+    if (journal)
+        moko_journal_close (journal) ;
+    if (entry)
+        moko_journal_entry_unref (entry) ;
+
+    return result ;
+}
+
+#endif




--- End Message ---
--- Begin Message ---
Author: mickey
Date: 2007-08-14 00:45:44 +0200 (Tue, 14 Aug 2007)
New Revision: 2696

Modified:
   
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/gtkspinbutton
Log:
theming: remove 2007.0 spinbutton theming


Modified: 
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/gtkspinbutton
===================================================================
--- 
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/gtkspinbutton
 2007-08-13 16:03:52 UTC (rev 2695)
+++ 
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/gtkspinbutton
 2007-08-13 22:45:44 UTC (rev 2696)
@@ -1,50 +1,6 @@
-#FIXME looks ugly, needs styling
-
 style "gtkspinbutton" 
 {
   GtkSpinButton::shadow_type = GTK_SHADOW_NONE
-    
-  engine "pixmap" 
-  {
-    image 
-    {
-      function        = BOX
-#     detail          = "spinbutton/spinbutton_up"
-      state           = NORMAL
-      file            = "spinbutton/spinbutton.png"
-      stretch         = TRUE
-    }
-    image 
-    {
-      function        = BOX
-      state           = PRELIGHT
-      file            = "spinbutton/spinbutton-pressed.png"
-      stretch         = TRUE
-    }
-     image 
-    {
-      function        = BOX
-      state           = INSENSITIVE
-      file            = "spinbutton/spinbutton-pressed.png"
-      stretch         = TRUE
-     }
-     image   
-     {
-       function        = ARROW 
-       overlay_file    = "spinbutton/spinbutton-plus.png"
-       overlay_border  = { 0, 0, 0, 0 }
-       overlay_stretch = FALSE 
-       arrow_direction = UP
-     }
-     image   
-     {
-       function        = ARROW 
-       overlay_file    = "spinbutton/spinbutton-minus.png"
-       overlay_border  = { 0, 0, 0, 0 }
-       overlay_stretch = FALSE 
-       arrow_direction = DOWN
-     }
-   }
 }
 class "GtkSpinButton" style "gtkspinbutton"
 widget_class "*.GtkSpinButton" style "gtkspinbutton"




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

Reply via email to