aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-03-28 16:26:39 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-04-05 21:03:33 +0800
commitca2423f0a3e6954ac551d5073fae7c5c944c828f (patch)
treeec79b7e015cc36422ee071f38b2bbb166b70683e
parent4322574cde666404adbe8512616d20b54e19426a (diff)
downloadgsoc2013-empathy-ca2423f0a3e6954ac551d5073fae7c5c944c828f.tar
gsoc2013-empathy-ca2423f0a3e6954ac551d5073fae7c5c944c828f.tar.gz
gsoc2013-empathy-ca2423f0a3e6954ac551d5073fae7c5c944c828f.tar.bz2
gsoc2013-empathy-ca2423f0a3e6954ac551d5073fae7c5c944c828f.tar.lz
gsoc2013-empathy-ca2423f0a3e6954ac551d5073fae7c5c944c828f.tar.xz
gsoc2013-empathy-ca2423f0a3e6954ac551d5073fae7c5c944c828f.tar.zst
gsoc2013-empathy-ca2423f0a3e6954ac551d5073fae7c5c944c828f.zip
presence-chooser: use GNetworkMonitor
-rw-r--r--libempathy-gtk/empathy-presence-chooser.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/libempathy-gtk/empathy-presence-chooser.c b/libempathy-gtk/empathy-presence-chooser.c
index e93573ed1..33637d483 100644
--- a/libempathy-gtk/empathy-presence-chooser.c
+++ b/libempathy-gtk/empathy-presence-chooser.c
@@ -36,7 +36,6 @@
#include <telepathy-glib/account-manager.h>
#include <telepathy-glib/util.h>
-#include <libempathy/empathy-connectivity.h>
#include <libempathy/empathy-presence-manager.h>
#include <libempathy/empathy-utils.h>
#include <libempathy/empathy-status-presets.h>
@@ -97,7 +96,7 @@ typedef enum {
typedef struct {
EmpathyPresenceManager *presence_mgr;
- EmpathyConnectivity *connectivity;
+ GNetworkMonitor *connectivity;
gboolean editing_status;
int block_set_editing;
@@ -775,7 +774,7 @@ update_sensitivity_am_prepared_cb (GObject *source_object,
g_list_free (accounts);
- if (!empathy_connectivity_is_online (priv->connectivity))
+ if (!g_network_monitor_get_network_available (priv->connectivity))
sensitive = FALSE;
gtk_widget_set_sensitive (GTK_WIDGET (chooser), sensitive);
@@ -813,7 +812,7 @@ presence_chooser_account_manager_account_changed_cb (
}
static void
-presence_chooser_connectivity_state_change (EmpathyConnectivity *connectivity,
+presence_chooser_network_change (GNetworkMonitor *connectivity,
gboolean new_online,
EmpathyPresenceChooser *chooser)
{
@@ -956,10 +955,12 @@ presence_chooser_constructed (GObject *object)
status_tooltip = gtk_entry_get_text (GTK_ENTRY (entry));
gtk_widget_set_tooltip_text (GTK_WIDGET (chooser), status_tooltip);
- priv->connectivity = empathy_connectivity_dup_singleton ();
+ priv->connectivity = g_network_monitor_get_default ();
+ g_object_ref (priv->connectivity);
+
tp_g_signal_connect_object (priv->connectivity,
- "state-change",
- G_CALLBACK (presence_chooser_connectivity_state_change),
+ "network-changed",
+ G_CALLBACK (presence_chooser_network_change),
chooser, 0);
presence_chooser_update_sensitivity (chooser);