2005-01-21 Dan Williams <dcbw@redhat.com>

* Add new icons, more frames of animation
	* Remove some hacks to get the panel applet to display correct
		status, an NM update will soon follow that will fix the
		real issue.


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@385 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams
2005-01-21 17:54:40 +00:00
parent 80df4b9232
commit 1e51d6465b
35 changed files with 266 additions and 218 deletions

View File

@@ -1,3 +1,10 @@
2005-01-21 Dan Williams <dcbw@redhat.com>
* Add new icons, more frames of animation
* Remove some hacks to get the panel applet to display correct
status, an NM update will soon follow that will fix the
real issue.
2005-01-19 Kjartan Maraas <kmaraas@gnome.org> 2005-01-19 Kjartan Maraas <kmaraas@gnome.org>
* panel-applet/NMWirelessApplet.c: #include <config.h> must be * panel-applet/NMWirelessApplet.c: #include <config.h> must be

View File

@@ -109,47 +109,41 @@ static GObject *nmwa_constructor (GType type,
*/ */
static void nmwa_update_network_state (NMWirelessApplet *applet) static void nmwa_update_network_state (NMWirelessApplet *applet)
{ {
static AppletState old_state = 0;
g_return_if_fail (applet != NULL); g_return_if_fail (applet != NULL);
if (!applet->connection) if (!applet->connection)
{ {
applet->applet_state = APPLET_STATE_NO_NM; applet->applet_state = APPLET_STATE_NO_NM;
return; goto out;
} }
if (applet->applet_state == APPLET_STATE_NO_NM) if (applet->applet_state == APPLET_STATE_NO_NM)
return; goto out;
if (!applet->nm_status) if (!applet->nm_status)
{ {
applet->applet_state = APPLET_STATE_NO_CONNECTION; applet->applet_state = APPLET_STATE_NO_CONNECTION;
return; goto out;
} }
if ( applet->forcing_device
&& (applet->applet_state == APPLET_STATE_WIRELESS_CONNECTING)
&& (strcmp (applet->nm_status, "connected") == 0))
{
return;
}
applet->forcing_device = FALSE;
if (strcmp (applet->nm_status, "scanning") == 0) if (strcmp (applet->nm_status, "scanning") == 0)
{ {
applet->applet_state = APPLET_STATE_WIRELESS_SCANNING; applet->applet_state = APPLET_STATE_WIRELESS_SCANNING;
return; goto out;
} }
if (strcmp (applet->nm_status, "disconnected") == 0) if (strcmp (applet->nm_status, "disconnected") == 0)
{ {
applet->applet_state = APPLET_STATE_NO_CONNECTION; applet->applet_state = APPLET_STATE_NO_CONNECTION;
return; goto out;
} }
if (!applet->active_device) if (!applet->active_device)
{ {
applet->applet_state = APPLET_STATE_NO_CONNECTION; applet->applet_state = APPLET_STATE_NO_CONNECTION;
return; goto out;
} }
/* If the device is not 802.x, we don't show state for it (yet) */ /* If the device is not 802.x, we don't show state for it (yet) */
@@ -157,7 +151,6 @@ static void nmwa_update_network_state (NMWirelessApplet *applet)
&& (applet->active_device->type != DEVICE_TYPE_WIRELESS_ETHERNET)) && (applet->active_device->type != DEVICE_TYPE_WIRELESS_ETHERNET))
{ {
applet->applet_state = APPLET_STATE_NO_CONNECTION; applet->applet_state = APPLET_STATE_NO_CONNECTION;
return;
} }
else if (applet->active_device->type == DEVICE_TYPE_WIRED_ETHERNET) else if (applet->active_device->type == DEVICE_TYPE_WIRED_ETHERNET)
{ {
@@ -173,40 +166,61 @@ static void nmwa_update_network_state (NMWirelessApplet *applet)
else if (strcmp (applet->nm_status, "connected") == 0) else if (strcmp (applet->nm_status, "connected") == 0)
applet->applet_state = APPLET_STATE_WIRELESS; applet->applet_state = APPLET_STATE_WIRELESS;
} }
out:
if (applet->applet_state != old_state)
{
applet->animation_step = 0;
if (applet->applet_state == APPLET_STATE_NO_NM)
{
/* We can only do this because we are called with
* the applet->data_mutex locked.
*/
g_free (applet->nm_status);
applet->nm_status = NULL;
}
old_state = applet->applet_state;
}
} }
static gboolean static gboolean
animation_timeout (NMWirelessApplet *applet) animation_timeout (NMWirelessApplet *applet)
{ {
switch (applet->applet_state) switch (applet->applet_state)
{ {
case (APPLET_STATE_WIRED_CONNECTING): case (APPLET_STATE_WIRED_CONNECTING):
applet->animation_step ++; if (applet->animation_step >= NUM_WIRED_CONNECTING_FRAMES)
if (applet->animation_step >= NUM_WIRED_CONNECTING_FRAMES) applet->animation_step = 0;
applet->animation_step = 0; gtk_image_set_from_pixbuf (GTK_IMAGE (applet->pixmap),
gtk_image_set_from_pixbuf (GTK_IMAGE (applet->pixmap), applet->wired_connecting_icons[applet->animation_step]);
applet->wired_connecting_icons[applet->animation_step]); applet->animation_step ++;
break; break;
case (APPLET_STATE_WIRELESS_CONNECTING):
applet->animation_step ++; case (APPLET_STATE_WIRELESS_CONNECTING):
if (applet->animation_step >= NUM_WIRELESS_CONNECTING_FRAMES) if (applet->animation_step >= NUM_WIRELESS_CONNECTING_FRAMES)
applet->animation_step = 0; applet->animation_step = 0;
gtk_image_set_from_pixbuf (GTK_IMAGE (applet->pixmap), gtk_image_set_from_pixbuf (GTK_IMAGE (applet->pixmap),
applet->wireless_connecting_icons[applet->animation_step]); applet->wireless_connecting_icons[applet->animation_step]);
break; applet->animation_step ++;
case (APPLET_STATE_NO_NM): break;
case (APPLET_STATE_WIRELESS_SCANNING):
applet->animation_step ++; case (APPLET_STATE_NO_NM):
if (applet->animation_step >= NUM_WIRELESS_SCANNING_FRAMES) applet->animation_step = 0;
applet->animation_step = 0; break;
gtk_image_set_from_pixbuf (GTK_IMAGE (applet->pixmap),
applet->wireless_scanning_icons[applet->animation_step]); case (APPLET_STATE_WIRELESS_SCANNING):
break; if (applet->animation_step >= NUM_WIRELESS_SCANNING_FRAMES)
default: applet->animation_step = 0;
break; gtk_image_set_from_pixbuf (GTK_IMAGE (applet->pixmap),
} applet->wireless_scanning_icons[applet->animation_step]);
return TRUE; applet->animation_step ++;
break;
default:
break;
}
return TRUE;
} }
@@ -252,122 +266,121 @@ inline void print_state (AppletState state)
static void static void
nmwa_update_state (NMWirelessApplet *applet) nmwa_update_state (NMWirelessApplet *applet)
{ {
gboolean show_applet = TRUE; gboolean show_applet = TRUE;
gboolean need_animation = FALSE; gboolean need_animation = FALSE;
GdkPixbuf *pixbuf = NULL; GdkPixbuf *pixbuf = NULL;
gint strength = -1; gint strength = -1;
char *tip = NULL; char *tip = NULL;
g_mutex_lock (applet->data_mutex); g_mutex_lock (applet->data_mutex);
if (applet->active_device) if (applet->active_device)
{
GSList *list;
for (list = applet->active_device->networks; list; list = list->next)
{ {
WirelessNetwork *network; GSList *list;
for (list = applet->active_device->networks; list; list = list->next)
{
WirelessNetwork *network = (WirelessNetwork *) list->data;
network = (WirelessNetwork *) list->data; if (network->active)
if (network->active) strength = CLAMP ((int) network->strength, 0, 100);
strength = CLAMP ((int) network->strength, 0, 100); }
if (strength <= 0)
strength = applet->active_device->strength;
} }
if (strength <= 0)
strength = applet->active_device->strength;
}
#if 0 #if 0
/* Only show icon if there's more than one device and at least one is wireless */ /* Only show icon if there's more than one device and at least one is wireless */
if (g_slist_length (applet->device_list) == 1 && if (g_slist_length (applet->device_list) == 1 && applet->applet_state != APPLET_STATE_NO_NM)
applet->applet_state != APPLET_STATE_NO_NM) {
{ if (((NetworkDevice *)applet->device_list->data)->type == DEVICE_TYPE_WIRED_ETHERNET)
if (((NetworkDevice *)applet->device_list->data)->type == DEVICE_TYPE_WIRED_ETHERNET) show_applet = FALSE;
show_applet = FALSE; }
}
#endif #endif
nmwa_update_network_state (applet); nmwa_update_network_state (applet);
/* print_state (applet->applet_state); */ /* print_state (applet->applet_state); */
switch (applet->applet_state) switch (applet->applet_state)
{
case (APPLET_STATE_NO_CONNECTION):
show_applet = FALSE;
tip = g_strdup (_("No network connection"));
break;
case (APPLET_STATE_WIRED):
pixbuf = applet->wired_icon;
tip = g_strdup (_("Wired network connection"));
break;
case (APPLET_STATE_WIRED_CONNECTING):
applet->animation_step = CLAMP (applet->animation_step, 0, NUM_WIRED_CONNECTING_FRAMES - 1);
pixbuf = applet->wired_connecting_icons[applet->animation_step];
need_animation = TRUE;
tip = g_strdup (_("Connecting to a wired network..."));
break;
case (APPLET_STATE_WIRELESS):
if (applet->active_device)
{ {
if (applet->is_adhoc) case (APPLET_STATE_NO_CONNECTION):
{ show_applet = FALSE;
pixbuf = applet->adhoc_icon; tip = g_strdup (_("No network connection"));
tip = g_strdup_printf (_("Connected to an Ad-Hoc wireless network")); break;
}
else case (APPLET_STATE_WIRED):
{ pixbuf = applet->wired_icon;
if (strength > 75) tip = g_strdup (_("Wired network connection"));
pixbuf = applet->wireless_100_icon; break;
else if (strength > 50)
pixbuf = applet->wireless_75_icon; case (APPLET_STATE_WIRED_CONNECTING):
else if (strength > 25) need_animation = TRUE;
pixbuf = applet->wireless_50_icon; tip = g_strdup (_("Connecting to a wired network..."));
else if (strength > 0) break;
pixbuf = applet->wireless_25_icon;
else case (APPLET_STATE_WIRELESS):
pixbuf = applet->wireless_00_icon; if (applet->active_device)
tip = g_strdup_printf (_("Wireless network connection (%d%%)"), strength); {
} if (applet->is_adhoc)
{
pixbuf = applet->adhoc_icon;
tip = g_strdup (_("Connected to an Ad-Hoc wireless network"));
}
else
{
if (strength > 75)
pixbuf = applet->wireless_100_icon;
else if (strength > 50)
pixbuf = applet->wireless_75_icon;
else if (strength > 25)
pixbuf = applet->wireless_50_icon;
else if (strength > 0)
pixbuf = applet->wireless_25_icon;
else
pixbuf = applet->wireless_00_icon;
tip = g_strdup_printf (_("Wireless network connection (%d%%)"), strength);
}
}
else
tip = g_strdup (_("Wireless network connection"));
break;
case (APPLET_STATE_WIRELESS_CONNECTING):
need_animation = TRUE;
tip = g_strdup (_("Connecting to a wireless network..."));
break;
case (APPLET_STATE_NO_NM):
show_applet = FALSE;
tip = g_strdup (_("NetworkManager is not running"));
break;
case (APPLET_STATE_WIRELESS_SCANNING):
need_animation = TRUE;
tip = g_strdup (_("Scanning for wireless networks..."));
break;
default:
break;
} }
else g_mutex_unlock (applet->data_mutex);
tip = g_strdup (_("Wireless network connection"));
break;
case (APPLET_STATE_WIRELESS_CONNECTING):
applet->animation_step = CLAMP (applet->animation_step, 0, NUM_WIRELESS_CONNECTING_FRAMES - 1);
pixbuf = applet->wireless_connecting_icons[applet->animation_step];
need_animation = TRUE;
tip = g_strdup (_("Connecting to a wireless network..."));
break;
case (APPLET_STATE_NO_NM):
show_applet = FALSE;
tip = g_strdup (_("NetworkManager is not running"));
case (APPLET_STATE_WIRELESS_SCANNING):
applet->animation_step = CLAMP (applet->animation_step, 0, NUM_WIRELESS_SCANNING_FRAMES - 1);
pixbuf = applet->wireless_scanning_icons[applet->animation_step];
need_animation = TRUE;
if (!tip)
tip = g_strdup (_("Scanning for wireless networks..."));
default:
break;
}
g_mutex_unlock (applet->data_mutex);
if (!applet->tooltips) if (!applet->tooltips)
applet->tooltips = gtk_tooltips_new (); applet->tooltips = gtk_tooltips_new ();
gtk_tooltips_set_tip (applet->tooltips, applet->event_box, tip, NULL); gtk_tooltips_set_tip (applet->tooltips, applet->event_box, tip, NULL);
g_free (tip); g_free (tip);
gtk_image_set_from_pixbuf (GTK_IMAGE (applet->pixmap), pixbuf); /*determine if we should hide the notification icon*/
if (show_applet)
gtk_widget_show (GTK_WIDGET (applet));
else
gtk_widget_hide (GTK_WIDGET (applet));
/*determine if we should hide the notification icon*/ if (applet->animation_id)
if (show_applet) g_source_remove (applet->animation_id);
gtk_widget_show (GTK_WIDGET (applet)); if (need_animation)
else applet->animation_id = g_timeout_add (100, (GSourceFunc) (animation_timeout), applet);
gtk_widget_hide (GTK_WIDGET (applet)); else
gtk_image_set_from_pixbuf (GTK_IMAGE (applet->pixmap), pixbuf);
if (applet->animation_id)
g_source_remove (applet->animation_id);
if (need_animation)
applet->animation_id =
g_timeout_add (125, (GSourceFunc) (animation_timeout), applet);
} }
@@ -387,7 +400,7 @@ static int nmwa_redraw_timeout (NMWirelessApplet *applet)
static void nmwa_start_redraw_timeout (NMWirelessApplet *applet) static void nmwa_start_redraw_timeout (NMWirelessApplet *applet)
{ {
applet->redraw_timeout_id = applet->redraw_timeout_id =
g_timeout_add (CFG_UPDATE_INTERVAL * 1000, (GtkFunction) nmwa_redraw_timeout, applet); g_timeout_add (CFG_UPDATE_INTERVAL * 1000, (GtkFunction) nmwa_redraw_timeout, applet);
} }
@@ -565,11 +578,7 @@ static void nmwa_menu_item_activate (GtkMenuItem *item, gpointer user_data)
dev = nmwa_get_device_for_nm_device (applet, tag); dev = nmwa_get_device_for_nm_device (applet, tag);
if (dev) if (dev)
{
applet->applet_state = APPLET_STATE_WIRELESS_CONNECTING;
applet->forcing_device = TRUE;
nmwa_dbus_set_device (applet->connection, dev, net, -1, NULL); nmwa_dbus_set_device (applet->connection, dev, net, -1, NULL);
}
} }
@@ -581,9 +590,13 @@ static void nmwa_menu_item_activate (GtkMenuItem *item, gpointer user_data)
*/ */
static void nmwa_toplevel_menu_activate (GtkWidget *menu, NMWirelessApplet *applet) static void nmwa_toplevel_menu_activate (GtkWidget *menu, NMWirelessApplet *applet)
{ {
nmwa_dispose_menu_items (applet); if (!applet->tooltips)
nmwa_populate_menu (applet); applet->tooltips = gtk_tooltips_new ();
gtk_widget_show (applet->menu); gtk_tooltips_set_tip (applet->tooltips, applet->event_box, NULL, NULL);
nmwa_dispose_menu_items (applet);
nmwa_populate_menu (applet);
gtk_widget_show (applet->menu);
} }
@@ -1016,9 +1029,7 @@ static GtkWidget * nmwa_get_instance (NMWirelessApplet *applet)
/* Load pixmaps and create applet widgets */ /* Load pixmaps and create applet widgets */
nmwa_setup_widgets (applet); nmwa_setup_widgets (applet);
g_signal_connect (applet,"destroy", G_CALLBACK (nmwa_destroy),NULL); g_signal_connect (applet,"destroy", G_CALLBACK (nmwa_destroy), NULL);
/* Start redraw timeout */ /* Start redraw timeout */
nmwa_start_redraw_timeout (applet); nmwa_start_redraw_timeout (applet);
@@ -1081,38 +1092,58 @@ nmwa_icons_free (NMWirelessApplet *applet)
} }
static void static void
nmwa_icons_load_from_disk (NMWirelessApplet *applet, nmwa_icons_load_from_disk (NMWirelessApplet *applet, GtkIconTheme *icon_theme)
GtkIconTheme *icon_theme)
{ {
gint icon_size; /* Assume icons are square */
gint con_icon_size = 24;
gint norm_icon_size = 22;
/* Assume icon is square */ applet->no_nm_icon = gtk_icon_theme_load_icon (icon_theme, "nm-device-broken", norm_icon_size, 0, NULL);
icon_size = 22; applet->wired_icon = gtk_icon_theme_load_icon (icon_theme, "nm-device-wired", norm_icon_size, 0, NULL);
applet->adhoc_icon = gtk_icon_theme_load_icon (icon_theme, "nm-adhoc", norm_icon_size, 0, NULL);
applet->no_nm_icon = gtk_icon_theme_load_icon (icon_theme, "nm-device-broken", icon_size, 0, NULL); applet->wired_connecting_icons[0] = gtk_icon_theme_load_icon (icon_theme, "nm-connecting01", con_icon_size, 0, NULL);
applet->wired_icon = gtk_icon_theme_load_icon (icon_theme, "nm-device-wired", icon_size, 0, NULL); applet->wired_connecting_icons[1] = gtk_icon_theme_load_icon (icon_theme, "nm-connecting02", con_icon_size, 0, NULL);
applet->adhoc_icon = gtk_icon_theme_load_icon (icon_theme, "nm-adhoc", icon_size, 0, NULL); applet->wired_connecting_icons[2] = gtk_icon_theme_load_icon (icon_theme, "nm-connecting03", con_icon_size, 0, NULL);
applet->wired_connecting_icons[0] = gtk_icon_theme_load_icon (icon_theme, "nm-connecting00", icon_size, 0, NULL); applet->wired_connecting_icons[3] = gtk_icon_theme_load_icon (icon_theme, "nm-connecting04", con_icon_size, 0, NULL);
applet->wired_connecting_icons[1] = gtk_icon_theme_load_icon (icon_theme, "nm-connecting01", icon_size, 0, NULL); applet->wired_connecting_icons[4] = gtk_icon_theme_load_icon (icon_theme, "nm-connecting05", con_icon_size, 0, NULL);
applet->wired_connecting_icons[2] = gtk_icon_theme_load_icon (icon_theme, "nm-connecting02", icon_size, 0, NULL); applet->wired_connecting_icons[5] = gtk_icon_theme_load_icon (icon_theme, "nm-connecting06", con_icon_size, 0, NULL);
applet->wired_connecting_icons[3] = gtk_icon_theme_load_icon (icon_theme, "nm-connecting03", icon_size, 0, NULL); applet->wired_connecting_icons[6] = gtk_icon_theme_load_icon (icon_theme, "nm-connecting07", con_icon_size, 0, NULL);
applet->wireless_00_icon = gtk_icon_theme_load_icon (icon_theme, "nm-signal-00", icon_size, 0, NULL); applet->wired_connecting_icons[7] = gtk_icon_theme_load_icon (icon_theme, "nm-connecting08", con_icon_size, 0, NULL);
applet->wireless_25_icon = gtk_icon_theme_load_icon (icon_theme, "nm-signal-25", icon_size, 0, NULL); applet->wired_connecting_icons[8] = gtk_icon_theme_load_icon (icon_theme, "nm-connecting09", con_icon_size, 0, NULL);
applet->wireless_50_icon = gtk_icon_theme_load_icon (icon_theme, "nm-signal-50", icon_size, 0, NULL); applet->wired_connecting_icons[9] = gtk_icon_theme_load_icon (icon_theme, "nm-connecting10", con_icon_size, 0, NULL);
applet->wireless_75_icon = gtk_icon_theme_load_icon (icon_theme, "nm-signal-75", icon_size, 0, NULL); applet->wired_connecting_icons[10] = gtk_icon_theme_load_icon (icon_theme, "nm-connecting11", con_icon_size, 0, NULL);
applet->wireless_100_icon = gtk_icon_theme_load_icon (icon_theme, "nm-signal-100", icon_size, 0, NULL); applet->wireless_00_icon = gtk_icon_theme_load_icon (icon_theme, "nm-signal-00", norm_icon_size, 0, NULL);
applet->wireless_connecting_icons[0] = gtk_icon_theme_load_icon (icon_theme, "nm-connecting00", icon_size, 0, NULL); applet->wireless_25_icon = gtk_icon_theme_load_icon (icon_theme, "nm-signal-25", norm_icon_size, 0, NULL);
applet->wireless_connecting_icons[1] = gtk_icon_theme_load_icon (icon_theme, "nm-connecting01", icon_size, 0, NULL); applet->wireless_50_icon = gtk_icon_theme_load_icon (icon_theme, "nm-signal-50", norm_icon_size, 0, NULL);
applet->wireless_connecting_icons[2] = gtk_icon_theme_load_icon (icon_theme, "nm-connecting02", icon_size, 0, NULL); applet->wireless_75_icon = gtk_icon_theme_load_icon (icon_theme, "nm-signal-75", norm_icon_size, 0, NULL);
applet->wireless_connecting_icons[3] = gtk_icon_theme_load_icon (icon_theme, "nm-connecting03", icon_size, 0, NULL); applet->wireless_100_icon = gtk_icon_theme_load_icon (icon_theme, "nm-signal-100", norm_icon_size, 0, NULL);
applet->wireless_scanning_icons[0] = gtk_icon_theme_load_icon (icon_theme, "nm-detect00", icon_size, 0, NULL); applet->wireless_connecting_icons[0] = gtk_icon_theme_load_icon (icon_theme, "nm-connecting01", con_icon_size, 0, NULL);
applet->wireless_scanning_icons[1] = gtk_icon_theme_load_icon (icon_theme, "nm-detect01", icon_size, 0, NULL); applet->wireless_connecting_icons[1] = gtk_icon_theme_load_icon (icon_theme, "nm-connecting02", con_icon_size, 0, NULL);
applet->wireless_scanning_icons[2] = gtk_icon_theme_load_icon (icon_theme, "nm-detect02", icon_size, 0, NULL); applet->wireless_connecting_icons[2] = gtk_icon_theme_load_icon (icon_theme, "nm-connecting03", con_icon_size, 0, NULL);
applet->wireless_scanning_icons[3] = gtk_icon_theme_load_icon (icon_theme, "nm-detect03", icon_size, 0, NULL); applet->wireless_connecting_icons[3] = gtk_icon_theme_load_icon (icon_theme, "nm-connecting04", con_icon_size, 0, NULL);
applet->wireless_scanning_icons[4] = gtk_icon_theme_load_icon (icon_theme, "nm-detect04", icon_size, 0, NULL); applet->wireless_connecting_icons[4] = gtk_icon_theme_load_icon (icon_theme, "nm-connecting05", con_icon_size, 0, NULL);
applet->wireless_scanning_icons[5] = gtk_icon_theme_load_icon (icon_theme, "nm-detect05", icon_size, 0, NULL); applet->wireless_connecting_icons[5] = gtk_icon_theme_load_icon (icon_theme, "nm-connecting06", con_icon_size, 0, NULL);
applet->wireless_scanning_icons[6] = gtk_icon_theme_load_icon (icon_theme, "nm-detect06", icon_size, 0, NULL); applet->wireless_connecting_icons[6] = gtk_icon_theme_load_icon (icon_theme, "nm-connecting07", con_icon_size, 0, NULL);
applet->wireless_scanning_icons[7] = gtk_icon_theme_load_icon (icon_theme, "nm-detect07", icon_size, 0, NULL); applet->wireless_connecting_icons[7] = gtk_icon_theme_load_icon (icon_theme, "nm-connecting08", con_icon_size, 0, NULL);
applet->wireless_connecting_icons[8] = gtk_icon_theme_load_icon (icon_theme, "nm-connecting09", con_icon_size, 0, NULL);
applet->wireless_connecting_icons[9] = gtk_icon_theme_load_icon (icon_theme, "nm-connecting10", con_icon_size, 0, NULL);
applet->wireless_connecting_icons[10] = gtk_icon_theme_load_icon (icon_theme, "nm-connecting11", con_icon_size, 0, NULL);
applet->wireless_scanning_icons[0] = gtk_icon_theme_load_icon (icon_theme, "nm-detect01", norm_icon_size, 0, NULL);
applet->wireless_scanning_icons[1] = gtk_icon_theme_load_icon (icon_theme, "nm-detect02", norm_icon_size, 0, NULL);
applet->wireless_scanning_icons[2] = gtk_icon_theme_load_icon (icon_theme, "nm-detect03", norm_icon_size, 0, NULL);
applet->wireless_scanning_icons[3] = gtk_icon_theme_load_icon (icon_theme, "nm-detect04", norm_icon_size, 0, NULL);
applet->wireless_scanning_icons[4] = gtk_icon_theme_load_icon (icon_theme, "nm-detect05", norm_icon_size, 0, NULL);
applet->wireless_scanning_icons[5] = gtk_icon_theme_load_icon (icon_theme, "nm-detect06", norm_icon_size, 0, NULL);
applet->wireless_scanning_icons[6] = gtk_icon_theme_load_icon (icon_theme, "nm-detect07", norm_icon_size, 0, NULL);
applet->wireless_scanning_icons[7] = gtk_icon_theme_load_icon (icon_theme, "nm-detect08", norm_icon_size, 0, NULL);
applet->wireless_scanning_icons[8] = gtk_icon_theme_load_icon (icon_theme, "nm-detect09", norm_icon_size, 0, NULL);
applet->wireless_scanning_icons[9] = gtk_icon_theme_load_icon (icon_theme, "nm-detect10", norm_icon_size, 0, NULL);
applet->wireless_scanning_icons[10] = gtk_icon_theme_load_icon (icon_theme, "nm-detect11", norm_icon_size, 0, NULL);
applet->wireless_scanning_icons[11] = gtk_icon_theme_load_icon (icon_theme, "nm-detect12", norm_icon_size, 0, NULL);
applet->wireless_scanning_icons[12] = gtk_icon_theme_load_icon (icon_theme, "nm-detect13", norm_icon_size, 0, NULL);
applet->wireless_scanning_icons[13] = gtk_icon_theme_load_icon (icon_theme, "nm-detect14", norm_icon_size, 0, NULL);
applet->wireless_scanning_icons[14] = gtk_icon_theme_load_icon (icon_theme, "nm-detect15", norm_icon_size, 0, NULL);
applet->wireless_scanning_icons[15] = gtk_icon_theme_load_icon (icon_theme, "nm-detect16", norm_icon_size, 0, NULL);
} }
static void static void

