Commit b6a5ffce authored by Simon Morlat's avatar Simon Morlat
Browse files

GTK: provides call logs in a tab

Better icons for incall view + spinner
parent 44f05cd1
linphone-3.5.0 -- future date
* added VP-8 video codec
* UI: call history tab, menu simplified
* UI: cosmetics for incall views
* UI: integration with libnotify
* UI: show registered SIP accounts
* Fixes for MacOS X, and uses GtkQuartz engine
linphone-3.4.3 -- March 28, 2011
* Fully ported to mac os x with gtk-osx (menu integration, bundle generation with "make bundle", sound I/O improved) but still audio only
* Fix stupid warning "no response" that sometimes arrived at end of calls
......
dnl Process this file with autoconf to produce a configure script.
AC_INIT([linphone],[3.4.99.1],[linphone-developers@nongnu.org])
AC_INIT([linphone],[3.4.99.2],[linphone-developers@nongnu.org])
AC_CANONICAL_SYSTEM
AC_CONFIG_SRCDIR([coreapi/linphonecore.c])
......
<?xml version="1.0"?>
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy toplevel-contextual -->
<object class="GtkListStore" id="call_logs_store">
<columns>
<!-- column-name icon -->
<column type="gchar"/>
<!-- column-name sipaddress -->
<column type="gchar"/>
</columns>
</object>
<object class="GtkDialog" id="call_logs">
<property name="width_request">500</property>
<property name="height_request">370</property>
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="title" translatable="yes">Call history</property>
<property name="window_position">center-on-parent</property>
<property name="type_hint">dialog</property>
<property name="has_separator">False</property>
<child internal-child="vbox">
<object class="GtkVBox" id="dialog-vbox1">
<object class="GtkVBox" id="call_logs_box">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="can_focus">False</property>
<property name="spacing">2</property>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">never</property>
<property name="vscrollbar_policy">automatic</property>
<child>
<object class="GtkTreeView" id="logs_view">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">False</property>
<signal name="row_activated" handler="linphone_gtk_history_row_activated"/>
</object>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child internal-child="action_area">
<object class="GtkHButtonBox" id="dialog-action_area1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="button1">
......@@ -52,6 +26,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="image">image1</property>
</object>
<packing>
......@@ -66,6 +41,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -79,6 +55,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
......@@ -90,10 +67,32 @@
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">never</property>
<property name="vscrollbar_policy">automatic</property>
<child>
<object class="GtkTreeView" id="logs_view">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">False</property>
<signal name="row-activated" handler="linphone_gtk_history_row_activated" swapped="no"/>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
<action-widgets>
......@@ -102,8 +101,17 @@
<action-widget response="0">call_logs_close</action-widget>
</action-widgets>
</object>
<object class="GtkListStore" id="call_logs_store">
<columns>
<!-- column-name icon -->
<column type="gchar"/>
<!-- column-name sipaddress -->
<column type="gchar"/>
</columns>
</object>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-clear</property>
</object>
</interface>
......@@ -20,6 +20,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "linphone.h"
static void fill_renderers(GtkTreeView *v){
GtkTreeViewColumn *c;
GtkCellRenderer *r=gtk_cell_renderer_pixbuf_new ();
g_object_set(r,"stock-size",GTK_ICON_SIZE_BUTTON,NULL);
c=gtk_tree_view_column_new_with_attributes("icon",r,"stock-id",0,NULL);
gtk_tree_view_append_column (v,c);
r=gtk_cell_renderer_text_new ();
c=gtk_tree_view_column_new_with_attributes("sipaddress",r,"markup",1,NULL);
gtk_tree_view_append_column (v,c);
}
void linphone_gtk_call_log_update(GtkWidget *w){
GtkTreeView *v=GTK_TREE_VIEW(linphone_gtk_get_widget(w,"logs_view"));
GtkListStore *store;
......@@ -30,6 +43,9 @@ void linphone_gtk_call_log_update(GtkWidget *w){
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));
fill_renderers(GTK_TREE_VIEW(linphone_gtk_get_widget(w,"logs_view")));
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")));
}
gtk_list_store_clear (store);
......@@ -88,7 +104,21 @@ static bool_t put_selection_to_uribar(GtkWidget *treeview){
}
void linphone_gtk_history_row_activated(GtkWidget *treeview){
put_selection_to_uribar(treeview);
if (put_selection_to_uribar(treeview)){
GtkWidget *mw=linphone_gtk_get_main_window();
linphone_gtk_start_call(linphone_gtk_get_widget(mw,"start_call"));
}
}
void linphone_gtk_clear_call_logs(GtkWidget *button){
linphone_core_clear_call_logs (linphone_gtk_get_core());
linphone_gtk_call_log_update(gtk_widget_get_toplevel(button));
}
void linphone_gtk_call_log_callback(GtkWidget *button){
GtkWidget *mw=linphone_gtk_get_main_window();
if (put_selection_to_uribar(linphone_gtk_get_widget(mw,"logs_view")))
linphone_gtk_start_call(linphone_gtk_get_widget(mw,"start_call"));
}
void linphone_gtk_call_log_response(GtkWidget *w, guint response_id){
......@@ -106,27 +136,15 @@ void linphone_gtk_call_log_response(GtkWidget *w, guint response_id){
}
static void fill_renderers(GtkTreeView *v){
GtkTreeViewColumn *c;
GtkCellRenderer *r=gtk_cell_renderer_pixbuf_new ();
g_object_set(r,"stock-size",GTK_ICON_SIZE_BUTTON,NULL);
c=gtk_tree_view_column_new_with_attributes("icon",r,"stock-id",0,NULL);
gtk_tree_view_append_column (v,c);
r=gtk_cell_renderer_text_new ();
c=gtk_tree_view_column_new_with_attributes("sipaddress",r,"markup",1,NULL);
gtk_tree_view_append_column (v,c);
}
GtkWidget * linphone_gtk_show_call_logs(void){
GtkWidget *mw=linphone_gtk_get_main_window();
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);
gtk_widget_show(w);
......
......@@ -66,6 +66,33 @@ static GtkWidget *make_tab_header(int number){
return w;
}
static void linphone_gtk_in_call_set_animation_image(GtkWidget *callview, const char *image_name, gboolean is_stock){
GtkWidget *container=linphone_gtk_get_widget(callview,"in_call_animation");
GList *elem=gtk_container_get_children(GTK_CONTAINER(container));
GtkWidget *image;
if (!is_stock)
image=create_pixmap(image_name);
else
image=gtk_image_new_from_stock(image_name,GTK_ICON_SIZE_DIALOG);
if (elem)
gtk_widget_destroy((GtkWidget*)elem->data);
gtk_widget_show(image);
gtk_container_add(GTK_CONTAINER(container),image);
}
static void linphone_gtk_in_call_set_animation_spinner(GtkWidget *callview){
GtkWidget *container=linphone_gtk_get_widget(callview,"in_call_animation");
GList *elem=gtk_container_get_children(GTK_CONTAINER(container));
GtkWidget *spinner=gtk_spinner_new();
if (elem)
gtk_widget_destroy((GtkWidget*)elem->data);
gtk_widget_show(spinner);
gtk_container_add(GTK_CONTAINER(container),spinner);
gtk_spinner_start(GTK_SPINNER(spinner));
}
static void linphone_gtk_transfer_call(LinphoneCall *dest_call){
LinphoneCall *call=linphone_gtk_get_currently_displayed_call();
linphone_core_transfer_call_to_another (linphone_gtk_get_core(),call,dest_call);
......@@ -181,25 +208,18 @@ void linphone_gtk_in_call_view_set_calling(LinphoneCall *call){
GtkWidget *status=linphone_gtk_get_widget(callview,"in_call_status");
GtkWidget *callee=linphone_gtk_get_widget(callview,"in_call_uri");
GtkWidget *duration=linphone_gtk_get_widget(callview,"in_call_duration");
GtkWidget *animation=linphone_gtk_get_widget(callview,"in_call_animation");
GdkPixbufAnimation *pbuf=create_pixbuf_animation("calling_anim.gif");
gtk_label_set_markup(GTK_LABEL(status),_("<b>Calling...</b>"));
display_peer_name_in_label(callee,linphone_call_get_remote_address (call));
gtk_label_set_text(GTK_LABEL(duration),_("00::00::00"));
if (pbuf!=NULL){
gtk_image_set_from_animation(GTK_IMAGE(animation),pbuf);
g_object_unref(G_OBJECT(pbuf));
}else gtk_image_set_from_stock(GTK_IMAGE(animation),GTK_STOCK_FIND,GTK_ICON_SIZE_DIALOG);
linphone_gtk_in_call_set_animation_spinner(callview);
}
void linphone_gtk_in_call_view_set_incoming(LinphoneCall *call, bool_t with_pause){
GtkWidget *callview=(GtkWidget*)linphone_call_get_user_pointer(call);
GtkWidget *status=linphone_gtk_get_widget(callview,"in_call_status");
GtkWidget *callee=linphone_gtk_get_widget(callview,"in_call_uri");
GtkWidget *animation=linphone_gtk_get_widget(callview,"in_call_animation");
GdkPixbufAnimation *pbuf=create_pixbuf_animation("calling_anim.gif");
GtkWidget *answer_button;
GtkWidget *image;
......@@ -221,10 +241,7 @@ void linphone_gtk_in_call_view_set_incoming(LinphoneCall *call, bool_t with_paus
gtk_button_set_image(GTK_BUTTON(linphone_gtk_get_widget(callview,"decline_call")),image);
gtk_widget_show(image);
if (pbuf!=NULL){
gtk_image_set_from_animation(GTK_IMAGE(animation),pbuf);
g_object_unref(G_OBJECT(pbuf));
}else gtk_image_set_from_stock(GTK_IMAGE(animation),GTK_STOCK_EXECUTE,GTK_ICON_SIZE_DIALOG);
linphone_gtk_in_call_set_animation_image(callview,GTK_STOCK_DIALOG_INFO,TRUE);
}
static void rating_to_color(float rating, GdkColor *color){
......@@ -283,8 +300,6 @@ void linphone_gtk_in_call_view_set_in_call(LinphoneCall *call){
GtkWidget *status=linphone_gtk_get_widget(callview,"in_call_status");
GtkWidget *callee=linphone_gtk_get_widget(callview,"in_call_uri");
GtkWidget *duration=linphone_gtk_get_widget(callview,"in_call_duration");
GtkWidget *animation=linphone_gtk_get_widget(callview,"in_call_animation");
GdkPixbufAnimation *pbuf=create_pixbuf_animation("incall_anim.gif");
guint taskid=GPOINTER_TO_INT(g_object_get_data(G_OBJECT(callview),"taskid"));
display_peer_name_in_label(callee,linphone_call_get_remote_address (call));
......@@ -294,10 +309,7 @@ void linphone_gtk_in_call_view_set_in_call(LinphoneCall *call){
gtk_label_set_markup(GTK_LABEL(status),_("<b>In call</b>"));
gtk_label_set_text(GTK_LABEL(duration),_("00::00::00"));
if (pbuf!=NULL){
gtk_image_set_from_animation(GTK_IMAGE(animation),pbuf);
g_object_unref(G_OBJECT(pbuf));
}else gtk_image_set_from_stock(GTK_IMAGE(animation),GTK_STOCK_EXECUTE,GTK_ICON_SIZE_DIALOG);
linphone_gtk_in_call_set_animation_image(callview,GTK_STOCK_MEDIA_PLAY,TRUE);
linphone_gtk_enable_mute_button(
GTK_BUTTON(linphone_gtk_get_widget(callview,"incall_mute")),TRUE);
if (taskid==0){
......@@ -309,10 +321,9 @@ void linphone_gtk_in_call_view_set_in_call(LinphoneCall *call){
void linphone_gtk_in_call_view_set_paused(LinphoneCall *call){
GtkWidget *callview=(GtkWidget*)linphone_call_get_user_pointer(call);
GtkWidget *status=linphone_gtk_get_widget(callview,"in_call_status");
GtkWidget *animation=linphone_gtk_get_widget(callview,"in_call_animation");
gtk_widget_hide(linphone_gtk_get_widget(callview,"answer_decline_panel"));
gtk_label_set_markup(GTK_LABEL(status),_("<b>Paused call</b>"));
gtk_image_set_from_stock(GTK_IMAGE(animation),GTK_STOCK_MEDIA_PAUSE,GTK_ICON_SIZE_DIALOG);
linphone_gtk_in_call_set_animation_image(callview,GTK_STOCK_MEDIA_PAUSE,TRUE);
}
void linphone_gtk_in_call_view_update_duration(LinphoneCall *call){
......@@ -335,8 +346,6 @@ static gboolean in_call_view_terminated(LinphoneCall *call){
void linphone_gtk_in_call_view_terminate(LinphoneCall *call, const char *error_msg){
GtkWidget *callview=(GtkWidget*)linphone_call_get_user_pointer(call);
GtkWidget *status=linphone_gtk_get_widget(callview,"in_call_status");
GtkWidget *animation=linphone_gtk_get_widget(callview,"in_call_animation");
GdkPixbuf *pbuf=create_pixbuf(linphone_gtk_get_ui_config("stop_call_icon","stopcall-red.png"));
guint taskid=GPOINTER_TO_INT(g_object_get_data(G_OBJECT(callview),"taskid"));
if (error_msg==NULL)
......@@ -346,10 +355,9 @@ void linphone_gtk_in_call_view_terminate(LinphoneCall *call, const char *error_m
gtk_label_set_markup(GTK_LABEL(status),msg);
g_free(msg);
}
if (pbuf!=NULL){
gtk_image_set_from_pixbuf(GTK_IMAGE(animation),pbuf);
g_object_unref(G_OBJECT(pbuf));
}
linphone_gtk_in_call_set_animation_image(callview,
linphone_gtk_get_ui_config("stop_call_icon","stopcall-red.png"),FALSE);
gtk_widget_hide(linphone_gtk_get_widget(callview,"answer_decline_panel"));
linphone_gtk_enable_mute_button(
GTK_BUTTON(linphone_gtk_get_widget(callview,"incall_mute")),FALSE);
......
......@@ -945,6 +945,7 @@ static void linphone_gtk_display_url(LinphoneCore *lc, const char *msg, const ch
static void linphone_gtk_call_log_updated(LinphoneCore *lc, LinphoneCallLog *cl){
GtkWidget *w=(GtkWidget*)g_object_get_data(G_OBJECT(linphone_gtk_get_main_window()),"call_logs");
if (w) linphone_gtk_call_log_update(w);
linphone_gtk_call_log_update(linphone_gtk_get_main_window());
}
#ifdef HAVE_NOTIFY
......@@ -1363,11 +1364,13 @@ static void linphone_gtk_configure_main_window(){
g_object_set_data(G_OBJECT(menu_item),"home",tmp);
}
{
/*
GdkPixbuf *pbuf=create_pixbuf("contact-orange.png");
if (pbuf) {
gtk_image_set_from_pixbuf(GTK_IMAGE(linphone_gtk_get_widget(w,"contact_tab_icon")),pbuf);
g_object_unref(G_OBJECT(pbuf));
}
*/
}
{
GdkPixbuf *pbuf=create_pixbuf("dialer-orange.png");
......@@ -1442,7 +1445,8 @@ static void linphone_gtk_init_main_window(){
linphone_gtk_show_friends();
linphone_gtk_connect_digits();
main_window=linphone_gtk_get_main_window();
linphone_gtk_call_log_update(main_window);
linphone_gtk_update_call_buttons (NULL);
/*prevent the main window from being destroyed by a user click on WM controls, instead we hide it*/
g_signal_connect (G_OBJECT (main_window), "delete-event",
......
This diff is collapsed.
mediastreamer2 @ 40e4fefd
Subproject commit 964f9bcca69967fccab626af4407efce9165a5be
Subproject commit 40e4fefd4c76843f7d822c8013307cf230def10b
......@@ -398,7 +398,7 @@ msgstr "<b>Appel en cours</b>"
#: ../gtk/incall_view.c:260
msgid "<b>Paused call</b>"
msgstr "<b>Appel en attente<b>"
msgstr "<b>Appel en attente</b>"
#: ../gtk/incall_view.c:272
#, c-format
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment