2006-04-06 Robert Love <rml@novell.com>

Fix bad but simple bug where an active modem connection did not update
	NM's connection state, breaking any app that did online/offline:
	* src/NetworkManagerMain.h: Add 'modem_active' member to NMData,
	  represented whether a dial up connection is active, or not.
	* src/nm-dbus-nm.c: Set and unset 'modem_active' in response
	  to modem activation and deactivation.
	* src/NetworkManagerDbus.c: When asked our state, do not return
	  disconnected if the modem is active.


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1674 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Robert Love 2006-04-06 14:12:23 +00:00 committed by Robert Love
parent 5b5d606e09
commit cd73c091c5
4 changed files with 18 additions and 1 deletions

View file

@ -1,3 +1,14 @@
2006-04-06 Robert Love <rml@novell.com>
Fix bad but simple bug where an active modem connection did not update
NM's connection state, breaking any app that did online/offline:
* src/NetworkManagerMain.h: Add 'modem_active' member to NMData,
represented whether a dial up connection is active, or not.
* src/nm-dbus-nm.c: Set and unset 'modem_active' in response
to modem activation and deactivation.
* src/NetworkManagerDbus.c: When asked our state, do not return
disconnected if the modem is active.
2006-04-04 Robert Love <rml@novell.com>
* gnome/applet/applet.c: Remove the 'Remove' option that I added to the

View file

@ -302,7 +302,7 @@ NMState nm_get_app_state_from_data (NMData *data)
return NM_STATE_ASLEEP;
act_dev = nm_get_active_device (data);
if (!act_dev)
if (!act_dev && !data->modem_active)
return NM_STATE_DISCONNECTED;
if (nm_device_is_activating (act_dev))

View file

@ -83,6 +83,7 @@ typedef struct NMData
GMutex * dev_list_mutex;
gboolean wireless_enabled;
gboolean modem_active;
gboolean asleep;
GSList * dialup_list;

View file

@ -170,6 +170,8 @@ static DBusMessage *nm_dbus_nm_activate_dialup (DBusConnection *connection, DBus
if (!nm_system_activate_dialup (nm_data->dialup_list, dialup))
reply = nm_dbus_create_error_message (message, NM_DBUS_INTERFACE, "ActivationFailed",
"Failed to activate the dialup device.");
else
nm_data->modem_active = TRUE;
nm_unlock_mutex (nm_data->dialup_list_mutex, __FUNCTION__);
out:
@ -203,6 +205,8 @@ static DBusMessage *nm_dbus_nm_deactivate_dialup (DBusConnection *connection, DB
if (!nm_system_deactivate_dialup (nm_data->dialup_list, dialup))
reply = nm_dbus_create_error_message (message, NM_DBUS_INTERFACE, "DeactivationFailed",
"Failed to deactivate the dialup device.");
else
nm_data->modem_active = FALSE;
nm_unlock_mutex (nm_data->dialup_list_mutex, __FUNCTION__);
out:
@ -560,6 +564,7 @@ static DBusMessage *nm_dbus_nm_sleep (DBusConnection *connection, DBusMessage *m
nm_lock_mutex (app_data->dialup_list_mutex, __FUNCTION__);
nm_system_deactivate_all_dialup (app_data->dialup_list);
app_data->modem_active = FALSE;
nm_unlock_mutex (app_data->dialup_list_mutex, __FUNCTION__);
}