View File

@@ -111,26 +111,25 @@ typedef struct
/* Data model elements */ /* Data model elements */
GMutex *data_mutex; GMutex *data_mutex;
AppletState applet_state; AppletState applet_state;
gboolean forcing_device;
gboolean is_adhoc; gboolean is_adhoc;
GSList *device_list; GSList *device_list;
NetworkDevice *active_device; NetworkDevice *active_device;
char *nm_status; char *nm_status;
NetworkDevice *dbus_active_device; NetworkDevice *dbus_active_device;
GdkPixbuf *no_nm_icon; GdkPixbuf *no_nm_icon;
GdkPixbuf *wired_icon; GdkPixbuf *wired_icon;
GdkPixbuf *adhoc_icon; GdkPixbuf *adhoc_icon;
#define NUM_WIRED_CONNECTING_FRAMES 4 #define NUM_WIRED_CONNECTING_FRAMES 11
GdkPixbuf *wired_connecting_icons[NUM_WIRED_CONNECTING_FRAMES]; GdkPixbuf *wired_connecting_icons[NUM_WIRED_CONNECTING_FRAMES];
GdkPixbuf *wireless_00_icon; GdkPixbuf *wireless_00_icon;
GdkPixbuf *wireless_25_icon; GdkPixbuf *wireless_25_icon;
GdkPixbuf *wireless_50_icon; GdkPixbuf *wireless_50_icon;
GdkPixbuf *wireless_75_icon; GdkPixbuf *wireless_75_icon;
GdkPixbuf *wireless_100_icon; GdkPixbuf *wireless_100_icon;
#define NUM_WIRELESS_CONNECTING_FRAMES 4 #define NUM_WIRELESS_CONNECTING_FRAMES 11
GdkPixbuf *wireless_connecting_icons[NUM_WIRELESS_CONNECTING_FRAMES]; GdkPixbuf *wireless_connecting_icons[NUM_WIRELESS_CONNECTING_FRAMES];
#define NUM_WIRELESS_SCANNING_FRAMES 8 #define NUM_WIRELESS_SCANNING_FRAMES 16
GdkPixbuf *wireless_scanning_icons[NUM_WIRELESS_SCANNING_FRAMES]; GdkPixbuf *wireless_scanning_icons[NUM_WIRELESS_SCANNING_FRAMES];
/* Animation stuff */ /* Animation stuff */

