| 67 static gboolean blinked = FALSE; |
67 static gboolean blinked = FALSE; |
| 68 gboolean ret = FALSE; /* by default, don't keep blinking */ |
68 gboolean ret = FALSE; /* by default, don't keep blinking */ |
| 69 |
69 |
| 70 blinked = !blinked; |
70 blinked = !blinked; |
| 71 |
71 |
| 72 if(pending && !connecting) { |
72 if (pending) { |
| 73 if (blinked) { |
73 if (ui_ops && ui_ops->blank_icon) { |
| 74 if (ui_ops && ui_ops->blank_icon) |
74 if (blinked) { |
| 75 ui_ops->blank_icon(); |
75 ui_ops->blank_icon(); |
| |
76 } else { |
| |
77 pidgin_docklet_update_icon(blinked); |
| |
78 } |
| 76 } else { |
79 } else { |
| 77 pidgin_docklet_update_icon(); |
80 pidgin_docklet_update_icon(blinked); |
| 78 } |
81 } |
| 79 ret = TRUE; /* keep blinking */ |
82 ret = TRUE; /* keep blinking */ |
| 80 } else { |
83 } else { |
| 81 docklet_blinking_timer = 0; |
84 docklet_blinking_timer = 0; |
| 82 blinked = FALSE; |
85 blinked = FALSE; |
| |
86 pidgin_docklet_update_icon(FALSE); |
| 83 } |
87 } |
| 84 |
88 |
| 85 return ret; |
89 return ret; |
| 86 } |
90 } |
| 87 |
91 |
| 205 if (status != newstatus || pending!=newpending || connecting!=newconnecting) { |
209 if (status != newstatus || pending!=newpending || connecting!=newconnecting) { |
| 206 status = newstatus; |
210 status = newstatus; |
| 207 pending = newpending; |
211 pending = newpending; |
| 208 connecting = newconnecting; |
212 connecting = newconnecting; |
| 209 |
213 |
| 210 pidgin_docklet_update_icon(); |
214 pidgin_docklet_update_icon(FALSE); |
| 211 |
215 |
| 212 /* and schedule the blinker function if messages are pending */ |
216 /* and schedule the blinker function if messages are pending */ |
| 213 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/docklet/blink") |
217 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/docklet/blink") |
| 214 && pending && !connecting && docklet_blinking_timer == 0) { |
218 && pending && !connecting && docklet_blinking_timer == 0) { |
| 215 docklet_blinking_timer = g_timeout_add(500, docklet_blink_icon, NULL); |
219 docklet_blinking_timer = g_timeout_add(500, docklet_blink_icon, NULL); |
| 756 |
760 |
| 757 /************************************************************************** |
761 /************************************************************************** |
| 758 * public api for ui_ops |
762 * public api for ui_ops |
| 759 **************************************************************************/ |
763 **************************************************************************/ |
| 760 void |
764 void |
| 761 pidgin_docklet_update_icon() |
765 pidgin_docklet_update_icon(gboolean blinked) |
| 762 { |
766 { |
| 763 if (ui_ops && ui_ops->update_icon) |
767 if (ui_ops && ui_ops->update_icon) |
| 764 ui_ops->update_icon(status, connecting, pending); |
768 ui_ops->update_icon(status, connecting, pending, blinked); |
| 765 } |
769 } |
| 766 |
770 |
| 767 void |
771 void |
| 768 pidgin_docklet_clicked(int button_type) |
772 pidgin_docklet_clicked(int button_type) |
| 769 { |
773 { |