1429
1449
EmpathyCallWindow *self = EMPATHY_CALL_WINDOW (user_data);
1430
1450
EmpathyCallWindowPriv *priv = GET_PRIV (self);
1434
time = g_timer_elapsed (priv->timer, NULL);
1454
time_ = g_timer_elapsed (priv->timer, NULL);
1436
1456
/* Translators: number of minutes:seconds the caller has been connected */
1437
str = g_strdup_printf (_("Connected ā %d:%02dm"), (int) time / 60,
1457
str = g_strdup_printf (_("Connected ā %d:%02dm"), (int) time_ / 60,
1439
1459
empathy_call_window_status_message (self, str);
1466
display_error (EmpathyCallWindow *self,
1467
EmpathyTpCall *call,
1471
const gchar *details)
1473
EmpathyCallWindowPriv *priv = GET_PRIV (self);
1474
GtkWidget *info_bar;
1475
GtkWidget *content_area;
1482
/* Create info bar */
1483
info_bar = gtk_info_bar_new_with_buttons (GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
1486
gtk_info_bar_set_message_type (GTK_INFO_BAR (info_bar), GTK_MESSAGE_WARNING);
1488
content_area = gtk_info_bar_get_content_area (GTK_INFO_BAR (info_bar));
1490
/* hbox containing the image and the messages vbox */
1491
hbox = gtk_hbox_new (FALSE, 3);
1492
gtk_container_add (GTK_CONTAINER (content_area), hbox);
1495
image = gtk_image_new_from_icon_name (img, GTK_ICON_SIZE_DIALOG);
1496
gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
1498
/* vbox containing the main message and the details expander */
1499
vbox = gtk_vbox_new (FALSE, 3);
1500
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
1503
txt = g_strdup_printf ("<b>%s</b>\n%s", title, desc);
1505
label = gtk_label_new (NULL);
1506
gtk_label_set_markup (GTK_LABEL (label), txt);
1507
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
1508
gtk_misc_set_alignment (GTK_MISC (label), 0, 0);
1511
gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0);
1514
if (details != NULL)
1516
GtkWidget *expander;
1518
expander = gtk_expander_new (_("Technical Details"));
1520
txt = g_strdup_printf ("<i>%s</i>", details);
1522
label = gtk_label_new (NULL);
1523
gtk_label_set_markup (GTK_LABEL (label), txt);
1524
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
1525
gtk_misc_set_alignment (GTK_MISC (label), 0, 0);
1528
gtk_container_add (GTK_CONTAINER (expander), label);
1529
gtk_box_pack_start (GTK_BOX (vbox), expander, TRUE, TRUE, 0);
1532
g_signal_connect (info_bar, "response",
1533
G_CALLBACK (gtk_widget_destroy), NULL);
1535
gtk_box_pack_start (GTK_BOX (priv->errors_vbox), info_bar,
1536
FALSE, FALSE, CONTENT_HBOX_CHILDREN_PACKING_PADDING);
1537
gtk_widget_show_all (info_bar);
1541
media_stream_error_to_txt (EmpathyCallWindow *self,
1542
EmpathyTpCall *call,
1544
TpMediaStreamError error)
1546
EmpathyCallWindowPriv *priv = GET_PRIV (self);
1553
case TP_MEDIA_STREAM_ERROR_CODEC_NEGOTIATION_FAILED:
1555
return g_strdup_printf (
1556
_("%s's software does not understand any of the audio formats "
1557
"supported by your computer"),
1558
empathy_contact_get_name (priv->contact));
1560
return g_strdup_printf (
1561
_("%s's software does not understand any of the video formats "
1562
"supported by your computer"),
1563
empathy_contact_get_name (priv->contact));
1565
case TP_MEDIA_STREAM_ERROR_CONNECTION_FAILED:
1566
return g_strdup_printf (
1567
_("Can't establish a connection to %s. "
1568
"One of you might be on a network that does not allow "
1569
"direct connections."),
1570
empathy_contact_get_name (priv->contact));
1572
case TP_MEDIA_STREAM_ERROR_NETWORK_ERROR:
1573
return g_strdup (_("There was a failure on the network"));
1575
case TP_MEDIA_STREAM_ERROR_NO_CODECS:
1577
return g_strdup (_("The audio formats necessary for this call "
1578
"are not installed on your computer"));
1580
return g_strdup (_("The video formats necessary for this call "
1581
"are not installed on your computer"));
1583
case TP_MEDIA_STREAM_ERROR_INVALID_CM_BEHAVIOR:
1584
cm = empathy_tp_call_get_connection_manager (call);
1586
url = g_strdup_printf ("http://bugs.freedesktop.org/enter_bug.cgi?"
1587
"product=Telepathy&component=%s", cm);
1589
result = g_strdup_printf (
1590
_("Something not expected happened in a Telepathy component. "
1591
"Please <a href=\"%s\">report this bug</a> and attach "
1592
"logs gathered from the 'Debug' window in the Help menu."), url);
1597
case TP_MEDIA_STREAM_ERROR_MEDIA_ERROR:
1598
return g_strdup (_("There was a failure in the call engine"));
1606
empathy_call_window_stream_error (EmpathyCallWindow *self,
1607
EmpathyTpCall *call,
1616
desc = media_stream_error_to_txt (self, call, audio, code);
1619
/* No description, use the error message. That's not great as it's not
1620
* localized but it's better than nothing. */
1621
display_error (self, call, icon, title, msg, NULL);
1625
display_error (self, call, icon, title, desc, msg);
1631
empathy_call_window_audio_stream_error (EmpathyTpCall *call,
1634
EmpathyCallWindow *self)
1636
empathy_call_window_stream_error (self, call, TRUE, code, msg,
1637
"gnome-stock-mic", _("Can't establish audio stream"));
1641
empathy_call_window_video_stream_error (EmpathyTpCall *call,
1644
EmpathyCallWindow *self)
1646
empathy_call_window_stream_error (self, call, FALSE, code, msg,
1647
"camera-web", _("Can't establish video stream"));
1445
1650
static gboolean
1446
1651
empathy_call_window_connected (gpointer user_data)