View File

@@ -1068,11 +1068,9 @@ static DBusHandlerResult nmwa_dbus_filter (DBusConnection *connection, DBusMessa
} }
else if ( dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceNowActive") else if ( dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceNowActive")
|| dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceNoLongerActive") || dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceNoLongerActive")
|| dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceActivating")) || dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceActivating")
{ || dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceStatusChanged")
nmwa_dbus_update_devices (applet); || dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DevicesChanged"))
}
else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DevicesChanged"))
{ {
nmwa_dbus_update_devices (applet); nmwa_dbus_update_devices (applet);
} }

View File

@@ -384,8 +384,6 @@ void nmwa_other_network_dialog_run (NMWirelessApplet *applet, gboolean create_ne
nm_key_type = NM_ENC_TYPE_UNKNOWN; nm_key_type = NM_ENC_TYPE_UNKNOWN;
break; break;
} }
applet->applet_state = APPLET_STATE_WIRELESS_CONNECTING;
applet->forcing_device = TRUE;
if (create_network) if (create_network)
nmwa_dbus_create_network (applet->connection, def_dev, net, nm_key_type, passphrase); nmwa_dbus_create_network (applet->connection, def_dev, net, nm_key_type, passphrase);
else else

View File

@@ -5,22 +5,37 @@ largeicon_DATA=\
nm-device-wireless.png nm-device-wireless.png
smallicondir=${datadir}/icons/hicolor/22x22/apps smallicondir=${datadir}/icons/hicolor/24x24/apps
smallicon_DATA=\ smallicon_DATA= \
nm-device-wired.png \ nm-device-wired.png \
nm-adhoc.png \ nm-adhoc.png \
nm-connecting00.png \
nm-connecting01.png \ nm-connecting01.png \
nm-connecting02.png \ nm-connecting02.png \
nm-connecting03.png \ nm-connecting03.png \
nm-detect00.png \ nm-connecting04.png \
nm-detect01.png \ nm-connecting05.png \
nm-detect02.png \ nm-connecting06.png \
nm-detect03.png \ nm-connecting07.png \
nm-detect04.png \ nm-connecting08.png \
nm-detect05.png \ nm-connecting09.png \
nm-detect06.png \ nm-connecting10.png \
nm-detect07.png \ nm-connecting11.png \
nm-detect01.png \
nm-detect02.png \
nm-detect03.png \
nm-detect04.png \
nm-detect05.png \
nm-detect06.png \
nm-detect07.png \
nm-detect08.png \
nm-detect09.png \
nm-detect10.png \
nm-detect11.png \
nm-detect12.png \
nm-detect13.png \
nm-detect14.png \
nm-detect15.png \
nm-detect16.png \
nm-signal-00.png \ nm-signal-00.png \
nm-signal-25.png \ nm-signal-25.png \
nm-signal-50.png \ nm-signal-50.png \

Binary file not shown.

Before

Width:  |  Height:  |  Size: 895 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 956 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 976 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 959 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 550 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 643 B

After

Width:  |  Height:  |  Size: 658 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 557 B

After

Width:  |  Height:  |  Size: 743 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 699 B

After

Width:  |  Height:  |  Size: 760 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 575 B

After

Width:  |  Height:  |  Size: 746 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 735 B

After

Width:  |  Height:  |  Size: 627 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 538 B

After

Width:  |  Height:  |  Size: 800 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 664 B

After

Width:  |  Height:  |  Size: 751 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 802 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 780 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 827 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 774 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 812 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 806 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 794 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 923 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 787 B