aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am63
-rw-r--r--src/cc-empathy-accounts-panel.c246
-rw-r--r--src/cc-empathy-accounts-panel.h55
-rw-r--r--src/empathy-about-dialog.c2
-rw-r--r--src/empathy-account-assistant.c4
-rw-r--r--src/empathy-accounts-common.c4
-rw-r--r--src/empathy-accounts-common.h1
-rw-r--r--src/empathy-accounts-dialog.c8
-rw-r--r--src/empathy-accounts-dialog.ui23
-rw-r--r--src/empathy-accounts-module.c40
-rw-r--r--src/empathy-accounts.c19
-rw-r--r--src/empathy-audio-src.c30
-rw-r--r--src/empathy-call-factory.c205
-rw-r--r--src/empathy-call-factory.h5
-rw-r--r--src/empathy-call-handler.c17
-rw-r--r--src/empathy-call-window.c431
-rw-r--r--src/empathy-call-window.h6
-rw-r--r--src/empathy-call-window.ui90
-rw-r--r--src/empathy-call.c86
-rw-r--r--src/empathy-chat-manager.c4
-rw-r--r--src/empathy-chat-window.c3
-rw-r--r--src/empathy-event-manager.c40
-rw-r--r--src/empathy-import-utils.c4
-rw-r--r--src/empathy-import-widget.c4
-rw-r--r--src/empathy-invite-participant-dialog.c32
-rw-r--r--src/empathy-main-window-menubar.ui1
-rw-r--r--src/empathy-main-window.c130
-rw-r--r--src/empathy-main-window.h2
-rw-r--r--src/empathy-main-window.ui3
-rw-r--r--src/empathy-mic-monitor.c7
-rw-r--r--src/empathy-migrate-butterfly-logs.c234
-rw-r--r--src/empathy-migrate-butterfly-logs.h32
-rw-r--r--src/empathy-new-chatroom-dialog.c78
-rw-r--r--src/empathy-new-chatroom-dialog.ui167
-rw-r--r--src/empathy-notifications-approver.c6
-rw-r--r--src/empathy-preferences.c35
-rw-r--r--src/empathy-preferences.h3
-rw-r--r--src/empathy-preferences.ui226
-rw-r--r--src/empathy-rounded-actor.c22
-rw-r--r--src/empathy-rounded-actor.h6
-rw-r--r--src/empathy-status-icon.c4
-rw-r--r--src/empathy-streamed-media-factory.c3
-rw-r--r--src/empathy-streamed-media-handler.c15
-rw-r--r--src/empathy-streamed-media-window.c8
-rw-r--r--src/empathy-streamed-media-window.ui90
-rw-r--r--src/empathy-video-src.c56
-rw-r--r--src/empathy.c34
-rw-r--r--src/ev-sidebar.c4
48 files changed, 1207 insertions, 1381 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index cc4eebe30..c6855d338 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -48,31 +48,6 @@ libempathy_accounts_common_la_LIBADD = \
$(LIBCHAMPLAIN_LIBS) \
$(NULL)
-if HAVE_CONTROL_CENTER_EMBEDDING
-ccmodulesdir = $(CONTROL_CENTER_EXTENSIONDIR)
-ccmodules_LTLIBRARIES = libempathy-accounts-panel.la
-
-libempathy_accounts_panel_la_SOURCES = \
- empathy-accounts-module.c \
- cc-empathy-accounts-panel.c \
- cc-empathy-accounts-panel.h \
- $(NULL)
-
-libempathy_accounts_panel_la_CPPFLAGS = \
- $(CPPFLAGS_COMMON) \
- $(CONTROL_CENTER_EMBEDDING_CFLAGS) \
- -DLOCALEDIR=\""$(datadir)/locale"\" \
- $(NULL)
-
-libempathy_accounts_panel_la_LDFLAGS = -export_dynamic -avoid-version -module -no-undefined -export-symbols-regex '^g_io_module_(load|unload)'
-
-libempathy_accounts_panel_la_LIBADD = \
- $(EMPATHY_LIBS) \
- $(CONTROL_CENTER_EMBEDDING_LIBS) \
- libempathy-accounts-common.la \
- $(NULL)
-endif
-
bin_PROGRAMS = \
empathy \
empathy-accounts \
@@ -84,11 +59,6 @@ libexec_PROGRAMS = \
empathy-av \
empathy-chat
-BUILT_SOURCES = \
- src-marshal.h \
- src-marshal.c \
- src-marshal.list
-
empathy_accounts_SOURCES = \
empathy-accounts.c empathy-accounts.h \
$(NULL)
@@ -127,8 +97,6 @@ empathy_av_SOURCES = \
empathy-mic-monitor.h
$(NULL)
-nodist_empathy_av_SOURCES = $(BUILT_SOURCES)
-
empathy_av_CFLAGS = $(EMPATHY_AV_CFLAGS)
empathy_av_LDFLAGS = $(EMPATHY_AV_LIBS) $(LIBM)
@@ -186,8 +154,6 @@ empathy_call_SOURCES = \
empathy-mic-monitor.c \
empathy-mic-monitor.h
-nodist_empathy_call_SOURCES = $(BUILT_SOURCES)
-
empathy_call_CFLAGS = $(EMPATHY_CALL_CFLAGS)
empathy_call_LDFLAGS = $(EMPATHY_CALL_LIBS)
@@ -201,7 +167,6 @@ empathy_handwritten_source = \
empathy-ft-manager.c empathy-ft-manager.h \
empathy-invite-participant-dialog.c empathy-invite-participant-dialog.h \
empathy-main-window.c empathy-main-window.h \
- empathy-migrate-butterfly-logs.c empathy-migrate-butterfly-logs.h \
empathy-new-chatroom-dialog.c empathy-new-chatroom-dialog.h \
empathy-notifications-approver.c empathy-notifications-approver.h \
empathy-call-observer.c empathy-call-observer.h \
@@ -224,8 +189,6 @@ empathy_LDADD = \
$(LIBCHAMPLAIN_LIBS) \
$(NULL)
-nodist_empathy_SOURCES = $(BUILT_SOURCES)
-
check_c_sources = \
$(empathy_handwritten_source) \
$(empathy_logs_SOURCES) \
@@ -268,33 +231,7 @@ EXTRA_DIST += \
empathy-map-view.ui
endif
-if !HAVE_CONTROL_CENTER_EMBEDDING
-EXTRA_DIST += $(libempathy_accounts_panel_la_SOURCES)
-else
-check_c_sources += $(libempathy_accounts_panel_la_SOURCES)
-endif
-
dist_man_MANS = \
empathy.1 \
empathy-accounts.1
-src-marshal.list: $(empathy_SOURCES) $(empathy_call_SOURCES) Makefile.am
- $(AM_V_GEN)( cd $(srcdir) && \
- sed -n -e 's/.*src_marshal_\([[:upper:][:digit:]]*__[[:upper:][:digit:]_]*\).*/\1/p' \
- $(empathy_SOURCES) $(empathy_av_SOURCES) $(empathy_call_SOURCES) ) \
- | sed -e 's/__/:/' -e 'y/_/,/' | sort -u > $@.tmp
- @if cmp -s $@.tmp $@; then \
- rm $@.tmp; \
- else \
- mv $@.tmp $@; \
- fi
-
-%-marshal.h: %-marshal.list Makefile
- $(AM_V_GEN)$(GLIB_GENMARSHAL) --header --prefix=_$(subst -,_,$*)_marshal $< > $*-marshal.h
-
-%-marshal.c: %-marshal.list Makefile
- $(AM_V_GEN)echo "#include \"src-marshal.h\"" > $@ && \
- $(GLIB_GENMARSHAL) --body --prefix=_$(subst -,_,$*)_marshal $< >> $*-marshal.c
-
-CLEANFILES = $(BUILT_SOURCES)
-
diff --git a/src/cc-empathy-accounts-panel.c b/src/cc-empathy-accounts-panel.c
deleted file mode 100644
index 6416c29f9..000000000
--- a/src/cc-empathy-accounts-panel.c
+++ /dev/null
@@ -1,246 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
- *
- * Copyright (C) 2010 Collabora, Ltd.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Authors: Travis Reitter <travis.reitter@collabora.co.uk>
- */
-
-#include "config.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#include <gtk/gtk.h>
-#include <gio/gio.h>
-#include <glib/gi18n-lib.h>
-
-#include <telepathy-glib/telepathy-glib.h>
-
-#include <libempathy/empathy-utils.h>
-#include <libempathy/empathy-connection-managers.h>
-#include <libempathy-gtk/empathy-ui-utils.h>
-#define DEBUG_FLAG EMPATHY_DEBUG_ACCOUNT
-#include <libempathy/empathy-debug.h>
-
-#include "empathy-accounts-common.h"
-#include "empathy-account-assistant.h"
-#include "empathy-accounts-dialog.h"
-
-#include "cc-empathy-accounts-panel.h"
-
-#define CC_EMPATHY_ACCOUNTS_PANEL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CC_TYPE_EMPATHY_ACCOUNTS_PANEL, CcEmpathyAccountsPanelPrivate))
-
-struct CcEmpathyAccountsPanelPrivate
-{
- /* the original window holding the dialog content; it needs to be retained and
- * destroyed in our finalize(), since it invalidates its children (even if
- * they've already been reparented by the time it is destroyed) */
- GtkWidget *accounts_window;
-
- GtkWidget *assistant;
- GtkWidget *container;
-};
-
-G_DEFINE_DYNAMIC_TYPE (CcEmpathyAccountsPanel, cc_empathy_accounts_panel, CC_TYPE_PANEL)
-
-static void
-panel_pack_with_accounts_dialog (CcEmpathyAccountsPanel *panel)
-{
- GtkWidget *content;
- GtkWidget *action_area;
-
- if (panel->priv->accounts_window != NULL)
- {
- gtk_widget_destroy (panel->priv->accounts_window);
- gtk_container_remove (GTK_CONTAINER (panel),
- gtk_bin_get_child (GTK_BIN (panel)));
- }
-
- panel->priv->accounts_window = empathy_accounts_dialog_show (NULL, NULL);
- gtk_widget_hide (panel->priv->accounts_window);
-
- content = gtk_dialog_get_content_area (
- GTK_DIALOG (panel->priv->accounts_window));
- action_area = gtk_dialog_get_action_area (
- GTK_DIALOG (panel->priv->accounts_window));
- gtk_widget_set_no_show_all (action_area, TRUE);
- gtk_widget_hide (action_area);
-
- gtk_widget_reparent (content, GTK_WIDGET (panel->priv->container));
-}
-
-static void
-account_assistant_closed_cb (GtkWidget *widget,
- gpointer user_data)
-{
- CcEmpathyAccountsPanel *panel = CC_EMPATHY_ACCOUNTS_PANEL (user_data);
-
- if (empathy_accounts_dialog_is_creating (
- EMPATHY_ACCOUNTS_DIALOG (panel->priv->accounts_window)))
- {
- empathy_account_dialog_cancel (
- EMPATHY_ACCOUNTS_DIALOG (panel->priv->accounts_window));
- }
-
- gtk_widget_set_sensitive (GTK_WIDGET (panel), TRUE);
- panel->priv->assistant = NULL;
-}
-
-static void
-connection_managers_prepare (GObject *source,
- GAsyncResult *result,
- gpointer user_data)
-{
- EmpathyConnectionManagers *cm_mgr = EMPATHY_CONNECTION_MANAGERS (source);
- TpAccountManager *account_mgr;
- CcEmpathyAccountsPanel *panel = CC_EMPATHY_ACCOUNTS_PANEL (user_data);
-
- account_mgr = TP_ACCOUNT_MANAGER (g_object_get_data (G_OBJECT (cm_mgr),
- "account-manager"));
-
- if (!empathy_connection_managers_prepare_finish (cm_mgr, result, NULL))
- goto out;
-
- panel_pack_with_accounts_dialog (panel);
-
- if (!empathy_accounts_has_non_salut_accounts (account_mgr))
- {
- GtkWindow *parent;
-
- parent = empathy_get_toplevel_window (GTK_WIDGET (panel));
- panel->priv->assistant = empathy_account_assistant_show (parent, cm_mgr);
-
- gtk_widget_set_sensitive (GTK_WIDGET (panel), FALSE);
-
- tp_g_signal_connect_object (panel->priv->assistant, "hide",
- G_CALLBACK (account_assistant_closed_cb),
- panel, 0);
- }
-
-out:
- /* remove ref from active_changed() */
- g_object_unref (account_mgr);
- g_object_unref (cm_mgr);
-}
-
-static void
-account_manager_ready_for_accounts_cb (GObject *source_object,
- GAsyncResult *result,
- gpointer user_data)
-{
- TpAccountManager *account_mgr = TP_ACCOUNT_MANAGER (source_object);
- CcEmpathyAccountsPanel *panel = CC_EMPATHY_ACCOUNTS_PANEL (user_data);
- GError *error = NULL;
-
- if (!tp_account_manager_prepare_finish (account_mgr, result, &error))
- {
- g_warning ("Failed to prepare account manager: %s", error->message);
- g_error_free (error);
- return;
- }
-
- if (empathy_accounts_has_non_salut_accounts (account_mgr))
- {
- panel_pack_with_accounts_dialog (panel);
-
- /* remove ref from active_changed() */
- g_object_unref (account_mgr);
- }
- else
- {
- EmpathyConnectionManagers *cm_mgr;
-
- cm_mgr = empathy_connection_managers_dup_singleton ();
-
- g_object_set_data_full (G_OBJECT (cm_mgr), "account-manager",
- g_object_ref (account_mgr), (GDestroyNotify) g_object_unref);
-
- empathy_connection_managers_prepare_async (cm_mgr,
- connection_managers_prepare, panel);
- }
-}
-
-static void
-cc_empathy_accounts_panel_finalize (GObject *object)
-{
- CcEmpathyAccountsPanel *panel;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (CC_IS_EMPATHY_ACCOUNTS_PANEL (object));
-
- panel = CC_EMPATHY_ACCOUNTS_PANEL (object);
-
- g_return_if_fail (panel->priv != NULL);
-
- gtk_widget_destroy (panel->priv->accounts_window);
-
- if (panel->priv->assistant != NULL)
- gtk_widget_destroy (panel->priv->assistant);
-
- G_OBJECT_CLASS (cc_empathy_accounts_panel_parent_class)->finalize (object);
-}
-
-static void
-cc_empathy_accounts_panel_class_init (CcEmpathyAccountsPanelClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- object_class->finalize = cc_empathy_accounts_panel_finalize;
-
- g_type_class_add_private (klass, sizeof (CcEmpathyAccountsPanelPrivate));
-}
-
-static void
-cc_empathy_accounts_panel_class_finalize (CcEmpathyAccountsPanelClass *klass)
-{
-}
-
-static void
-cc_empathy_accounts_panel_init (CcEmpathyAccountsPanel *panel)
-{
- TpAccountManager *account_manager;
-
- panel->priv = CC_EMPATHY_ACCOUNTS_PANEL_GET_PRIVATE (panel);
-
- /* create a container widget immediately, and pack it into the panel,
- * because the CC library expects a children to exist after
- * the object is constructed.
- */
- panel->priv->container = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
- gtk_widget_show (panel->priv->container);
- gtk_container_add (GTK_CONTAINER (panel), panel->priv->container);
-
- empathy_gtk_init ();
-
- /* unref'd in final endpoint callbacks */
- account_manager = tp_account_manager_dup ();
-
- tp_account_manager_prepare_async (account_manager, NULL,
- account_manager_ready_for_accounts_cb, panel);
-}
-
-void
-cc_empathy_accounts_panel_register (GIOModule *module)
-{
- /* Setup gettext */
- bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
-
- cc_empathy_accounts_panel_register_type (G_TYPE_MODULE (module));
- g_io_extension_point_implement (CC_SHELL_PANEL_EXTENSION_POINT,
- CC_TYPE_EMPATHY_ACCOUNTS_PANEL, "empathy-accounts", 10);
-}
diff --git a/src/cc-empathy-accounts-panel.h b/src/cc-empathy-accounts-panel.h
deleted file mode 100644
index cd51b69c1..000000000
--- a/src/cc-empathy-accounts-panel.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
- *
- * Copyright (C) 2010 Collabora Ltd.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Authors: Travis Reitter <travis.reitter@collabora.co.uk>
- */
-
-#ifndef __CC_EMPATHY_ACCOUNTS_PANEL_H
-#define __CC_EMPATHY_ACCOUNTS_PANEL_H
-
-#include <gtk/gtk.h>
-#include <libgnome-control-center/cc-panel.h>
-
-G_BEGIN_DECLS
-
-#define CC_TYPE_EMPATHY_ACCOUNTS_PANEL (cc_empathy_accounts_panel_get_type ())
-#define CC_EMPATHY_ACCOUNTS_PANEL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), CC_TYPE_EMPATHY_ACCOUNTS_PANEL, CcEmpathyAccountsPanel))
-#define CC_EMPATHY_ACCOUNTS_PANEL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), CC_TYPE_EMPATHY_ACCOUNTS_PANEL, CcEmpathyAccountsPanelClass))
-#define CC_IS_EMPATHY_ACCOUNTS_PANEL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), CC_TYPE_EMPATHY_ACCOUNTS_PANEL))
-#define CC_IS_EMPATHY_ACCOUNTS_PANEL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), CC_TYPE_EMPATHY_ACCOUNTS_PANEL))
-#define CC_EMPATHY_ACCOUNTS_PANEL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), CC_TYPE_EMPATHY_ACCOUNTS_PANEL, CcEmpathyAccountsPanelClass))
-
-typedef struct CcEmpathyAccountsPanelPrivate CcEmpathyAccountsPanelPrivate;
-
-typedef struct
-{
- CcPanel parent;
- CcEmpathyAccountsPanelPrivate *priv;
-} CcEmpathyAccountsPanel;
-
-typedef struct
-{
- CcPanelClass parent_class;
-} CcEmpathyAccountsPanelClass;
-
-GType cc_empathy_accounts_panel_get_type (void);
-void cc_empathy_accounts_panel_register (GIOModule *module);
-
-G_END_DECLS
-
-#endif /* __CC_EMPATHY_ACCOUNTS_PANEL_H */
diff --git a/src/empathy-about-dialog.c b/src/empathy-about-dialog.c
index 1a66fb2b9..04b2753b6 100644
--- a/src/empathy-about-dialog.c
+++ b/src/empathy-about-dialog.c
@@ -107,7 +107,7 @@ empathy_about_dialog_new (GtkWindow *parent)
"comments", _("An Instant Messaging client for GNOME"),
"license", license_trans,
"wrap-license", TRUE,
- "copyright", "Imendio AB 2002-2007\nCollabora Ltd 2007-2010",
+ "copyright", "Imendio AB 2002-2007\nCollabora Ltd 2007-2011",
"documenters", documenters,
"logo-icon-name", "empathy",
"translator-credits", _("translator-credits"),
diff --git a/src/empathy-account-assistant.c b/src/empathy-account-assistant.c
index 1b39000cd..efd6dc184 100644
--- a/src/empathy-account-assistant.c
+++ b/src/empathy-account-assistant.c
@@ -1161,7 +1161,7 @@ account_mgr_prepare_cb (GObject *source_object,
TpAccountManager *manager = TP_ACCOUNT_MANAGER (source_object);
GError *error = NULL;
- if (!tp_account_manager_prepare_finish (manager, result, &error))
+ if (!tp_proxy_prepare_finish (manager, result, &error))
{
DEBUG ("Failed to prepare account manager: %s", error->message);
g_error_free (error);
@@ -1277,7 +1277,7 @@ do_constructed (GObject *object)
priv->salut_page = page;
priv->display_salut_page = TRUE;
- tp_account_manager_prepare_async (priv->account_mgr, NULL,
+ tp_proxy_prepare_async (priv->account_mgr, NULL,
account_mgr_prepare_cb, self);
gtk_window_set_resizable (GTK_WINDOW (self), FALSE);
diff --git a/src/empathy-accounts-common.c b/src/empathy-accounts-common.c
index 8932fdbbc..a08a1ef77 100644
--- a/src/empathy-accounts-common.c
+++ b/src/empathy-accounts-common.c
@@ -132,12 +132,14 @@ out:
void
empathy_accounts_show_accounts_ui (TpAccountManager *manager,
TpAccount *account,
+ gboolean assistant,
GCallback window_destroyed_cb)
{
g_return_if_fail (TP_IS_ACCOUNT_MANAGER (manager));
g_return_if_fail (!account || TP_IS_ACCOUNT (account));
- if (empathy_accounts_has_non_salut_accounts (manager))
+ if ((empathy_accounts_has_non_salut_accounts (manager) && !assistant) ||
+ account != NULL)
{
do_show_accounts_ui (manager, account, window_destroyed_cb);
}
diff --git a/src/empathy-accounts-common.h b/src/empathy-accounts-common.h
index c7f36661b..002d78323 100644
--- a/src/empathy-accounts-common.h
+++ b/src/empathy-accounts-common.h
@@ -28,6 +28,7 @@ gboolean empathy_accounts_has_accounts (TpAccountManager *manager);
void empathy_accounts_show_accounts_ui (TpAccountManager *manager,
TpAccount *account,
+ gboolean assistant,
GCallback window_destroyed_cb);
#endif /* __EMPATHY_ACCOUNTS_COMMON_H__ */
diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c
index 0eeec826c..ccda20079 100644
--- a/src/empathy-accounts-dialog.c
+++ b/src/empathy-accounts-dialog.c
@@ -1887,7 +1887,7 @@ account_prepare_cb (GObject *source_object,
TpAccount *account = TP_ACCOUNT (source_object);
GError *error = NULL;
- if (!tp_account_prepare_finish (account, result, &error))
+ if (!tp_proxy_prepare_finish (account, result, &error))
{
DEBUG ("Failed to prepare account: %s", error->message);
g_error_free (error);
@@ -1903,7 +1903,7 @@ accounts_dialog_account_validity_changed_cb (TpAccountManager *manager,
gboolean valid,
EmpathyAccountsDialog *dialog)
{
- tp_account_prepare_async (account, NULL, account_prepare_cb, dialog);
+ tp_proxy_prepare_async (account, NULL, account_prepare_cb, dialog);
}
static void
@@ -2118,7 +2118,7 @@ accounts_dialog_manager_ready_cb (GObject *source_object,
TpAccountManager *manager = TP_ACCOUNT_MANAGER (source_object);
GError *error = NULL;
- if (!tp_account_manager_prepare_finish (manager, result, &error))
+ if (!tp_proxy_prepare_finish (manager, result, &error))
{
DEBUG ("Failed to prepare account manager: %s", error->message);
g_error_free (error);
@@ -2444,7 +2444,7 @@ do_constructed (GObject *object)
/* Set up signalling */
priv->account_manager = tp_account_manager_dup ();
- tp_account_manager_prepare_async (priv->account_manager, NULL,
+ tp_proxy_prepare_async (priv->account_manager, NULL,
accounts_dialog_manager_ready_cb, dialog);
priv->connectivity = empathy_connectivity_dup_singleton ();
diff --git a/src/empathy-accounts-dialog.ui b/src/empathy-accounts-dialog.ui
index fd8c75c15..4a1b8bbb3 100644
--- a/src/empathy-accounts-dialog.ui
+++ b/src/empathy-accounts-dialog.ui
@@ -254,29 +254,6 @@
<property name="position">1</property>
</packing>
</child>
- <child type="tab">
- <object class="GtkLabel" id="label2">
- <property name="visible">True</property>
- <property name="label">page 2</property>
- </object>
- <packing>
- <property name="position">1</property>
- <property name="tab_fill">False</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- <child type="tab">
- <object class="GtkLabel" id="label3">
- <property name="visible">True</property>
- <property name="label">page 3</property>
- </object>
- <packing>
- <property name="position">2</property>
- <property name="tab_fill">False</property>
- </packing>
- </child>
</object>
<packing>
<property name="position">1</property>
diff --git a/src/empathy-accounts-module.c b/src/empathy-accounts-module.c
deleted file mode 100644
index aedded62c..000000000
--- a/src/empathy-accounts-module.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
- *
- * Copyright (C) 2010 Collabora Ltd.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Authors: Travis Reitter <travis.reitter@collabora.co.uk>
- */
-
-#include <config.h>
-
-#include <glib.h>
-#include <glib/gi18n-lib.h>
-#include <gmodule.h>
-#include <gio/gio.h>
-
-#include "cc-empathy-accounts-panel.h"
-
-void
-g_io_module_load (GIOModule *module)
-{
- cc_empathy_accounts_panel_register (module);
-}
-
-void
-g_io_module_unload (GIOModule *module)
-{
-}
diff --git a/src/empathy-accounts.c b/src/empathy-accounts.c
index 78398c3ee..3cad96744 100644
--- a/src/empathy-accounts.c
+++ b/src/empathy-accounts.c
@@ -55,6 +55,7 @@ static gboolean only_if_needed = FALSE;
static gboolean hidden = FALSE;
static gchar *selected_account_name = NULL;
static gboolean account_manager_prepared = FALSE;
+static gboolean assistant = FALSE;
static void
account_prepare_cb (GObject *source_object,
@@ -65,7 +66,7 @@ account_prepare_cb (GObject *source_object,
TpAccount *account = TP_ACCOUNT (source_object);
GError *error = NULL;
- if (!tp_account_prepare_finish (account, result, &error))
+ if (!tp_proxy_prepare_finish (account, result, &error))
{
DEBUG ("Failed to prepare account: %s", error->message);
g_error_free (error);
@@ -73,7 +74,7 @@ account_prepare_cb (GObject *source_object,
account = NULL;
}
- empathy_accounts_show_accounts_ui (manager, account,
+ empathy_accounts_show_accounts_ui (manager, account, assistant,
G_CALLBACK (gtk_main_quit));
}
@@ -84,7 +85,7 @@ maybe_show_accounts_ui (TpAccountManager *manager)
(only_if_needed && empathy_accounts_has_non_salut_accounts (manager)))
gtk_main_quit ();
else
- empathy_accounts_show_accounts_ui (manager, NULL, gtk_main_quit);
+ empathy_accounts_show_accounts_ui (manager, NULL, assistant, gtk_main_quit);
}
static void
@@ -95,7 +96,7 @@ account_manager_ready_for_accounts_cb (GObject *source_object,
TpAccountManager *manager = TP_ACCOUNT_MANAGER (source_object);
GError *error = NULL;
- if (!tp_account_manager_prepare_finish (manager, result, &error))
+ if (!tp_proxy_prepare_finish (manager, result, &error))
{
DEBUG ("Failed to prepare account manager: %s", error->message);
g_clear_error (&error);
@@ -121,7 +122,7 @@ account_manager_ready_for_accounts_cb (GObject *source_object,
bus = tp_dbus_daemon_dup (NULL);
if ((account = tp_account_new (bus, account_path, &error)))
{
- tp_account_prepare_async (account, NULL, account_prepare_cb, manager);
+ tp_proxy_prepare_async (account, NULL, account_prepare_cb, manager);
g_object_unref (bus);
return;
}
@@ -156,7 +157,7 @@ app_command_line_cb (GApplication *app,
TpAccountManager *account_manager;
account_manager = tp_account_manager_dup ();
- empathy_accounts_show_accounts_ui (account_manager, NULL,
+ empathy_accounts_show_accounts_ui (account_manager, NULL, assistant,
G_CALLBACK (gtk_main_quit));
g_object_unref (account_manager);
@@ -191,6 +192,10 @@ local_cmdline (GApplication *app,
N_("Initially select given account (eg, "
"gabble/jabber/foo_40example_2eorg0)"),
N_("<account-id>") },
+ { "assistant", 'a',
+ 0, G_OPTION_ARG_NONE, &assistant,
+ N_("Show account assistant"),
+ NULL },
{ NULL }
};
@@ -248,7 +253,7 @@ main (int argc, char *argv[])
account_manager = tp_account_manager_dup ();
- tp_account_manager_prepare_async (account_manager, NULL,
+ tp_proxy_prepare_async (account_manager, NULL,
account_manager_ready_for_accounts_cb, NULL);
g_signal_connect (app, "command-line", G_CALLBACK (app_command_line_cb),
diff --git a/src/empathy-audio-src.c b/src/empathy-audio-src.c
index 203082dce..916f3cd98 100644
--- a/src/empathy-audio-src.c
+++ b/src/empathy-audio-src.c
@@ -27,7 +27,6 @@
#include "empathy-audio-src.h"
-#include "src-marshal.h"
#include "empathy-mic-monitor.h"
#define DEBUG_FLAG EMPATHY_DEBUG_VOIP
@@ -92,6 +91,21 @@ empathy_audio_src_supports_changing_mic (EmpathyGstAudioSrc *self)
"source-output-index") != NULL);
}
+static guint
+empathy_audio_src_get_mic_index (EmpathyGstAudioSrc *self)
+{
+ EmpathyGstAudioSrcPrivate *priv = EMPATHY_GST_AUDIO_SRC_GET_PRIVATE (self);
+ guint audio_src_idx = PA_INVALID_INDEX;
+
+ if (empathy_audio_src_supports_changing_mic (self))
+ g_object_get (priv->src,
+ "source-output-index", &audio_src_idx,
+ NULL);
+
+ return audio_src_idx;
+}
+
+
static void
empathy_audio_src_microphone_changed_cb (EmpathyMicMonitor *monitor,
guint source_output_idx,
@@ -100,9 +114,9 @@ empathy_audio_src_microphone_changed_cb (EmpathyMicMonitor *monitor,
{
EmpathyGstAudioSrc *self = user_data;
EmpathyGstAudioSrcPrivate *priv = EMPATHY_GST_AUDIO_SRC_GET_PRIVATE (self);
- guint audio_src_idx = PA_INVALID_INDEX;
+ guint audio_src_idx;
- g_object_get (priv->src, "source-output-index", &audio_src_idx, NULL);
+ audio_src_idx = empathy_audio_src_get_mic_index (self);
if (source_output_idx == PA_INVALID_INDEX
|| source_output_idx != audio_src_idx)
@@ -148,9 +162,9 @@ empathy_audio_src_source_output_index_notify (GObject *object,
EmpathyGstAudioSrc *self)
{
EmpathyGstAudioSrcPrivate *priv = EMPATHY_GST_AUDIO_SRC_GET_PRIVATE (self);
- guint source_output_idx = PA_INVALID_INDEX;
+ guint source_output_idx;
- g_object_get (priv->src, "source-output-index", &source_output_idx, NULL);
+ source_output_idx = empathy_audio_src_get_mic_index (self);
if (source_output_idx == PA_INVALID_INDEX)
return;
@@ -336,7 +350,7 @@ empathy_audio_src_class_init (EmpathyGstAudioSrcClass
G_SIGNAL_RUN_LAST,
0,
NULL, NULL,
- g_cclosure_marshal_VOID__DOUBLE,
+ g_cclosure_marshal_generic,
G_TYPE_NONE, 1, G_TYPE_DOUBLE);
param_spec = g_param_spec_double ("rms-level", "RMS level", "RMS level",
@@ -349,7 +363,7 @@ empathy_audio_src_class_init (EmpathyGstAudioSrcClass
G_SIGNAL_RUN_LAST,
0,
NULL, NULL,
- g_cclosure_marshal_VOID__DOUBLE,
+ g_cclosure_marshal_generic,
G_TYPE_NONE, 1, G_TYPE_DOUBLE);
}
@@ -562,7 +576,7 @@ empathy_audio_src_change_microphone_async (EmpathyGstAudioSrc *src,
return;
}
- g_object_get (priv->src, "source-output-index", &source_output_idx, NULL);
+ source_output_idx = empathy_audio_src_get_mic_index (src);
if (source_output_idx == PA_INVALID_INDEX)
{
diff --git a/src/empathy-call-factory.c b/src/empathy-call-factory.c
index 9f3fe16ec..b3c85f4b0 100644
--- a/src/empathy-call-factory.c
+++ b/src/empathy-call-factory.c
@@ -29,69 +29,66 @@
#include <telepathy-yell/telepathy-yell.h>
+#include <libempathy/empathy-client-factory.h>
#include <libempathy/empathy-request-util.h>
#include <libempathy/empathy-tp-contact-factory.h>
#include <libempathy/empathy-utils.h>
#include "empathy-call-factory.h"
#include "empathy-call-handler.h"
-#include "src-marshal.h"
#define DEBUG_FLAG EMPATHY_DEBUG_VOIP
#include <libempathy/empathy-debug.h>
-G_DEFINE_TYPE(EmpathyCallFactory, empathy_call_factory, G_TYPE_OBJECT)
+G_DEFINE_TYPE(EmpathyCallFactory, empathy_call_factory, TP_TYPE_BASE_CLIENT)
-static void handle_channels_cb (TpSimpleHandler *handler,
+static void handle_channels (TpBaseClient *client,
TpAccount *account,
TpConnection *connection,
GList *channels,
GList *requests_satisfied,
gint64 user_action_time,
- TpHandleChannelsContext *context,
- gpointer user_data);
+ TpHandleChannelsContext *context);
+
+static void approve_channels (TpBaseClient *client,
+ TpAccount *account,
+ TpConnection *connection,
+ GList *channels,
+ TpChannelDispatchOperation *dispatch_operation,
+ TpAddDispatchOperationContext *context);
/* signal enum */
enum
{
NEW_CALL_HANDLER,
+ INCOMING_CALL,
LAST_SIGNAL
};
static guint signals[LAST_SIGNAL] = {0};
-/* private structure */
-typedef struct {
- TpBaseClient *handler;
- gboolean dispose_has_run;
-} EmpathyCallFactoryPriv;
-
-#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyCallFactory)
-
static GObject *call_factory = NULL;
static void
empathy_call_factory_init (EmpathyCallFactory *obj)
{
- EmpathyCallFactoryPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (obj,
- EMPATHY_TYPE_CALL_FACTORY, EmpathyCallFactoryPriv);
- TpAccountManager *am;
-
- obj->priv = priv;
-
- am = tp_account_manager_dup ();
+ TpBaseClient *client = (TpBaseClient *) obj;
- priv->handler = tp_simple_handler_new_with_am (am, FALSE, FALSE,
- EMPATHY_CALL_BUS_NAME_SUFFIX, FALSE, handle_channels_cb, obj, NULL);
+ tp_base_client_take_approver_filter (client, tp_asv_new (
+ TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,
+ TPY_IFACE_CHANNEL_TYPE_CALL,
+ TP_PROP_CHANNEL_TARGET_HANDLE_TYPE,
+ G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT,
+ NULL));
- tp_base_client_take_handler_filter (priv->handler, tp_asv_new (
+ tp_base_client_take_handler_filter (client, tp_asv_new (
TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,
TPY_IFACE_CHANNEL_TYPE_CALL,
TP_PROP_CHANNEL_TARGET_HANDLE_TYPE,
G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT,
NULL));
- tp_base_client_take_handler_filter (priv->handler, tp_asv_new (
+ tp_base_client_take_handler_filter (client, tp_asv_new (
TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,
TPY_IFACE_CHANNEL_TYPE_CALL,
TP_PROP_CHANNEL_TARGET_HANDLE_TYPE,
@@ -99,7 +96,7 @@ empathy_call_factory_init (EmpathyCallFactory *obj)
TPY_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO, G_TYPE_BOOLEAN, TRUE,
NULL));
- tp_base_client_take_handler_filter (priv->handler, tp_asv_new (
+ tp_base_client_take_handler_filter (client, tp_asv_new (
TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,
TPY_IFACE_CHANNEL_TYPE_CALL,
TP_PROP_CHANNEL_TARGET_HANDLE_TYPE,
@@ -107,13 +104,11 @@ empathy_call_factory_init (EmpathyCallFactory *obj)
TPY_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO, G_TYPE_BOOLEAN, TRUE,
NULL));
- tp_base_client_add_handler_capabilities_varargs (priv->handler,
+ tp_base_client_add_handler_capabilities_varargs (client,
"org.freedesktop.Telepathy.Channel.Interface.MediaSignalling/ice-udp",
"org.freedesktop.Telepathy.Channel.Interface.MediaSignalling/gtalk-p2p",
"org.freedesktop.Telepathy.Channel.Interface.MediaSignalling/video/h264",
NULL);
-
- g_object_unref (am);
}
static GObject *
@@ -130,59 +125,59 @@ empathy_call_factory_constructor (GType type, guint n_construct_params,
}
static void
-empathy_call_factory_finalize (GObject *object)
-{
- /* free any data held directly by the object here */
-
- if (G_OBJECT_CLASS (empathy_call_factory_parent_class)->finalize)
- G_OBJECT_CLASS (empathy_call_factory_parent_class)->finalize (object);
-}
-
-static void
-empathy_call_factory_dispose (GObject *object)
-{
- EmpathyCallFactoryPriv *priv = GET_PRIV (object);
-
- if (priv->dispose_has_run)
- return;
-
- priv->dispose_has_run = TRUE;
-
- tp_clear_object (&priv->handler);
-
- if (G_OBJECT_CLASS (empathy_call_factory_parent_class)->dispose)
- G_OBJECT_CLASS (empathy_call_factory_parent_class)->dispose (object);
-}
-
-static void
-empathy_call_factory_class_init (
- EmpathyCallFactoryClass *empathy_call_factory_class)
+empathy_call_factory_class_init (EmpathyCallFactoryClass *klass)
{
- GObjectClass *object_class = G_OBJECT_CLASS (empathy_call_factory_class);
-
- g_type_class_add_private (empathy_call_factory_class,
- sizeof (EmpathyCallFactoryPriv));
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ TpBaseClientClass *base_clt_cls = TP_BASE_CLIENT_CLASS (klass);
object_class->constructor = empathy_call_factory_constructor;
- object_class->dispose = empathy_call_factory_dispose;
- object_class->finalize = empathy_call_factory_finalize;
+
+ base_clt_cls->handle_channels = handle_channels;
+ base_clt_cls->add_dispatch_operation = approve_channels;
signals[NEW_CALL_HANDLER] =
g_signal_new ("new-call-handler",
- G_TYPE_FROM_CLASS (empathy_call_factory_class),
+ G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, 0,
NULL, NULL,
- _src_marshal_VOID__OBJECT_BOOLEAN,
+ g_cclosure_marshal_generic,
G_TYPE_NONE,
2, EMPATHY_TYPE_CALL_HANDLER, G_TYPE_BOOLEAN);
+
+ signals[INCOMING_CALL] =
+ g_signal_new ("incoming-call",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST, 0,
+ NULL, NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN,
+ 4, G_TYPE_UINT, TPY_TYPE_CALL_CHANNEL,
+ TP_TYPE_CHANNEL_DISPATCH_OPERATION,
+ TP_TYPE_ADD_DISPATCH_OPERATION_CONTEXT);
}
EmpathyCallFactory *
empathy_call_factory_initialise (void)
{
+ EmpathyCallFactory *self;
+ EmpathyClientFactory *factory;
+ TpAccountManager *am;
+
g_return_val_if_fail (call_factory == NULL, NULL);
- return EMPATHY_CALL_FACTORY (g_object_new (EMPATHY_TYPE_CALL_FACTORY, NULL));
+ am = tp_account_manager_dup ();
+ factory = empathy_client_factory_dup ();
+
+ self = EMPATHY_CALL_FACTORY (g_object_new (EMPATHY_TYPE_CALL_FACTORY,
+ "account-manager", am,
+ "factory", factory,
+ "name", EMPATHY_CALL_BUS_NAME_SUFFIX,
+ NULL));
+
+ g_object_unref (am);
+ g_object_unref (factory);
+
+ return self;
}
EmpathyCallFactory *
@@ -254,16 +249,15 @@ call_channel_ready_cb (TpyCallChannel *call,
static void
-handle_channels_cb (TpSimpleHandler *handler,
+handle_channels (TpBaseClient *client,
TpAccount *account,
TpConnection *connection,
GList *channels,
GList *requests_satisfied,
gint64 user_action_time,
- TpHandleChannelsContext *context,
- gpointer user_data)
+ TpHandleChannelsContext *context)
{
- EmpathyCallFactory *self = user_data;
+ EmpathyCallFactory *self = EMPATHY_CALL_FACTORY (client);
GList *l;
for (l = channels; l != NULL; l = g_list_next (l))
@@ -298,11 +292,80 @@ handle_channels_cb (TpSimpleHandler *handler,
tp_handle_channels_context_accept (context);
}
+static TpyCallChannel *
+find_call_channel (GList *channels)
+{
+ GList *l;
+
+ for (l = channels; l != NULL; l = g_list_next (l))
+ {
+ TpChannel *channel = l->data;
+ GQuark channel_type;
+
+ if (tp_proxy_get_invalidated (channel) != NULL)
+ continue;
+
+ channel_type = tp_channel_get_channel_type_id (channel);
+
+ if (channel_type == TPY_IFACE_QUARK_CHANNEL_TYPE_CALL)
+ return TPY_CALL_CHANNEL (channel);
+ }
+
+ return NULL;
+}
+
+static void
+approve_channels (TpBaseClient *client,
+ TpAccount *account,
+ TpConnection *connection,
+ GList *channels,
+ TpChannelDispatchOperation *dispatch_operation,
+ TpAddDispatchOperationContext *context)
+{
+ EmpathyCallFactory *self = EMPATHY_CALL_FACTORY (client);
+ TpyCallChannel *channel;
+ guint handle;
+ GError error = { TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, "" };
+ gboolean handled = FALSE;
+
+ channel = find_call_channel (channels);
+
+ if (channel == NULL)
+ {
+ DEBUG ("Failed to find the main channel; ignoring");
+ error.message = "Unknown channel";
+ goto out;
+ }
+
+ handle = tp_channel_get_handle (TP_CHANNEL (channel), NULL);
+
+ if (handle == 0)
+ {
+ DEBUG ("Unknown handle, ignoring");
+ error.code = TP_ERROR_INVALID_HANDLE;
+ error.message = "Unknown handle";
+ goto out;
+ }
+
+ g_signal_emit (self, signals[INCOMING_CALL], 0,
+ handle, channel, dispatch_operation, context,
+ &handled);
+
+ if (handled)
+ return;
+
+ /* There was no call window so the context wasn't handled. */
+ DEBUG ("Call with a contact for which there's no existing "
+ "call window, ignoring");
+ error.message = "No call window with this contact";
+
+ out:
+ tp_add_dispatch_operation_context_fail (context, &error);
+}
+
gboolean
empathy_call_factory_register (EmpathyCallFactory *self,
GError **error)
{
- EmpathyCallFactoryPriv *priv = GET_PRIV (self);
-
- return tp_base_client_register (priv->handler, error);
+ return tp_base_client_register (TP_BASE_CLIENT (self), error);
}
diff --git a/src/empathy-call-factory.h b/src/empathy-call-factory.h
index 0e5276278..174fbf4bd 100644
--- a/src/empathy-call-factory.h
+++ b/src/empathy-call-factory.h
@@ -29,12 +29,11 @@ typedef struct _EmpathyCallFactory EmpathyCallFactory;
typedef struct _EmpathyCallFactoryClass EmpathyCallFactoryClass;
struct _EmpathyCallFactoryClass {
- GObjectClass parent_class;
+ TpBaseClientClass parent_class;
};
struct _EmpathyCallFactory {
- GObject parent;
- gpointer priv;
+ TpBaseClient parent;
};
GType empathy_call_factory_get_type (void);
diff --git a/src/empathy-call-handler.c b/src/empathy-call-handler.c
index cf93a1de3..9fe89337d 100644
--- a/src/empathy-call-handler.c
+++ b/src/empathy-call-handler.c
@@ -36,7 +36,6 @@
#include <libempathy-gtk/empathy-call-utils.h>
#include "empathy-call-handler.h"
-#include "src-marshal.h"
#define DEBUG_FLAG EMPATHY_DEBUG_VOIP
#include <libempathy/empathy-debug.h>
@@ -457,55 +456,55 @@ empathy_call_handler_class_init (EmpathyCallHandlerClass *klass)
signals[CONFERENCE_ADDED] =
g_signal_new ("conference-added", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, 0, NULL, NULL,
- g_cclosure_marshal_VOID__OBJECT,
+ g_cclosure_marshal_generic,
G_TYPE_NONE,
1, FS_TYPE_CONFERENCE);
signals[CONFERENCE_REMOVED] =
g_signal_new ("conference-removed", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, 0, NULL, NULL,
- g_cclosure_marshal_VOID__OBJECT,
+ g_cclosure_marshal_generic,
G_TYPE_NONE,
1, FS_TYPE_CONFERENCE);
signals[SRC_PAD_ADDED] =
g_signal_new ("src-pad-added", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, 0, NULL, NULL,
- _src_marshal_BOOLEAN__OBJECT_UINT,
+ g_cclosure_marshal_generic,
G_TYPE_BOOLEAN,
2, GST_TYPE_PAD, G_TYPE_UINT);
signals[SINK_PAD_ADDED] =
g_signal_new ("sink-pad-added", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, 0, NULL, NULL,
- _src_marshal_BOOLEAN__OBJECT_UINT,
+ g_cclosure_marshal_generic,
G_TYPE_BOOLEAN,
2, GST_TYPE_PAD, G_TYPE_UINT);
signals[SINK_PAD_REMOVED] =
g_signal_new ("sink-pad-removed", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, 0, NULL, NULL,
- _src_marshal_BOOLEAN__OBJECT_UINT,
+ g_cclosure_marshal_generic,
G_TYPE_BOOLEAN,
2, GST_TYPE_PAD, G_TYPE_UINT);
signals[CLOSED] =
g_signal_new ("closed", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, 0, NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
+ g_cclosure_marshal_generic,
G_TYPE_NONE,
0);
signals[CANDIDATES_CHANGED] =
g_signal_new ("candidates-changed", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, 0, NULL, NULL,
- g_cclosure_marshal_VOID__UINT,
+ g_cclosure_marshal_generic,
G_TYPE_NONE, 1, G_TYPE_UINT);
signals[STATE_CHANGED] =
g_signal_new ("state-changed", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, 0, NULL, NULL,
- g_cclosure_marshal_VOID__UINT,
+ g_cclosure_marshal_generic,
G_TYPE_NONE, 1, G_TYPE_UINT);
}
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index ccec9f628..2a92e9471 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -43,6 +43,7 @@
#include <libempathy/empathy-camera-monitor.h>
#include <libempathy/empathy-gsettings.h>
#include <libempathy/empathy-tp-contact-factory.h>
+#include <libempathy/empathy-request-util.h>
#include <libempathy/empathy-utils.h>
#include <libempathy-gtk/empathy-avatar-image.h>
@@ -103,11 +104,12 @@ enum {
};
typedef enum {
- CONNECTING,
- CONNECTED,
- HELD,
- DISCONNECTED,
- REDIALING
+ RINGING, /* Incoming call */
+ CONNECTING, /* Outgoing call */
+ CONNECTED, /* Connected */
+ HELD, /* Connected, but on hold */
+ DISCONNECTED, /* Disconnected */
+ REDIALING /* Redialing (special case of CONNECTING) */
} CallState;
typedef enum {
@@ -152,6 +154,8 @@ struct _EmpathyCallWindowPriv
ClutterActor *preview_rectangle_box2;
ClutterActor *preview_rectangle_box3;
ClutterActor *preview_rectangle_box4;
+ ClutterActor *preview_spinner_actor;
+ GtkWidget *preview_spinner_widget;
GtkWidget *video_container;
GtkWidget *remote_user_avatar_widget;
GtkWidget *remote_user_avatar_toolbar;
@@ -184,11 +188,22 @@ struct _EmpathyCallWindowPriv
easilly repack everything when toggling fullscreen */
GtkWidget *content_hbox;
+ /* These are used to accept or reject an incoming call when the status
+ is RINGING. */
+ GtkWidget *incoming_call_dialog;
+ TpyCallChannel *pending_channel;
+ TpChannelDispatchOperation *pending_cdo;
+ TpAddDispatchOperationContext *pending_context;
+
gulong video_output_motion_handler_id;
guint bus_message_source_id;
gdouble volume;
+ /* String that contains the queued tones to send after the current ones
+ are sent */
+ GString *tones;
+ gboolean sending_tones;
GtkWidget *dtmf_panel;
/* Details vbox */
@@ -293,6 +308,8 @@ static gboolean empathy_call_window_video_output_motion_notify (
static void empathy_call_window_video_menu_popup (EmpathyCallWindow *window,
guint button);
+static void empathy_call_window_connect_handler (EmpathyCallWindow *self);
+
static void empathy_call_window_dialpad_cb (GtkToggleToolButton *button,
EmpathyCallWindow *window);
@@ -335,35 +352,72 @@ empathy_call_window_video_call_cb (GtkToggleToolButton *button,
}
static void
-dtmf_button_pressed_cb (GtkButton *button, EmpathyCallWindow *window)
+empathy_call_window_emit_tones (EmpathyCallWindow *self)
{
- EmpathyCallWindowPriv *priv = GET_PRIV (window);
- TpyCallChannel *call;
+ TpChannel *channel;
+
+ if (tp_str_empty (self->priv->tones->str))
+ return;
+
+ g_object_get (self->priv->handler, "call-channel", &channel, NULL);
+
+ DEBUG ("Emitting multiple tones: %s", self->priv->tones->str);
+
+ tp_cli_channel_interface_dtmf_call_multiple_tones (channel, -1,
+ self->priv->tones->str,
+ NULL, NULL, NULL, NULL);
+
+ self->priv->sending_tones = TRUE;
+
+ g_string_set_size (self->priv->tones, 0);
+
+ g_object_unref (channel);
+}
+
+static void
+empathy_call_window_maybe_emit_tones (EmpathyCallWindow *self)
+{
+ if (self->priv->sending_tones)
+ return;
+
+ empathy_call_window_emit_tones (self);
+}
+
+static void
+empathy_call_window_tones_stopped_cb (TpChannel *proxy,
+ gboolean arg_cancelled,
+ gpointer user_data,
+ GObject *weak_object)
+{
+ EmpathyCallWindow *self = EMPATHY_CALL_WINDOW (user_data);
+
+ self->priv->sending_tones = FALSE;
+
+ empathy_call_window_emit_tones (self);
+}
+
+static void
+dtmf_button_pressed_cb (GtkButton *button,
+ EmpathyCallWindow *self)
+{
+ EmpathyCallWindowPriv *priv = GET_PRIV (self);
GQuark button_quark;
TpDTMFEvent event;
- g_object_get (priv->handler, "call-channel", &call, NULL);
-
button_quark = g_quark_from_static_string (EMPATHY_DTMF_BUTTON_ID);
event = GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (button),
button_quark));
- tpy_call_channel_dtmf_start_tone (call, event);
+ g_string_append_c (priv->tones, tp_dtmf_event_to_char (event));
- g_object_unref (call);
+ empathy_call_window_maybe_emit_tones (self);
}
+/* empathy_create_dtmf_dialpad() requires a callback, even if empty */
static void
-dtmf_button_released_cb (GtkButton *button, EmpathyCallWindow *window)
+dtmf_button_released_cb (GtkButton *button,
+ EmpathyCallWindow *self)
{
- EmpathyCallWindowPriv *priv = GET_PRIV (window);
- TpyCallChannel *call;
-
- g_object_get (priv->handler, "call-channel", &call, NULL);
-
- tpy_call_channel_dtmf_stop_tone (call);
-
- g_object_unref (call);
}
static void
@@ -700,6 +754,55 @@ empathy_call_window_show_preview_rectangles (EmpathyCallWindow *self,
g_object_set (self->priv->preview_rectangle4, "visible", show, NULL);
}
+static void
+empathy_call_window_get_preview_coordinates (EmpathyCallWindow *self,
+ PreviewPosition pos,
+ guint *x,
+ guint *y)
+{
+ guint ret_x = 0, ret_y = 0;
+ ClutterGeometry box;
+
+ if (!clutter_actor_has_allocation (self->priv->video_box))
+ goto out;
+
+ clutter_actor_get_geometry (self->priv->video_box, &box);
+
+ switch (pos)
+ {
+ case PREVIEW_POS_TOP_LEFT:
+ ret_x = ret_y = SELF_VIDEO_SECTION_MARGIN;
+ break;
+ case PREVIEW_POS_TOP_RIGHT:
+ ret_x = box.width - SELF_VIDEO_SECTION_MARGIN
+ - SELF_VIDEO_SECTION_WIDTH;
+ ret_y = SELF_VIDEO_SECTION_MARGIN;
+ break;
+ case PREVIEW_POS_BOTTOM_LEFT:
+ ret_x = SELF_VIDEO_SECTION_MARGIN;
+ ret_y = box.height - SELF_VIDEO_SECTION_MARGIN
+ - SELF_VIDEO_SECTION_HEIGHT
+ - FLOATING_TOOLBAR_HEIGHT - FLOATING_TOOLBAR_SPACING;
+ break;
+ case PREVIEW_POS_BOTTOM_RIGHT:
+ ret_x = box.width - SELF_VIDEO_SECTION_MARGIN
+ - SELF_VIDEO_SECTION_WIDTH;
+ ret_y = box.height - SELF_VIDEO_SECTION_MARGIN
+ - SELF_VIDEO_SECTION_HEIGHT - FLOATING_TOOLBAR_HEIGHT
+ - FLOATING_TOOLBAR_SPACING;
+ break;
+ default:
+ g_warn_if_reached ();
+ }
+
+out:
+ if (x != NULL)
+ *x = ret_x;
+
+ if (y != NULL)
+ *y = ret_y;
+}
+
static PreviewPosition
empathy_call_window_get_preview_position (EmpathyCallWindow *self,
gfloat event_x,
@@ -900,6 +1003,13 @@ empathy_call_window_preview_on_drag_begin_cb (ClutterDragAction *action,
}
static void
+empathy_call_window_on_animation_completed_cb (ClutterAnimation *animation,
+ ClutterActor *actor)
+{
+ clutter_actor_set_opacity (actor, 255);
+}
+
+static void
empathy_call_window_preview_on_drag_end_cb (ClutterDragAction *action,
ClutterActor *actor,
gfloat event_x,
@@ -908,18 +1018,30 @@ empathy_call_window_preview_on_drag_end_cb (ClutterDragAction *action,
EmpathyCallWindow *self)
{
PreviewPosition pos;
+ guint x, y;
/* Get the position before destroying the drag actor, otherwise the
* preview_box allocation won't be valid and we won't be able to
* calculate the position. */
pos = empathy_call_window_get_preview_position (self, event_x, event_y);
- /* Destroy the video preview copy that we were dragging */
- clutter_actor_destroy (self->priv->drag_preview);
- self->priv->drag_preview = NULL;
+ empathy_call_window_get_preview_coordinates (self,
+ pos != PREVIEW_POS_NONE ? pos : self->priv->preview_pos,
+ &x, &y);
+
+ /* Move the preview to the destination and destroy it afterwards */
+ clutter_actor_animate (self->priv->drag_preview, CLUTTER_LINEAR, 500,
+ "x", (gfloat) x,
+ "y", (gfloat) y,
+ "signal-swapped-after::completed",
+ clutter_actor_destroy, self->priv->drag_preview,
+ "signal-swapped-after::completed",
+ clutter_actor_show, self->priv->preview_shown_button,
+ "signal::completed",
+ empathy_call_window_on_animation_completed_cb, actor,
+ NULL);
- clutter_actor_set_opacity (actor, 255);
- clutter_actor_show (self->priv->preview_shown_button);
+ self->priv->drag_preview = NULL;
if (pos != PREVIEW_POS_NONE)
empathy_call_window_move_video_preview (self, pos);
@@ -993,6 +1115,7 @@ create_video_preview (EmpathyCallWindow *self)
ClutterAction *action;
GtkWidget *button;
PreviewPosition pos;
+ GdkRGBA transparent = { 0., 0., 0., 0. };
g_assert (priv->video_preview == NULL);
@@ -1013,6 +1136,28 @@ create_video_preview (EmpathyCallWindow *self)
SELF_VIDEO_SECTION_HEIGHT + 2 * SELF_VIDEO_SECTION_MARGIN +
FLOATING_TOOLBAR_HEIGHT + FLOATING_TOOLBAR_SPACING);
+ /* Spinner for when changing the camera device */
+ priv->preview_spinner_widget = gtk_spinner_new ();
+ priv->preview_spinner_actor = empathy_rounded_actor_new ();
+ empathy_rounded_actor_set_round_factor (
+ EMPATHY_ROUNDED_ACTOR (priv->preview_spinner_actor), 16);
+
+ g_object_set (priv->preview_spinner_widget, "expand", TRUE, NULL);
+ gtk_widget_override_background_color (
+ gtk_clutter_actor_get_widget (
+ GTK_CLUTTER_ACTOR (priv->preview_spinner_actor)),
+ GTK_STATE_FLAG_NORMAL, &transparent);
+ gtk_widget_show (priv->preview_spinner_widget);
+
+ gtk_container_add (
+ GTK_CONTAINER (gtk_clutter_actor_get_widget (
+ GTK_CLUTTER_ACTOR (priv->preview_spinner_actor))),
+ priv->preview_spinner_widget);
+ clutter_actor_set_size (priv->preview_spinner_actor,
+ SELF_VIDEO_SECTION_WIDTH, SELF_VIDEO_SECTION_HEIGHT);
+ clutter_actor_set_opacity (priv->preview_spinner_actor, 128);
+ clutter_actor_hide (priv->preview_spinner_actor);
+
/* We have a box with the margins and the video in the middle inside
* a bigger box with an extra bottom margin so we're not on top of
* the floating toolbar. */
@@ -1024,6 +1169,8 @@ create_video_preview (EmpathyCallWindow *self)
SELF_VIDEO_SECTION_HEIGHT + 2 * SELF_VIDEO_SECTION_MARGIN);
clutter_container_add_actor (CLUTTER_CONTAINER (box), preview);
+ clutter_container_add_actor (CLUTTER_CONTAINER (box),
+ priv->preview_spinner_actor);
clutter_container_add_actor (CLUTTER_CONTAINER (priv->video_preview), box);
g_object_set (priv->video_preview_sink,
@@ -1102,24 +1249,43 @@ create_video_preview (EmpathyCallWindow *self)
clutter_actor_set_reactive (priv->preview_shown_button, TRUE);
}
+static void
+empathy_call_window_start_camera_spinning (EmpathyCallWindow *self)
+{
+ clutter_actor_show (self->priv->preview_spinner_actor);
+ gtk_spinner_start (GTK_SPINNER (self->priv->preview_spinner_widget));
+}
+
+static void
+empathy_call_window_stop_camera_spinning (EmpathyCallWindow *self)
+{
+ clutter_actor_hide (self->priv->preview_spinner_actor);
+ gtk_spinner_stop (GTK_SPINNER (self->priv->preview_spinner_widget));
+}
+
void
-empathy_call_window_play_camera (EmpathyCallWindow *window,
+empathy_call_window_play_camera (EmpathyCallWindow *self,
gboolean play)
{
- EmpathyCallWindowPriv *priv = GET_PRIV (window);
+ EmpathyCallWindowPriv *priv = GET_PRIV (self);
GstElement *preview;
GstState state;
if (priv->video_preview == NULL)
{
- create_video_preview (window);
- add_video_preview_to_pipeline (window);
+ create_video_preview (self);
+ add_video_preview_to_pipeline (self);
}
if (play)
- state = GST_STATE_PLAYING;
+ {
+ state = GST_STATE_PLAYING;
+ }
else
- state = GST_STATE_NULL;
+ {
+ empathy_call_window_start_camera_spinning (self);
+ state = GST_STATE_NULL;
+ }
preview = priv->video_preview_sink;
@@ -1358,6 +1524,105 @@ empathy_call_window_stage_allocation_changed_cb (ClutterActor *stage,
}
static void
+empathy_call_window_incoming_call_response_cb (GtkDialog *dialog,
+ gint response_id,
+ EmpathyCallWindow *self)
+{
+ switch (response_id)
+ {
+ case GTK_RESPONSE_ACCEPT:
+ tp_channel_dispatch_operation_handle_with_async (
+ self->priv->pending_cdo, EMPATHY_CALL_BUS_NAME, NULL, NULL);
+
+ tp_clear_object (&self->priv->pending_cdo);
+ tp_clear_object (&self->priv->pending_channel);
+ tp_clear_object (&self->priv->pending_context);
+
+ break;
+ case GTK_RESPONSE_CANCEL:
+ tp_channel_dispatch_operation_close_channels_async (
+ self->priv->pending_cdo, NULL, NULL);
+
+ empathy_call_window_status_message (self, _("Disconnected"));
+ self->priv->call_state = DISCONNECTED;
+ break;
+ default:
+ g_warn_if_reached ();
+ }
+}
+
+static void
+empathy_call_window_set_state_ringing (EmpathyCallWindow *self)
+{
+ gboolean video;
+
+ g_assert (self->priv->call_state != CONNECTED);
+
+ video = tpy_call_channel_has_initial_video (self->priv->pending_channel);
+
+ empathy_call_window_status_message (self, _("Incoming call"));
+ self->priv->call_state = RINGING;
+
+ self->priv->incoming_call_dialog = gtk_message_dialog_new (
+ GTK_WINDOW (self), GTK_DIALOG_MODAL,
+ GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE,
+ video ? _("Incoming video call from %s") : _("Incoming call from %s"),
+ empathy_contact_get_alias (self->priv->contact));
+
+ gtk_dialog_add_buttons (GTK_DIALOG (self->priv->incoming_call_dialog),
+ _("Reject"), GTK_RESPONSE_CANCEL,
+ _("Answer"), GTK_RESPONSE_ACCEPT,
+ NULL);
+
+ g_signal_connect (self->priv->incoming_call_dialog, "response",
+ G_CALLBACK (empathy_call_window_incoming_call_response_cb), self);
+ gtk_widget_show (self->priv->incoming_call_dialog);
+}
+
+static void
+empathy_call_window_cdo_invalidated_cb (TpProxy *channel,
+ guint domain,
+ gint code,
+ gchar *message,
+ EmpathyCallWindow *self)
+{
+ tp_clear_object (&self->priv->pending_cdo);
+ tp_clear_object (&self->priv->pending_channel);
+ tp_clear_object (&self->priv->pending_context);
+
+ /* We don't know if the incoming call has been accepted or not, so we
+ * assume it hasn't and if it has, we'll set the proper status when
+ * we get the new handler. */
+ empathy_call_window_status_message (self, _("Disconnected"));
+ self->priv->call_state = DISCONNECTED;
+
+ gtk_widget_destroy (self->priv->incoming_call_dialog);
+ self->priv->incoming_call_dialog = NULL;
+}
+
+void
+empathy_call_window_start_ringing (EmpathyCallWindow *self,
+ TpyCallChannel *channel,
+ TpChannelDispatchOperation *dispatch_operation,
+ TpAddDispatchOperationContext *context)
+{
+ g_assert (self->priv->pending_channel == NULL);
+ g_assert (self->priv->pending_context == NULL);
+ g_assert (self->priv->pending_cdo == NULL);
+
+ /* Start ringing and delay until the user answers or hangs. */
+ self->priv->pending_channel = g_object_ref (channel);
+ self->priv->pending_context = g_object_ref (context);
+ self->priv->pending_cdo = g_object_ref (dispatch_operation);
+
+ g_signal_connect (self->priv->pending_cdo, "invalidated",
+ G_CALLBACK (empathy_call_window_cdo_invalidated_cb), self);
+
+ empathy_call_window_set_state_ringing (self);
+ tp_add_dispatch_operation_context_accept (context);
+}
+
+static void
empathy_call_window_init (EmpathyCallWindow *self)
{
EmpathyCallWindowPriv *priv;
@@ -1373,6 +1638,8 @@ empathy_call_window_init (EmpathyCallWindow *self)
priv = self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
EMPATHY_TYPE_CALL_WINDOW, EmpathyCallWindowPriv);
+ priv->settings = g_settings_new (EMPATHY_PREFS_CALL_SCHEMA);
+
filename = empathy_file_lookup ("empathy-call-window.ui", "src");
gui = empathy_builder_get_file (filename,
"call_window_vbox", &top_vbox,
@@ -1556,6 +1823,8 @@ empathy_call_window_init (EmpathyCallWindow *self)
G_CALLBACK (dtmf_button_pressed_cb),
G_CALLBACK (dtmf_button_released_cb));
+ priv->tones = g_string_new ("");
+
gtk_box_pack_start (GTK_BOX (priv->pane), priv->dtmf_panel,
FALSE, FALSE, 6);
@@ -1608,8 +1877,6 @@ empathy_call_window_init (EmpathyCallWindow *self)
empathy_call_window_show_hangup_button (self, TRUE);
- priv->settings = g_settings_new (EMPATHY_PREFS_CALL_SCHEMA);
-
/* Retrieve initial volume */
priv->volume = g_settings_get_double (priv->settings,
EMPATHY_PREFS_CALL_SOUND_VOLUME) / 100.0;
@@ -1993,13 +2260,14 @@ empathy_call_window_constructed (GObject *object)
EmpathyCallWindow *self = EMPATHY_CALL_WINDOW (object);
EmpathyCallWindowPriv *priv = GET_PRIV (self);
TpyCallChannel *call;
+ TpyCallState state;
g_assert (priv->handler != NULL);
g_object_get (priv->handler, "call-channel", &call, NULL);
- priv->outgoing = (call == NULL);
- if (call != NULL)
- g_object_unref (call);
+ state = tpy_call_channel_get_state (call, NULL, NULL);
+ priv->outgoing = (state == TPY_CALL_STATE_PENDING_INITIATOR);
+ tp_clear_object (&call);
g_object_get (priv->handler, "target-contact", &priv->contact, NULL);
g_assert (priv->contact != NULL);
@@ -2188,6 +2456,8 @@ empathy_call_window_finalize (GObject *object)
g_timer_destroy (priv->timer);
+ g_string_free (priv->tones, TRUE);
+
G_OBJECT_CLASS (empathy_call_window_parent_class)->finalize (object);
}
@@ -2199,6 +2469,20 @@ empathy_call_window_new (EmpathyCallHandler *handler)
g_object_new (EMPATHY_TYPE_CALL_WINDOW, "handler", handler, NULL));
}
+void
+empathy_call_window_present (EmpathyCallWindow *self,
+ EmpathyCallHandler *handler)
+{
+ g_return_if_fail (EMPATHY_IS_CALL_HANDLER (handler));
+
+ tp_clear_object (&self->priv->handler);
+ self->priv->handler = g_object_ref (handler);
+ empathy_call_window_connect_handler (self);
+
+ empathy_window_present (GTK_WINDOW (self));
+ empathy_call_window_restart_call (self);
+}
+
static void
empathy_call_window_conference_added_cb (EmpathyCallHandler *handler,
GstElement *conference, gpointer user_data)
@@ -2324,6 +2608,9 @@ empathy_call_window_disconnected (EmpathyCallWindow *self,
gtk_action_set_sensitive (priv->menu_fullscreen, FALSE);
gtk_widget_set_sensitive (priv->dtmf_panel, FALSE);
+ priv->sending_tones = FALSE;
+ g_string_set_size (priv->tones, 0);
+
could_reset_pipeline = empathy_call_window_reset_pipeline (self);
if (priv->call_state == CONNECTING)
@@ -3140,7 +3427,7 @@ empathy_call_window_bus_message (GstBus *bus, GstMessage *message,
{
EmpathyCallWindow *self = EMPATHY_CALL_WINDOW (user_data);
EmpathyCallWindowPriv *priv = GET_PRIV (self);
- GstState newstate;
+ GstState newstate, pending;
empathy_call_handler_bus_message (priv->handler, bus, message);
@@ -3164,6 +3451,15 @@ empathy_call_window_bus_message (GstBus *bus, GstMessage *message,
start_call (self);
}
}
+ if (GST_MESSAGE_SRC (message) == GST_OBJECT (priv->video_preview_sink))
+ {
+ gst_message_parse_state_changed (message, NULL, &newstate,
+ &pending);
+
+ if (newstate == GST_STATE_PLAYING &&
+ pending == GST_STATE_VOID_PENDING)
+ empathy_call_window_stop_camera_spinning (self);
+ }
break;
case GST_MESSAGE_ERROR:
{
@@ -3268,50 +3564,63 @@ call_handler_notify_call_cb (EmpathyCallHandler *handler,
tp_g_signal_connect_object (call, "members-changed",
G_CALLBACK (empathy_call_window_members_changed_cb), self, 0);
+ tp_cli_channel_interface_dtmf_connect_to_stopped_tones (TP_CHANNEL (call),
+ empathy_call_window_tones_stopped_cb, self, NULL,
+ G_OBJECT (call), NULL);
+
g_object_unref (call);
}
static void
-empathy_call_window_realized_cb (GtkWidget *widget, EmpathyCallWindow *window)
+empathy_call_window_connect_handler (EmpathyCallWindow *self)
{
- EmpathyCallWindowPriv *priv = GET_PRIV (window);
+ EmpathyCallWindowPriv *priv = GET_PRIV (self);
TpyCallChannel *call;
- gint width;
-
- /* Make the hangup button twice as wide */
- width = gtk_widget_get_allocated_width (priv->hangup_button);
- gtk_widget_set_size_request (priv->hangup_button, width * 2, -1);
g_signal_connect (priv->handler, "state-changed",
- G_CALLBACK (empathy_call_window_state_changed_cb), window);
+ G_CALLBACK (empathy_call_window_state_changed_cb), self);
g_signal_connect (priv->handler, "conference-added",
- G_CALLBACK (empathy_call_window_conference_added_cb), window);
+ G_CALLBACK (empathy_call_window_conference_added_cb), self);
g_signal_connect (priv->handler, "conference-removed",
- G_CALLBACK (empathy_call_window_conference_removed_cb), window);
+ G_CALLBACK (empathy_call_window_conference_removed_cb), self);
g_signal_connect (priv->handler, "closed",
- G_CALLBACK (empathy_call_window_channel_closed_cb), window);
+ G_CALLBACK (empathy_call_window_channel_closed_cb), self);
g_signal_connect (priv->handler, "src-pad-added",
- G_CALLBACK (empathy_call_window_src_added_cb), window);
+ G_CALLBACK (empathy_call_window_src_added_cb), self);
g_signal_connect (priv->handler, "sink-pad-added",
- G_CALLBACK (empathy_call_window_sink_added_cb), window);
+ G_CALLBACK (empathy_call_window_sink_added_cb), self);
g_signal_connect (priv->handler, "sink-pad-removed",
- G_CALLBACK (empathy_call_window_sink_removed_cb), window);
+ G_CALLBACK (empathy_call_window_sink_removed_cb), self);
+
+ /* We connect to ::call-channel unconditionally since we'll
+ * get new channels if we hangup and redial or if we reuse the
+ * call window. */
+ g_signal_connect (priv->handler, "notify::call-channel",
+ G_CALLBACK (call_handler_notify_call_cb), self);
g_object_get (priv->handler, "call-channel", &call, NULL);
if (call != NULL)
{
- call_handler_notify_call_cb (priv->handler, NULL, window);
+ /* We won't get notify::call-channel for this channel, so
+ * directly call the callback. */
+ call_handler_notify_call_cb (priv->handler, NULL, self);
g_object_unref (call);
}
- else
- {
- /* call-channel doesn't exist yet, we'll connect signals once it has been
- * set */
- g_signal_connect (priv->handler, "notify::call-channel",
- G_CALLBACK (call_handler_notify_call_cb), window);
- }
+}
+
+static void
+empathy_call_window_realized_cb (GtkWidget *widget,
+ EmpathyCallWindow *self)
+{
+ gint width;
+
+ /* Make the hangup button twice as wide */
+ width = gtk_widget_get_allocated_width (self->priv->hangup_button);
+ gtk_widget_set_size_request (self->priv->hangup_button, width * 2, -1);
+
+ empathy_call_window_connect_handler (self);
- gst_element_set_state (priv->pipeline, GST_STATE_PAUSED);
+ gst_element_set_state (self->priv->pipeline, GST_STATE_PAUSED);
}
static gboolean
diff --git a/src/empathy-call-window.h b/src/empathy-call-window.h
index eebb55f69..81cf170ae 100644
--- a/src/empathy-call-window.h
+++ b/src/empathy-call-window.h
@@ -63,6 +63,12 @@ GType empathy_call_window_get_type (void);
EmpathyCallWindowClass))
EmpathyCallWindow *empathy_call_window_new (EmpathyCallHandler *handler);
+void empathy_call_window_present (EmpathyCallWindow *window,
+ EmpathyCallHandler *handler);
+void empathy_call_window_start_ringing (EmpathyCallWindow *self,
+ TpyCallChannel *channel,
+ TpChannelDispatchOperation *dispatch_operation,
+ TpAddDispatchOperationContext *context);
GtkUIManager *empathy_call_window_get_ui_manager (EmpathyCallWindow *window);
diff --git a/src/empathy-call-window.ui b/src/empathy-call-window.ui
index 0dea20869..924bab6f4 100644
--- a/src/empathy-call-window.ui
+++ b/src/empathy-call-window.ui
@@ -388,11 +388,8 @@
<property name="right_padding">0</property>
<child>
- <object class="GtkTable" id="video">
+ <object class="GtkGrid" id="video">
<property name="visible">True</property>
- <property name="n_rows">4</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
@@ -419,11 +416,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="right_attach">1</property>
<property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
@@ -449,11 +442,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="right_attach">2</property>
<property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
@@ -480,11 +469,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="right_attach">1</property>
<property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
@@ -510,11 +495,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="right_attach">2</property>
<property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
@@ -541,11 +522,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="right_attach">1</property>
<property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
@@ -570,11 +547,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="right_attach">2</property>
<property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
@@ -586,11 +559,7 @@
</object>
<packing>
<property name="left_attach">2</property>
- <property name="right_attach">3</property>
<property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
@@ -618,11 +587,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="right_attach">1</property>
<property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
@@ -647,11 +612,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="right_attach">2</property>
<property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
@@ -663,11 +624,7 @@
</object>
<packing>
<property name="left_attach">2</property>
- <property name="right_attach">3</property>
<property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
@@ -736,11 +693,8 @@
<property name="right_padding">0</property>
<child>
- <object class="GtkTable" id="audio">
+ <object class="GtkGrid" id="audio">
<property name="visible">True</property>
- <property name="n_rows">4</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
@@ -767,11 +721,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="right_attach">1</property>
<property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
@@ -796,11 +746,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="right_attach">2</property>
<property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
@@ -827,11 +773,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="right_attach">1</property>
<property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
@@ -856,11 +798,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="right_attach">2</property>
<property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
@@ -887,11 +825,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="right_attach">1</property>
<property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
@@ -916,11 +850,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="right_attach">2</property>
<property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
@@ -932,11 +862,7 @@
</object>
<packing>
<property name="left_attach">2</property>
- <property name="right_attach">3</property>
<property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
@@ -963,11 +889,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="right_attach">1</property>
<property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
@@ -992,11 +914,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="right_attach">2</property>
<property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
@@ -1008,11 +926,7 @@
</object>
<packing>
<property name="left_attach">2</property>
- <property name="right_attach">3</property>
<property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
diff --git a/src/empathy-call.c b/src/empathy-call.c
index 1f60217db..2ff49a81b 100644
--- a/src/empathy-call.c
+++ b/src/empathy-call.c
@@ -34,6 +34,8 @@
#include <telepathy-yell/telepathy-yell.h>
+#include <libempathy/empathy-client-factory.h>
+
#include <libempathy-gtk/empathy-ui-utils.h>
#include "empathy-call-window.h"
@@ -55,6 +57,55 @@ static gboolean use_timer = TRUE;
static EmpathyCallFactory *call_factory = NULL;
+/* An EmpathyContact -> EmpathyCallWindow hash table for all existing
+ * Call windows. We own a ref on the EmpathyContacts. */
+static GHashTable *call_windows;
+
+static void
+call_window_destroyed_cb (GtkWidget *window,
+ EmpathyContact *contact)
+{
+ g_hash_table_remove (call_windows, contact);
+
+ g_application_release (G_APPLICATION (app));
+}
+
+static gboolean
+find_window_for_handle (gpointer key,
+ gpointer value,
+ gpointer user_data)
+{
+ EmpathyContact *contact = key;
+ guint handle = GPOINTER_TO_UINT (user_data);
+
+ if (handle == empathy_contact_get_handle (contact))
+ return TRUE;
+
+ return FALSE;
+}
+
+static gboolean
+incoming_call_cb (EmpathyCallFactory *factory,
+ guint handle,
+ TpyCallChannel *channel,
+ TpChannelDispatchOperation *dispatch_operation,
+ TpAddDispatchOperationContext *context,
+ gpointer user_data)
+{
+ EmpathyCallWindow *window = g_hash_table_find (call_windows,
+ find_window_for_handle, GUINT_TO_POINTER (handle));
+
+ if (window != NULL)
+ {
+ /* The window takes care of accepting or rejecting the context. */
+ empathy_call_window_start_ringing (window,
+ channel, dispatch_operation, context);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
static void
new_call_handler_cb (EmpathyCallFactory *factory,
EmpathyCallHandler *handler,
@@ -62,17 +113,29 @@ new_call_handler_cb (EmpathyCallFactory *factory,
gpointer user_data)
{
EmpathyCallWindow *window;
+ EmpathyContact *contact;
- DEBUG ("Create a new call window");
+ DEBUG ("Show the call window");
- window = empathy_call_window_new (handler);
+ g_object_get (handler, "target-contact", &contact, NULL);
- g_application_hold (G_APPLICATION (app));
+ window = g_hash_table_lookup (call_windows, contact);
- g_signal_connect_swapped (window, "destroy",
- G_CALLBACK (g_application_release), app);
+ if (window != NULL)
+ {
+ empathy_call_window_present (window, handler);
+ }
+ else
+ {
+ window = empathy_call_window_new (handler);
+
+ g_hash_table_insert (call_windows, g_object_ref (contact), window);
+ g_application_hold (G_APPLICATION (app));
+ g_signal_connect (window, "destroy",
+ G_CALLBACK (call_window_destroyed_cb), contact);
- gtk_widget_show (GTK_WIDGET (window));
+ gtk_widget_show (GTK_WIDGET (window));
+ }
}
static void
@@ -96,6 +159,8 @@ activate_cb (GApplication *application)
g_signal_connect (G_OBJECT (call_factory), "new-call-handler",
G_CALLBACK (new_call_handler_cb), NULL);
+ g_signal_connect (G_OBJECT (call_factory), "incoming-call",
+ G_CALLBACK (incoming_call_cb), NULL);
if (!empathy_call_factory_register (call_factory, &error))
{
@@ -117,6 +182,7 @@ main (int argc,
#endif
GError *error = NULL;
gint retval;
+ GtkSettings *gtk_settings;
/* Init */
g_thread_init (NULL);
@@ -156,6 +222,10 @@ main (int argc,
gtk_window_set_default_icon_name ("empathy");
textdomain (GETTEXT_PACKAGE);
+ gtk_settings = gtk_settings_get_default ();
+ g_object_set (G_OBJECT (gtk_settings), "gtk-application-prefer-dark-theme",
+ TRUE, NULL);
+
app = gtk_application_new (EMPATHY_CALL_DBUS_NAME, G_APPLICATION_FLAGS_NONE);
g_signal_connect (app, "activate", G_CALLBACK (activate_cb), NULL);
@@ -172,6 +242,9 @@ main (int argc,
use_timer = FALSE;
}
+ call_windows = g_hash_table_new_full (g_direct_hash, g_direct_equal,
+ g_object_unref, NULL);
+
/* the inactivity timeout can only be set while the application is held */
g_application_hold (G_APPLICATION (app));
g_application_set_inactivity_timeout (G_APPLICATION (app), TIMEOUT * 1000);
@@ -179,6 +252,7 @@ main (int argc,
retval = g_application_run (G_APPLICATION (app), argc, argv);
+ g_hash_table_unref (call_windows);
g_object_unref (app);
tp_clear_object (&call_factory);
diff --git a/src/empathy-chat-manager.c b/src/empathy-chat-manager.c
index 5f19159c5..a52585736 100644
--- a/src/empathy-chat-manager.c
+++ b/src/empathy-chat-manager.c
@@ -349,7 +349,7 @@ empathy_chat_manager_class_init (
G_SIGNAL_RUN_LAST,
0,
NULL, NULL,
- g_cclosure_marshal_VOID__UINT,
+ g_cclosure_marshal_generic,
G_TYPE_NONE,
1, G_TYPE_UINT, NULL);
@@ -359,7 +359,7 @@ empathy_chat_manager_class_init (
G_SIGNAL_RUN_LAST,
0,
NULL, NULL,
- g_cclosure_marshal_VOID__UINT,
+ g_cclosure_marshal_generic,
G_TYPE_NONE,
1, G_TYPE_UINT, NULL);
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index a84eef7a0..46f76466b 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -1482,8 +1482,7 @@ chat_window_new_message_cb (EmpathyChat *chat,
* a) the chatroom's always_urgent property is TRUE
* b) the message contains our alias
*/
- if (empathy_chat_is_room (chat) ||
- empathy_chat_get_remote_contact (chat) == NULL) {
+ if (empathy_chat_is_room (chat)) {
TpAccount *account;
const gchar *room;
EmpathyChatroom *chatroom;
diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c
index a6ce22b18..da677d42d 100644
--- a/src/empathy-event-manager.c
+++ b/src/empathy-event-manager.c
@@ -1115,12 +1115,11 @@ approve_channels (TpSimpleApprover *approver,
event_manager_call_channel_got_contact_cb,
approval, NULL, G_OBJECT (self));
}
- else if (channel_type == TP_IFACE_QUARK_CHANNEL_TYPE_FILE_TRANSFER)
+ else if (EMPATHY_IS_TP_FILE (channel))
{
TpHandle handle;
- EmpathyTpFile *tp_file = empathy_tp_file_new (channel);
- approval->handler_instance = G_OBJECT (tp_file);
+ approval->handler_instance = g_object_ref (channel);
handle = tp_channel_get_handle (channel, NULL);
@@ -1129,10 +1128,31 @@ approve_channels (TpSimpleApprover *approver,
}
else if (channel_type == TP_IFACE_QUARK_CHANNEL_TYPE_SERVER_AUTHENTICATION)
{
- event_manager_add (approval->manager, account, NULL, EMPATHY_EVENT_TYPE_AUTH,
- GTK_STOCK_DIALOG_AUTHENTICATION, tp_account_get_display_name (account),
- _("Password required"), approval,
- event_manager_auth_process_func, NULL);
+ GHashTable *props;
+ const gchar * const *available_mechanisms;
+
+ props = tp_channel_borrow_immutable_properties (channel);
+ available_mechanisms = tp_asv_get_boxed (props,
+ TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_AVAILABLE_MECHANISMS,
+ G_TYPE_STRV);
+
+ if (tp_strv_contains (available_mechanisms, "X-TELEPATHY-PASSWORD"))
+ {
+ event_manager_add (approval->manager, account, NULL,
+ EMPATHY_EVENT_TYPE_AUTH,
+ GTK_STOCK_DIALOG_AUTHENTICATION,
+ tp_account_get_display_name (account),
+ _("Password required"), approval,
+ event_manager_auth_process_func, NULL);
+ }
+ else
+ {
+ GError error = { TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED,
+ "Support only X-TELEPATHY-PASSWORD auth method" };
+
+ tp_add_dispatch_operation_context_fail (context, &error);
+ return;
+ }
}
else
{
@@ -1340,7 +1360,7 @@ empathy_event_manager_class_init (EmpathyEventManagerClass *klass)
G_SIGNAL_RUN_LAST,
0,
NULL, NULL,
- g_cclosure_marshal_VOID__POINTER,
+ g_cclosure_marshal_generic,
G_TYPE_NONE,
1, G_TYPE_POINTER);
@@ -1350,7 +1370,7 @@ empathy_event_manager_class_init (EmpathyEventManagerClass *klass)
G_SIGNAL_RUN_LAST,
0,
NULL, NULL,
- g_cclosure_marshal_VOID__POINTER,
+ g_cclosure_marshal_generic,
G_TYPE_NONE, 1, G_TYPE_POINTER);
signals[EVENT_UPDATED] =
@@ -1359,7 +1379,7 @@ empathy_event_manager_class_init (EmpathyEventManagerClass *klass)
G_SIGNAL_RUN_LAST,
0,
NULL, NULL,
- g_cclosure_marshal_VOID__POINTER,
+ g_cclosure_marshal_generic,
G_TYPE_NONE, 1, G_TYPE_POINTER);
g_type_class_add_private (object_class, sizeof (EmpathyEventManagerPriv));
diff --git a/src/empathy-import-utils.c b/src/empathy-import-utils.c
index 7e69d6235..bf7f29e3b 100644
--- a/src/empathy-import-utils.c
+++ b/src/empathy-import-utils.c
@@ -96,6 +96,10 @@ empathy_import_protocol_is_supported (const gchar *protocol,
if (tp_connection_manager_has_protocol (tp_cm,
(const gchar*) protocol))
{
+ if (!tp_strdiff (protocol, "irc")
+ && !tp_strdiff (tp_cm->name, "haze"))
+ continue;
+
if (!proto_is_supported)
{
*cm = tp_cm;
diff --git a/src/empathy-import-widget.c b/src/empathy-import-widget.c
index fc1e2f532..9a8917ffc 100644
--- a/src/empathy-import-widget.c
+++ b/src/empathy-import-widget.c
@@ -103,7 +103,7 @@ account_manager_prepared_cb (GObject *source_object,
EmpathyImportWidgetPriv *priv = GET_PRIV (self);
GError *error = NULL;
- if (!tp_account_manager_prepare_finish (manager, result, &error))
+ if (!tp_proxy_prepare_finish (manager, result, &error))
{
DEBUG ("Failed to prepare account manager: %s", error->message);
g_error_free (error);
@@ -156,7 +156,7 @@ import_widget_add_accounts_to_model (EmpathyImportWidget *self)
manager = tp_account_manager_dup ();
- tp_account_manager_prepare_async (manager, NULL,
+ tp_proxy_prepare_async (manager, NULL,
account_manager_prepared_cb, self);
g_object_unref (manager);
diff --git a/src/empathy-invite-participant-dialog.c b/src/empathy-invite-participant-dialog.c
index ec5a275d4..9280dda32 100644
--- a/src/empathy-invite-participant-dialog.c
+++ b/src/empathy-invite-participant-dialog.c
@@ -14,6 +14,8 @@
#include "empathy-invite-participant-dialog.h"
+#include <libempathy/empathy-utils.h>
+
#include <libempathy-gtk/empathy-contact-chooser.h>
#include <libempathy-gtk/empathy-individual-view.h>
#include <libempathy-gtk/empathy-ui-utils.h>
@@ -101,39 +103,11 @@ static TpContact *
get_tp_contact_for_chat (EmpathyInviteParticipantDialog *self,
FolksIndividual *individual)
{
- TpContact *contact = NULL;
TpConnection *chat_conn;
- GeeSet *personas;
- GeeIterator *iter;
chat_conn = tp_channel_borrow_connection (TP_CHANNEL (self->priv->tp_chat));
- personas = folks_individual_get_personas (individual);
- iter = gee_iterable_iterator (GEE_ITERABLE (personas));
- while (contact == FALSE && gee_iterator_next (iter))
- {
- TpfPersona *persona = gee_iterator_get (iter);
- TpConnection *contact_conn;
- TpContact *contact_cur = NULL;
-
- if (TPF_IS_PERSONA (persona))
- {
- contact_cur = tpf_persona_get_contact (persona);
- if (contact_cur != NULL)
- {
- contact_conn = tp_contact_get_connection (contact_cur);
-
- if (!tp_strdiff (tp_proxy_get_object_path (contact_conn),
- tp_proxy_get_object_path (chat_conn)))
- contact = contact_cur;
- }
- }
-
- g_clear_object (&persona);
- }
- g_clear_object (&iter);
-
- return contact;
+ return empathy_get_tp_contact_for_individual (individual, chat_conn);
}
static gboolean
diff --git a/src/empathy-main-window-menubar.ui b/src/empathy-main-window-menubar.ui
index 979afe215..0bb5d14f0 100644
--- a/src/empathy-main-window-menubar.ui
+++ b/src/empathy-main-window-menubar.ui
@@ -204,6 +204,7 @@
<property name="name">room_join_new</property>
<property name="label" translatable="yes">_Join…</property>
</object>
+ <accelerator key="j" modifiers="GDK_CONTROL_MASK"/>
</child>
<child>
<object class="GtkAction" id="room_join_favorites">
diff --git a/src/empathy-main-window.c b/src/empathy-main-window.c
index 1463e8ed9..fda8a9601 100644
--- a/src/empathy-main-window.c
+++ b/src/empathy-main-window.c
@@ -76,7 +76,6 @@
#include "empathy-chatrooms-window.h"
#include "empathy-event-manager.h"
#include "empathy-ft-manager.h"
-#include "empathy-migrate-butterfly-logs.h"
#define DEBUG_FLAG EMPATHY_DEBUG_OTHER
#include <libempathy/empathy-debug.h>
@@ -98,6 +97,11 @@ enum {
PAGE_NO_MATCH
};
+enum {
+ PROP_0,
+ PROP_SHELL_RUNNING
+};
+
G_DEFINE_TYPE (EmpathyMainWindow, empathy_main_window, GTK_TYPE_WINDOW);
#define GET_PRIV(self) ((EmpathyMainWindowPriv *)((EmpathyMainWindow *) self)->priv)
@@ -164,8 +168,7 @@ struct _EmpathyMainWindowPriv {
/* Actions that are enabled when there are connected accounts */
GList *actions_connected;
- /* The idle event source to migrate butterfly's logs */
- guint butterfly_log_migration_members_changed_id;
+ gboolean shell_running;
};
static void
@@ -552,6 +555,23 @@ main_window_event_removed_cb (EmpathyEventManager *manager,
&data);
}
+static gboolean
+main_window_load_events_idle_cb (gpointer user_data)
+{
+ EmpathyMainWindow *window = user_data;
+ EmpathyMainWindowPriv *priv = GET_PRIV (window);
+ GSList *l;
+
+ l = empathy_event_manager_get_events (priv->event_manager);
+ while (l) {
+ main_window_event_added_cb (priv->event_manager, l->data,
+ window);
+ l = l->next;
+ }
+
+ return FALSE;
+}
+
static void
main_window_row_activated_cb (EmpathyContactListView *view,
GtkTreePath *path,
@@ -646,6 +666,12 @@ main_window_row_inserted_cb (GtkTreeModel *model,
gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->notebook),
PAGE_CONTACT_LIST);
gtk_widget_grab_focus (GTK_WIDGET (priv->individual_view));
+
+ /* The store is being filled, it will be done after an idle cb.
+ * So we can then get events. If we do that too soon, event's
+ * contact is not yet in the store and it won't get marked as
+ * having events. */
+ g_idle_add (main_window_load_events_idle_cb, window);
}
}
@@ -1854,7 +1880,8 @@ empathy_main_window_show_preferences (EmpathyMainWindow *window,
EmpathyMainWindowPriv *priv = GET_PRIV (window);
if (priv->preferences == NULL) {
- priv->preferences = empathy_preferences_new (GTK_WINDOW (window));
+ priv->preferences = empathy_preferences_new (GTK_WINDOW (window),
+ priv->shell_running);
g_object_add_weak_pointer (G_OBJECT (priv->preferences),
(gpointer) &priv->preferences);
@@ -1984,9 +2011,11 @@ main_window_connection_items_setup (EmpathyMainWindow *window,
"room_join_favorites",
"chat_new_message",
"chat_new_call",
+ "chat_search_contacts",
"chat_add_contact",
"edit_personal_information",
- "edit_blocked_contacts"
+ "edit_blocked_contacts",
+ "edit_search_contacts"
};
for (i = 0, list = NULL; i < G_N_ELEMENTS (actions_connected); i++) {
@@ -2008,7 +2037,7 @@ account_manager_prepared_cb (GObject *source_object,
EmpathyMainWindowPriv *priv = GET_PRIV (window);
GError *error = NULL;
- if (!tp_account_manager_prepare_finish (manager, result, &error)) {
+ if (!tp_proxy_prepare_finish (manager, result, &error)) {
DEBUG ("Failed to prepare account manager: %s", error->message);
g_error_free (error);
return;
@@ -2041,25 +2070,17 @@ account_manager_prepared_cb (GObject *source_object,
g_list_free (accounts);
}
-static void
-main_window_members_changed_cb (EmpathyContactList *list,
- EmpathyContact *contact,
- EmpathyContact *actor,
- guint reason,
- gchar *message,
- gboolean is_member,
- EmpathyMainWindow *window)
+void
+empathy_main_window_set_shell_running (EmpathyMainWindow *window,
+ gboolean shell_running)
{
EmpathyMainWindowPriv *priv = GET_PRIV (window);
- if (!is_member)
+ if (priv->shell_running == shell_running)
return;
- if (!empathy_migrate_butterfly_logs (contact)) {
- g_signal_handler_disconnect (list,
- priv->butterfly_log_migration_members_changed_id);
- priv->butterfly_log_migration_members_changed_id = 0;
- }
+ priv->shell_running = shell_running;
+ g_object_notify (G_OBJECT (window), "shell-running");
}
static GObject *
@@ -2081,13 +2102,64 @@ empathy_main_window_constructor (GType type,
}
static void
+empathy_main_window_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ EmpathyMainWindow *self = EMPATHY_MAIN_WINDOW (object);
+ EmpathyMainWindowPriv *priv = GET_PRIV (self);
+
+ switch (property_id)
+ {
+ case PROP_SHELL_RUNNING:
+ priv->shell_running = g_value_get_boolean (value);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+
+static void
+empathy_main_window_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ EmpathyMainWindow *self = EMPATHY_MAIN_WINDOW (object);
+ EmpathyMainWindowPriv *priv = GET_PRIV (self);
+
+ switch (property_id)
+ {
+ case PROP_SHELL_RUNNING:
+ g_value_set_boolean (value, priv->shell_running);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+
+static void
empathy_main_window_class_init (EmpathyMainWindowClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GParamSpec *pspec;
object_class->finalize = empathy_main_window_finalize;
object_class->constructor = empathy_main_window_constructor;
+ object_class->set_property = empathy_main_window_set_property;
+ object_class->get_property = empathy_main_window_get_property;
+
+ pspec = g_param_spec_boolean ("shell-running",
+ "Shell running",
+ "Whether the Shell is running or not",
+ FALSE,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+ g_object_class_install_property (object_class, PROP_SHELL_RUNNING, pspec);
+
g_type_class_add_private (object_class, sizeof (EmpathyMainWindowPriv));
}
@@ -2103,7 +2175,6 @@ empathy_main_window_init (EmpathyMainWindow *window)
GtkToolItem *item;
gboolean show_offline;
gchar *filename;
- GSList *l;
GtkTreeModel *model;
GtkWidget *search_vbox;
GtkWidget *menubar;
@@ -2120,6 +2191,10 @@ empathy_main_window_init (EmpathyMainWindow *window)
gtk_window_set_role (GTK_WINDOW (window), "contact_list");
gtk_window_set_default_size (GTK_WINDOW (window), 225, 325);
+ /* don't finalize the widget on delete-event, just hide it */
+ g_signal_connect (window, "delete-event",
+ G_CALLBACK (gtk_widget_hide_on_delete), NULL);
+
/* Set up interface */
filename = empathy_file_lookup ("empathy-main-window.ui", "src");
gui = empathy_builder_get_file (filename,
@@ -2206,7 +2281,7 @@ empathy_main_window_init (EmpathyMainWindow *window)
priv->account_manager = tp_account_manager_dup ();
- tp_account_manager_prepare_async (priv->account_manager, NULL,
+ tp_proxy_prepare_async (priv->account_manager, NULL,
account_manager_prepared_cb, window);
priv->errors = g_hash_table_new_full (g_direct_hash,
@@ -2280,10 +2355,6 @@ empathy_main_window_init (EmpathyMainWindow *window)
EMPATHY_INDIVIDUAL_VIEW_FEATURE_ALL ^ EMPATHY_INDIVIDUAL_VIEW_FEATURE_PERSONA_DROP,
EMPATHY_INDIVIDUAL_FEATURE_ALL);
- priv->butterfly_log_migration_members_changed_id = g_signal_connect (
- priv->contact_manager, "members-changed",
- G_CALLBACK (main_window_members_changed_cb), window);
-
gtk_widget_show (GTK_WIDGET (priv->individual_view));
gtk_container_add (GTK_CONTAINER (sw),
GTK_WIDGET (priv->individual_view));
@@ -2344,13 +2415,6 @@ empathy_main_window_init (EmpathyMainWindow *window)
G_CALLBACK (main_window_account_disabled_cb),
window);
- l = empathy_event_manager_get_events (priv->event_manager);
- while (l) {
- main_window_event_added_cb (priv->event_manager, l->data,
- window);
- l = l->next;
- }
-
/* Show offline ? */
show_offline = g_settings_get_boolean (priv->gsettings_ui,
EMPATHY_PREFS_UI_SHOW_OFFLINE);
diff --git a/src/empathy-main-window.h b/src/empathy-main-window.h
index cb0ae3cf0..af4c1924e 100644
--- a/src/empathy-main-window.h
+++ b/src/empathy-main-window.h
@@ -55,6 +55,8 @@ GtkWidget *empathy_main_window_dup (void);
void empathy_main_window_show_preferences (EmpathyMainWindow *window,
const gchar *tab);
+void empathy_main_window_set_shell_running (EmpathyMainWindow *window,
+ gboolean shell_running);
G_END_DECLS
diff --git a/src/empathy-main-window.ui b/src/empathy-main-window.ui
index 711cab0da..a09d123f8 100644
--- a/src/empathy-main-window.ui
+++ b/src/empathy-main-window.ui
@@ -9,6 +9,9 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="toolbar_style">both</property>
+ <style>
+ <class name="primary-toolbar"/>
+ </style>
</object>
<packing>
<property name="expand">False</property>
diff --git a/src/empathy-mic-monitor.c b/src/empathy-mic-monitor.c
index 1628828e0..29d2d3a3d 100644
--- a/src/empathy-mic-monitor.c
+++ b/src/empathy-mic-monitor.c
@@ -26,7 +26,6 @@
#include "empathy-mic-monitor.h"
-#include "src-marshal.h"
#include <libempathy/empathy-utils.h>
@@ -268,7 +267,7 @@ empathy_mic_monitor_class_init (EmpathyMicMonitorClass *klass)
G_SIGNAL_RUN_LAST,
0,
NULL, NULL,
- _src_marshal_VOID__UINT_STRING_STRING_BOOLEAN,
+ g_cclosure_marshal_generic,
G_TYPE_NONE, 4, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN);
signals[MICROPHONE_REMOVED] = g_signal_new ("microphone-removed",
@@ -276,7 +275,7 @@ empathy_mic_monitor_class_init (EmpathyMicMonitorClass *klass)
G_SIGNAL_RUN_LAST,
0,
NULL, NULL,
- g_cclosure_marshal_VOID__UINT,
+ g_cclosure_marshal_generic,
G_TYPE_NONE, 1, G_TYPE_UINT);
signals[MICROPHONE_CHANGED] = g_signal_new ("microphone-changed",
@@ -284,7 +283,7 @@ empathy_mic_monitor_class_init (EmpathyMicMonitorClass *klass)
G_SIGNAL_RUN_LAST,
0,
NULL, NULL,
- _src_marshal_VOID__UINT_UINT,
+ g_cclosure_marshal_generic,
G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT);
g_type_class_add_private (object_class, sizeof (EmpathyMicMonitorPrivate));
diff --git a/src/empathy-migrate-butterfly-logs.c b/src/empathy-migrate-butterfly-logs.c
deleted file mode 100644
index 4a8bf973c..000000000
--- a/src/empathy-migrate-butterfly-logs.c
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
-* Copyright (C) 2010 Collabora Ltd.
-*
-* 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.
-*
-* 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
-*/
-
-#include <string.h>
-
-#include <gio/gio.h>
-
-#define DEBUG_FLAG EMPATHY_DEBUG_OTHER
-#include <libempathy/empathy-debug.h>
-#include <libempathy/empathy-gsettings.h>
-
-#include <telepathy-glib/account-manager.h>
-#include <telepathy-glib/util.h>
-#include <telepathy-glib/defs.h>
-
-#include "empathy-migrate-butterfly-logs.h"
-
-static guint butterfly_log_migration_id = 0;
-
-static void
-migrate_log_files_in_dir (const gchar *dirname)
-{
- GDir *dir;
- const gchar *subdir;
- gchar *new_name;
- gchar *full_path;
- GError *error = NULL;
-
- dir = g_dir_open (dirname, 0, &error);
-
- if (dir == NULL)
- {
- DEBUG ("Failed to open dir: %s", error->message);
- g_error_free (error);
- return;
- }
-
- while ((subdir = g_dir_read_name (dir)) != NULL)
- {
- GFile *old_gfile, *new_gfile;
-
- if (!tp_strdiff (subdir, "chatrooms"))
- continue;
-
- if (g_str_has_suffix (subdir, "#1"))
- {
- new_name = g_strndup (subdir, (strlen (subdir) - 2));
- }
- else if (g_str_has_suffix (subdir, "#32"))
- {
- gchar *tmp;
- tmp = g_strndup (subdir, (strlen (subdir) - 3));
- new_name = g_strdup_printf ("%s#yahoo", tmp);
- g_free (tmp);
- }
- else
- {
- continue;
- }
-
- full_path = g_build_filename (dirname, subdir, NULL);
- old_gfile = g_file_new_for_path (full_path);
- g_free (full_path);
-
- full_path = g_build_filename (dirname, new_name, NULL);
- new_gfile = g_file_new_for_path (full_path);
- g_free (full_path);
-
- if (!g_file_move (old_gfile, new_gfile, G_FILE_COPY_NONE,
- NULL, NULL, NULL, &error))
- {
- DEBUG ("Failed to move file: %s", error->message);
- g_clear_error (&error);
- }
- else
- {
- DEBUG ("Successfully migrated logs for %s", new_name);
- }
-
- g_free (new_name);
- g_object_unref (old_gfile);
- g_object_unref (new_gfile);
- }
-
- g_dir_close (dir);
-}
-
-/* This is copied from empathy-log-store-empathy.c (see #613437) */
-static gchar *
-log_store_account_to_dirname (TpAccount *account)
-{
- const gchar *name;
-
- name = tp_proxy_get_object_path (account);
- if (g_str_has_prefix (name, TP_ACCOUNT_OBJECT_PATH_BASE))
- name += strlen (TP_ACCOUNT_OBJECT_PATH_BASE);
-
- return g_strdelimit (g_strdup (name), "/", '_');
-}
-
-static gchar *
-get_log_dir_for_account (TpAccount *account)
-{
- gchar *basedir;
- gchar *escaped;
-
- escaped = log_store_account_to_dirname (account);
-
- basedir = g_build_path (G_DIR_SEPARATOR_S, g_get_user_data_dir (),
- PACKAGE_NAME, "logs", escaped, NULL);
-
- g_free (escaped);
-
- return basedir;
-}
-
-
-static void
-migration_account_manager_prepared_cb (GObject *source_object,
- GAsyncResult *result,
- gpointer user_data)
-{
- TpAccountManager *am = TP_ACCOUNT_MANAGER (source_object);
- GError *error = NULL;
- GList *accounts, *l;
- GSettings *gsettings;
-
- if (!tp_account_manager_prepare_finish (am, result, &error))
- {
- DEBUG ("Failed to prepare the account manager: %s", error->message);
- g_error_free (error);
- return;
- }
-
- accounts = tp_account_manager_get_valid_accounts (am);
-
- for (l = accounts; l != NULL; l = l->next)
- {
- TpAccount *account = TP_ACCOUNT (l->data);
- gchar *dir, *cm;
-
- tp_account_parse_object_path (tp_proxy_get_object_path (account),
- &cm, NULL, NULL, NULL);
-
- if (tp_strdiff (cm, "butterfly"))
- {
- g_free (cm);
- continue;
- }
-
- dir = get_log_dir_for_account (account);
- DEBUG ("Migrating all logs from dir: %s", dir);
-
- migrate_log_files_in_dir (dir);
-
- g_free (cm);
- g_free (dir);
- }
-
- DEBUG ("Finished all migrating");
-
- gsettings = g_settings_new (EMPATHY_PREFS_SCHEMA);
- g_settings_set_boolean (gsettings, EMPATHY_PREFS_BUTTERFLY_LOGS_MIGRATED,
- TRUE);
- g_object_unref (gsettings);
-
- g_list_free (accounts);
-}
-
-static gboolean
-migrate_logs (gpointer data)
-{
- TpAccountManager *account_manager;
-
- account_manager = tp_account_manager_dup ();
-
- tp_account_manager_prepare_async (account_manager, NULL,
- migration_account_manager_prepared_cb, NULL);
-
- g_object_unref (account_manager);
-
- return FALSE;
-}
-
-gboolean
-empathy_migrate_butterfly_logs (EmpathyContact *contact)
-{
- GSettings *gsettings = g_settings_new (EMPATHY_PREFS_SCHEMA);
- gchar *cm;
-
- /* Already in progress. */
- if (butterfly_log_migration_id != 0)
- return FALSE;
-
- /* Already done. */
- if (g_settings_get_boolean (gsettings, EMPATHY_PREFS_BUTTERFLY_LOGS_MIGRATED))
- return FALSE;
-
- tp_account_parse_object_path (
- tp_proxy_get_object_path (empathy_contact_get_account (contact)),
- &cm, NULL, NULL, NULL);
-
- if (tp_strdiff (cm, "butterfly"))
- {
- g_free (cm);
- return TRUE;
- }
- g_free (cm);
-
- if (g_str_has_suffix (empathy_contact_get_id (contact), "#32")
- || g_str_has_suffix (empathy_contact_get_id (contact), "#1"))
- return TRUE;
-
- /* Okay, we know a new butterfly is being used, so we should migrate its logs */
- butterfly_log_migration_id = g_idle_add_full (G_PRIORITY_LOW,
- migrate_logs, NULL, NULL);
-
- return FALSE;
-}
diff --git a/src/empathy-migrate-butterfly-logs.h b/src/empathy-migrate-butterfly-logs.h
deleted file mode 100644
index a06c1b488..000000000
--- a/src/empathy-migrate-butterfly-logs.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-* Copyright (C) 2010 Collabora Ltd.
-*
-* 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.
-*
-* 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
-*/
-
-#include <glib.h>
-
-#include <libempathy/empathy-contact.h>
-
-#ifndef __EMPATHY_MIGRATE_BUTTERFLY_LOGS_H__
-#define __EMPATHY_MIGRATE_BUTTERFLY_LOGS_H__
-
-G_BEGIN_DECLS
-
-gboolean empathy_migrate_butterfly_logs (EmpathyContact *contact);
-
-G_END_DECLS
-
-#endif /* __EMPATHY_MIGRATE_BUTTERFLY_LOGS_H__ */
diff --git a/src/empathy-new-chatroom-dialog.c b/src/empathy-new-chatroom-dialog.c
index a09a5f710..8176c4803 100644
--- a/src/empathy-new-chatroom-dialog.c
+++ b/src/empathy-new-chatroom-dialog.c
@@ -37,6 +37,7 @@
#include <libempathy/empathy-chatroom.h>
#include <libempathy/empathy-utils.h>
#include <libempathy/empathy-request-util.h>
+#include <libempathy/empathy-gsettings.h>
#include <libempathy-gtk/empathy-account-chooser.h>
#include <libempathy-gtk/empathy-ui-utils.h>
@@ -56,7 +57,7 @@ typedef struct {
GtkWidget *window;
GtkWidget *vbox_widgets;
- GtkWidget *table_info;
+ GtkWidget *table_grid;
GtkWidget *label_account;
GtkWidget *account_chooser;
GtkWidget *label_server;
@@ -71,6 +72,8 @@ typedef struct {
GtkWidget *button_join;
GtkWidget *label_error_message;
GtkWidget *viewport_error;
+
+ GSettings *gsettings;
} EmpathyNewChatroomDialog;
enum {
@@ -94,6 +97,8 @@ static void new_chatroom_dialog_model_add_columns (EmpathyNewC
static void new_chatroom_dialog_update_widgets (EmpathyNewChatroomDialog *dialog);
static void new_chatroom_dialog_account_changed_cb (GtkComboBox *combobox,
EmpathyNewChatroomDialog *dialog);
+static void new_chatroom_dialog_account_ready_cb (EmpathyAccountChooser *combobox,
+ EmpathyNewChatroomDialog *dialog);
static void new_chatroom_dialog_roomlist_destroy_cb (EmpathyTpRoomlist *room_list,
EmpathyNewChatroomDialog *dialog);
static void new_chatroom_dialog_new_room_cb (EmpathyTpRoomlist *room_list,
@@ -151,7 +156,7 @@ empathy_new_chatroom_dialog_show (GtkWindow *parent)
filename = empathy_file_lookup ("empathy-new-chatroom-dialog.ui", "src");
gui = empathy_builder_get_file (filename,
"new_chatroom_dialog", &dialog->window,
- "table_info", &dialog->table_info,
+ "table_grid", &dialog->table_grid,
"label_account", &dialog->label_account,
"label_server", &dialog->label_server,
"label_room", &dialog->label_room,
@@ -198,16 +203,21 @@ empathy_new_chatroom_dialog_show (GtkWindow *parent)
gtk_box_pack_start (GTK_BOX (dialog->hbox_expander), dialog->throbber,
TRUE, TRUE, 0);
+ dialog->gsettings = g_settings_new (EMPATHY_PREFS_CHAT_SCHEMA);
+
/* Account chooser for custom */
dialog->account_chooser = empathy_account_chooser_new ();
empathy_account_chooser_set_filter (EMPATHY_ACCOUNT_CHOOSER (dialog->account_chooser),
empathy_account_chooser_filter_supports_chatrooms,
NULL);
- gtk_table_attach_defaults (GTK_TABLE (dialog->table_info),
+ gtk_grid_attach (GTK_GRID (dialog->table_grid),
dialog->account_chooser,
- 1, 2, 0, 1);
+ 1, 0, 1, 1);
gtk_widget_show (dialog->account_chooser);
+ g_signal_connect (EMPATHY_ACCOUNT_CHOOSER (dialog->account_chooser), "ready",
+ G_CALLBACK (new_chatroom_dialog_account_ready_cb),
+ dialog);
g_signal_connect (GTK_COMBO_BOX (dialog->account_chooser), "changed",
G_CALLBACK (new_chatroom_dialog_account_changed_cb),
dialog);
@@ -223,12 +233,32 @@ empathy_new_chatroom_dialog_show (GtkWindow *parent)
}
static void
+new_chatroom_dialog_store_last_account (GSettings *gsettings,
+ EmpathyAccountChooser *account_chooser)
+{
+ TpAccount *account;
+ const char *account_path;
+
+ account = empathy_account_chooser_get_account (account_chooser);
+ if (account == NULL)
+ return;
+
+ account_path = tp_proxy_get_object_path (account);
+ DEBUG ("Storing account path '%s'", account_path);
+
+ g_settings_set (gsettings, EMPATHY_PREFS_CHAT_ROOM_LAST_ACCOUNT,
+ "o", account_path);
+}
+
+static void
new_chatroom_dialog_response_cb (GtkWidget *widget,
gint response,
EmpathyNewChatroomDialog *dialog)
{
if (response == GTK_RESPONSE_OK) {
new_chatroom_dialog_join (dialog);
+ new_chatroom_dialog_store_last_account (dialog->gsettings,
+ EMPATHY_ACCOUNT_CHOOSER (dialog->account_chooser));
}
gtk_widget_destroy (widget);
@@ -248,6 +278,8 @@ new_chatroom_dialog_destroy_cb (GtkWidget *widget,
g_object_unref (dialog->account);
}
+ g_clear_object (&dialog->gsettings);
+
g_free (dialog);
}
@@ -428,6 +460,44 @@ account_status_changed_cb (TpAccount *account,
}
static void
+new_chatroom_dialog_select_last_account (GSettings *gsettings,
+ EmpathyAccountChooser *account_chooser)
+{
+ const gchar *account_path;
+ TpAccountManager *manager;
+ TpSimpleClientFactory *factory;
+ TpAccount *account;
+ TpConnectionStatus status;
+
+ account_path = g_settings_get_string (gsettings, EMPATHY_PREFS_CHAT_ROOM_LAST_ACCOUNT);
+ DEBUG ("Selecting account path '%s'", account_path);
+
+ manager = tp_account_manager_dup ();
+ factory = tp_proxy_get_factory (manager);
+ account = tp_simple_client_factory_ensure_account (factory,
+ account_path,
+ NULL,
+ NULL);
+
+ if (account != NULL) {
+ status = tp_account_get_connection_status (account, NULL);
+ if (status == TP_CONNECTION_STATUS_CONNECTED) {
+ empathy_account_chooser_set_account (account_chooser,
+ account);
+ }
+ g_object_unref (account);
+ }
+ g_object_unref (manager);
+}
+
+static void
+new_chatroom_dialog_account_ready_cb (EmpathyAccountChooser *combobox,
+ EmpathyNewChatroomDialog *dialog)
+{
+ new_chatroom_dialog_select_last_account (dialog->gsettings, combobox);
+}
+
+static void
new_chatroom_dialog_account_changed_cb (GtkComboBox *combobox,
EmpathyNewChatroomDialog *dialog)
{
diff --git a/src/empathy-new-chatroom-dialog.ui b/src/empathy-new-chatroom-dialog.ui
index e2b6a814a..e77ec60cd 100644
--- a/src/empathy-new-chatroom-dialog.ui
+++ b/src/empathy-new-chatroom-dialog.ui
@@ -1,32 +1,82 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
<interface>
- <requires lib="gtk+" version="2.16"/>
- <!-- interface-naming-policy toplevel-contextual -->
+ <!-- interface-requires gtk+ 3.0 -->
<object class="GtkImage" id="join_image">
+ <property name="can_focus">False</property>
<property name="stock">gtk-jump-to</property>
</object>
<object class="GtkDialog" id="new_chatroom_dialog">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="title" translatable="yes">Join Room</property>
<property name="role">join_new_chatroom</property>
<property name="default_width">350</property>
<property name="type_hint">dialog</property>
<child internal-child="vbox">
- <object class="GtkVBox" id="dialog-vbox4">
+ <object class="GtkBox" id="dialog-vbox4">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="dialog-action_area4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="button_cancel">
+ <property name="label">gtk-cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="button_join">
+ <property name="label" translatable="yes">_Join</property>
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_action_appearance">False</property>
+ <property name="image">join_image</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
<child>
<object class="GtkVBox" id="vbox_widgets">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="spacing">5</property>
<child>
- <object class="GtkTable" id="table_info">
+ <object class="GtkGrid" id="table_grid">
<property name="visible">True</property>
- <property name="n_rows">3</property>
- <property name="n_columns">2</property>
- <property name="column_spacing">5</property>
+ <property name="can_focus">False</property>
<property name="row_spacing">5</property>
+ <property name="column_spacing">5</property>
<child>
<object class="GtkEntry" id="entry_room">
<property name="visible">True</property>
@@ -37,24 +87,25 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="right_attach">2</property>
<property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_room">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Room:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">entry_room</property>
</object>
<packing>
+ <property name="left_attach">0</property>
<property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
@@ -66,42 +117,41 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="right_attach">2</property>
<property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_server">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Server:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">entry_server</property>
</object>
<packing>
+ <property name="left_attach">0</property>
<property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_account">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Account:</property>
</object>
<packing>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
- <child>
- <placeholder/>
- </child>
</object>
<packing>
<property name="expand">False</property>
@@ -116,16 +166,20 @@
<child>
<object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="spacing">2</property>
<child>
<object class="GtkViewport" id="viewport_error">
+ <property name="can_focus">False</property>
<property name="resize_mode">queue</property>
<child>
<object class="GtkHBox" id="hbox1">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<child>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="stock">gtk-dialog-error</property>
<property name="icon-size">1</property>
</object>
@@ -139,11 +193,14 @@
<child>
<object class="GtkLabel" id="label_error_message">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="xpad">10</property>
<property name="label" translatable="yes">Couldn't load room list</property>
</object>
<packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
@@ -152,10 +209,12 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
<property name="relief">none</property>
<child>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="stock">gtk-close</property>
<property name="icon-size">1</property>
</object>
@@ -183,7 +242,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">never</property>
- <property name="vscrollbar_policy">automatic</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkTreeView" id="treeview">
@@ -191,10 +249,15 @@
<property name="can_focus">True</property>
<property name="search_column">0</property>
<property name="show_expanders">False</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection" id="treeview-selection1"/>
+ </child>
</object>
</child>
</object>
<packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
@@ -203,13 +266,17 @@
<child type="label">
<object class="GtkHBox" id="hbox_expander">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes">Room List</property>
</object>
<packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
@@ -220,56 +287,16 @@
</child>
</object>
<packing>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child internal-child="action_area">
- <object class="GtkHButtonBox" id="dialog-action_area4">
- <property name="visible">True</property>
- <property name="layout_style">end</property>
- <child>
- <object class="GtkButton" id="button_cancel">
- <property name="label">gtk-cancel</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="button_join">
- <property name="label" translatable="yes">_Join</property>
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="receives_default">False</property>
- <property name="image">join_image</property>
- <property name="use_underline">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
</packing>
</child>
</object>
diff --git a/src/empathy-notifications-approver.c b/src/empathy-notifications-approver.c
index aa4630849..c312a3be6 100644
--- a/src/empathy-notifications-approver.c
+++ b/src/empathy-notifications-approver.c
@@ -253,10 +253,10 @@ add_notification_actions (EmpathyNotificationsApprover *self,
break;
case EMPATHY_EVENT_TYPE_AUTH:
- /* translators: the 'Provide' button is displayed in a notification
- * bubble when Empathy is asking for an account password; clicking on it
- * brings the password popup. */
notify_notification_add_action (notification,
+ /* translators: the 'Provide' button is displayed in a notification
+ * bubble when Empathy is asking for an account password; clicking on it
+ * brings the password popup. */
"provide", _("Provide"), (NotifyActionCallback) notification_approve_cb,
self, NULL);
break;
diff --git a/src/empathy-preferences.c b/src/empathy-preferences.c
index 9dc7f58bf..3eb9e608d 100644
--- a/src/empathy-preferences.c
+++ b/src/empathy-preferences.c
@@ -846,7 +846,8 @@ preferences_theme_variant_notify_cb (GSettings *gsettings,
g_free (conf_name);
}
-static void
+/* return TRUE if we added at least one variant */
+static gboolean
preferences_theme_variants_fill (EmpathyPreferences *preferences,
GHashTable *info)
{
@@ -856,6 +857,7 @@ preferences_theme_variants_fill (EmpathyPreferences *preferences,
GPtrArray *variants;
const gchar *default_variant;
guint i;
+ gboolean result = FALSE;
model = gtk_combo_box_get_model (GTK_COMBO_BOX (priv->combobox_chat_theme_variant));
store = GTK_LIST_STORE (model);
@@ -870,12 +872,16 @@ preferences_theme_variants_fill (EmpathyPreferences *preferences,
COL_VARIANT_NAME, name,
COL_VARIANT_DEFAULT, !tp_strdiff (name, default_variant),
-1);
+
+ result = TRUE;
}
/* Select the variant from the GSetting key */
preferences_theme_variant_notify_cb (priv->gsettings_chat,
EMPATHY_PREFS_CHAT_THEME_VARIANT,
preferences);
+
+ return result;
}
static void
@@ -943,11 +949,14 @@ preferences_theme_changed_cb (GtkComboBox *combo,
EMPATHY_PREFS_CHAT_THEME,
name);
if (is_adium) {
+ gboolean variant;
+
g_settings_set_string (priv->gsettings_chat,
EMPATHY_PREFS_CHAT_ADIUM_PATH,
path);
- preferences_theme_variants_fill (preferences, info);
- gtk_widget_show (priv->hbox_chat_theme_variant);
+
+ variant = preferences_theme_variants_fill (preferences, info);
+ gtk_widget_set_visible (priv->hbox_chat_theme_variant, variant);
} else {
gtk_widget_hide (priv->hbox_chat_theme_variant);
}
@@ -1283,9 +1292,12 @@ empathy_preferences_tab_to_string (EmpathyPreferencesTab tab)
}
GtkWidget *
-empathy_preferences_new (GtkWindow *parent)
+empathy_preferences_new (GtkWindow *parent,
+ gboolean shell_running)
{
- GtkWidget *self;
+ GtkWidget *self;
+ EmpathyPreferencesPriv *priv;
+ GtkWidget *notif_page;
g_return_val_if_fail (parent == NULL || GTK_IS_WINDOW (parent), NULL);
@@ -1296,6 +1308,19 @@ empathy_preferences_new (GtkWindow *parent)
parent);
}
+ /* when running in Gnome Shell we must hide these options since they
+ * are meaningless in that context:
+ * - 'Display incoming events in the notification area' (General->Behavior)
+ * - 'Notifications' tab
+ */
+ priv = GET_PRIV (self);
+ if (shell_running) {
+ gtk_widget_hide (priv->checkbutton_events_notif_area);
+ notif_page = gtk_notebook_get_nth_page (GTK_NOTEBOOK (priv->notebook),
+ EMPATHY_PREFERENCES_TAB_NOTIFICATIONS);
+ gtk_widget_hide (notif_page);
+ }
+
return self;
}
diff --git a/src/empathy-preferences.h b/src/empathy-preferences.h
index fef0646d7..b8b126bd8 100644
--- a/src/empathy-preferences.h
+++ b/src/empathy-preferences.h
@@ -64,7 +64,8 @@ typedef enum
GType empathy_preferences_get_type (void);
-GtkWidget *empathy_preferences_new (GtkWindow *parent);
+GtkWidget *empathy_preferences_new (GtkWindow *parent,
+ gboolean shell_running);
void empathy_preferences_show_tab (EmpathyPreferences *self,
const gchar *tab);
diff --git a/src/empathy-preferences.ui b/src/empathy-preferences.ui
index 791f3fbd9..67575abaa 100644
--- a/src/empathy-preferences.ui
+++ b/src/empathy-preferences.ui
@@ -495,7 +495,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes">Input volume</property>
+ <property name="label" translatable="yes">Input volume:</property>
</object>
<packing>
<property name="expand">False</property>
@@ -535,7 +535,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes">Input level</property>
+ <property name="label" translatable="yes">Input level:</property>
</object>
<packing>
<property name="expand">False</property>
@@ -563,7 +563,7 @@
</child>
<child>
<object class="GtkCheckButton" id="call_echo_cancellation">
- <property name="label">_Echo Cancellation</property>
+ <property name="label">Use _echo cancellation to improve call quality</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="use_underline">True</property>
@@ -574,6 +574,47 @@
<property name="position">2</property>
</packing>
</child>
+ <child>
+ <object class="GtkBox" id="box1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkImage" id="image2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-dialog-info</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label7">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Echo cancellation helps to make your voice sound clearer to the other person, but may cause problems on some computers. If you or the other person hear strange noises or glitches during calls, try turning echo cancellation off and restarting the call.</property>
+ <property name="wrap">True</property>
+ <attributes>
+ <attribute name="scale" value="0.80000000000000004"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
</object>
</child>
</object>
@@ -973,137 +1014,98 @@
</packing>
</child>
<child>
- <object class="GtkBox" id="vbox206">
+ <object class="GtkBox" id="vbox_chat_theme">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">12</property>
<property name="orientation">vertical</property>
- <property name="spacing">18</property>
+ <property name="spacing">6</property>
<child>
- <object class="GtkFrame" id="frame11">
+ <object class="GtkBox" id="hbox139">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">none</property>
+ <property name="spacing">12</property>
<child>
- <object class="GtkAlignment" id="alignment19">
+ <object class="GtkLabel" id="label586">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="top_padding">6</property>
- <property name="left_padding">12</property>
+ <property name="label" translatable="yes">Chat Th_eme:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">combobox_chat_theme</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="combobox_chat_theme">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="hbox_chat_theme_variant">
+ <property name="can_focus">False</property>
+ <property name="spacing">12</property>
<child>
- <object class="GtkBox" id="vbox_chat_theme">
+ <object class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkBox" id="hbox139">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">12</property>
- <child>
- <object class="GtkLabel" id="label586">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Chat Th_eme:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">combobox_chat_theme</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="combobox_chat_theme">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkBox" id="hbox_chat_theme_variant">
- <property name="can_focus">False</property>
- <property name="spacing">12</property>
- <child>
- <object class="GtkLabel" id="label4">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Variant:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">combobox_chat_theme_variant</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="combobox_chat_theme_variant">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkScrolledWindow" id="sw_chat_theme_preview">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="shadow_type">in</property>
- <child>
- <placeholder/>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
+ <property name="label" translatable="yes">Variant:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">combobox_chat_theme_variant</property>
</object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="combobox_chat_theme_variant">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
</child>
</object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
</child>
- <child type="label">
- <object class="GtkLabel" id="label626">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Appearance</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="sw_chat_theme_preview">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <placeholder/>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
- <property name="position">0</property>
+ <property name="position">1</property>
</packing>
</child>
</object>
diff --git a/src/empathy-rounded-actor.c b/src/empathy-rounded-actor.c
index 463a73c61..0537dea96 100644
--- a/src/empathy-rounded-actor.c
+++ b/src/empathy-rounded-actor.c
@@ -26,9 +26,15 @@
G_DEFINE_TYPE(EmpathyRoundedActor, empathy_rounded_actor, GTK_CLUTTER_TYPE_ACTOR)
+struct _EmpathyRoundedActorPriv
+{
+ guint round_factor;
+};
+
static void
empathy_rounded_actor_paint (ClutterActor *actor)
{
+ EmpathyRoundedActor *self = EMPATHY_ROUNDED_ACTOR (actor);
ClutterActorBox allocation = { 0, };
gfloat width, height;
@@ -38,7 +44,8 @@ empathy_rounded_actor_paint (ClutterActor *actor)
cogl_path_new ();
/* create and store a path describing a rounded rectangle */
- cogl_path_round_rectangle (0, 0, width, height, height / 2, 0.1);
+ cogl_path_round_rectangle (0, 0, width, height,
+ height / self->priv->round_factor, 0.1);
cogl_clip_push_from_path ();
@@ -50,6 +57,10 @@ empathy_rounded_actor_paint (ClutterActor *actor)
static void
empathy_rounded_actor_init (EmpathyRoundedActor *self)
{
+ self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
+ EMPATHY_TYPE_ROUNDED_ACTOR, EmpathyRoundedActorPriv);
+
+ self->priv->round_factor = 2;
}
static void
@@ -58,6 +69,8 @@ empathy_rounded_actor_class_init (EmpathyRoundedActorClass *klass)
ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass);
actor_class->paint = empathy_rounded_actor_paint;
+
+ g_type_class_add_private (klass, sizeof (EmpathyRoundedActorPriv));
}
ClutterActor *
@@ -66,3 +79,10 @@ empathy_rounded_actor_new (void)
return CLUTTER_ACTOR (
g_object_new (EMPATHY_TYPE_ROUNDED_ACTOR, NULL));
}
+
+void
+empathy_rounded_actor_set_round_factor (EmpathyRoundedActor *self,
+ guint round_factor)
+{
+ self->priv->round_factor = round_factor;
+}
diff --git a/src/empathy-rounded-actor.h b/src/empathy-rounded-actor.h
index e4c83b078..4287cf389 100644
--- a/src/empathy-rounded-actor.h
+++ b/src/empathy-rounded-actor.h
@@ -27,6 +27,7 @@
G_BEGIN_DECLS
typedef struct _EmpathyRoundedActor EmpathyRoundedActor;
+typedef struct _EmpathyRoundedActorPriv EmpathyRoundedActorPriv;
typedef struct _EmpathyRoundedActorClass EmpathyRoundedActorClass;
struct _EmpathyRoundedActorClass {
@@ -35,6 +36,8 @@ struct _EmpathyRoundedActorClass {
struct _EmpathyRoundedActor {
GtkClutterActor parent;
+
+ EmpathyRoundedActorPriv *priv;
};
GType empathy_rounded_actor_get_type (void);
@@ -58,6 +61,9 @@ GType empathy_rounded_actor_get_type (void);
ClutterActor *empathy_rounded_actor_new (void);
+void empathy_rounded_actor_set_round_factor (EmpathyRoundedActor *self,
+ guint round_factor);
+
G_END_DECLS
#endif /* #ifndef __EMPATHY_ROUNDED_ACTOR_H__*/
diff --git a/src/empathy-status-icon.c b/src/empathy-status-icon.c
index 008ea4701..d6f5b2e46 100644
--- a/src/empathy-status-icon.c
+++ b/src/empathy-status-icon.c
@@ -437,7 +437,7 @@ account_manager_prepared_cb (GObject *source_object,
EmpathyStatusIcon *icon = user_data;
GError *error = NULL;
- if (!tp_account_manager_prepare_finish (account_manager, result, &error)) {
+ if (!tp_proxy_prepare_finish (account_manager, result, &error)) {
DEBUG ("Failed to prepare account manager: %s", error->message);
g_error_free (error);
return;
@@ -465,7 +465,7 @@ empathy_status_icon_init (EmpathyStatusIcon *icon)
priv->account_manager = tp_account_manager_dup ();
priv->event_manager = empathy_event_manager_dup_singleton ();
- tp_account_manager_prepare_async (priv->account_manager, NULL,
+ tp_proxy_prepare_async (priv->account_manager, NULL,
account_manager_prepared_cb, icon);
/* make icon listen and respond to MAIN_WINDOW_HIDDEN changes */
diff --git a/src/empathy-streamed-media-factory.c b/src/empathy-streamed-media-factory.c
index 9ef5da5e1..1c25ae253 100644
--- a/src/empathy-streamed-media-factory.c
+++ b/src/empathy-streamed-media-factory.c
@@ -32,7 +32,6 @@
#include "empathy-streamed-media-factory.h"
#include "empathy-streamed-media-handler.h"
-#include "src-marshal.h"
#define DEBUG_FLAG EMPATHY_DEBUG_VOIP
#include <libempathy/empathy-debug.h>
@@ -166,7 +165,7 @@ empathy_streamed_media_factory_class_init (
G_TYPE_FROM_CLASS (empathy_streamed_media_factory_class),
G_SIGNAL_RUN_LAST, 0,
NULL, NULL,
- _src_marshal_VOID__OBJECT_BOOLEAN,
+ g_cclosure_marshal_generic,
G_TYPE_NONE,
2, EMPATHY_TYPE_STREAMED_MEDIA_HANDLER, G_TYPE_BOOLEAN);
}
diff --git a/src/empathy-streamed-media-handler.c b/src/empathy-streamed-media-handler.c
index 39e3e560d..67527d8e4 100644
--- a/src/empathy-streamed-media-handler.c
+++ b/src/empathy-streamed-media-handler.c
@@ -34,7 +34,6 @@
#include <libempathy-gtk/empathy-call-utils.h>
#include "empathy-streamed-media-handler.h"
-#include "src-marshal.h"
#define DEBUG_FLAG EMPATHY_DEBUG_VOIP
#include <libempathy/empathy-debug.h>
@@ -342,21 +341,21 @@ empathy_streamed_media_handler_class_init (EmpathyStreamedMediaHandlerClass *kla
signals[CONFERENCE_ADDED] =
g_signal_new ("conference-added", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, 0, NULL, NULL,
- g_cclosure_marshal_VOID__OBJECT,
+ g_cclosure_marshal_generic,
G_TYPE_NONE,
1, FS_TYPE_CONFERENCE);
signals[SRC_PAD_ADDED] =
g_signal_new ("src-pad-added", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, 0, NULL, NULL,
- _src_marshal_BOOLEAN__OBJECT_UINT,
+ g_cclosure_marshal_generic,
G_TYPE_BOOLEAN,
2, GST_TYPE_PAD, G_TYPE_UINT);
signals[SINK_PAD_ADDED] =
g_signal_new ("sink-pad-added", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, 0, NULL, NULL,
- _src_marshal_BOOLEAN__OBJECT_UINT,
+ g_cclosure_marshal_generic,
G_TYPE_BOOLEAN,
2, GST_TYPE_PAD, G_TYPE_UINT);
@@ -364,26 +363,26 @@ empathy_streamed_media_handler_class_init (EmpathyStreamedMediaHandlerClass *kla
g_signal_new ("request-resource", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, 0,
g_signal_accumulator_true_handled, NULL,
- _src_marshal_BOOLEAN__UINT_UINT,
+ g_cclosure_marshal_generic,
G_TYPE_BOOLEAN, 2, G_TYPE_UINT, G_TYPE_UINT);
signals[CLOSED] =
g_signal_new ("closed", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, 0, NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
+ g_cclosure_marshal_generic,
G_TYPE_NONE,
0);
signals[STREAM_CLOSED] =
g_signal_new ("stream-closed", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, 0, NULL, NULL,
- g_cclosure_marshal_VOID__OBJECT,
+ g_cclosure_marshal_generic,
G_TYPE_NONE, 1, TF_TYPE_STREAM);
signals[CANDIDATES_CHANGED] =
g_signal_new ("candidates-changed", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, 0, NULL, NULL,
- g_cclosure_marshal_VOID__UINT,
+ g_cclosure_marshal_generic,
G_TYPE_NONE, 1, G_TYPE_UINT);
}
diff --git a/src/empathy-streamed-media-window.c b/src/empathy-streamed-media-window.c
index d60c0753b..26bd689ac 100644
--- a/src/empathy-streamed-media-window.c
+++ b/src/empathy-streamed-media-window.c
@@ -1840,16 +1840,16 @@ reset_details_pane (EmpathyStreamedMediaWindow *self)
/* translators: encoding video codec is unknown */
gtk_label_set_text (GTK_LABEL (priv->vcodec_encoding_label),
- C_("encoding video codec", "Unknown"));
+ C_("codec", "Unknown"));
/* translators: encoding audio codec is unknown */
gtk_label_set_text (GTK_LABEL (priv->acodec_encoding_label),
- C_("encoding audio codec", "Unknown"));
+ C_("codec", "Unknown"));
/* translators: decoding video codec is unknown */
gtk_label_set_text (GTK_LABEL (priv->vcodec_decoding_label),
- C_("decoding video codec", "Unknown"));
+ C_("codec", "Unknown"));
/* translators: decoding audio codec is unknown */
gtk_label_set_text (GTK_LABEL (priv->acodec_decoding_label),
- C_("decoding audio codec", "Unknown"));
+ C_("codec", "Unknown"));
}
static gboolean
diff --git a/src/empathy-streamed-media-window.ui b/src/empathy-streamed-media-window.ui
index ecd00dfc1..5f1a16e8c 100644
--- a/src/empathy-streamed-media-window.ui
+++ b/src/empathy-streamed-media-window.ui
@@ -298,11 +298,8 @@
<property name="right_padding">0</property>
<child>
- <object class="GtkTable" id="video">
+ <object class="GtkGrid" id="video">
<property name="visible">True</property>
- <property name="n_rows">4</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
@@ -329,11 +326,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="right_attach">1</property>
<property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
@@ -359,11 +352,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="right_attach">2</property>
<property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
@@ -390,11 +379,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="right_attach">1</property>
<property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
@@ -420,11 +405,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="right_attach">2</property>
<property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
@@ -451,11 +432,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="right_attach">1</property>
<property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
@@ -480,11 +457,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="right_attach">2</property>
<property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
@@ -496,11 +469,7 @@
</object>
<packing>
<property name="left_attach">2</property>
- <property name="right_attach">3</property>
<property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
@@ -528,11 +497,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="right_attach">1</property>
<property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
@@ -557,11 +522,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="right_attach">2</property>
<property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
@@ -573,11 +534,7 @@
</object>
<packing>
<property name="left_attach">2</property>
- <property name="right_attach">3</property>
<property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
@@ -646,11 +603,8 @@
<property name="right_padding">0</property>
<child>
- <object class="GtkTable" id="audio">
+ <object class="GtkGrid" id="audio">
<property name="visible">True</property>
- <property name="n_rows">4</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
@@ -677,11 +631,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="right_attach">1</property>
<property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
@@ -706,11 +656,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="right_attach">2</property>
<property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
@@ -737,11 +683,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="right_attach">1</property>
<property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
@@ -766,11 +708,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="right_attach">2</property>
<property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
@@ -797,11 +735,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="right_attach">1</property>
<property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
@@ -826,11 +760,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="right_attach">2</property>
<property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
@@ -842,11 +772,7 @@
</object>
<packing>
<property name="left_attach">2</property>
- <property name="right_attach">3</property>
<property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
@@ -873,11 +799,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="right_attach">1</property>
<property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
@@ -902,11 +824,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="right_attach">2</property>
<property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
@@ -918,11 +836,7 @@
</object>
<packing>
<property name="left_attach">2</property>
- <property name="right_attach">3</property>
<property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
</packing>
</child>
diff --git a/src/empathy-video-src.c b/src/empathy-video-src.c
index 25d257f3d..ca8370d82 100644
--- a/src/empathy-video-src.c
+++ b/src/empathy-video-src.c
@@ -245,23 +245,41 @@ empathy_video_src_new (void)
return gst_element_factory_make ("empathyvideosrc", NULL);
}
+static GstColorBalance *
+dup_color_balance (GstElement *src)
+{
+ GstElement *color;
+
+ /* Find something supporting GstColorBalance */
+ color = gst_bin_get_by_interface (GST_BIN (src), GST_TYPE_COLOR_BALANCE);
+
+ if (color == NULL)
+ return NULL;
+
+ /* colorbalance is wrapped by GstImplementsInterface, we
+ * need to check if it is actually supported for this instance
+ * in its current state before trying to use it */
+ if (!GST_IS_COLOR_BALANCE (color))
+ {
+ g_object_unref (color);
+ return NULL;
+ }
+
+ return GST_COLOR_BALANCE (color);
+}
+
void
empathy_video_src_set_channel (GstElement *src,
EmpathyGstVideoSrcChannel channel, guint percent)
{
- GstElement *color;
GstColorBalance *balance;
const GList *channels;
GList *l;
- /* Find something supporting GstColorBalance */
- color = gst_bin_get_by_interface (GST_BIN (src), GST_TYPE_COLOR_BALANCE);
-
- if (color == NULL)
+ balance = dup_color_balance (src);
+ if (balance == NULL)
return;
- balance = GST_COLOR_BALANCE (color);
-
channels = gst_color_balance_list_channels (balance);
for (l = (GList *) channels; l != NULL; l = g_list_next (l))
@@ -277,27 +295,22 @@ empathy_video_src_set_channel (GstElement *src,
}
}
- g_object_unref (color);
+ g_object_unref (balance);
}
guint
empathy_video_src_get_channel (GstElement *src,
EmpathyGstVideoSrcChannel channel)
{
- GstElement *color;
GstColorBalance *balance;
const GList *channels;
GList *l;
guint percent = 0;
- /* Find something supporting GstColorBalance */
- color = gst_bin_get_by_interface (GST_BIN (src), GST_TYPE_COLOR_BALANCE);
-
- if (color == NULL)
+ balance = dup_color_balance (src);
+ if (balance == NULL)
return percent;
- balance = GST_COLOR_BALANCE (color);
-
channels = gst_color_balance_list_channels (balance);
for (l = (GList *) channels; l != NULL; l = g_list_next (l))
@@ -315,7 +328,7 @@ empathy_video_src_get_channel (GstElement *src,
}
}
- g_object_unref (color);
+ g_object_unref (balance);
return percent;
}
@@ -324,20 +337,15 @@ empathy_video_src_get_channel (GstElement *src,
guint
empathy_video_src_get_supported_channels (GstElement *src)
{
- GstElement *color;
GstColorBalance *balance;
const GList *channels;
GList *l;
guint result = 0;
- /* Find something supporting GstColorBalance */
- color = gst_bin_get_by_interface (GST_BIN (src), GST_TYPE_COLOR_BALANCE);
-
- if (color == NULL)
+ balance = dup_color_balance (src);
+ if (balance == NULL)
goto out;
- balance = GST_COLOR_BALANCE (color);
-
channels = gst_color_balance_list_channels (balance);
for (l = (GList *) channels; l != NULL; l = g_list_next (l))
@@ -355,7 +363,7 @@ empathy_video_src_get_supported_channels (GstElement *src)
}
}
- g_object_unref (color);
+ g_object_unref (balance);
out:
return result;
diff --git a/src/empathy.c b/src/empathy.c
index 9294557ec..e1dab1f18 100644
--- a/src/empathy.c
+++ b/src/empathy.c
@@ -287,6 +287,9 @@ out:
/* Rely on GNOME Shell to watch session state */
empathy_presence_manager_set_auto_away (self->presence_mgr, FALSE);
+
+ empathy_main_window_set_shell_running (EMPATHY_MAIN_WINDOW (self->window),
+ TRUE);
}
else
{
@@ -382,7 +385,7 @@ empathy_app_command_line (GApplication *app,
empathy_window_present (GTK_WINDOW (self->window));
/* Display the accounts dialog if needed */
- tp_account_manager_prepare_async (self->account_manager, NULL,
+ tp_proxy_prepare_async (self->account_manager, NULL,
account_manager_ready_cb, self);
return 0;
@@ -626,7 +629,7 @@ account_manager_ready_cb (GObject *source_object,
GError *error = NULL;
TpConnectionPresenceType presence;
- if (!tp_account_manager_prepare_finish (manager, result, &error))
+ if (!tp_proxy_prepare_finish (manager, result, &error))
{
GtkWidget *dialog;
@@ -672,13 +675,10 @@ account_join_chatrooms (TpAccount *account,
TpConnection *conn;
GList *chatrooms, *p;
- if (tp_account_get_connection_status (account, NULL) !=
- TP_CONNECTION_STATUS_CONNECTED)
- return;
-
- /* If we're connected we should have a connection */
+ /* Wait if we are not connected or the TpConnection is not prepared yet */
conn = tp_account_get_connection (account);
- g_return_if_fail (conn != NULL);
+ if (conn == NULL)
+ return;
chatrooms = empathy_chatroom_manager_get_chatrooms (
chatroom_manager, account);
@@ -697,12 +697,8 @@ account_join_chatrooms (TpAccount *account,
}
static void
-account_status_changed_cb (TpAccount *account,
- guint old_status,
- guint new_status,
- guint reason,
- gchar *dbus_error_name,
- GHashTable *details,
+account_connection_changed_cb (TpAccount *account,
+ GParamSpec *spec,
EmpathyChatroomManager *manager)
{
account_join_chatrooms (account, manager);
@@ -718,7 +714,7 @@ account_manager_chatroom_ready_cb (GObject *source_object,
GList *accounts, *l;
GError *error = NULL;
- if (!tp_account_manager_prepare_finish (account_manager, result, &error))
+ if (!tp_proxy_prepare_finish (account_manager, result, &error))
{
DEBUG ("Failed to prepare account manager: %s", error->message);
g_error_free (error);
@@ -735,8 +731,8 @@ account_manager_chatroom_ready_cb (GObject *source_object,
account_join_chatrooms (account, chatroom_manager);
/* And/or join them on (re)connection */
- tp_g_signal_connect_object (account, "status-changed",
- G_CALLBACK (account_status_changed_cb), chatroom_manager, 0);
+ tp_g_signal_connect_object (account, "notify::connection",
+ G_CALLBACK (account_connection_changed_cb), chatroom_manager, 0);
}
g_list_free (accounts);
}
@@ -748,7 +744,7 @@ chatroom_manager_ready_cb (EmpathyChatroomManager *chatroom_manager,
{
TpAccountManager *account_manager = user_data;
- tp_account_manager_prepare_async (account_manager, NULL,
+ tp_proxy_prepare_async (account_manager, NULL,
account_manager_chatroom_ready_cb, chatroom_manager);
}
@@ -786,7 +782,7 @@ empathy_app_constructed (GObject *object)
/* account management */
self->account_manager = tp_account_manager_dup ();
- tp_account_manager_prepare_async (self->account_manager, NULL,
+ tp_proxy_prepare_async (self->account_manager, NULL,
account_manager_ready_cb, self);
migrate_config_to_xdg_dir ();
diff --git a/src/ev-sidebar.c b/src/ev-sidebar.c
index 56e5cf982..1d0b2df2f 100644
--- a/src/ev-sidebar.c
+++ b/src/ev-sidebar.c
@@ -76,7 +76,7 @@ ev_sidebar_class_init (EvSidebarClass *ev_sidebar_class)
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (EvSidebarClass, closed),
NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
+ g_cclosure_marshal_generic,
G_TYPE_NONE, 0);
ev_sidebar_table_signals[CHANGED] =
@@ -85,7 +85,7 @@ ev_sidebar_class_init (EvSidebarClass *ev_sidebar_class)
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (EvSidebarClass, closed),
NULL, NULL,
- g_cclosure_marshal_VOID__STRING,
+ g_cclosure_marshal_generic,
G_TYPE_NONE, 1, G_TYPE_STRING);
}