--- Begin Message ---
Author: mickey
Date: 2007-04-27 13:12:00 +0200 (Fri, 27 Apr 2007)
New Revision: 1856
Modified:
trunk/src/target/OM-2007/examples/openmoko-gsmd-demo/src/demo-main.c
Log:
openmoko-gsmd-demo: can receive/initiate calls now
Modified: trunk/src/target/OM-2007/examples/openmoko-gsmd-demo/src/demo-main.c
===================================================================
--- trunk/src/target/OM-2007/examples/openmoko-gsmd-demo/src/demo-main.c
2007-04-27 11:11:40 UTC (rev 1855)
+++ trunk/src/target/OM-2007/examples/openmoko-gsmd-demo/src/demo-main.c
2007-04-27 11:12:00 UTC (rev 1856)
@@ -41,31 +41,82 @@
static GtkLabel* network;
static GtkLabel* signal;
static GtkLabel* status;
+static GtkEntry* entry;
+static GtkTextBuffer* buffer;
+
+#include <gsmd/event.h>
+
+static const char *cprog_names[] = {
+ [GSMD_CALLPROG_SETUP] = "SETUP",
+ [GSMD_CALLPROG_DISCONNECT] = "DISCONNECT",
+ [GSMD_CALLPROG_ALERT] = "ALERT",
+ [GSMD_CALLPROG_CALL_PROCEED] = "PROCEED",
+ [GSMD_CALLPROG_SYNC] = "SYNC",
+ [GSMD_CALLPROG_PROGRESS] = "PROGRESS",
+ [GSMD_CALLPROG_CONNECTED] = "CONNECTED",
+ [GSMD_CALLPROG_RELEASE] = "RELEASE",
+ [GSMD_CALLPROG_REJECT] = "REJECT",
+ [GSMD_CALLPROG_UNKNOWN] = "UNKNOWN",
+};
+
+static const char *cdir_names[] = {
+ [GSMD_CALL_DIR_MO] = "Outgoing",
+ [GSMD_CALL_DIR_MT] = "Incoming",
+ [GSMD_CALL_DIR_CCBS] = "CCBS",
+ [GSMD_CALL_DIR_MO_REDIAL] = "Outgoing Redial",
+};
+
+
+#define my_debug(fmt,...) \
+ gtk_text_buffer_insert_at_cursor( buffer,
g_strdup_printf(fmt,##__VA_ARGS__), -1 ); \
+ gtk_text_buffer_insert_at_cursor( buffer, "\n", 1 );
+
void cb_poweron_clicked( GtkButton* button, MokoFingerWindow* window )
{
+ my_debug( "setting antenna power to 1" );
moko_gsmd_connection_set_antenna_power( gsm, TRUE );
}
void cb_register_clicked( GtkButton* button, MokoFingerWindow* window )
{
+ my_debug( "calling network register" );
moko_gsmd_connection_network_register( gsm );
}
void cb_poweroff_clicked( GtkButton* button, MokoFingerWindow* window )
{
+ my_debug( "setting antenna power to 0" );
moko_gsmd_connection_set_antenna_power( gsm, FALSE );
}
+void cb_acceptcall_clicked( GtkButton* button, MokoFingerWindow* window )
+{
+ my_debug( "accepting voice call" );
+ moko_gsmd_connection_voice_accept( gsm );
+}
+
+void cb_dial_clicked( GtkButton* button, MokoFingerWindow* window )
+{
+ my_debug( "dialing %s", gtk_entry_get_text( entry ) );
+ moko_gsmd_connection_voice_dial( gsm, gtk_entry_get_text( entry ) );
+}
+
+void cb_hangup_clicked( GtkButton* button, MokoFingerWindow* window )
+{
+ my_debug( "hanging up" );
+ moko_gsmd_connection_voice_hangup( gsm );
+}
+
void cb_signal_strength_changed( MokoGsmdConnection* connection, int value,
gpointer user_data )
{
- g_debug( "openmoko-gsmd-demo: signal strength changed" );
+ my_debug( "signal strength changed: %d", value );
gtk_label_set_text( signal, g_strdup_printf( "Signal Strength: %d", value
) );
}
void cb_network_registration( MokoGsmdConnection* connection, int type, int
lac, int cell )
{
- g_debug( "openmoko-gsmd-demo: network registration" );
+ my_debug( "network registration %d, %d, %d", type, lac, cell );
if ( type == 0 )
gtk_label_set_text( status, "Not Searching..." );
else
@@ -85,9 +136,25 @@
}
}
+void cb_incoming_call( MokoGsmdConnection* connection, int type )
+{
+ my_debug( "incoming call type -- type = %d", type );
+}
+
+void cb_incoming_call_progress( MokoGsmdConnection* connection, int code )
+{
+ my_debug( "call progress -- code = %d (%s)", code, cprog_names[code] );
+ gtk_label_set_text( status, cprog_names[code] );
+}
+
+void cb_incoming_clip( MokoGsmdConnection* connection, char* number )
+{
+ my_debug( "incoming number -- number = %s", number );
+}
+
int main( int argc, char** argv )
{
- g_debug( "openmoko-gsmd-demo starting up" );
+ g_debug( "starting up" );
/* Initialize GTK+ */
gtk_init( &argc, &argv );
@@ -118,25 +185,40 @@
status = gtk_label_new( "Idle" );
GtkLabel* label2 = gtk_label_new( "Press buttons to experiment..." );
+ entry = gtk_entry_new();
+
GtkTable* table = gtk_table_new( 4, 3, TRUE );
GtkButton* button1 = gtk_button_new_with_label( "Power-On" );
g_signal_connect( G_OBJECT(button1), "clicked",
G_CALLBACK(cb_poweron_clicked), window );
- gtk_table_attach_defaults( GTK_BOX(table), GTK_WIDGET(button1), 0, 1, 0, 1
);
-
+ gtk_table_attach_defaults( GTK_BOX(table), GTK_WIDGET(button1), 0, 1, 1, 2
);
GtkButton* button2 = gtk_button_new_with_label( "Register" );
g_signal_connect( G_OBJECT(button2), "clicked",
G_CALLBACK(cb_register_clicked), window );
- gtk_table_attach_defaults( GTK_BOX(table), GTK_WIDGET(button2), 1, 2, 0, 1
);
-
+ gtk_table_attach_defaults( GTK_BOX(table), GTK_WIDGET(button2), 1, 2, 1, 2
);
GtkButton* button3 = gtk_button_new_with_label( "Power-Off" );
g_signal_connect( G_OBJECT(button3), "clicked",
G_CALLBACK(cb_poweroff_clicked), window );
- gtk_table_attach_defaults( GTK_BOX(table), GTK_WIDGET(button3), 2, 3, 0, 1
);
+ gtk_table_attach_defaults( GTK_BOX(table), GTK_WIDGET(button3), 2, 3, 1, 2
);
+ GtkButton* button4 = gtk_button_new_with_label( "Accept Call" );
+ g_signal_connect( G_OBJECT(button4), "clicked",
G_CALLBACK(cb_acceptcall_clicked), window );
+ gtk_table_attach_defaults( GTK_BOX(table), GTK_WIDGET(button4), 0, 1, 0, 1
);
+ GtkButton* button5 = gtk_button_new_with_label( "Dial" );
+ g_signal_connect( G_OBJECT(button5), "clicked",
G_CALLBACK(cb_dial_clicked), window );
+ gtk_table_attach_defaults( GTK_BOX(table), GTK_WIDGET(button5), 1, 2, 0, 1
);
+ GtkButton* button6 = gtk_button_new_with_label( "Hangup" );
+ g_signal_connect( G_OBJECT(button6), "clicked",
G_CALLBACK(cb_hangup_clicked), window );
+ gtk_table_attach_defaults( GTK_BOX(table), GTK_WIDGET(button6), 2, 3, 0, 1
);
+
+ GtkTextView* textview = gtk_text_view_new();
+ buffer = gtk_text_view_get_buffer( GTK_TEXT_VIEW(textview) );
+
gtk_box_pack_start( vbox, GTK_WIDGET(label0), FALSE, FALSE, 0 );
gtk_box_pack_start( vbox, GTK_WIDGET(network), FALSE, FALSE, 0 );
gtk_box_pack_start( vbox, GTK_WIDGET(signal), FALSE, FALSE, 0 );
gtk_box_pack_start( vbox, GTK_WIDGET(status), FALSE, FALSE, 0 );
+ gtk_box_pack_start( vbox, GTK_WIDGET(entry), FALSE, FALSE, 0 );
gtk_box_pack_start( vbox, GTK_WIDGET(table), TRUE, TRUE, 0 );
+ gtk_box_pack_start( vbox, GTK_WIDGET(textview), TRUE, TRUE, 0 );
gtk_box_pack_start( vbox, GTK_WIDGET(label2), FALSE, FALSE, 0 );
moko_finger_window_set_contents( window, GTK_WIDGET(vbox) );
@@ -145,14 +227,18 @@
g_signal_connect( G_OBJECT(gsm), "signal-strength-changed",
G_CALLBACK(cb_signal_strength_changed), NULL );
g_signal_connect( G_OBJECT(gsm), "network-registration",
G_CALLBACK(cb_network_registration), NULL );
+ g_signal_connect( G_OBJECT(gsm), "incoming-call",
G_CALLBACK(cb_incoming_call), NULL );
+ g_signal_connect( G_OBJECT(gsm), "call-progress",
G_CALLBACK(cb_incoming_call_progress), NULL );
+ g_signal_connect( G_OBJECT(gsm), "incoming-clip",
G_CALLBACK(cb_incoming_clip), NULL );
/* show everything and run main loop */
gtk_widget_show_all( GTK_WIDGET(window) );
- g_debug( "openmoko-gsmd-demo entering main loop" );
+ g_debug( "entering main loop" );
gtk_main();
- g_debug( "openmoko-gsmd-demo left main loop" );
+ g_debug( "left main loop" );
g_object_unref( G_OBJECT(gsm) );
+ g_debug( "shutting down" );
return 0;
}
--- End Message ---
--- Begin Message ---
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 [EMAIL PROTECTED]
- ****************************************************************************/
-
-/*
- * 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];
--- End Message ---