r1857 - trunk/src/target/OM-2007/applications/openmoko-dialer/src
thomas at sita.openmoko.org
thomas at sita.openmoko.org
Fri Apr 27 13:24:34 CEST 2007
Author: thomas
Date: 2007-04-27 13:24:32 +0200 (Fri, 27 Apr 2007)
New Revision: 1857
Removed:
trunk/src/target/OM-2007/applications/openmoko-dialer/src/history.c
trunk/src/target/OM-2007/applications/openmoko-dialer/src/history.h
Modified:
trunk/src/target/OM-2007/applications/openmoko-dialer/src/Makefile.am
trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-main.c
trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-main.h
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
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
trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-window-talking.c
trunk/src/target/OM-2007/applications/openmoko-dialer/src/moko-dialer-autolist.h
trunk/src/target/OM-2007/applications/openmoko-dialer/src/moko-dialer-includes.h
Log:
* dialer: remove history code to be replaced with libmokojournal
Modified: trunk/src/target/OM-2007/applications/openmoko-dialer/src/Makefile.am
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-dialer/src/Makefile.am 2007-04-27 11:12:00 UTC (rev 1856)
+++ trunk/src/target/OM-2007/applications/openmoko-dialer/src/Makefile.am 2007-04-27 11:24:32 UTC (rev 1857)
@@ -12,7 +12,6 @@
moko-dialer-textview.c\
moko-dialer-tip.c\
moko-dialer-autolist.c\
-history.c\
contacts.c\
common.c\
dialer-window-history.c\
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-04-27 11:12:00 UTC (rev 1856)
+++ trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-main.c 2007-04-27 11:24:32 UTC (rev 1857)
@@ -30,7 +30,6 @@
#include <fcntl.h>
#include "contacts.h"
-#include "history.h"
#include "error.h"
#include "errno.h"
#include "dialer-main.h"
@@ -178,7 +177,6 @@
//init application data
contact_init_contact_data (&(p_dialer_data->g_contactlist));
- history_init_history_data (&(p_dialer_data->g_historylist));
/* application object */
@@ -199,8 +197,6 @@
window_pin_init (p_dialer_data);
window_outgoing_init (p_dialer_data);
window_history_init (p_dialer_data);
- DBG_MSG
- ("\nusage: \"dialer\" will not show any GUI initialy until you reactivate the app using another \"openmoko-dialer\" command");
if (show_gui)
{
@@ -213,6 +209,5 @@
//release everything
contact_release_contact_list (&(p_dialer_data->g_contactlist));
- history_release_history_list (&(p_dialer_data->g_historylist));
return 0;
}
Modified: trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-main.h
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-main.h 2007-04-27 11:12:00 UTC (rev 1856)
+++ trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-main.h 2007-04-27 11:24:32 UTC (rev 1857)
@@ -49,8 +49,6 @@
DIALER_CONTACT_PEER_INFO g_peer_info; ///<hold the peer's name, number, etc.
- HISTORY_LIST_HEAD g_historylist; ///< the whole list of the talk history
- HISTORY_ENTRY *g_currentselected; ///<pointer to the history entry which in the GUI the user selects.
GLOBAL_STATE g_state; ///< the global states holder. we count on it a lot.
@@ -97,7 +95,5 @@
GtkTreeModel *g_list_store_filter; ///<the list store used by the gtktreeview, for displaying the history list dynamically.
- HISTORY_TYPE g_history_filter_type; ///<indicates the current history filter type, the gtktreeview will be filtered on the value.
-
GdkPixbuf *g_iconReceived, *g_iconMissed, *g_iconDialed; ///<the global pixbuf for the 3 icons displayed in the history window.}DIALER_APP_DATA;
} MokoDialerData;
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-04-27 11:12:00 UTC (rev 1856)
+++ trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-window-history.c 2007-04-27 11:24:32 UTC (rev 1857)
@@ -20,61 +20,48 @@
#include <libmokoui/moko-finger-window.h>
#include <libmokoui/moko-finger-wheel.h>
#include <libmokoui/moko-pixmap-button.h>
+#include <libmokojournal/moko-journal.h>
-#include <gtk/gtkalignment.h>
-#include <gtk/gtkbutton.h>
-#include <gtk/gtkhbox.h>
-#include <gtk/gtklabel.h>
-#include <gtk/gtkmain.h>
-#include <gtk/gtkmenu.h>
-#include <gtk/gtkmenuitem.h>
-#include <gtk/gtkvbox.h>
-#include <gtk/gtktreeview.h>
-#include <gtk/gtktreemodelfilter.h>
-#include <gtk/gtkscrolledwindow.h>
-#include <gtk/gtkimagemenuitem.h>
-#include <gtk/gtkmenu.h>
+#include <gtk/gtk.h>
#include "common.h"
#include "contacts.h"
#include "dialer-main.h"
#include "moko-dialer-status.h"
-#include "history.h"
#include "dialer-window-history.h"
+/* call types */
+typedef enum {
+ ALL,
+ MISSED,
+ OUTGOING,
+ INCOMING
+} CallFilter;
/* function declarations */
gint history_update_counter (MokoDialerData * p_dialer_data);
+GtkWidget *create_window_history_content (MokoDialerData * p_dialer_data);
+GtkWidget *history_create_menu_history (MokoDialerData * p_dialer_data);
+gint history_build_history_list_view (MokoDialerData * p_dialer_data);
+
/**
* @brief re-filter the treeview widget by the history type
*
*
*
- * @param type HISTORY_TYPE, indicating only the history items of that type will be displayed
+ * @param type CallType, indicating only the history items of that type will be displayed
* @return 1
* @retval
*/
int
history_view_change_filter (MokoDialerData * p_dialer_data,
- HISTORY_TYPE type)
+ CallFilter type)
{
- GtkTreePath *path;
- DBG_TRACE ();
- p_dialer_data->g_history_filter_type = type;
- gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER
- (p_dialer_data->g_list_store_filter));
-
- path = gtk_tree_path_new_first ();
- gtk_tree_view_set_cursor (GTK_TREE_VIEW (p_dialer_data->treeview_history),
- path, 0, 0);
- gtk_tree_path_free (path);
-
-
- return 1;
+ return 0;
}
void
@@ -221,12 +208,12 @@
return;
}
- if (appdata->g_currentselected)
+ /*if (appdata->g_currentselected)
{
DBG_MESSAGE ("to delete %s", appdata->g_currentselected->number);
history_delete_entry (&(appdata->g_historylist),
appdata->g_currentselected);
- }
+ }*/
path = gtk_tree_model_get_path (model, &iter);
@@ -343,7 +330,7 @@
history_create_menu_history (p_dialer_data);
MokoFingerWindow *window = NULL;
- MokoFingerToolBox *tools = NULL;
+ GtkWidget *tools = NULL;
GtkWidget *button;
GtkWidget *image;
@@ -386,8 +373,7 @@
tools = moko_finger_window_get_toolbox (window);
- /* TODO: remove the GTK_WIDGET() casts when libmokoui is fixed */
- button = moko_finger_tool_box_add_button_without_label (tools);
+ button = moko_finger_tool_box_add_button_without_label (MOKO_FINGER_TOOL_BOX (tools));
image = file_new_image_from_relative_path ("phone.png");
moko_pixmap_button_set_finger_toolbox_btn_center_image
(MOKO_PIXMAP_BUTTON (button), image);
@@ -395,8 +381,7 @@
G_CALLBACK (cb_tool_button_history_call_clicked),
p_dialer_data);
- button =
- GTK_WIDGET (moko_finger_tool_box_add_button_without_label (tools));
+ button = moko_finger_tool_box_add_button_without_label (MOKO_FINGER_TOOL_BOX (tools));
image = file_new_image_from_relative_path ("sms.png");
moko_pixmap_button_set_finger_toolbox_btn_center_image
(MOKO_PIXMAP_BUTTON (button), image);
@@ -405,16 +390,14 @@
p_dialer_data);
- button =
- GTK_WIDGET (moko_finger_tool_box_add_button_without_label (tools));
+ button = moko_finger_tool_box_add_button_without_label (MOKO_FINGER_TOOL_BOX (tools));
image = file_new_image_from_relative_path ("delete_01.png");
moko_pixmap_button_set_finger_toolbox_btn_center_image
(MOKO_PIXMAP_BUTTON (button), image);
g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (cb_tool_button_history_delete_clicked),
p_dialer_data);
- button =
- GTK_WIDGET (moko_finger_tool_box_add_button_without_label (tools));
+ button = moko_finger_tool_box_add_button_without_label (MOKO_FINGER_TOOL_BOX (tools));
image = file_new_image_from_relative_path ("exit.png");
moko_pixmap_button_set_finger_toolbox_btn_center_image
(MOKO_PIXMAP_BUTTON (button), image);
@@ -441,7 +424,7 @@
GtkTreeIter iter;
GtkTreeModel *model;
GtkTreeSelection *selection;
- HISTORY_ENTRY *p;
+ /*HISTORY_ENTRY*/void *p;
int hasname;
MokoDialerData *p_dialer_data = (MokoDialerData *) user_data;
@@ -451,13 +434,13 @@
if (!gtk_tree_selection_get_selected (selection, &model, &iter))
{
- p_dialer_data->g_currentselected = 0;
+ //p_dialer_data->g_currentselected = 0;
return;
}
gtk_tree_model_get (model, &iter, COLUMN_ENTRYPOINTER, &p, -1);
- p_dialer_data->g_currentselected = p;
+ //p_dialer_data->g_currentselected = p;
gtk_tree_model_get (model, &iter, COLUMN_HASNAME, &hasname, -1);
history_update_counter (p_dialer_data);
@@ -571,8 +554,9 @@
history_view_filter_visible_function (GtkTreeModel * model,
GtkTreeIter * iter, gpointer data)
{
+ /*
MokoDialerData *p_dialer_data = (MokoDialerData *) data;
- HISTORY_TYPE type;
+ CallFilter type;
if (p_dialer_data->g_history_filter_type == ALL)
return TRUE;
gtk_tree_model_get (model, iter, COLUMN_TYPE, &type, -1);
@@ -580,6 +564,8 @@
return TRUE;
else
return FALSE;
+ */
+ return TRUE;
}
@@ -601,8 +587,8 @@
{
GtkListStore *list_store;
- GtkTreeIter iter;
- HISTORY_ENTRY *entry;
+// GtkTreeIter iter;
+// HISTORY_ENTRY *entry;
//copied
GtkTreeViewColumn *col;
@@ -614,7 +600,7 @@
//DBG_ENTER();
//DBG_TRACE();
- p_dialer_data->g_history_filter_type = ALL;
+ //p_dialer_data->g_history_filter_type = ALL;
contactview = p_dialer_data->treeview_history;
if (contactview == NULL)
@@ -651,7 +637,7 @@
gtk_tree_view_append_column (GTK_TREE_VIEW (contactview), col);
- entry = p_dialer_data->g_historylist.first;
+ //entry = p_dialer_data->g_historylist.first;
list_store = gtk_list_store_new (N_COLUMN, G_TYPE_INT, GDK_TYPE_PIXBUF,
G_TYPE_STRING, G_TYPE_STRING,
@@ -705,7 +691,7 @@
error = NULL;
}
*/
-
+#if 0
while (entry)
{
//DBG_MESSAGE(entry->number);
@@ -762,7 +748,7 @@
entry = entry->next;
}
-
+#endif
gtk_tree_view_set_model (GTK_TREE_VIEW (contactview),
GTK_TREE_MODEL (p_dialer_data->
g_list_store_filter));
@@ -942,8 +928,9 @@
* @retval 1 everything is OK
*/
gint
-history_list_view_add (MokoDialerData * appdata, HISTORY_ENTRY * entry)
+history_list_view_add (MokoDialerData * appdata, MokoJournalEntry * entry)
{
+#if 0
DBG_ENTER ();
if (entry == 0)
{
@@ -1023,20 +1010,15 @@
}
}
history_update_counter (appdata);
+#endif
return 1;
}
gint
-add_histroy_entry (MokoDialerData * appdata, HISTORY_TYPE type,
+add_histroy_entry (MokoDialerData * appdata, CallFilter type,
const char *name, const char *number, const char *id,
char *time, char *date, int durationsec)
{
-
-//DBG_ENTER();
- //DBG_MESSAGE("History add:%s,%s,%s,%s,%s,%d",name,number,picpath,time,date,durationsec);
- HISTORY_ENTRY *pentry =
- history_add_entry (&(appdata->g_historylist), type, name, number, id,
- time, date, durationsec);
- return history_list_view_add (appdata, pentry);
+return 0;
}
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-04-27 11:12:00 UTC (rev 1856)
+++ trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-window-history.h 2007-04-27 11:24:32 UTC (rev 1857)
@@ -18,32 +18,9 @@
#include "moko-dialer-includes.h"
#ifndef _OPENMOKO_DIALER_WINDOW_HISTORY_H
-#define _OPENMOKO_DIALER_WINDOW_HISTORY_H
-#ifdef __cplusplus
+gint window_history_init (MokoDialerData * p_dialer_data);
+#define _OPENMOKO_DIALER_WINDOW_HISTORY_H
-
-extern "C"
-{
#endif
-
-
- GtkWidget *create_window_history_content (MokoDialerData *
- p_dialer_data);
- gint window_history_init (MokoDialerData * p_dialer_data);
- gint history_build_history_list_view (MokoDialerData * p_dialer_data);
- void window_history_prepare (MokoDialerData * appdata);
- GtkWidget *history_create_menu_history (MokoDialerData *
- p_dialer_data);
- gint add_histroy_entry (MokoDialerData * appdata, HISTORY_TYPE type,
- const char *name, const char *number,
- const char *picpath, char *time, char *date,
- int durationsec);
- gint history_list_view_add (MokoDialerData * appdata,
- HISTORY_ENTRY * entry);
-#ifdef __cplusplus
-}
-#endif
-
-#endif
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-04-27 11:12:00 UTC (rev 1856)
+++ trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-window-incoming.c 2007-04-27 11:24:32 UTC (rev 1857)
@@ -36,7 +36,6 @@
#include "dialer-window-incoming.h"
#include "dialer-window-talking.h"
#include "dialer-window-history.h"
-#include "history.h"
void
cb_answer_button_clicked (GtkButton * button,
MokoDialerData * appdata)
@@ -168,12 +167,13 @@
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,
+ /*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 ();
}
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-04-27 11:12:00 UTC (rev 1856)
+++ trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-window-outgoing.c 2007-04-27 11:24:32 UTC (rev 1857)
@@ -78,7 +78,7 @@
window_outgoing_setup_timer (appdata);
appdata->g_state.callstate = STATE_CALLING;
- appdata->g_state.historytype = OUTGOING;
+ //appdata->g_state.historytype = OUTGOING;
/* TOOD: MokoGsmdConnection->dial
* gsm_dial (appdata->g_peer_info.number);
*/
@@ -189,14 +189,14 @@
}
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.picpath,
appdata->g_state.starttime,
appdata->g_state.startdate, 0);
-
+*/
}
@@ -240,7 +240,7 @@
//DBG_TRACE ();
appdata->g_state.callstate = STATE_CALLING;
//DBG_TRACE ();
- appdata->g_state.historytype = OUTGOING;
+ //appdata->g_state.historytype = OUTGOING;
//DBG_TRACE ();
/* TODO: MokoGsmdConnection->dial
* int retv = gsm_dial (appdata->g_peer_info.number);
Modified: trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-window-talking.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-window-talking.c 2007-04-27 11:12:00 UTC (rev 1856)
+++ trunk/src/target/OM-2007/applications/openmoko-dialer/src/dialer-window-talking.c 2007-04-27 11:24:32 UTC (rev 1857)
@@ -230,14 +230,14 @@
gtk_widget_hide (appdata->toolbox_talking);
moko_dialer_textview_empty (appdata->moko_dtmf_text_view);
- add_histroy_entry (appdata, appdata->g_state.historytype,
+/* add_histroy_entry (appdata, appdata->g_state.historytype,
appdata->g_peer_info.name,
appdata->g_peer_info.number,
appdata->g_peer_info.picpath,
appdata->g_state.starttime,
appdata->g_state.startdate, appdata->g_timer_data.ticks);
+*/
-
}
void
Deleted: trunk/src/target/OM-2007/applications/openmoko-dialer/src/history.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-dialer/src/history.c 2007-04-27 11:12:00 UTC (rev 1856)
+++ trunk/src/target/OM-2007/applications/openmoko-dialer/src/history.c 2007-04-27 11:24:32 UTC (rev 1857)
@@ -1,321 +0,0 @@
-/***************************************************************************
- * history.c
- *
- * Wed Oct 25 18:25:13 2006
- * Copyright 2006 User
- * Email
- ****************************************************************************/
-
-/*
- * 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 Library 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include "history.h"
-#include "error.h"
-#include <stdlib.h>
-/**
- * @brief initialze the contact list by calling the external APIs.
- *
- * This function should be called once at the initial process.
- *
- * @param head DIALER_CONTACTS_LIST_HEAD head pointer
- * @return the number of the contacts.
- * @retval
- */
-int
-history_read_list (HISTORY_LIST_HEAD * historyhead)
-{
- return 0;
-}
-
-
-/**
- * @brief read the history list using internal data,just for debug use
- *
- *
- *
- * @param head HISTORY_LIST_HEAD*,head pointer
- * @return the number of the history items
- * @retval 0 failed
- * @retval other success
- */
-int
-history_read_list_cmd (HISTORY_LIST_HEAD * historyhead)
-{
-
- historyhead->length = 0;
- historyhead->first = 0;
- historyhead->last = 0;
- history_add_entry (historyhead, MISSED, "", "1391721112",
- "", "17:58", "12/20", 100);
-
- history_add_entry (historyhead, INCOMING, "tony", "13917309523",
- "./tony.png", "13:58", "12/20", 10);
- history_add_entry (historyhead, OUTGOING, "sally", "13361900551",
- "./sally.png", "10:58", "12/20", 106);
- history_add_entry (historyhead, MISSED, "chaowei", "1391110923",
- "./chaowei.png", "11:58", "12/20", 120);
- history_add_entry (historyhead, OUTGOING, "", "1395721111",
- "", "17:58", "12/20", 100);
-
- history_add_entry (historyhead, INCOMING, "steven", "1391721111",
- "./steven.png", "17:58", "12/20", 100);
- history_add_entry (historyhead, INCOMING, "ken", "1381720923",
- "./ken.png", "18:58", "12/20", 200);
- history_add_entry (historyhead, MISSED, "", "1391721113",
- "", "17:58", "12/20", 100);
- history_add_entry (historyhead, MISSED, "", "1394721111",
- "", "17:58", "12/20", 100);
- history_add_entry (historyhead, MISSED, "", "1396721111",
- "", "17:58", "12/20", 100);
- return historyhead->length;
-
-}
-
-/*
-typedef struct historyentry
-{
- int ID;///<the unique ID for an contact entry
- HISTORY_TYPE type;
- char *name; ///<person name
- char *picpath; ///<the picture file path for the person
- char *time;
- int durationsec;
- struct historyentry* next; ///<pointer to next entry
- struct historyentry* prev; ///<pointer to next entry
-}HISTORY_ENTRY;
-*/
-
-/**
- * @brief delete the supplied entry from the list
- *
- *
- *
- * @param head HISTORY_LIST_HEAD*,head pointer
- * @param entry HISTORY_ENTRY*, the history entry to be deleted
- * @return
- * @retval 0 failed
- * @retval 1 success
- */
-int
-history_delete_entry (HISTORY_LIST_HEAD * historyhead, HISTORY_ENTRY * entry)
-{
- DBG_ENTER ();
- if (entry == 0)
- return 0;
- if (entry->number == 0)
- return 0;
- if (entry->prev == 0 && entry->next == 0)
- return 0;
-
- DBG_MESSAGE ("deleting %s", entry->number);
-
- if (entry->prev)
- {
- entry->prev->next = entry->next;
- }
- else
- { //entry is the first one.
- historyhead->first = entry->next;
- }
-
- if (entry->next)
- {
- entry->next->prev = entry->prev;
- }
- else
- {
- historyhead->last = entry->prev;
- }
-
- history_release_entry (entry);
-
- historyhead->length--;
- return historyhead->length;
-}
-
-
-
-/**
- * @brief create a history entry, and add this entry to the list.
- *
- *
- *
- * @param name const char*, the name of the counterpart
- * @param number const char*, the number of the counterpart
- * @param picpath const char*, the picture path of the counterpart
- * @param time char*, the time of that connection
- * @param date char*, the date of that connection
- * @param durationsec int, the duaration of that connection in seconds
- * @return
- * @retval the newly created entry pointer
- */
-HISTORY_ENTRY *
-history_add_entry (HISTORY_LIST_HEAD * historyhead, HISTORY_TYPE type,
- const char *name, const char *number, const char *id,
- char *time, char *date, int durationsec)
-{
-
- DBG_ENTER ();
- HISTORY_ENTRY *pentry =
- (HISTORY_ENTRY *) calloc (1, sizeof (HISTORY_ENTRY));
-
-// DBG_MESSAGE("pentry add:0X%x",pentry);
-
- if (name && g_utf8_strlen (name, -1) > 0)
- {
- pentry->name = (char *) calloc (1, g_utf8_strlen (name, -1) + 1);
- g_stpcpy (pentry->name, name);
- pentry->hasname = 1;
- }
- else
- {
- pentry->name = 0;
- pentry->hasname = 0;
- }
-
- if (number && g_utf8_strlen (number, -1) > 0)
- {
- pentry->number = (char *) calloc (1, g_utf8_strlen (number, -1) + 1);
- g_stpcpy (pentry->number, number);
- }
- else
- {
- //release memory, and return;
- history_release_entry (pentry);
- return 0;
- }
-
- //DBG_MESSAGE("History add:0X%x,%s,%s,%s,%s,%s,%d",historyhead,name,number,picpath,time,date,durationsec);
-
- if (id && g_utf8_strlen (id, -1) > 0)
- {
- pentry->ID = (char *) calloc (1, g_utf8_strlen (id, -1) + 1);
- g_stpcpy (pentry->ID, id);
- }
- if (time && g_utf8_strlen (time, -1) > 0)
- {
- pentry->time = (char *) calloc (1, g_utf8_strlen (time, -1) + 1);
- g_stpcpy (pentry->time, time);
- }
- pentry->durationsec = durationsec;
-
- pentry->type = type;
- historyhead->length++;
-
-
- if (historyhead->first)
- { //DBG_TRACE();
- //DBG_MESSAGE("first=0x%x",historyhead->first);
- //DBG_MESSAGE("first=%s",historyhead->first->number);
- historyhead->first->prev = pentry;
- //DBG_TRACE();
- pentry->next = historyhead->first;
- //DBG_TRACE();
- historyhead->first = pentry;
- //DBG_TRACE();
- }
- else
- { //DBG_TRACE();
- historyhead->first = pentry;
- historyhead->last = pentry;
- }
-// DBG_LEAVE();
- return pentry;
-}
-
-int
-history_release_entry (HISTORY_ENTRY * pentry)
-{
- if (!pentry)
- return 1;
- if (pentry->name)
- {
- free (pentry->name);
- pentry->name = 0;
- }
- if (pentry->number)
- {
- free (pentry->number);
- pentry->number = 0;
- }
- if (pentry->ID)
- {
- free (pentry->ID);
- pentry->ID = 0;
- }
- if (pentry->time)
- {
- free (pentry->time);
- pentry->time = 0;
- }
- if (pentry->date)
- {
- free (pentry->date);
- pentry->date = 0;
- }
-
- pentry->prev = 0;
- pentry->next = 0;
- free (pentry);
- pentry = 0;
- return 1;
-
-}
-
-/**
- * @brief release the momory by the list and it's entry
- *
- *
- *
- * @param head HISTORY_LIST_HEAD*,head pointer
- * @return
- * @retval 0 failed
- * @retval 1 success
- */
-int
-history_release_history_list (HISTORY_LIST_HEAD * historyhead)
-{
- HISTORY_ENTRY *pentry;
- HISTORY_ENTRY *next;
- pentry = historyhead->first;
- while (pentry)
- {
- next = pentry->next;
- history_release_entry (pentry);
- pentry = next;
- }
- historyhead->first = 0;
- historyhead->last = 0;
- historyhead->length = 0;
- return 1;
-}
-
-int
-history_init_history_data (HISTORY_LIST_HEAD * historyhead)
-{
-
- DBG_ENTER ();
- int res = history_read_list (historyhead);
-/*
- if (res == 0)
- {
- res = history_read_list_cmd (historyhead);
- }
- */
- DBG_MESSAGE ("History:%d", historyhead->length);
- DBG_LEAVE ();
- return res;
-}
Deleted: trunk/src/target/OM-2007/applications/openmoko-dialer/src/history.h
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-dialer/src/history.h 2007-04-27 11:12:00 UTC (rev 1856)
+++ trunk/src/target/OM-2007/applications/openmoko-dialer/src/history.h 2007-04-27 11:24:32 UTC (rev 1857)
@@ -1,149 +0,0 @@
-/***************************************************************************
- * history.h
- *
- * Wed Oct 25 18:15:38 2006
- * Copyright 2006 Tony Guan
- * Email tonyguan at fic-sh.com.cn
- ****************************************************************************/
-
-/*
- * 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 Library 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _HISTORY_H
-#define _HISTORY_H
-
-#ifdef __cplusplus
-
-
-
-extern "C"
-{
-#endif
-
-
-
-/**
- * @brief enum of history type
- */
-
- typedef enum _historytype
- {
- INCOMING = 0, ///<incoming calls
- OUTGOING, ///<outgoing calls
- MISSED, ///<missed calls
- ALL ///<all the types including the above
- } HISTORY_TYPE;
-
-/**
- * @brief history entry item structure
- */
- typedef struct historyentry
- {
- int ID; ///<the unique ID for an contact entry
- HISTORY_TYPE type;
- char *name; ///<person name
- char *number; ///<person number
-// char *id; ///<the id
- char *time; ///< start time of that talk
- char *date; ///<start date of that talk
- int durationsec; ///<seconds of the duaration
- struct historyentry *next; ///<pointer to next entry
- struct historyentry *prev; ///<pointer to next entry
- int hasname;
- } HISTORY_ENTRY;
-
-
-/**
- * @brief contacts list head structure.
- */
- typedef struct history_list_head
- {
- int length; ///<the number of history
- HISTORY_ENTRY *first; ///<list head pointer
- HISTORY_ENTRY *last; ///<list head pointer
- } HISTORY_LIST_HEAD;
-/**
- * @brief read the history list using the external APIs,currently only return 0
- *
- *
- *
- * @param head HISTORY_LIST_HEAD*,head pointer
- * @retval 0 failed
- * @retval other success
- */
- int history_read_list (HISTORY_LIST_HEAD * historyhead);
-
-/**
- * @brief read the history list using internal data,just for debug use
- *
- *
- *
- * @param head HISTORY_LIST_HEAD*,head pointer
- * @return the number of the history items
- * @retval 0 failed
- * @retval other success
- */
- int history_read_list_cmd (HISTORY_LIST_HEAD * historyhead);
-
-/**
- * @brief release the momory by the list and it's entry
- *
- *
- *
- * @param head HISTORY_LIST_HEAD*,head pointer
- * @return
- * @retval 0 failed
- * @retval 1 success
- */
- int history_release_history_list (HISTORY_LIST_HEAD * historyhead);
-
-/**
- * @brief create a history entry, and add this entry to the list.
- *
- *
- *
- * @param name const char*, the name of the counterpart
- * @param number const char*, the number of the counterpart
- * @param picpath const char*, the picture path of the counterpart
- * @param time char*, the time of that connection,may include date&time, and may be seperated into 2 fields in the future.
- * @param durationsec int, the duaration of that connection in seconds
- * @return
- * @retval the newly created entry pointer
- */
- HISTORY_ENTRY *history_add_entry (HISTORY_LIST_HEAD * historyhead,
- HISTORY_TYPE type, const char *name,
- const char *number, const char *picpath,
- char *time, char *date, int durationsec);
-/**
- * @brief delete the supplied entry from the list
- *
- *
- *
- * @param head HISTORY_LIST_HEAD*,head pointer
- * @param entry HISTORY_ENTRY*, the history entry to be deleted
- * @return
- * @retval 0 failed
- * @retval 1 success
- */
- int history_delete_entry (HISTORY_LIST_HEAD * historyhead,
- HISTORY_ENTRY * entry);
-
- int history_init_history_data (HISTORY_LIST_HEAD * historyhead);
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _HISTORY_H */
Modified: trunk/src/target/OM-2007/applications/openmoko-dialer/src/moko-dialer-autolist.h
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-dialer/src/moko-dialer-autolist.h 2007-04-27 11:12:00 UTC (rev 1856)
+++ trunk/src/target/OM-2007/applications/openmoko-dialer/src/moko-dialer-autolist.h 2007-04-27 11:24:32 UTC (rev 1857)
@@ -31,8 +31,6 @@
#include "moko-dialer-tip.h"
#include "moko-dialer-declares.h"
#include "contacts.h"
-#include "history.h"
-//#include "moko-dialer-includes.h"
G_BEGIN_DECLS
#define MOKO_TYPE_DIALER_AUTOLIST (moko_dialer_autolist_get_type())
Modified: trunk/src/target/OM-2007/applications/openmoko-dialer/src/moko-dialer-includes.h
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-dialer/src/moko-dialer-includes.h 2007-04-27 11:12:00 UTC (rev 1856)
+++ trunk/src/target/OM-2007/applications/openmoko-dialer/src/moko-dialer-includes.h 2007-04-27 11:24:32 UTC (rev 1857)
@@ -22,7 +22,6 @@
#include "moko-dialer-declares.h"
#include "error.h"
#include "contacts.h"
-#include "history.h"
#include "moko-dialer-autolist.h"
#include "moko-dialer-panel.h"
#include "moko-dialer-textview.h"
@@ -73,7 +72,6 @@
CONNECTION_STATE callstate;
WINDOW_STATE talkingstate;
SPEAKER_STATE speakerstate;
- HISTORY_TYPE historytype;
char starttime[24];
char startdate[24];
char lastnumber[MOKO_DIALER_MAX_NUMBER_LEN + 1];
More information about the commitlog
mailing list