~bcurtiswx/ubuntu/precise/empathy/3.4.2.3-0ubuntu1

« back to all changes in this revision

Viewing changes to src/empathy-call-window.c

  • Committer: Package Import Robot
  • Author(s): Ken VanDine
  • Date: 2012-03-20 10:40:28 UTC
  • mfrom: (1.1.89)
  • Revision ID: package-import@ubuntu.com-20120320104028-s3t9wzw30quucy1e
Tags: 3.3.92-0ubuntu1
* New upstream release
  - Fixed: empathy-accounts crashed with SIGSEGV in 
    empathy_account_settings_get_account (LP: #951478)
  - Fixed: Rendering artifacts in the call window  
  - Fixed: The video preview is not rounded the same way as its 
    highlight rectangle  
  - Fixed: Crash receiving a call on a already disconnected empathy 
    call window  
  - Fixed: Crash on hangup in audio-only video call  
  - Fixed: Should try to get icons from EMPATHY_SRCDIR  
  - Fixed: Accounts dialog doesn't update when account goes online  
  - Fixed: MUC: make F9 toggle the contact list sidebar  
  - Fixed: Border overflows not taken in account when drawing Clutter 
    actors in empathy-call  
  - Fixed: Untranslated strings in libempathy/empathy-keyring.c  
  - Fixed: Information display of group chat contacts and irc 
    contacts broken  
  - Fixed: Receiving Files via XMPP isn't working 
  - Fixed: Should replace the birthday calendar by a button  
  - Fixed: Hide stupid vCard field roles  
  - Fixed: Contact list only appears after several seconds  
  - Fixed: Remove account info  
  - Fixed: Right align contact info fields  
  - Fixed: Set chat.facebook.com:443 as fallback server  

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
 
80
80
#define SELF_VIDEO_SECTION_WIDTH 120
81
81
#define SELF_VIDEO_SECTION_HEIGHT 90
82
 
#define SELF_VIDEO_SECTION_MARGIN 10
 
82
#define SELF_VIDEO_SECTION_MARGIN 2
 
83
#define SELF_VIDEO_SECTION_BORDER SELF_VIDEO_SECTION_MARGIN*2
83
84
 
84
85
#define FLOATING_TOOLBAR_OPACITY 192
85
86
#define FLOATING_TOOLBAR_WIDTH 280
100
101
/* The time interval in milliseconds between 2 outgoing rings */
101
102
#define MS_BETWEEN_RING 500
102
103
 
 
104
/* The roundedness of preview box and placeholders */
 
105
#define PREVIEW_ROUND_FACTOR 16
 
106
 
103
107
G_DEFINE_TYPE(EmpathyCallWindow, empathy_call_window, GTK_TYPE_WINDOW)
104
108
 
105
109
enum {
630
634
    ClutterBinAlignment y)
631
635
{
632
636
  ClutterLayoutManager *layout1, *layout2;
633
 
  ClutterActor *rectangle;
 
637
  EmpathyRoundedRectangle *rectangle;
634
638
  ClutterActor *box1, *box2;
635
639
 
636
640
  layout1 = clutter_bin_layout_new (CLUTTER_BIN_ALIGNMENT_CENTER,
641
645
  *box = box1;
642
646
 
643
647
  rectangle = empathy_rounded_rectangle_new (
644
 
      SELF_VIDEO_SECTION_WIDTH + 5,
645
 
      SELF_VIDEO_SECTION_HEIGHT + 5);
 
648
      SELF_VIDEO_SECTION_WIDTH + 2 * SELF_VIDEO_SECTION_MARGIN,
 
649
      SELF_VIDEO_SECTION_HEIGHT + 2 * SELF_VIDEO_SECTION_MARGIN,
 
650
      PREVIEW_ROUND_FACTOR);
646
651
 
647
652
  clutter_actor_set_size (box1,
648
653
      SELF_VIDEO_SECTION_WIDTH + 2 * SELF_VIDEO_SECTION_MARGIN,
662
667
      SELF_VIDEO_SECTION_HEIGHT + 2 * SELF_VIDEO_SECTION_MARGIN);
663
668
 
664
669
  clutter_container_add_actor (CLUTTER_CONTAINER (box1), box2);
665
 
  clutter_container_add_actor (CLUTTER_CONTAINER (box2), rectangle);
 
670
  clutter_container_add_actor (CLUTTER_CONTAINER (box2), CLUTTER_ACTOR (rectangle));
666
671
 
667
672
  clutter_bin_layout_add (CLUTTER_BIN_LAYOUT (self->priv->video_layout),
668
673
      box1, x, y);
669
674
 
670
 
  clutter_actor_hide (rectangle);
 
675
  clutter_actor_hide (CLUTTER_ACTOR (rectangle));
671
676
 
672
 
  return rectangle;
 
677
  return CLUTTER_ACTOR (rectangle);
673
678
}
674
679
 
675
680
static void
788
793
    }
