aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2009-08-20 21:44:10 +0800
committerJonny Lamb <jonny.lamb@collabora.co.uk>2009-08-20 21:44:10 +0800
commit900bb42ee52f895dd7c6ce252e7f6104968d1bf8 (patch)
tree87089e299a4677baa6186bbb16e7367c09fbcdfb /libempathy-gtk
parentf6b001dd6a0ef2dd1ae6bf071c3334d934c30628 (diff)
parent3336ae452410f53254957b48b72460978f3b990a (diff)
downloadgsoc2013-empathy-900bb42ee52f895dd7c6ce252e7f6104968d1bf8.tar
gsoc2013-empathy-900bb42ee52f895dd7c6ce252e7f6104968d1bf8.tar.gz
gsoc2013-empathy-900bb42ee52f895dd7c6ce252e7f6104968d1bf8.tar.bz2
gsoc2013-empathy-900bb42ee52f895dd7c6ce252e7f6104968d1bf8.tar.lz
gsoc2013-empathy-900bb42ee52f895dd7c6ce252e7f6104968d1bf8.tar.xz
gsoc2013-empathy-900bb42ee52f895dd7c6ce252e7f6104968d1bf8.tar.zst
gsoc2013-empathy-900bb42ee52f895dd7c6ce252e7f6104968d1bf8.zip
Merge branch 'connman'
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-conf.h2
-rw-r--r--libempathy-gtk/empathy-presence-chooser.c26
2 files changed, 27 insertions, 1 deletions
diff --git a/libempathy-gtk/empathy-conf.h b/libempathy-gtk/empathy-conf.h
index 2383a7edf..d8e34f6b9 100644
--- a/libempathy-gtk/empathy-conf.h
+++ b/libempathy-gtk/empathy-conf.h
@@ -78,7 +78,7 @@ struct _EmpathyConfClass {
#define EMPATHY_PREFS_CONTACTS_SORT_CRITERIUM EMPATHY_PREFS_PATH "/contacts/sort_criterium"
#define EMPATHY_PREFS_HINTS_CLOSE_MAIN_WINDOW EMPATHY_PREFS_PATH "/hints/close_main_window"
#define EMPATHY_PREFS_SALUT_ACCOUNT_CREATED EMPATHY_PREFS_PATH "/accounts/salut_created"
-#define EMPATHY_PREFS_USE_NM EMPATHY_PREFS_PATH "/use_nm"
+#define EMPATHY_PREFS_USE_CONN EMPATHY_PREFS_PATH "/use_conn"
#define EMPATHY_PREFS_AUTOCONNECT EMPATHY_PREFS_PATH "/autoconnect"
#define EMPATHY_PREFS_IMPORT_ASKED EMPATHY_PREFS_PATH "/import_asked"
#define EMPATHY_PREFS_FILE_TRANSFER_DEFAULT_FOLDER EMPATHY_PREFS_PATH "/file_transfer/default_folder"
diff --git a/libempathy-gtk/empathy-presence-chooser.c b/libempathy-gtk/empathy-presence-chooser.c
index 7c5850af8..ba36e091c 100644
--- a/libempathy-gtk/empathy-presence-chooser.c
+++ b/libempathy-gtk/empathy-presence-chooser.c
@@ -35,6 +35,7 @@
#include <telepathy-glib/util.h>
+#include <libempathy/empathy-connectivity.h>
#include <libempathy/empathy-idle.h>
#include <libempathy/empathy-utils.h>
#include <libempathy/empathy-status-presets.h>
@@ -98,6 +99,9 @@ typedef enum {
typedef struct {
EmpathyIdle *idle;
+ EmpathyConnectivity *connectivity;
+
+ gulong state_change_signal_id;
gboolean editing_status;
int block_set_editing;
@@ -710,6 +714,14 @@ presence_chooser_entry_focus_out_cb (EmpathyPresenceChooser *chooser,
}
static void
+presence_chooser_connectivity_state_change (EmpathyConnectivity *connectivity,
+ gboolean new_online,
+ EmpathyPresenceChooser *chooser)
+{
+ gtk_widget_set_sensitive (GTK_WIDGET (chooser), new_online);
+}
+
+static void
empathy_presence_chooser_init (EmpathyPresenceChooser *chooser)
{
EmpathyPresenceChooserPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (chooser,
@@ -780,6 +792,14 @@ empathy_presence_chooser_init (EmpathyPresenceChooser *chooser)
/* FIXME: this string sucks */
gtk_widget_set_tooltip_text (GTK_WIDGET (chooser),
_("Set your presence and current status"));
+
+ priv->connectivity = empathy_connectivity_dup_singleton ();
+ priv->state_change_signal_id = g_signal_connect (priv->connectivity,
+ "state-change",
+ G_CALLBACK (presence_chooser_connectivity_state_change),
+ chooser);
+ presence_chooser_connectivity_state_change (priv->connectivity,
+ empathy_connectivity_is_online (priv->connectivity), chooser);
}
static void
@@ -802,6 +822,12 @@ presence_chooser_finalize (GObject *object)
object);
g_object_unref (priv->idle);
+ g_signal_handler_disconnect (priv->connectivity,
+ priv->state_change_signal_id);
+ priv->state_change_signal_id = 0;
+
+ g_object_unref (priv->connectivity);
+
G_OBJECT_CLASS (empathy_presence_chooser_parent_class)->finalize (object);
}