From 176616e0fb7f02dd27469b44510428e7140a0461 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 23 Sep 2010 15:14:46 +0200 Subject: [PATCH] beautifull call logs --- gtk/call_logs.ui | 35 ++++++++++++++++++++++++++++++++--- gtk/calllogs.c | 22 ++++++++++++++++++++-- 2 files changed, 52 insertions(+), 5 deletions(-) diff --git a/gtk/call_logs.ui b/gtk/call_logs.ui index db6ad70e5..00c2dfbda 100644 --- a/gtk/call_logs.ui +++ b/gtk/call_logs.ui @@ -16,7 +16,6 @@ 5 Call history center-on-parent - linphone2.png dialog False @@ -48,7 +47,31 @@ True end - + + Clear all + True + True + True + image1 + + + False + False + 0 + + + + + Call back + True + True + True + + + False + False + 1 + @@ -61,7 +84,7 @@ False False - 1 + 2 @@ -74,7 +97,13 @@ + button1 + call_back_button call_logs_close + + True + gtk-clear + diff --git a/gtk/calllogs.c b/gtk/calllogs.c index 3f7875a9a..c196c2c41 100644 --- a/gtk/calllogs.c +++ b/gtk/calllogs.c @@ -29,6 +29,7 @@ void linphone_gtk_call_log_update(GtkWidget *w){ if (store==NULL){ store=gtk_list_store_new(3,G_TYPE_STRING,G_TYPE_STRING, G_TYPE_POINTER); gtk_tree_view_set_model(v,GTK_TREE_MODEL(store)); + g_object_unref(G_OBJECT(store)); } gtk_list_store_clear (store); @@ -58,7 +59,7 @@ void linphone_gtk_call_log_update(GtkWidget *w){ } -void linphone_gtk_history_row_activated(GtkWidget *treeview){ +static bool_t put_selection_to_uribar(GtkWidget *treeview){ GtkTreeSelection *sel; sel=gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)); @@ -74,16 +75,31 @@ void linphone_gtk_history_row_activated(GtkWidget *treeview){ tmp=linphone_address_as_string (la); gtk_entry_set_text(GTK_ENTRY(linphone_gtk_get_widget(linphone_gtk_get_main_window(),"uribar")),tmp); ms_free(tmp); + return TRUE; } } + return FALSE; } -void linphone_gtk_call_log_response(GtkWidget *w){ +void linphone_gtk_history_row_activated(GtkWidget *treeview){ + put_selection_to_uribar(treeview); +} + +void linphone_gtk_call_log_response(GtkWidget *w, guint response_id){ GtkWidget *mw=linphone_gtk_get_main_window(); + if (response_id==1){ + if (put_selection_to_uribar(linphone_gtk_get_widget(w,"logs_view"))) + linphone_gtk_start_call(linphone_gtk_get_widget(mw,"start_call")); + }else if (response_id==2){ + linphone_core_clear_call_logs (linphone_gtk_get_core()); + linphone_gtk_call_log_update(w); + return; + } g_object_set_data(G_OBJECT(mw),"call_logs",NULL); gtk_widget_destroy(w); } + static void fill_renderers(GtkTreeView *v){ GtkTreeViewColumn *c; GtkCellRenderer *r=gtk_cell_renderer_pixbuf_new (); @@ -102,6 +118,8 @@ GtkWidget * linphone_gtk_show_call_logs(void){ GtkWidget *w=(GtkWidget*)g_object_get_data(G_OBJECT(linphone_gtk_get_main_window()),"call_logs"); if (w==NULL){ w=linphone_gtk_create_window("call_logs"); + gtk_button_set_image(GTK_BUTTON(linphone_gtk_get_widget(w,"call_back_button")), + create_pixmap (linphone_gtk_get_ui_config("callback_button","status-green.png"))); fill_renderers(GTK_TREE_VIEW(linphone_gtk_get_widget(w,"logs_view"))); g_object_set_data(G_OBJECT(mw),"call_logs",w); g_signal_connect(G_OBJECT(w),"response",(GCallback)linphone_gtk_call_log_response,NULL);