GtkWidget *w=gtk_hbox_new (FALSE,0);
GtkWidget *i=create_pixmap ("status-green.png");
GtkWidget *l;
- gchar *text=g_strdup_printf("Call %i",number);
+ gchar *text=g_strdup_printf("Call #%i",number);
l=gtk_label_new (text);
gtk_box_pack_start (GTK_BOX(w),i,FALSE,FALSE,0);
gtk_box_pack_end(GTK_BOX(w),l,TRUE,TRUE,0);
return w;
}
+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);
+}
+
+static void transfer_button_clicked(GtkWidget *button, gpointer call_ref){
+ GtkWidget *menu_item;
+ GtkWidget *menu=gtk_menu_new();
+ LinphoneCall *call=(LinphoneCall*)call_ref;
+ LinphoneCore *lc=linphone_gtk_get_core();
+ const MSList *elem=linphone_core_get_calls(lc);
+
+ for(;elem!=NULL;elem=elem->next){
+ LinphoneCall *other_call=(LinphoneCall*)elem->data;
+ GtkWidget *call_view=(GtkWidget*)linphone_call_get_user_pointer(other_call);
+ if (other_call!=call){
+ int call_index=GPOINTER_TO_INT(g_object_get_data(G_OBJECT(call_view),"call_index"));
+ char *remote_uri=linphone_call_get_remote_address_as_string (call);
+ char *text=g_strdup_printf("Transfer to call #%i with %s",call_index,remote_uri);
+ menu_item=gtk_image_menu_item_new_with_label(text);
+ ms_free(remote_uri);
+ g_free(text);
+ gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menu_item),create_pixmap("status-green.png"));
+ gtk_widget_show(menu_item);
+ gtk_menu_shell_append(GTK_MENU_SHELL(menu),menu_item);
+ g_signal_connect_swapped(G_OBJECT(menu_item),"activate",(GCallback)linphone_gtk_transfer_call,other_call);
+ }
+ }
+ gtk_menu_popup(GTK_MENU(menu),NULL,NULL,NULL,NULL,0,
+ gtk_get_current_event_time());
+ gtk_widget_show(menu);
+}
+
+void linphone_gtk_enable_transfer_button(LinphoneCore *lc, gboolean value){
+ const MSList *elem=linphone_core_get_calls(lc);
+ for(;elem!=NULL;elem=elem->next){
+ LinphoneCall *call=(LinphoneCall*)elem->data;
+ GtkWidget *call_view=(GtkWidget*)linphone_call_get_user_pointer(call);
+ GtkWidget *box=linphone_gtk_get_widget (call_view,"mute_pause_buttons");
+ GtkWidget *button=(GtkWidget*)g_object_get_data(G_OBJECT(box),"transfer");
+ if (button && value==FALSE){
+ gtk_widget_destroy(button);
+ button=NULL;
+ }else if (!button && value==TRUE){
+ button=gtk_button_new_with_label (_("Transfer"));
+ gtk_button_set_image(GTK_BUTTON(button),gtk_image_new_from_stock (GTK_STOCK_GO_FORWARD,GTK_ICON_SIZE_BUTTON));
+ g_signal_connect(G_OBJECT(button),"clicked",(GCallback)transfer_button_clicked,call);
+ gtk_widget_show_all(button);
+ gtk_container_add(GTK_CONTAINER(box),button);
+ }
+ g_object_set_data(G_OBJECT(box),"transfer",button);
+ }
+}
+
void linphone_gtk_create_in_call_view(LinphoneCall *call){
GtkWidget *call_view=linphone_gtk_create_widget("main","in_call_frame");
GtkWidget *main_window=linphone_gtk_get_main_window ();
call_index=1;
}
g_object_set_data(G_OBJECT(call_view),"call",call);
+ g_object_set_data(G_OBJECT(call_view),"call_index",GINT_TO_POINTER(call_index));
+
linphone_call_set_user_pointer (call,call_view);
linphone_call_ref(call);
gtk_notebook_append_page (notebook,call_view,make_tab_header(call_index));