aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--libempathy-gtk/empathy-preferences.c6
-rw-r--r--libempathy-gtk/empathy-preferences.glade19
-rw-r--r--libempathy/empathy-idle.c21
4 files changed, 22 insertions, 33 deletions
diff --git a/ChangeLog b/ChangeLog
index 178e9afa8..6274dd053 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2007-12-06 Xavier Claessens <xclaesse@gmail.com>
+ * libempathy-gtk/empathy-preferences.c:
+ * libempathy-gtk/empathy-preferences.glade:
+ * libempathy/empathy-idle.c: When NM is in sleeping (=disabled) state,
+ do just like if it was connected. Remove option from preference dialog
+ to disabled NM support because NM can be disabled using nm-applet, but
+ let the option in gconf, it can be useful in case of buggy NM.
+
+2007-12-06 Xavier Claessens <xclaesse@gmail.com>
+
* data/empathy.schemas.in:
* libempathy-gtk/empathy-preferences.c:
* libempathy-gtk/empathy-preferences.glade:
diff --git a/libempathy-gtk/empathy-preferences.c b/libempathy-gtk/empathy-preferences.c
index 14ee8f763..a8b52954d 100644
--- a/libempathy-gtk/empathy-preferences.c
+++ b/libempathy-gtk/empathy-preferences.c
@@ -50,7 +50,6 @@ typedef struct {
GtkWidget *combobox_chat_theme;
GtkWidget *checkbutton_theme_chat_room;
GtkWidget *checkbutton_separate_chat_windows;
- GtkWidget *checkbutton_use_nm;
GtkWidget *radiobutton_contact_list_sort_by_name;
GtkWidget *radiobutton_contact_list_sort_by_state;
@@ -179,10 +178,6 @@ preferences_setup_widgets (EmpathyPreferences *preferences)
preferences->checkbutton_separate_chat_windows);
preferences_hookup_toggle_button (preferences,
- EMPATHY_PREFS_USE_NM,
- preferences->checkbutton_use_nm);
-
- preferences_hookup_toggle_button (preferences,
EMPATHY_PREFS_UI_SHOW_AVATARS,
preferences->checkbutton_show_avatars);
@@ -944,7 +939,6 @@ empathy_preferences_show (GtkWindow *parent)
"combobox_chat_theme", &preferences->combobox_chat_theme,
"checkbutton_theme_chat_room", &preferences->checkbutton_theme_chat_room,
"checkbutton_separate_chat_windows", &preferences->checkbutton_separate_chat_windows,
- "checkbutton_use_nm", &preferences->checkbutton_use_nm,
"radiobutton_contact_list_sort_by_name", &preferences->radiobutton_contact_list_sort_by_name,
"radiobutton_contact_list_sort_by_state", &preferences->radiobutton_contact_list_sort_by_state,
"checkbutton_sounds_for_messages", &preferences->checkbutton_sounds_for_messages,
diff --git a/libempathy-gtk/empathy-preferences.glade b/libempathy-gtk/empathy-preferences.glade
index 5c3321197..4db860f13 100644
--- a/libempathy-gtk/empathy-preferences.glade
+++ b/libempathy-gtk/empathy-preferences.glade
@@ -232,25 +232,6 @@
<property name="fill">False</property>
</packing>
</child>
-
- <child>
- <widget class="GtkCheckButton" id="checkbutton_use_nm">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Use network manager</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
</widget>
</child>
</widget>
diff --git a/libempathy/empathy-idle.c b/libempathy/empathy-idle.c
index 10d5b7bde..6ef72609e 100644
--- a/libempathy/empathy-idle.c
+++ b/libempathy/empathy-idle.c
@@ -208,8 +208,9 @@ empathy_idle_init (EmpathyIdle *idle)
idle, NULL);
} else {
empathy_debug (DEBUG_DOMAIN, "Failed to get nm proxy");
- priv->nm_connected = TRUE;
}
+
+ priv->nm_connected = TRUE;
}
static void
@@ -468,7 +469,7 @@ empathy_idle_set_use_nm (EmpathyIdle *idle,
"Couldn't get NM state: %s",
error->message);
g_clear_error (&error);
- nm_status = NM_STATE_CONNECTED;
+ nm_status = NM_STATE_ASLEEP;
}
idle_nm_state_change_cb (priv->nm_proxy, nm_status, idle);
@@ -573,6 +574,7 @@ idle_nm_state_change_cb (DBusGProxy *proxy,
EmpathyIdle *idle)
{
EmpathyIdlePriv *priv;
+ gboolean nm_connected;
priv = GET_PRIV (idle);
@@ -583,20 +585,23 @@ idle_nm_state_change_cb (DBusGProxy *proxy,
return;
}
- if (state != NM_STATE_CONNECTED && priv->nm_connected) {
+ nm_connected = !(state == NM_STATE_CONNECTING ||
+ state == NM_STATE_DISCONNECTED);
+
+ if (priv->nm_connected && !nm_connected) {
/* We are no more connected */
idle_ext_away_stop (idle);
- priv->nm_saved_state = priv->state;
+ priv->nm_saved_state = priv->state;
empathy_idle_set_state (idle, MC_PRESENCE_OFFLINE);
- priv->nm_connected = FALSE;
}
- else if (state == NM_STATE_CONNECTED && !priv->nm_connected) {
+ else if (!priv->nm_connected && nm_connected) {
/* We are now connected */
- priv->nm_connected = TRUE;
- empathy_idle_set_state (idle, priv->nm_saved_state);
priv->nm_saved_state = MC_PRESENCE_UNSET;
+ empathy_idle_set_state (idle, priv->nm_saved_state);
}
+
+ priv->nm_connected = nm_connected;
}
static void