mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-07 05:53:06 +00:00
beautifull call logs
This commit is contained in:
parent
27e4117f59
commit
176616e0fb
2 changed files with 52 additions and 5 deletions
|
|
@ -16,7 +16,6 @@
|
|||
<property name="border_width">5</property>
|
||||
<property name="title" translatable="yes">Call history</property>
|
||||
<property name="window_position">center-on-parent</property>
|
||||
<property name="icon">linphone2.png</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<property name="has_separator">False</property>
|
||||
<child internal-child="vbox">
|
||||
|
|
@ -48,7 +47,31 @@
|
|||
<property name="visible">True</property>
|
||||
<property name="layout_style">end</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
<object class="GtkButton" id="button1">
|
||||
<property name="label" translatable="yes">Clear all</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="image">image1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="call_back_button">
|
||||
<property name="label" translatable="yes">Call back</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="call_logs_close">
|
||||
|
|
@ -61,7 +84,7 @@
|
|||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
|
|
@ -74,7 +97,13 @@
|
|||
</object>
|
||||
</child>
|
||||
<action-widgets>
|
||||
<action-widget response="2">button1</action-widget>
|
||||
<action-widget response="1">call_back_button</action-widget>
|
||||
<action-widget response="0">call_logs_close</action-widget>
|
||||
</action-widgets>
|
||||
</object>
|
||||
<object class="GtkImage" id="image1">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-clear</property>
|
||||
</object>
|
||||
</interface>
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue