2005-11-02 Christopher Aillon <caillon@redhat.com>

* gnome/applet/applet.c:
	* gnome/applet/applet.h:
	Partial backout of Dan's timeout animation patch.
	Timeout IDs cannot legally be 0, so revert the code in place to handle
	a timeout ID of 0 to denote the timeout isn't running.


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1089 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Christopher Aillon 2005-11-02 06:40:10 +00:00 committed by Chris Aillon
parent d52b45a03a
commit 5db5b5a80b
3 changed files with 15 additions and 12 deletions

View file

@ -1,3 +1,11 @@
2005-11-02 Christopher Aillon <caillon@redhat.com>
* gnome/applet/applet.c:
* gnome/applet/applet.h:
Partial backout of Dan's timeout animation patch.
Timeout IDs cannot legally be 0, so revert the code in place to handle
a timeout ID of 0 to denote the timeout isn't running.
2005-11-02 Christopher Aillon <caillon@redhat.com> 2005-11-02 Christopher Aillon <caillon@redhat.com>
* src/NetworkManagerPolicy.c: * src/NetworkManagerPolicy.c:

View file

@ -126,7 +126,7 @@ NetworkDevice * nmwa_get_first_active_device (GSList *dev_list)
static void nmwa_init (NMWirelessApplet *applet) static void nmwa_init (NMWirelessApplet *applet)
{ {
applet->animation_active = FALSE; applet->animation_id = 0;
applet->animation_step = 0; applet->animation_step = 0;
glade_gnome_init (); glade_gnome_init ();
@ -1016,7 +1016,7 @@ static gboolean animation_timeout (NMWirelessApplet *applet)
if (!applet->nm_running) if (!applet->nm_running)
{ {
applet->animation_step = 0; applet->animation_step = 0;
applet->animation_active = FALSE; applet->animation_id = 0;
return FALSE; return FALSE;
} }
@ -1024,7 +1024,7 @@ static gboolean animation_timeout (NMWirelessApplet *applet)
if (!act_dev) if (!act_dev)
{ {
applet->animation_step = 0; applet->animation_step = 0;
applet->animation_active = FALSE; applet->animation_id = 0;
return FALSE; return FALSE;
} }
@ -1054,7 +1054,6 @@ static gboolean animation_timeout (NMWirelessApplet *applet)
else else
{ {
applet->animation_step = 0; applet->animation_step = 0;
applet->animation_active = FALSE;
nmwa_update_state (applet); nmwa_update_state (applet);
return FALSE; return FALSE;
} }
@ -1166,17 +1165,14 @@ done:
g_free (tip); g_free (tip);
applet->animation_step = 0; applet->animation_step = 0;
if (need_animation && !applet->animation_active) if (need_animation && applet->animation_id == 0)
{
applet->animation_id = g_timeout_add (100, (GSourceFunc) animation_timeout, applet); applet->animation_id = g_timeout_add (100, (GSourceFunc) animation_timeout, applet);
applet->animation_active = TRUE;
}
else if (!need_animation) else if (!need_animation)
{ {
if (applet->animation_active) if (applet->animation_id)
{ {
g_source_remove (applet->animation_id); g_source_remove (applet->animation_id);
applet->animation_active = FALSE; applet->animation_id = 0;
} }
if (pixbuf) if (pixbuf)
@ -1201,7 +1197,7 @@ done:
*/ */
static int nmwa_redraw_timeout (NMWirelessApplet *applet) static int nmwa_redraw_timeout (NMWirelessApplet *applet)
{ {
if (!applet->animation_active) if (!applet->animation_id)
nmwa_update_state (applet); nmwa_update_state (applet);
return TRUE; return TRUE;

View file

@ -108,7 +108,6 @@ typedef struct
/* Animation stuff */ /* Animation stuff */
int animation_step; int animation_step;
gboolean animation_active;
guint animation_id; guint animation_id;
/* Direct UI elements */ /* Direct UI elements */