]> sjero.net Git - linphone/blobdiff - gtk-glade/incall_view.c
Merge branch 'master' into dev_multicall
[linphone] / gtk-glade / incall_view.c
index c0ddfcbbdd41db18baf142592496c64346b04afb..a17741ff4ae8f5ac5c04133854f140fa477a0d89 100644 (file)
@@ -124,7 +124,7 @@ void linphone_gtk_in_call_view_set_in_call(){
        GtkWidget *duration=linphone_gtk_get_widget(main_window,"in_call_duration");
        GtkWidget *animation=linphone_gtk_get_widget(main_window,"in_call_animation");
        GdkPixbufAnimation *pbuf=create_pixbuf_animation("incall_anim.gif");
-       const LinphoneAddress *uri=linphone_core_get_remote_uri(lc);
+       const LinphoneAddress *uri=linphone_core_get_current_call_remote_address(lc);
        char *tmp=linphone_address_as_string(uri);
        display_peer_name_in_label(callee,tmp);
        ms_free(tmp);
@@ -137,7 +137,9 @@ void linphone_gtk_in_call_view_set_in_call(){
                g_object_unref(G_OBJECT(pbuf));
        }else gtk_image_set_from_stock(GTK_IMAGE(animation),GTK_STOCK_INFO,GTK_ICON_SIZE_DIALOG);
        linphone_gtk_enable_mute_button(
-               GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(main_window,"incall_mute")),TRUE);
+                                       GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(main_window,"incall_mute")),TRUE);
+       linphone_gtk_enable_hold_button(
+               GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(main_window,"hold_call")),TRUE);
 }
 
 void linphone_gtk_in_call_view_update_duration(int duration){
@@ -175,6 +177,8 @@ void linphone_gtk_in_call_view_terminate(const char *error_msg){
        }
        linphone_gtk_enable_mute_button(
                GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(main_window,"incall_mute")),FALSE);
+       linphone_gtk_enable_hold_button(
+               GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(main_window,"hold_call")),FALSE);
        g_timeout_add_seconds(2,(GSourceFunc)in_call_view_terminated,NULL);
 }
 
@@ -202,7 +206,50 @@ void linphone_gtk_mute_toggled(GtkToggleButton *button){
        linphone_gtk_draw_mute_button(button,active);
 }
 
-void linphone_gtk_enable_mute_button(GtkToggleButton *button, gboolean sensitive){
+void linphone_gtk_enable_mute_button(GtkToggleButton *button, gboolean sensitive)
+{
        gtk_widget_set_sensitive(GTK_WIDGET(button),sensitive);
        linphone_gtk_draw_mute_button(button,FALSE);
 }
+
+void linphone_gtk_draw_hold_button(GtkToggleButton *button, gboolean active){
+       GtkWidget *status=linphone_gtk_get_widget(linphone_gtk_get_main_window(),"in_call_status");
+       if (active){
+               GtkWidget *image=create_pixmap("hold_off.png");
+               gtk_button_set_label(GTK_BUTTON(button),_("HoldOff"));
+               gtk_label_set_markup(GTK_LABEL(status),_("<b>In call holded with</b>"));
+               if (image!=NULL) {
+                       gtk_button_set_image(GTK_BUTTON(button),image);
+                       gtk_widget_show(image);
+               }
+       }else{
+               GtkWidget *image=create_pixmap("hold_on.png");
+               gtk_button_set_label(GTK_BUTTON(button),_("HoldOn"));
+               gtk_label_set_markup(GTK_LABEL(status),_("<b>In call with</b>"));
+               if (image!=NULL) {
+                       gtk_button_set_image(GTK_BUTTON(button),image);
+                       gtk_widget_show(image);
+               }
+       }
+}
+
+void linphone_gtk_hold_toggled(GtkToggleButton *button){
+       GtkWidget *mw=linphone_gtk_get_main_window();
+       gboolean active=gtk_toggle_button_get_active(button);
+       if(active)
+       {
+               linphone_core_pause_call(linphone_gtk_get_core(),NULL);
+               gtk_widget_set_sensitive(linphone_gtk_get_widget(mw,"terminate_call"),FALSE);
+       }
+       else
+       {
+               linphone_core_resume_call(linphone_gtk_get_core(),NULL);
+               gtk_widget_set_sensitive(linphone_gtk_get_widget(mw,"terminate_call"),TRUE);
+       }
+       linphone_gtk_draw_hold_button(button,active);
+}
+
+void linphone_gtk_enable_hold_button(GtkToggleButton *button, gboolean sensitive){
+       gtk_widget_set_sensitive(GTK_WIDGET(button),sensitive);
+       linphone_gtk_hold_toggled(button);
+}