aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-account-widget.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-05-08 19:46:48 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-05-09 15:34:18 +0800
commit852af596dcc11e104a5565e953240af2f83b4cc2 (patch)
tree1415384824801ec6fc5437b655169fc507dc644e /libempathy-gtk/empathy-account-widget.c
parentd3e20304bf68216c268e2c7db0a2a081b8d3a197 (diff)
downloadgsoc2013-empathy-852af596dcc11e104a5565e953240af2f83b4cc2.tar
gsoc2013-empathy-852af596dcc11e104a5565e953240af2f83b4cc2.tar.gz
gsoc2013-empathy-852af596dcc11e104a5565e953240af2f83b4cc2.tar.bz2
gsoc2013-empathy-852af596dcc11e104a5565e953240af2f83b4cc2.tar.lz
gsoc2013-empathy-852af596dcc11e104a5565e953240af2f83b4cc2.tar.xz
gsoc2013-empathy-852af596dcc11e104a5565e953240af2f83b4cc2.tar.zst
gsoc2013-empathy-852af596dcc11e104a5565e953240af2f83b4cc2.zip
account-widget: delay 'close' signal if enabling the account
The whole point of this signal is to tell to user when it can be destroyed, so we shouldn't fire it if we are still pending on an async call. https://bugzilla.gnome.org/show_bug.cgi?id=675667
Diffstat (limited to 'libempathy-gtk/empathy-account-widget.c')
-rw-r--r--libempathy-gtk/empathy-account-widget.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/libempathy-gtk/empathy-account-widget.c b/libempathy-gtk/empathy-account-widget.c
index 6848c87ed..96e6a8868 100644
--- a/libempathy-gtk/empathy-account-widget.c
+++ b/libempathy-gtk/empathy-account-widget.c
@@ -903,6 +903,8 @@ account_widget_account_enabled_cb (GObject *source_object,
empathy_connect_new_account (account, self->priv->account_manager);
}
+ g_signal_emit (self, signals[CLOSE], 0, GTK_RESPONSE_APPLY);
+
/* unref self - part of the workaround */
g_object_unref (self);
}
@@ -917,6 +919,7 @@ account_widget_applied_cb (GObject *source_object,
EmpathyAccountSettings *settings = EMPATHY_ACCOUNT_SETTINGS (source_object);
EmpathyAccountWidget *self = EMPATHY_ACCOUNT_WIDGET (user_data);
gboolean reconnect_required;
+ gboolean fire_close = TRUE;
empathy_account_settings_apply_finish (settings, res, &reconnect_required,
&error);
@@ -942,6 +945,9 @@ account_widget_applied_cb (GObject *source_object,
tp_account_set_enabled_async (account, TRUE,
account_widget_account_enabled_cb, self);
g_signal_emit (self, signals[ACCOUNT_CREATED], 0, account);
+
+ /* Will be fired in account_widget_account_enabled_cb */
+ fire_close = FALSE;
}
else
{
@@ -969,8 +975,11 @@ account_widget_applied_cb (GObject *source_object,
self->priv->contains_pending_changes = FALSE;
- /* announce the widget can be closed */
- g_signal_emit (self, signals[CLOSE], 0, GTK_RESPONSE_APPLY);
+ if (fire_close)
+ {
+ /* announce the widget can be closed */
+ g_signal_emit (self, signals[CLOSE], 0, GTK_RESPONSE_APPLY);
+ }
/* unref the widget - part of the workaround */
g_object_unref (self);