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

thomas at sita.openmoko.org thomas at sita.openmoko.org
Thu May 24 18:03:33 CEST 2007


Author: thomas
Date: 2007-05-24 18:03:31 +0200 (Thu, 24 May 2007)
New Revision: 2078

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-incoming.c
   trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-window-outgoing.c
Log:
openmoko-dialer: remove more unused code, add some debugging messages


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-05-24 14:19:49 UTC (rev 2077)
+++ trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-window-history.c	2007-05-24 16:03:31 UTC (rev 2078)
@@ -854,109 +854,3 @@
 }
 
 
-
-/**
- * @brief add an entry to the history treeview
- *
- *
- *
- * @param entry HISTORY_ENTRY *, the history entry to be added to the treeview.
- * @return 
- * @retval 0 error occured
- * @retval 1 everything is OK
- */
-static gint
-history_list_view_add (MokoDialerData * appdata, MokoJournalEntry * entry)
-{
-#if 0
-  DBG_ENTER ();
-  if (entry == 0)
-  {
-    DBG_ERROR ("THE ENTRY IS ZERO");
-    return 0;
-  }
-
-  if (appdata->treeview_history == 0)
-  {
-    DBG_WARN ("treeview_history not ready");
-    return 0;
-
-  }
-  //
-  GtkTreeIter iter;             //iter of the filter store
-  GtkTreeModel *model;
-  GtkListStore *list_store;
-  GtkTreeView *treeview;
-
-  treeview = GTK_TREE_VIEW (appdata->treeview_history);
-
-  model =
-    gtk_tree_model_filter_get_model (GTK_TREE_MODEL_FILTER
-                                     (appdata->g_list_store_filter));
-
-  list_store = GTK_LIST_STORE (model);
-  //
-
-
-  //DBG_MESSAGE(entry->number);
-  gtk_list_store_insert (list_store, &iter, 0);
-  gtk_list_store_set (list_store, &iter, COLUMN_TYPE, entry->type,
-                      COLUMN_SEPRATE, "--", COLUMN_TIME, entry->time,
-                      COLUMN_DURATION, entry->durationsec,
-                      COLUMN_ENTRYPOINTER, entry, COLUMN_HASNAME, 0, -1);
-  if (entry->name == 0)
-  {
-    //DBG_MESSAGE(entry->number);
-    gtk_list_store_set (list_store, &iter, COLUMN_NAME_NUMBER,
-                        entry->number, -1);
-    gtk_list_store_set (list_store, &iter, COLUMN_HASNAME, 0, -1);
-  }
-  else
-  {
-    gtk_list_store_set (list_store, &iter, COLUMN_NAME_NUMBER, entry->name,
-                        -1);
-    gtk_list_store_set (list_store, &iter, COLUMN_HASNAME, 1, -1);
-  }
-  switch (entry->type)
-  {
-  case INCOMING:
-    {
-      gtk_list_store_set (list_store, &iter, COLUMN_TYPEICON,
-                          appdata->g_iconReceived, -1);
-      //      icon=gdk_pixbuf_new_from_file("./received.png",&error);
-      break;
-    }
-  case OUTGOING:
-    {                           //     icon=gdk_pixbuf_new_from_file("./dialed.png",&error);
-      gtk_list_store_set (list_store, &iter, COLUMN_TYPEICON,
-                          appdata->g_iconDialed, -1);
-      break;
-    }
-  case MISSED:
-    {                           //icon=gdk_pixbuf_new_from_file("./missed.png",&error);
-      gtk_list_store_set (list_store, &iter, COLUMN_TYPEICON,
-                          appdata->g_iconMissed, -1);
-      break;
-    }
-
-  default:
-
-    {                           //icon=gdk_pixbuf_new_from_file("./missed.png",&error);
-      gtk_list_store_set (list_store, &iter, COLUMN_TYPEICON,
-                          appdata->g_iconMissed, -1);
-      break;
-    }
-  }
-  history_update_counter (appdata);
-#endif
-  return 1;
-}
-
-
-static gint
-add_histroy_entry (MokoDialerData * appdata, CallFilter type,
-                   const char *name, const char *number, const char *id,
-                   char *time, char *date, int durationsec)
-{
-return 0;
-}

Modified: trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-window-incoming.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-window-incoming.c	2007-05-24 14:19:49 UTC (rev 2077)
+++ trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-window-incoming.c	2007-05-24 16:03:31 UTC (rev 2078)
@@ -26,47 +26,8 @@
 #include "dialer-window-incoming.h"
 #include "dialer-window-talking.h"
 #include "dialer-window-history.h"
