aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorGuillaume Desmottes <gdesmott@gnome.org>2008-02-17 01:10:57 +0800
committerGuillaume Desmottes <gdesmott@gnome.org>2008-02-17 01:10:57 +0800
commit6630718c9bc6dfff20d89ac262b8af77899ec289 (patch)
treea4e536fbd28241499ed89ae8a00ca71366c7e60b /libempathy-gtk
parenta0aa511642d02bac18ff5b73a4a7da17f0590645 (diff)
parent551eee5499e5c0dad1b49dabe7958401de26663a (diff)
downloadgsoc2013-empathy-6630718c9bc6dfff20d89ac262b8af77899ec289.tar
gsoc2013-empathy-6630718c9bc6dfff20d89ac262b8af77899ec289.tar.gz
gsoc2013-empathy-6630718c9bc6dfff20d89ac262b8af77899ec289.tar.bz2
gsoc2013-empathy-6630718c9bc6dfff20d89ac262b8af77899ec289.tar.lz
gsoc2013-empathy-6630718c9bc6dfff20d89ac262b8af77899ec289.tar.xz
gsoc2013-empathy-6630718c9bc6dfff20d89ac262b8af77899ec289.tar.zst
gsoc2013-empathy-6630718c9bc6dfff20d89ac262b8af77899ec289.zip
Merge commit 'origin/master' into irc
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-call-window.c634
-rw-r--r--libempathy-gtk/empathy-call-window.glade635
-rw-r--r--libempathy-gtk/empathy-call-window.h34
-rw-r--r--libempathy-gtk/empathy-chat.c64
-rw-r--r--libempathy-gtk/empathy-chat.h1
-rw-r--r--libempathy-gtk/empathy-group-chat.c38
-rw-r--r--libempathy-gtk/empathy-private-chat.c4
-rw-r--r--libempathy-gtk/empathy-theme-boxes.c15
-rw-r--r--libempathy-gtk/empathy-ui-utils.c3
9 files changed, 882 insertions, 546 deletions
diff --git a/libempathy-gtk/empathy-call-window.c b/libempathy-gtk/empathy-call-window.c
index a1c7bd799..5cd62d1ce 100644
--- a/libempathy-gtk/empathy-call-window.c
+++ b/libempathy-gtk/empathy-call-window.c
@@ -1,219 +1,533 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
- * Copyright (C) 2007 Elliot Fairweather
- * Copyright (C) 2007 Collabora Ltd.
+ * Copyright (C) 2007 Elliot Fairweather
*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
*
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
*
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
- * Authors: Elliot Fairweather <elliot.fairweather@collabora.co.uk>
- * Xavier Claessens <xclaesse@gmail.com>
+ * Authors: Elliot Fairweather <elliot.fairweather@collabora.co.uk>
*/
-#include "config.h"
+#include <string.h>
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
+#include <libtelepathy/tp-chan.h>
+#include <libtelepathy/tp-helpers.h>
+#include <libmissioncontrol/mc-account.h>
+#include <libmissioncontrol/mc-account-monitor.h>
+#include <libmissioncontrol/mission-control.h>
+
+#include <libempathy/empathy-contact.h>
+#include <libempathy/empathy-tp-call.h>
+#include <libempathy/empathy-chandler.h>
#include <libempathy/empathy-debug.h>
+#include <libempathy/empathy-utils.h>
-#include "empathy-call-window.h"
-#include "empathy-ui-utils.h"
+#include <libempathy-gtk/empathy-call-window.h>
+#include <libempathy-gtk/empathy-ui-utils.h>
#define DEBUG_DOMAIN "CallWindow"
-typedef struct {
- GtkWidget *window;
- GtkWidget *input_volume_scale;
- GtkWidget *output_volume_scale;
- GtkWidget *input_mute_togglebutton;
- GtkWidget *output_mute_togglebutton;
- GtkWidget *preview_video_frame;
- GtkWidget *output_video_frame;
- GtkWidget *preview_video_socket;
- GtkWidget *output_video_socket;
- GtkWidget *send_video_checkbutton;
-
- EmpathyTpCall *call;
+typedef struct
+{
+ GtkWidget *window;
+ GtkWidget *status_label;
+ GtkWidget *start_call_button;
+ GtkWidget *end_call_button;
+ GtkWidget *input_volume_scale;
+ GtkWidget *output_volume_scale;
+ GtkWidget *input_mute_button;
+ GtkWidget *output_mute_button;
+ GtkWidget *preview_video_frame;
+ GtkWidget *output_video_frame;
+ GtkWidget *preview_video_socket;
+ GtkWidget *output_video_socket;
+ GtkWidget *video_button;
+ GtkWidget *output_video_label;
+
+ EmpathyTpCall *call;
+
+ GTimeVal start_time;
+ guint timeout_event_id;
+
+ gboolean is_drawing;
} EmpathyCallWindow;
+static gboolean
+call_window_update_timer (gpointer data)
+{
+ EmpathyCallWindow *window = data;
+ GTimeVal current;
+ gchar *str;
+ glong now, then;
+ glong time, seconds, minutes, hours;
+
+ g_get_current_time (&current);
+
+ now = current.tv_sec;
+ then = (window->start_time).tv_sec;
+
+ time = now - then;
+
+ seconds = time % 60;
+ time /= 60;
+ minutes = time % 60;
+ time /= 60;
+ hours = time % 60;
+
+ if (hours > 0)
+ {
+ str = g_strdup_printf ("Connected - %02ld : %02ld : %02ld", hours,
+ minutes, seconds);
+ }
+ else
+ {
+ str = g_strdup_printf ("Connected - %02ld : %02ld", minutes, seconds);
+ }
+
+ gtk_label_set_text (GTK_LABEL (window->status_label), str);
+
+ g_free (str);
+
+ return TRUE;
+}
+
static void
-call_window_output_volume_changed_cb (GtkWidget *scale,
- EmpathyCallWindow *window)
+call_window_stop_timeout (EmpathyCallWindow *window)
{
- guint volume;
+ GMainContext *context;
+ GSource *source;
+
+ context = g_main_context_default ();
+
+ empathy_debug (DEBUG_DOMAIN, "Timer stopped");
- volume = (guint) gtk_range_get_value (GTK_RANGE (scale));
- empathy_tp_call_set_output_volume (window->call, volume);
+ if (window->timeout_event_id)
+ {
+ source = g_main_context_find_source_by_id (context,
+ window->timeout_event_id);
+ g_source_destroy (source);
+ window->timeout_event_id = 0;
+ }
}
+static void
+call_window_set_output_video_is_drawing (EmpathyCallWindow *window,
+ gboolean is_drawing)
+{
+ GtkWidget* child;
+
+ child = gtk_bin_get_child (GTK_BIN (window->output_video_frame));
+
+ empathy_debug (DEBUG_DOMAIN,
+ "Setting output video is drawing - %d", is_drawing);
+
+ if (is_drawing)
+ {
+ if (!window->is_drawing)
+ {
+ if (child)
+ {
+ gtk_container_remove (GTK_CONTAINER (window->output_video_frame),
+ child);
+ }
+ gtk_container_add (GTK_CONTAINER (window->output_video_frame),
+ window->output_video_socket);
+ gtk_widget_show (window->output_video_socket);
+ empathy_tp_call_add_output_video (window->call,
+ gtk_socket_get_id (GTK_SOCKET (window->output_video_socket)));
+ window->is_drawing = is_drawing;
+ }
+ }
+ else
+ {
+ if (window->is_drawing)
+ {
+ empathy_tp_call_add_output_video (window->call, 0);
+ if (child)
+ {
+ gtk_container_remove (GTK_CONTAINER (window->output_video_frame),
+ child);
+ }
+ gtk_container_add (GTK_CONTAINER (window->output_video_frame),
+ window->output_video_label);
+ gtk_widget_show (window->output_video_label);
+ window->is_drawing = is_drawing;
+ }
+ }
+}
+
+static gboolean
+call_window_delete_event_cb (GtkWidget *widget,
+ GdkEvent *event,
+ EmpathyCallWindow *window)
+{
+ GtkWidget *dialog;
+ gint result;
+ guint status;
+
+ empathy_debug (DEBUG_DOMAIN, "Delete event occurred");
+
+ g_object_get (G_OBJECT (window->call), "status", &status, NULL);
+
+ if (status != EMPATHY_TP_CALL_STATUS_CLOSED)
+ {
+ dialog = gtk_message_dialog_new (GTK_WINDOW (window->window),
+ GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
+ "This call will be ended. Continue?");
+
+ result = gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
+
+ switch (result)
+ {
+ case GTK_RESPONSE_YES:
+ call_window_stop_timeout (window);
+ call_window_set_output_video_is_drawing (window, FALSE);
+ empathy_tp_call_close_channel (window->call);
+ empathy_tp_call_remove_preview_video (gtk_socket_get_id (GTK_SOCKET
+ (window->preview_video_socket)));
+ return FALSE;
+ default:
+ return TRUE;
+ }
+ }
+ else
+ {
+ empathy_tp_call_remove_preview_video (gtk_socket_get_id (GTK_SOCKET
+ (window->preview_video_socket)));
+ return FALSE;
+ }
+}
static void
-call_window_output_mute_toggled_cb (GtkWidget *button,
- EmpathyCallWindow *window)
+call_window_video_button_toggled_cb (GtkWidget *button,
+ EmpathyCallWindow *window)
{
- gboolean is_muted;
+ gboolean is_sending;
+
+ is_sending = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
+
+ empathy_debug (DEBUG_DOMAIN, "Send video toggled - %d", is_sending);
- is_muted = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
- empathy_tp_call_mute_output (window->call, is_muted);
+ empathy_tp_call_request_video_stream_direction (window->call, is_sending);
}
+static void
+call_window_status_changed_cb (EmpathyTpCall *call,
+ EmpathyCallWindow *window)
+{
+ EmpathyContact *contact;
+ guint status;
+ guint stream_state;
+ EmpathyTpCallStream *audio_stream;
+ EmpathyTpCallStream *video_stream;
+ gboolean is_incoming;
+ gchar *title;
+
+ g_object_get (G_OBJECT (window->call), "status", &status, NULL);
+ g_object_get (G_OBJECT (window->call), "audio-stream", &audio_stream, NULL);
+ g_object_get (G_OBJECT (window->call), "video-stream", &video_stream, NULL);
+
+ if (video_stream->state > audio_stream->state)
+ {
+ stream_state = video_stream->state;
+ }
+ else
+ {
+ stream_state = audio_stream->state;
+ }
+
+ empathy_debug (DEBUG_DOMAIN, "Status changed - status: %d, stream state: %d",
+ status, stream_state);
+
+ if (window->timeout_event_id)
+ {
+ call_window_stop_timeout (window);
+ }
+
+ if (status == EMPATHY_TP_CALL_STATUS_CLOSED)
+ {
+ gtk_label_set_text (GTK_LABEL (window->status_label), "Closed");
+ gtk_widget_set_sensitive (window->end_call_button, FALSE);
+ gtk_widget_set_sensitive (window->start_call_button, FALSE);
+
+ call_window_set_output_video_is_drawing (window, FALSE);
+ }
+ else if (stream_state == TP_MEDIA_STREAM_STATE_DISCONNECTED)
+ {
+ gtk_label_set_text (GTK_LABEL (window->status_label), "Disconnected");
+ }
+ else if (status == EMPATHY_TP_CALL_STATUS_PENDING)
+ {
+ g_object_get (G_OBJECT (window->call), "contact", &contact, NULL);
+
+ title = g_strdup_printf ("%s - Empathy Call",
+ empathy_contact_get_name (contact));
+ gtk_window_set_title (GTK_WINDOW (window->window), title);
+
+ gtk_label_set_text (GTK_LABEL (window->status_label), "Ringing");
+ gtk_widget_set_sensitive (window->end_call_button, TRUE);
+ gtk_widget_set_sensitive (window->video_button, TRUE);
+
+ g_object_get (G_OBJECT (window->call), "is-incoming", &is_incoming, NULL);
+ if (is_incoming)
+ {
+ gtk_widget_set_sensitive (window->start_call_button, TRUE);
+ }
+ else
+ {
+ g_signal_connect (GTK_OBJECT (window->video_button), "toggled",
+ G_CALLBACK (call_window_video_button_toggled_cb),
+ window);
+ }
+ }
+ else if (status == EMPATHY_TP_CALL_STATUS_ACCEPTED)
+ {
+ if (stream_state == TP_MEDIA_STREAM_STATE_CONNECTING)
+ {
+ gtk_label_set_text (GTK_LABEL (window->status_label), "Connecting");
+ }
+ else if (stream_state == TP_MEDIA_STREAM_STATE_CONNECTED)
+ {
+ if ((window->start_time).tv_sec == 0)
+ {
+ g_get_current_time (&(window->start_time));
+ }
+ window->timeout_event_id = g_timeout_add (1000,
+ call_window_update_timer, window);
+ empathy_debug (DEBUG_DOMAIN, "Timer started");
+ }
+ }
+}
static void
-call_window_input_mute_toggled_cb (GtkWidget *button,
- EmpathyCallWindow *window)
+call_window_receiving_video_cb (EmpathyTpCall *call,
+ gboolean receiving_video,
+ EmpathyCallWindow *window)
{
- gboolean is_muted;
+ empathy_debug (DEBUG_DOMAIN, "Receiving video signal received");
- is_muted = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
- empathy_tp_call_mute_input (window->call, is_muted);
+ call_window_set_output_video_is_drawing (window, receiving_video);
}
+static void
+call_window_sending_video_cb (EmpathyTpCall *call,
+ gboolean sending_video,
+ EmpathyCallWindow *window)
+{
+ empathy_debug (DEBUG_DOMAIN, "Sending video signal received");
+
+ g_signal_handlers_block_by_func (window->video_button,
+ call_window_video_button_toggled_cb, window);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (window->video_button),
+ sending_video);
+ g_signal_handlers_unblock_by_func (window->video_button,
+ call_window_video_button_toggled_cb, window);
+}
static void
-call_window_send_video_toggled_cb (GtkWidget *button,
- EmpathyCallWindow *window)
+call_window_socket_realized_cb (GtkWidget *widget,
+ EmpathyCallWindow *window)
{
- gboolean is_sending;
+ if (widget == window->preview_video_socket)
+ {
+ empathy_debug (DEBUG_DOMAIN, "Preview socket realized");
+ empathy_tp_call_add_preview_video (gtk_socket_get_id (GTK_SOCKET
+ (window->preview_video_socket)));
+ }
+ else
+ {
+ empathy_debug (DEBUG_DOMAIN, "Output socket realized");
+ }
+}
- is_sending = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
- empathy_tp_call_send_video (window->call, is_sending);
+static void
+call_window_start_call_button_clicked_cb (GtkWidget *widget,
+ EmpathyCallWindow *window)
+{
+ gboolean send_video;
+ gboolean is_incoming;
+
+ empathy_debug (DEBUG_DOMAIN, "Start call clicked");
+
+ gtk_widget_set_sensitive (window->start_call_button, FALSE);
+ g_object_get (G_OBJECT (window->call), "is-incoming", &is_incoming, NULL);
+ if (is_incoming)
+ {
+ empathy_tp_call_accept_incoming_call (window->call);
+ send_video = gtk_toggle_button_get_active
+ (GTK_TOGGLE_BUTTON (window->video_button));
+ empathy_tp_call_request_video_stream_direction (window->call, send_video);
+ g_signal_connect (GTK_OBJECT (window->video_button), "toggled",
+ G_CALLBACK (call_window_video_button_toggled_cb), window);
+ }
}
static void
-call_window_capabilities_notify_cb (EmpathyContact *contact,
- GParamSpec *param,
- EmpathyCallWindow *window)
+call_window_end_call_button_clicked_cb (GtkWidget *widget,
+ EmpathyCallWindow *window)
{
- EmpathyCapabilities capabilities;
+ empathy_debug (DEBUG_DOMAIN, "End call clicked");
- capabilities = empathy_contact_get_capabilities (contact);
- empathy_tp_call_request_streams (window->call,
- capabilities & EMPATHY_CAPABILITIES_AUDIO,
- capabilities & EMPATHY_CAPABILITIES_VIDEO);
+ call_window_set_output_video_is_drawing (window, FALSE);
+ empathy_tp_call_close_channel (window->call);
+ gtk_widget_set_sensitive (window->end_call_button, FALSE);
+ gtk_widget_set_sensitive (window->start_call_button, FALSE);
}
static void
-call_window_name_notify_cb (EmpathyContact *contact,
- GParamSpec *param,
- EmpathyCallWindow *window)
+call_window_output_volume_changed_cb (GtkWidget *scale,
+ EmpathyCallWindow *window)
{
- const gchar *name;
- gchar *title;
+ guint volume;
- name = empathy_contact_get_name (contact);
- title = g_strdup_printf (_("Call from %s"), name);
- gtk_window_set_title (GTK_WINDOW (window->window), title);
- g_free (title);
+ volume = (guint) gtk_range_get_value (GTK_RANGE (scale));
+
+ empathy_debug (DEBUG_DOMAIN, "Output volume changed - %u", volume);
+
+ empathy_tp_call_set_output_volume (window->call, volume);
}
static void
-call_window_status_notify_cb (EmpathyTpCall *call,
- GParamSpec *param,
- EmpathyCallWindow *window)
-{
- guint status;
-
- status = empathy_tp_call_get_status (call);
- empathy_debug (DEBUG_DOMAIN, "Status changed to %d",
- status);
-
- if (status == EMPATHY_TP_CALL_STATUS_RINGING) {
- if (empathy_tp_call_is_incoming (window->call)) {
- empathy_tp_call_accept (window->call);
- } else {
- EmpathyContact *contact;
-
- contact = empathy_tp_call_get_contact (call);
- g_signal_connect (contact, "notify::capabilities",
- G_CALLBACK (call_window_capabilities_notify_cb),
- window);
- g_signal_connect (contact, "notify::name",
- G_CALLBACK (call_window_name_notify_cb),
- window);
- call_window_capabilities_notify_cb (contact, NULL, window);
- call_window_name_notify_cb (contact, NULL, window);
- }
- }
-
- if (status == EMPATHY_TP_CALL_STATUS_RUNNING) {
- empathy_tp_call_set_output_window (window->call,
- gtk_socket_get_id (GTK_SOCKET (window->output_video_socket)));
- }
+call_window_output_mute_button_toggled_cb (GtkWidget *button,
+ EmpathyCallWindow *window)
+{
+ gboolean is_muted;
+
+ is_muted = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
+
+ empathy_debug (DEBUG_DOMAIN, "Mute output toggled - %d", is_muted);
+
+ empathy_tp_call_mute_output (window->call, is_muted);
}
static void
-call_window_destroy_cb (GtkWidget *widget,
- EmpathyCallWindow *window)
+call_window_input_mute_button_toggled_cb (GtkWidget *button,
+ EmpathyCallWindow *window)
{
- g_object_unref (window->call);
- g_slice_free (EmpathyCallWindow, window);
+ gboolean is_muted;
+
+ is_muted = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
+
+ empathy_debug (DEBUG_DOMAIN, "Mute input toggled - %d", is_muted);
+
+ empathy_tp_call_mute_input (window->call, is_muted);
+}
+
+static void
+call_window_destroy_cb (GtkWidget *widget,
+ EmpathyCallWindow *window)
+{
+ g_signal_handlers_disconnect_by_func (window->call,
+ call_window_status_changed_cb, window);
+ g_signal_handlers_disconnect_by_func (window->call,
+ call_window_receiving_video_cb, window);
+ g_signal_handlers_disconnect_by_func (window->call,
+ call_window_sending_video_cb, window);
+
+ g_object_unref (window->call);
+ g_object_unref (window->output_video_socket);
+ g_object_unref (window->preview_video_socket);
+ g_object_unref (window->output_video_label);
+
+ g_slice_free (EmpathyCallWindow, window);
}
GtkWidget *
-empathy_call_window_show (EmpathyTpCall *call)
-{
- EmpathyCallWindow *window;
- GladeXML *glade;
-
- window = g_slice_new0 (EmpathyCallWindow);
-
- glade = empathy_glade_get_file ("empathy-call-window.glade",
- "window",
- NULL,
- "window", &window->window,
- "input_volume_scale", &window->input_volume_scale,
- "output_volume_scale", &window->output_volume_scale,
- "input_mute_togglebutton", &window->input_mute_togglebutton,
- "output_mute_togglebutton", &window->output_mute_togglebutton,
- "preview_video_frame", &window->preview_video_frame,
- "output_video_frame", &window->output_video_frame,
- "send_video_checkbutton", &window->send_video_checkbutton,
- NULL);
-
- empathy_glade_connect (glade,
- window,
- "window", "destroy", call_window_destroy_cb,
- "input_mute_togglebutton", "toggled", call_window_input_mute_toggled_cb,
- "output_mute_togglebutton", "toggled", call_window_output_mute_toggled_cb,
- "output_volume_scale", "value-changed", call_window_output_volume_changed_cb,
- "send_video_checkbutton", "toggled", call_window_send_video_toggled_cb,
- NULL);
- g_object_unref (glade);
-
- /* Set output window socket */
- window->output_video_socket = gtk_socket_new ();
- gtk_widget_show (window->output_video_socket);
- gtk_container_add (GTK_CONTAINER (window->output_video_frame),
- window->output_video_socket);
-
- /* Set preview window socket */
- window->preview_video_socket = gtk_socket_new ();
- gtk_widget_show (window->preview_video_socket);
- gtk_container_add (GTK_CONTAINER (window->preview_video_frame),
- window->preview_video_socket);
-
- /* Setup TpCall */
- window->call = g_object_ref (call);
- empathy_tp_call_add_preview_window (window->call,
- gtk_socket_get_id (GTK_SOCKET (window->preview_video_socket)));
- g_signal_connect (window->call, "notify::status",
- G_CALLBACK (call_window_status_notify_cb),
- window);
-
- gtk_widget_show (window->window);
-
- return window->window;
+empathy_call_window_new (EmpathyTpCall *call)
+{
+ EmpathyCallWindow *window;
+ GladeXML *glade;
+ guint status;
+
+ g_return_val_if_fail (EMPATHY_IS_TP_CALL (call), NULL);
+
+ window = g_slice_new0 (EmpathyCallWindow);
+ window->call = g_object_ref (call);
+
+ glade = empathy_glade_get_file ("empathy-call-window.glade",
+ "window",
+ NULL,
+ "window", &window->window,
+ "status_label", &window->status_label,
+ "start_call_button", &window->start_call_button,
+ "end_call_button", &window->end_call_button,
+ "input_volume_scale", &window->input_volume_scale,
+ "output_volume_scale", &window->output_volume_scale,
+ "input_mute_button", &window->input_mute_button,
+ "output_mute_button", &window->output_mute_button,
+ "preview_video_frame", &window->preview_video_frame,
+ "output_video_frame", &window->output_video_frame,
+ "video_button", &window->video_button,
+ NULL);
+
+ empathy_glade_connect (glade,
+ window,
+ "window", "destroy", call_window_destroy_cb,
+ "window", "delete_event", call_window_delete_event_cb,
+ "input_mute_button", "toggled", call_window_input_mute_button_toggled_cb,
+ "output_mute_button", "toggled", call_window_output_mute_button_toggled_cb,
+ "output_volume_scale", "value-changed", call_window_output_volume_changed_cb,
+ "start_call_button", "clicked", call_window_start_call_button_clicked_cb,
+ "end_call_button", "clicked", call_window_end_call_button_clicked_cb,
+ NULL);
+
+ g_object_unref (glade);
+
+ /* Output video label */
+ window->output_video_label = g_object_ref (gtk_label_new ("No video output"));
+ gtk_container_add (GTK_CONTAINER (window->output_video_frame),
+ window->output_video_label);
+ gtk_widget_show (window->output_video_label);
+
+ /* Output video socket */
+ window->output_video_socket = g_object_ref (gtk_socket_new ());
+ g_signal_connect (GTK_OBJECT (window->output_video_socket), "realize",
+ G_CALLBACK (call_window_socket_realized_cb), window);
+ gtk_widget_show (window->output_video_socket);
+
+ /* Preview video socket */
+ window->preview_video_socket = g_object_ref (gtk_socket_new ());
+ g_signal_connect (GTK_OBJECT (window->preview_video_socket), "realize",
+ G_CALLBACK (call_window_socket_realized_cb), window);
+ gtk_container_add (GTK_CONTAINER (window->preview_video_frame),
+ window->preview_video_socket);
+ gtk_widget_show (window->preview_video_socket);
+
+ g_signal_connect (G_OBJECT (window->call), "status-changed",
+ G_CALLBACK (call_window_status_changed_cb),
+ window);
+ g_signal_connect (G_OBJECT (window->call), "receiving-video",
+ G_CALLBACK (call_window_receiving_video_cb),
+ window);
+ g_signal_connect (G_OBJECT (window->call), "sending-video",
+ G_CALLBACK (call_window_sending_video_cb),
+ window);
+
+ window->is_drawing = FALSE;
+
+ g_object_get (G_OBJECT (window->call), "status", &status, NULL);
+
+ if (status == EMPATHY_TP_CALL_STATUS_READYING)
+ {
+ gtk_window_set_title (GTK_WINDOW (window->window), "Empathy Call");
+ gtk_label_set_text (GTK_LABEL (window->status_label), "Readying");
+ }
+
+ gtk_widget_show (window->window);
+
+ return window->window;
}
diff --git a/libempathy-gtk/empathy-call-window.glade b/libempathy-gtk/empathy-call-window.glade
index bc18952b6..20b2760a1 100644
--- a/libempathy-gtk/empathy-call-window.glade
+++ b/libempathy-gtk/empathy-call-window.glade
@@ -1,335 +1,304 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
+<!--Generated with glade3 3.4.1 on Thu Jan 17 20:37:30 2008 -->
<glade-interface>
-
-<widget class="GtkWindow" id="window">
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="title" translatable="yes">Call</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="decorated">True</property>
- <property name="skip_taskbar_hint">False</property>
- <property name="skip_pager_hint">False</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
- <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
- <property name="focus_on_map">True</property>
- <property name="urgency_hint">False</property>
-
- <child>
- <widget class="GtkHBox" id="hbox2">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">10</property>
-
- <child>
- <widget class="GtkFrame" id="frame1">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkAlignment" id="alignment1">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
- <property name="xscale">1</property>
- <property name="yscale">1</property>
- <property name="top_padding">0</property>
- <property name="bottom_padding">0</property>
- <property name="left_padding">0</property>
- <property name="right_padding">0</property>
-
- <child>
- <widget class="GtkHBox" id="hbox3">
- <property name="visible">True</property>
- <property name="homogeneous">True</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkVBox" id="vbox4">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label2">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Input</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">5</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVScale" id="input_volume_scale">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="can_focus">True</property>
- <property name="draw_value">False</property>
- <property name="value_pos">GTK_POS_TOP</property>
- <property name="digits">1</property>
- <property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
- <property name="inverted">True</property>
- <property name="adjustment">100 0 100 1 0 0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkToggleButton" id="input_mute_togglebutton">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Mute</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- </widget>
- <packing>
- <property name="padding">5</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">5</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox5">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Output</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">5</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVScale" id="output_volume_scale">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="can_focus">True</property>
- <property name="draw_value">False</property>
- <property name="value_pos">GTK_POS_TOP</property>
- <property name="digits">1</property>
- <property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
- <property name="inverted">True</property>
- <property name="adjustment">100 0 100 1 0 0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkToggleButton" id="output_mute_togglebutton">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Mute</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- </widget>
- <packing>
- <property name="padding">5</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">5</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label4">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Volume</property>
- <property name="use_underline">False</property>
- <property name="use_markup">True</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox2">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkAspectFrame" id="output_video_frame">
- <property name="width_request">352</property>
- <property name="height_request">288</property>
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="ratio">1.22000002861</property>
- <property name="obey_child">False</property>
-
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox3">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkAspectFrame" id="preview_video_frame">
- <property name="width_request">176</property>
- <property name="height_request">144</property>
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="ratio">1.22000002861</property>
- <property name="obey_child">False</property>
-
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="send_video_checkbutton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Send Video</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">True</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">10</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
+ <widget class="GtkWindow" id="window">
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <child>
+ <widget class="GtkVBox" id="vbox1">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="border_width">10</property>
+ <property name="spacing">10</property>
+ <child>
+ <widget class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <child>
+ <widget class="GtkLabel" id="status_label">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHSeparator" id="hseparator1">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox2">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="spacing">10</property>
+ <child>
+ <widget class="GtkFrame" id="frame1">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label_xalign">0</property>
+ <child>
+ <widget class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <child>
+ <widget class="GtkHBox" id="hbox3">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="homogeneous">True</property>
+ <child>
+ <widget class="GtkVBox" id="vbox4">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="extension_events">GDK_EXTENSION_EVENTS_CURSOR</property>
+ <property name="resize_mode">GTK_RESIZE_QUEUE</property>
+ <child>
+ <widget class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Input</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="padding">5</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkVScale" id="input_volume_scale">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="adjustment">100 0 100 1 0 0</property>
+ <property name="inverted">True</property>
+ <property name="draw_value">False</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkToggleButton" id="input_mute_button">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Mute</property>
+ <property name="response_id">0</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="padding">5</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">5</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkVBox" id="vbox5">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <child>
+ <widget class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Output</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="padding">5</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkVScale" id="output_volume_scale">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="adjustment">100 0 100 1 0 0</property>
+ <property name="inverted">True</property>
+ <property name="draw_value">False</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkToggleButton" id="output_mute_button">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Mute</property>
+ <property name="response_id">0</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="padding">5</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">5</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Volume</property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkVBox" id="vbox2">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <child>
+ <widget class="GtkAspectFrame" id="output_video_frame">
+ <property name="width_request">352</property>
+ <property name="height_request">288</property>
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label_xalign">0</property>
+ <property name="ratio">1.2200000286102295</property>
+ <property name="obey_child">False</property>
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkVBox" id="vbox3">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <child>
+ <widget class="GtkAspectFrame" id="preview_video_frame">
+ <property name="width_request">176</property>
+ <property name="height_request">144</property>
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label_xalign">0</property>
+ <property name="ratio">1.2200000286102295</property>
+ <property name="obey_child">False</property>
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkCheckButton" id="video_button">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Send Video</property>
+ <property name="response_id">0</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="padding">10</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHSeparator" id="hseparator2">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="padding">5</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="start_call_button">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Start Call</property>
+ <property name="response_id">0</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="padding">10</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="end_call_button">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">End Call</property>
+ <property name="response_id">0</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">10</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
</glade-interface>
diff --git a/libempathy-gtk/empathy-call-window.h b/libempathy-gtk/empathy-call-window.h
index c8c6d7f0e..7d65aaeae 100644
--- a/libempathy-gtk/empathy-call-window.h
+++ b/libempathy-gtk/empathy-call-window.h
@@ -1,36 +1,34 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
- * Copyright (C) 2007 Elliot Fairweather
- * Copyright (C) 2007 Collabora Ltd.
+ * Copyright (C) 2007 Elliot Fairweather
*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
*
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
*
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
- * Authors: Elliot Fairweather <elliot.fairweather@collabora.co.uk>
- * Xavier Claessens <xclaesse@gmail.com>
+ * Authors: Elliot Fairweather <elliot.fairweather@collabora.co.uk>
*/
#ifndef __EMPATHY_CALL_WINDOW_H__
#define __EMPATHY_CALL_WINDOW_H__
+#include <gtk/gtk.h>
+
#include <libempathy/empathy-tp-call.h>
G_BEGIN_DECLS
-GtkWidget * empathy_call_window_show (EmpathyTpCall *call);
+GtkWidget *empathy_call_window_new (EmpathyTpCall *call);
G_END_DECLS
#endif /* __EMPATHY_CALL_WINDOW_H__ */
-
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index f7c013820..ae0825255 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -80,6 +80,8 @@ struct _EmpathyChatPriv {
gboolean first_tp_chat;
time_t last_log_timestamp;
gboolean is_first_char;
+ guint block_events_timeout_id;
+ GList *pending_messages;
/* Used to automatically shrink a window that has temporarily
* grown due to long input.
*/
@@ -396,6 +398,9 @@ chat_finalize (GObject *object)
chat_composing_remove_timeout (chat);
g_object_unref (priv->log_manager);
+ g_list_foreach (priv->pending_messages, (GFunc) g_object_unref, NULL);
+ g_list_free (priv->pending_messages);
+
dbus_g_proxy_disconnect_signal (DBUS_G_PROXY (priv->mc), "AccountStatusChanged",
G_CALLBACK (chat_status_changed_cb),
chat);
@@ -414,6 +419,10 @@ chat_finalize (GObject *object)
g_source_remove (priv->scroll_idle_id);
}
+ if (priv->block_events_timeout_id) {
+ g_source_remove (priv->block_events_timeout_id);
+ }
+
g_free (priv->id);
G_OBJECT_CLASS (empathy_chat_parent_class)->finalize (object);
@@ -436,6 +445,13 @@ chat_destroy_cb (EmpathyTpChat *tp_chat,
empathy_chat_view_append_event (chat->view, _("Disconnected"));
gtk_widget_set_sensitive (chat->input_text_view, FALSE);
+ if (priv->block_events_timeout_id != 0) {
+ g_source_remove (priv->block_events_timeout_id);
+ }
+
+ g_list_foreach (priv->pending_messages, (GFunc) g_object_unref, NULL);
+ g_list_free (priv->pending_messages);
+
if (EMPATHY_CHAT_GET_CLASS (chat)->set_tp_chat) {
EMPATHY_CHAT_GET_CLASS (chat)->set_tp_chat (chat, NULL);
}
@@ -519,6 +535,14 @@ chat_message_received_cb (EmpathyTpChat *tp_chat,
return;
}
+ if (chat->block_events) {
+ /* Wait until block_events cb before displaying
+ * them to have to chance to get alias/avatar of sender. */
+ priv->pending_messages = g_list_append (priv->pending_messages,
+ g_object_ref (message));
+ return;
+ }
+
sender = empathy_message_get_sender (message);
empathy_debug (DEBUG_DOMAIN, "Appending message ('%s')",
empathy_contact_get_name (sender));
@@ -1439,12 +1463,32 @@ empathy_chat_load_geometry (EmpathyChat *chat,
empathy_geometry_load (empathy_chat_get_id (chat), x, y, w, h);
}
+static gboolean
+chat_block_events_timeout_cb (gpointer data)
+{
+ EmpathyChat *chat = EMPATHY_CHAT (data);
+ EmpathyChatPriv *priv = GET_PRIV (chat);
+ GList *l;
+
+ chat->block_events = FALSE;
+ priv->block_events_timeout_id = 0;
+
+ for (l = priv->pending_messages; l; l = l->next) {
+ chat_message_received_cb (priv->tp_chat, l->data, chat);
+ g_object_unref (l->data);
+ }
+ g_list_free (priv->pending_messages);
+ priv->pending_messages = NULL;
+
+ return FALSE;
+}
+
void
empathy_chat_set_tp_chat (EmpathyChat *chat,
EmpathyTpChat *tp_chat)
{
EmpathyChatPriv *priv;
- GList *messages, *l;
+ GList *messages;
g_return_if_fail (EMPATHY_IS_CHAT (chat));
g_return_if_fail (EMPATHY_IS_TP_CHAT (tp_chat));
@@ -1455,6 +1499,15 @@ empathy_chat_set_tp_chat (EmpathyChat *chat,
return;
}
+ /* Block events for some time to avoid having "has come online" or
+ * "joined" messages. */
+ chat->block_events = TRUE;
+ if (priv->block_events_timeout_id != 0) {
+ g_source_remove (priv->block_events_timeout_id);
+ }
+ priv->block_events_timeout_id =
+ g_timeout_add_seconds (1, chat_block_events_timeout_cb, chat);
+
if (priv->tp_chat) {
g_signal_handlers_disconnect_by_func (priv->tp_chat,
chat_message_received_cb,
@@ -1494,14 +1547,11 @@ empathy_chat_set_tp_chat (EmpathyChat *chat,
G_CALLBACK (chat_destroy_cb),
chat);
- /* Get pending messages */
+ /* Get pending messages, wait until block_events cb before displaying
+ * them to have to chance to get alias/avatar of sender. */
empathy_tp_chat_set_acknowledge (tp_chat, TRUE);
messages = empathy_tp_chat_get_pendings (tp_chat);
- for (l = messages; l; l = l->next) {
- chat_message_received_cb (tp_chat, l->data, chat);
- g_object_unref (l->data);
- }
- g_list_free (messages);
+ priv->pending_messages = g_list_concat (priv->pending_messages, messages);
if (!priv->sensitive) {
gtk_widget_set_sensitive (chat->input_text_view, TRUE);
diff --git a/libempathy-gtk/empathy-chat.h b/libempathy-gtk/empathy-chat.h
index 5bf456e48..bcf382e53 100644
--- a/libempathy-gtk/empathy-chat.h
+++ b/libempathy-gtk/empathy-chat.h
@@ -58,6 +58,7 @@ struct _EmpathyChat {
/* Protected */
EmpathyChatView *view;
GtkWidget *input_text_view;
+ gboolean block_events;
};
struct _EmpathyChatClass {
diff --git a/libempathy-gtk/empathy-group-chat.c b/libempathy-gtk/empathy-group-chat.c
index 4f86ef2ba..a51b25228 100644
--- a/libempathy-gtk/empathy-group-chat.c
+++ b/libempathy-gtk/empathy-group-chat.c
@@ -355,20 +355,18 @@ group_chat_members_changed_cb (EmpathyTpChatroom *tp_chat,
gboolean is_member,
EmpathyGroupChat *chat)
{
- EmpathyGroupChatPriv *priv;
- gchar *str;
-
- priv = GET_PRIV (chat);
-
- if (is_member) {
- str = g_strdup_printf (_("%s has joined the room"),
- empathy_contact_get_name (contact));
- } else {
- str = g_strdup_printf (_("%s has left the room"),
- empathy_contact_get_name (contact));
+ if (!EMPATHY_CHAT (chat)->block_events) {
+ gchar *str;
+ if (is_member) {
+ str = g_strdup_printf (_("%s has joined the room"),
+ empathy_contact_get_name (contact));
+ } else {
+ str = g_strdup_printf (_("%s has left the room"),
+ empathy_contact_get_name (contact));
+ }
+ empathy_chat_view_append_event (EMPATHY_CHAT (chat)->view, str);
+ g_free (str);
}
- empathy_chat_view_append_event (EMPATHY_CHAT (chat)->view, str);
- g_free (str);
}
static void
@@ -571,13 +569,15 @@ group_chat_subject_notify_cb (EmpathyTpChat *tp_chat,
priv->topic = str;
gtk_label_set_text (GTK_LABEL (priv->label_topic), priv->topic);
- if (!G_STR_EMPTY (priv->topic)) {
- str = g_strdup_printf (_("Topic set to: %s"), priv->topic);
- } else {
- str = g_strdup (_("No topic defined"));
+ if (!EMPATHY_CHAT (chat)->block_events) {
+ if (!G_STR_EMPTY (priv->topic)) {
+ str = g_strdup_printf (_("Topic set to: %s"), priv->topic);
+ } else {
+ str = g_strdup (_("No topic defined"));
+ }
+ empathy_chat_view_append_event (EMPATHY_CHAT (chat)->view, str);
+ g_free (str);
}
- empathy_chat_view_append_event (EMPATHY_CHAT (chat)->view, str);
- g_free (str);
}
static void
diff --git a/libempathy-gtk/empathy-private-chat.c b/libempathy-gtk/empathy-private-chat.c
index 2dd1ba755..0bcdd7844 100644
--- a/libempathy-gtk/empathy-private-chat.c
+++ b/libempathy-gtk/empathy-private-chat.c
@@ -223,7 +223,7 @@ private_chat_contact_presence_updated_cb (EmpathyContact *contact,
empathy_contact_get_id (contact));
if (!empathy_contact_is_online (contact)) {
- if (priv->is_online) {
+ if (priv->is_online && !EMPATHY_CHAT (chat)->block_events) {
gchar *msg;
msg = g_strdup_printf (_("%s went offline"),
@@ -237,7 +237,7 @@ private_chat_contact_presence_updated_cb (EmpathyContact *contact,
g_signal_emit_by_name (chat, "composing", FALSE);
} else {
- if (!priv->is_online) {
+ if (!priv->is_online && !EMPATHY_CHAT (chat)->block_events) {
gchar *msg;
msg = g_strdup_printf (_("%s has come online"),
diff --git a/libempathy-gtk/empathy-theme-boxes.c b/libempathy-gtk/empathy-theme-boxes.c
index 30ae59f30..7285a9e9e 100644
--- a/libempathy-gtk/empathy-theme-boxes.c
+++ b/libempathy-gtk/empathy-theme-boxes.c
@@ -597,15 +597,16 @@ theme_boxes_maybe_append_header (EmpathyTheme *theme,
box = gtk_hbox_new (FALSE, 0);
- avatar = empathy_chat_view_get_avatar_pixbuf_with_cache (contact);
- if (avatar && empathy_theme_get_show_avatars (theme)) {
- GtkWidget *image;
+ if (empathy_theme_get_show_avatars (theme)) {
+ avatar = empathy_chat_view_get_avatar_pixbuf_with_cache (contact);
+ if (avatar) {
+ GtkWidget *image;
- image = gtk_image_new_from_pixbuf (avatar);
-
- gtk_box_pack_start (GTK_BOX (box), image,
- FALSE, TRUE, 2);
+ image = gtk_image_new_from_pixbuf (avatar);
+ gtk_box_pack_start (GTK_BOX (box), image,
+ FALSE, TRUE, 2);
+ }
}
g_signal_connect_object (view, "size-allocate",
diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c
index 9c66e73ba..c31dfefc0 100644
--- a/libempathy-gtk/empathy-ui-utils.c
+++ b/libempathy-gtk/empathy-ui-utils.c
@@ -1273,6 +1273,9 @@ empathy_window_present (GtkWindow *window,
timestamp = gtk_get_current_event_time ();
gtk_window_set_skip_taskbar_hint (window, FALSE);
gtk_window_present_with_time (window, timestamp);
+ /* FIXME: This shouldn't be required as gtk_window_present's doc says
+ * it deiconify automatically. */
+ gtk_window_deiconify (window);
}
GtkWindow *