789
794
  else if (box.width - SELF_VIDEO_SECTION_MARGIN >= event_x &&
790
795
      event_x >= (box.width - SELF_VIDEO_SECTION_MARGIN - (gint) SELF_VIDEO_SECTION_WIDTH) &&
791
 
      box.height - SELF_VIDEO_SECTION_MARGIN - SELF_VIDEO_SECTION_MARGIN - FLOATING_TOOLBAR_HEIGHT - FLOATING_TOOLBAR_SPACING >= event_y &&
 
796
      box.height - 2 * SELF_VIDEO_SECTION_MARGIN - FLOATING_TOOLBAR_HEIGHT - FLOATING_TOOLBAR_SPACING >= event_y &&
792
797
      event_y >= (box.height - SELF_VIDEO_SECTION_MARGIN - FLOATING_TOOLBAR_HEIGHT - FLOATING_TOOLBAR_SPACING - (gint) SELF_VIDEO_SECTION_HEIGHT))
793
798
    {
794
799
      pos = PREVIEW_POS_BOTTOM_RIGHT;
876
881
  rectangle = empathy_call_window_get_preview_rectangle (self, pos);
877
882
 
878
883
  empathy_rounded_rectangle_set_border_width (
879
 
      EMPATHY_ROUNDED_RECTANGLE (rectangle), 5);
 
884
      EMPATHY_ROUNDED_RECTANGLE (rectangle), 2 * SELF_VIDEO_SECTION_MARGIN);
880
885
  empathy_rounded_rectangle_set_border_color (
881
886
      EMPATHY_ROUNDED_RECTANGLE (rectangle), CLUTTER_COLOR_Red);
882
887
}
1065
1070
  GtkWidget *button;
1066
1071
  PreviewPosition pos;
1067
1072
  GdkRGBA transparent = { 0., 0., 0., 0. };
 
1073
  GtkWidget *bin;
1068
1074
 
1069
1075
  g_assert (priv->video_preview == NULL);
1070
1076
 
1076
1082
 
1077
1083
  priv->video_preview_sink = gst_element_factory_make ("cluttersink", NULL);
1078
1084
  if (priv->video_preview_sink == NULL)
1079
 
    g_error ("Missing cluttersink");
1080
 
  else
1081
 
    g_object_set (priv->video_preview_sink, "texture", preview, NULL);
 
1085
      g_error ("Missing cluttersink, check your clutter-gst installation");
 
1086
  g_object_set (priv->video_preview_sink, "texture", preview, NULL);
 
1087
  g_object_add_weak_pointer (G_OBJECT (priv->video_preview_sink), (gpointer) &priv->video_preview_sink);
1082
1088
 
1083
1089
  /* Add a little offset to the video preview */