-void 
-cb_answer_button_clicked (GtkButton * button,
-                          MokoDialerData * appdata) 
-{
-  DBG_ENTER ();
-  appdata->g_state.callstate = STATE_TALKING;
-  /* TODO: MokoGsmdConnection->answer
-   * gsm_answer ();
-   */
 
-  gtk_widget_hide (appdata->window_incoming);
-
-  //transfer the contact info
-   window_talking_prepare (appdata);
-  gtk_widget_show (appdata->window_talking);
-  DBG_LEAVE ();
-} 
-
 void
-cb_ignore_button_clicked (GtkButton * button,
-                          MokoDialerData * appdata) 
-{
-  DBG_ENTER ();
-  DBG_MESSAGE ("We will mute the phone for this call.");
-  appdata->g_state.callstate = STATE_IGNORED;
-  DBG_LEAVE ();
-} void 
-
-cb_reject_button_clicked (GtkButton * button,
-                          MokoDialerData * appdata) 
-{
-  DBG_ENTER ();
-  /* TODO: MokoGsmdConnection->hangup
-   * gsm_hangup ();
-   */
-  appdata->g_state.callstate = STATE_REJECTED;
-  gtk_widget_hide (appdata->window_incoming);
-  DBG_LEAVE ();
-}
-
-void
 window_incoming_prepare (MokoDialerData * appdata) 
 {
   if (!appdata)
@@ -98,111 +59,8 @@
     moko_dialer_status_set_person_name (appdata->status_incoming, "");
   }
 }
-void 
-window_incoming_fails (MokoDialerData * appdata) 
-{
-  DBG_ENTER ();
-  DBG_LEAVE ();
-} 
 
-gint  
-timer_incoming_time_out (MokoDialerData * appdata) 
-{
-  
-//DBG_ENTER();
-  //TIMER_DATA * timer_data = &(appdata->g_timer_data);
-  moko_dialer_status_update_icon (appdata->status_incoming);
-  
-  //now that we have the incoming call status report correctly, the timeout 
-  //mechanism is not needed.
-/*
-  if (event_get_keep_calling ())
-  {
-    event_reset_keep_calling ();
-    timer_data->ticks = 0;
-  }
-  else
-  { //we count 4 before we confirm that there are no calling at all.
-    if (timer_data->ticks >= 3)
-    {
-      DBG_MESSAGE ("THE CALLER aborted, we quit.");
-      gsm_hangup ();
-      appdata->g_state.callstate = STATE_MISSED;
-      appdata->g_state.historytype = MISSED;
-      gdk_threads_enter ();
-      gtk_widget_hide (appdata->window_incoming);
-      gdk_threads_leave ();
-      return 0;                 //don't lookout the timeout.
-    }
-    else
-    {
-      DBG_MESSAGE ("ticks=%d", timer_data->ticks);
-      timer_data->ticks++;
-    }
-  }
-*/ 
-    return 1;
-}
-void 
-on_window_incoming_hide (GtkWidget * widget, MokoDialerData * appdata) 
-{
-  DBG_ENTER ();
-  if (appdata->g_timer_data.ptimer != 0)
-    
-  {
-    g_source_remove (appdata->g_timer_data.ptimer);
-    appdata->g_timer_data.ptimer = 0;
-  }
-  /*
-  event_reset_clip_signaled ();
-  event_reset_incoming_signaled ();
-  event_reset_keep_calling ();
-  */
-  if (appdata->g_state.callstate != STATE_TALKING)
-    
-  {                             //     add_histroy_entry(g_state.historytype,g_state.contactinfo.name,g_state.contactinfo.number,g_state.contactinfo.picpath,g_state.starttime,0);
-    /*add_histroy_entry (appdata, appdata->g_state.historytype,
-                        appdata->g_peer_info.name,
-                        appdata->g_peer_info.number,
-                        appdata->g_peer_info.ID,
-                        appdata->g_state.starttime,
-                        appdata->g_state.startdate, 0);
-                        */
-  }
-  DBG_LEAVE ();
-}
-void 
-window_incoming_setup_timer (MokoDialerData * appdata) 
-{
-  time_t timep;
-  struct tm *p;
-  time (&timep);
-  p = localtime (&timep);
-  sprintf (appdata->g_state.starttime, "%02d:%02d:%02d", p->tm_hour,
-             p->tm_min, p->tm_sec);
-  sprintf (appdata->g_state.startdate, "%04d/%02d/%02d", p->tm_year,
-            p->tm_mon, p->tm_mday);
-  if (appdata->g_timer_data.ptimer != 0)
-    
-  {
-    g_source_remove (appdata->g_timer_data.ptimer);
-    appdata->g_timer_data.ptimer = 0;
-  }
-  memset (&(appdata->g_timer_data), 0, sizeof (appdata->g_timer_data));
-  appdata->g_timer_data.stopsec = 0;
-  appdata->g_timer_data.ptimer =
-  g_timeout_add (1000, (GSourceFunc)timer_incoming_time_out, (gpointer)appdata);
-}
 
