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

* gnome/applet/applet.c: add nmwa_enable_wireless_set_active().
	* gnome/applet/applet-dbus-devices.c: invoke the new function
	  nmwa_enable_wireless_set_active() to ensure that the state of the		  'Enable Wireless' checkbox matches the daemon's state.  This is a
	  concern because the daemon remembers the state.


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1092 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Robert Love 2005-11-02 18:27:19 +00:00 committed by Robert Love
parent 3dc658143d
commit 91027274d3
4 changed files with 26 additions and 2 deletions

View file

@ -1,3 +1,10 @@
2005-11-02 Robert Love <rml@novell.com>
* gnome/applet/applet.c: add nmwa_enable_wireless_set_active().
* gnome/applet/applet-dbus-devices.c: invoke the new function
nmwa_enable_wireless_set_active() to ensure that the state of the 'Enable Wireless' checkbox matches the daemon's state. This is a
concern because the daemon remembers the state.
2005-11-02 Robert Love <rml@novell.com>
* gnome/applet/applet.c: Make menu item "Enable Wireless" not "Wireless

View file

@ -118,7 +118,11 @@ static void nmwa_dbus_update_wireless_enabled_cb (DBusPendingCall *pcall, void *
}
if (dbus_message_get_args (reply, NULL, DBUS_TYPE_BOOLEAN, &wireless_enabled, DBUS_TYPE_INVALID))
{
applet->wireless_enabled = wireless_enabled;
nmwa_enable_wireless_set_active (applet);
}
dbus_message_unref (reply);
out:

View file

@ -2050,6 +2050,17 @@ static void nmwa_context_menu_update (NMWirelessApplet *applet)
gtk_widget_hide (applet->stop_wireless_item);
}
/*
* nmwa_enable_wireless_set_active
*
* 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.
*/
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);
}
/*
* nmwa_context_menu_create
@ -2069,11 +2080,11 @@ static GtkWidget *nmwa_context_menu_create (NMWirelessApplet *applet)
/* 'Enable Wireless' item */
applet->stop_wireless_item = gtk_check_menu_item_new_with_mnemonic (_("Enable _Wireless"));
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (applet->stop_wireless_item), TRUE);
nmwa_enable_wireless_set_active (applet);
g_signal_connect (G_OBJECT (applet->stop_wireless_item), "activate", G_CALLBACK (nmwa_set_wireless_enabled_cb), applet);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), applet->stop_wireless_item);
/* Connection Information item */
/* 'Connection Information' item */
applet->info_menu_item = gtk_image_menu_item_new_with_mnemonic (_("Connection _Information"));
g_signal_connect (G_OBJECT (applet->info_menu_item), "activate", G_CALLBACK (nmwa_show_info_cb), applet);
image = gtk_image_new_from_stock (GTK_STOCK_INFO, GTK_ICON_SIZE_MENU);

View file

@ -145,6 +145,8 @@ void nmwa_schedule_vpn_login_banner_dialog (NMWirelessApplet *applet, const c
NetworkDevice * nmwa_get_first_active_device (GSList *dev_list);
VPNConnection * nmwa_get_first_active_vpn_connection (NMWirelessApplet *applet);
void nmwa_enable_wireless_set_active (NMWirelessApplet *applet);
int nm_null_safe_strcmp (const char *s1, const char *s2);
#endif