1084
1090
  layout = clutter_bin_layout_new (CLUTTER_BIN_ALIGNMENT_CENTER,
1091
1097
 
1092
1098
  /* Spinner for when changing the camera device */
1093
1099
  priv->preview_spinner_widget = gtk_spinner_new ();
1094
 
  priv->preview_spinner_actor = empathy_rounded_actor_new ();
1095
 
  empathy_rounded_actor_set_round_factor (
1096
 
      EMPATHY_ROUNDED_ACTOR (priv->preview_spinner_actor), 16);
 
1100
  priv->preview_spinner_actor = empathy_rounded_actor_new (PREVIEW_ROUND_FACTOR);
1097
1101
 
1098
1102
  g_object_set (priv->preview_spinner_widget, "expand", TRUE, NULL);
1099
1103
  gtk_widget_override_background_color (
1134
1138
  /* Translators: this is an "Info" label. It should be as short
1135
1139
   * as possible. */
1136
1140
  button = gtk_button_new_with_label (_("i"));
1137
 
  priv->preview_shown_button = b = empathy_rounded_actor_new ();
1138
 
  gtk_container_add (
1139
 
      GTK_CONTAINER (gtk_clutter_actor_get_widget (GTK_CLUTTER_ACTOR (b))),
1140
 
      button);
 
1141
  priv->preview_shown_button = b = gtk_clutter_actor_new_with_contents (button);
1141
1142
  clutter_actor_set_size (b, 24, 24);
 
1143
  bin = gtk_clutter_actor_get_widget (GTK_CLUTTER_ACTOR (b));
 
1144
  gtk_widget_override_background_color (bin, GTK_STATE_FLAG_NORMAL, &transparent);
1142
1145
 
1143
1146
  layout_end = clutter_bin_layout_new (CLUTTER_BIN_ALIGNMENT_END,
1144
1147
      CLUTTER_BIN_ALIGNMENT_END);
1145
1148
  box = clutter_box_new (layout_end);
1146
1149
  clutter_actor_set_size (box,
1147
 
      SELF_VIDEO_SECTION_WIDTH,
1148
 
      SELF_VIDEO_SECTION_HEIGHT + SELF_VIDEO_SECTION_MARGIN);
 
1150
      SELF_VIDEO_SECTION_WIDTH - 4,
 
1151
      SELF_VIDEO_SECTION_HEIGHT - 2);
1149
1152
 
1150
1153
  clutter_container_add_actor (CLUTTER_CONTAINER (box), b);
1151
1154
  clutter_container_add_actor (CLUTTER_CONTAINER (priv->video_preview), box);
1157
1160
  /* Translators: this is an "Info" label. It should be as short
1158
1161
   * as possible. */
1159
1162
  button = gtk_button_new_with_label (_("i"));
1160
 
  b = empathy_rounded_actor_new ();
1161
 
  gtk_container_add (
1162
 
      GTK_CONTAINER (gtk_clutter_actor_get_widget (GTK_CLUTTER_ACTOR (b))),
1163
 
      button);
 
1163
  priv->preview_hidden_button = b = gtk_clutter_actor_new_with_contents (button);
1164
1164
  clutter_actor_set_size (b, 24, 24);
1165
 
  priv->preview_hidden_button = b;
 
1165
  gtk_widget_override_background_color (bin, GTK_STATE_FLAG_NORMAL, &transparent);
1166
1166
 
1167
1167
  clutter_bin_layout_add (CLUTTER_BIN_LAYOUT (priv->video_layout),
1168
1168
      priv->preview_hidden_button,
1726
1726
  create_audio_input (self);
1727
1727
  create_video_input (self);
1728
1728
 
1729
 
  priv->floating_toolbar = empathy_rounded_actor_new ();
 
1729
  priv->floating_toolbar = empathy_rounded_actor_new (2);
1730
1730
 
1731
1731
  gtk_widget_reparent (priv->bottom_toolbar,
1732
1732
      gtk_clutter_actor_get_widget (GTK_CLUTTER_ACTOR (priv->floating_toolbar)));
2420
2420
{
2421
2421
  g_return_if_fail (EMPATHY_IS_CALL_HANDLER (handler));
2422
2422
 
2423
 
  tp_clear_object (&self->priv->handler);
2424
 
  self->priv->handler = g_object_ref (handler);
2425
 
  empathy_call_window_connect_handler (self);
2426
 
 
2427
2423
  empathy_window_present (GTK_WINDOW (self));
2428
 
  empathy_call_window_restart_call (self);
 
2424
 
 
2425
  if (self->priv->call_state == DISCONNECTED)
 
2426
    {
 
2427
      /* start a new call if one is not already in progress */
 
2428
      tp_clear_object (&self->priv->handler);
 
2429
      self->priv->handler = g_object_ref (handler);
 
2430
      empathy_call_window_connect_handler (self);
 
2431
 
 
2432
      empathy_call_window_restart_call (self);
 
2433
    }
2429
2434
}
2430
2435
 
2431
2436
static void
3182
3187
  TpCallChannel *call;
3183
3188
  gboolean can_send_video;
3184
3189
 
3185
 
  if (state == TP_CALL_STATE_ENDED &&
3186
 
      !tp_strdiff (reason, TP_ERROR_STR_INSUFFICIENT_BALANCE))
 
3190
  if (state == TP_CALL_STATE_ENDED)
3187
3191
    {
3188
 
      show_balance_error (self);
 
3192
      DEBUG ("Call ended: %s", (reason != NULL && reason[0] != '\0') ? reason : "unspecified reason");
 
3193
      empathy_call_window_disconnected (self, TRUE);
 
3194
      if (!tp_strdiff (reason, TP_ERROR_STR_INSUFFICIENT_BALANCE))
 
3195
          show_balance_error (self);
3189
3196
      return;
3190
3197
    }
3191
3198
 
3619
3626
                  start_call (self);
3620
3627
              }
3621
3628
          }
3622
 
        if (GST_MESSAGE_SRC (message) == GST_OBJECT (priv->video_preview_sink))
 
3629
        if (priv->video_preview_sink != NULL &&
 
3630
            GST_MESSAGE_SRC (message) == GST_OBJECT (priv->video_preview_sink))
3623
3631
          {
3624
3632
            gst_message_parse_state_changed (message, NULL, &newstate,
3625
3633
                &pending);
3982
3990
empathy_call_window_hangup_cb (gpointer object,
3983
3991
    EmpathyCallWindow *self)
3984
3992
{
 
3993
  /* stopping the call will put it the ENDED state and
 
3994
   * from state_changed_cb we'll reconfigure the window
 
3995
   */
3985
3996
  empathy_call_handler_stop_call (self->priv->handler);
3986
 
 
3987
 
  empathy_call_window_disconnected (self, TRUE);
3988
3997
}
3989
3998
 
3990
3999
static void