2005-11-02 Robert Love <rml@novell.com>

* gnome/applet/applet.c: Only send the DBUS setWirelessEnabled method
	  if the widget state differs from our saved state.  This ensures we
	  do not enter an endless loop of death and destruction.  Also, this
	  guarantees us that we enforce the widget state.


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1094 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Robert Love 2005-11-02 20:03:28 +00:00 committed by Robert Love
parent 4b279b5fc4
commit 1b73bb6d2f
2 changed files with 15 additions and 3 deletions

View file

@ -1,3 +1,10 @@
2005-11-02 Robert Love <rml@novell.com>
* gnome/applet/applet.c: Only send the DBUS setWirelessEnabled method
if the widget state differs from our saved state. This ensures we
do not enter an endless loop of death and destruction. Also, this
guarantees us that we enforce the widget state.
2005-11-02 Robert Love <rml@novell.com>
* gnome/applet/applet.c: add nmwa_enable_wireless_set_active().

View file

@ -1871,9 +1871,13 @@ static void nmwa_menu_add_devices (GtkWidget *menu, NMWirelessApplet *applet)
static void nmwa_set_wireless_enabled_cb (GtkWidget *widget, NMWirelessApplet *applet)
{
gboolean state;
g_return_if_fail (applet != NULL);
nmwa_dbus_enable_wireless (applet, !applet->wireless_enabled);
state = gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (widget));
if (applet->wireless_enabled != state)
nmwa_dbus_enable_wireless (applet, state);
}
@ -2055,11 +2059,12 @@ static void nmwa_context_menu_update (NMWirelessApplet *applet)
*
* Set the 'Enable Wireless' menu item state to match the daemon's last DBUS
* message. We cannot just do this at menu creation time because the DBUS
* message might not have been sent yet.
* message might not have been sent yet or in case the daemon state changes
* out from under us.
*/
void nmwa_enable_wireless_set_active (NMWirelessApplet *applet)
{
//gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (applet->stop_wireless_item), applet->wireless_enabled);
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (applet->stop_wireless_item), applet->wireless_enabled);
}
/*