-void 
-on_window_incoming_show (GtkWidget * widget, MokoDialerData * appdata) 
-{
-  DBG_ENTER ();
-  appdata->g_state.callstate = STATE_INCOMING;
-  window_incoming_setup_timer (appdata);
-  DBG_LEAVE ();
-}
-
 void
 window_incoming_init (MokoDialerData * data) 
 {
@@ -224,6 +82,7 @@
 static void
 call_progress_cb (MokoGsmdConnection *connection, int type, MokoDialerData *data)
 {
+  g_debug ("Incoming Call Progress: %d", type);
   if (type == MOKO_GSMD_PROG_DISCONNECT)
   {
     /* call was disconnected before it was answered */
@@ -283,6 +142,7 @@
 void
 window_incoming_update_message (MokoDialerData *data, const gchar *clip)
 {
+  g_debug ("Incoming Call CLIP: %s", clip);
   moko_message_dialog_set_message (MOKO_MESSAGE_DIALOG (data->window_incoming),
                                    "Incoming call from %s", clip);
   // moko_journal_voice_info_set_distant_number ();

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-05-24 14:19:49 UTC (rev 2077)
+++ trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-window-outgoing.c	2007-05-24 16:03:31 UTC (rev 2078)
@@ -29,9 +29,6 @@
 #include "dialer-window-history.h"
 #include "dialer-window-talking.h"
 
-/* function declerations */
-static void window_outgoing_setup_timer (MokoDialerData * appdata);
-
 static void
 cb_speaker_button_clicked (GtkButton * button, MokoDialerData * data)
 {
@@ -57,60 +54,8 @@
   moko_gsmd_connection_voice_dial (data->connection, number);
 }
 
-#if 0 /* Not used at the moment */
-static void
-cb_cancel_button_clicked (GtkButton * button, MokoDialerData * appdata)
-{
-  DBG_ENTER ();
-  /* TODO: MokoGsmdConnection->hangup
-   * gsm_hangup ();
-   */
-  appdata->g_state.callstate = STATE_FAILED;
-  DBG_TRACE ();
-  gtk_widget_hide (appdata->window_outgoing);
-  DBG_LEAVE ();
-}
-#endif 
 
 gint
-timer_outgoing_time_out (MokoDialerData * appdata)
-{
-//DBG_ENTER();
-  TIMER_DATA *timer_data = &(appdata->g_timer_data);
-
-
-  timer_data->ticks++;
-  timer_data->hour = timer_data->ticks / 3600;
-  timer_data->min = (timer_data->ticks - timer_data->hour * 3600) / 60;
-  timer_data->sec = timer_data->ticks % 60;
-
-
-  sprintf (timer_data->timestring, "Calling ... (%02d:%02d:%02d)",
-           timer_data->hour, timer_data->min, timer_data->sec);
-
-//ok,we update the label now.
-
-
-  moko_dialer_status_set_status_label (appdata->status_outgoing,
-                                       timer_data->timestring);
-  moko_dialer_status_update_icon (appdata->status_outgoing);
-
-  if (timer_data->stopsec != 0 && timer_data->ticks >= timer_data->stopsec)
-  {
-
-    timer_data->timeout = 1;
-    g_source_remove (timer_data->ptimer);
-    timer_data->ptimer = 0;
-//maybe it failes
-//    window_outgoing_fails (appdata);
-    return 0;                   //0 stops the timer.
-  }
-  else
-    return 1;
-}
-
-
-gint
 window_outgoing_init (MokoDialerData * p_dialer_data)
 {
   GtkWidget *window;
@@ -182,6 +127,7 @@
 static void
 call_progress_cb (MokoGsmdConnection *connection, int type, MokoDialerData *data)
 {
+  g_debug ("Outgoing Call Progress: %d", type);
   if (type == MOKO_GSMD_PROG_REJECT)
   {
     g_debug ("call rejected");





More information about the commitlog mailing list