Mercurial > pidgin.yaz
comparison gtk/gtkdocklet.c @ 14873:3a23706f9f4b
[gaim-migrate @ 17642]
Show icon pref. No way to change it yet (other than your editor)
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Wed, 01 Nov 2006 00:57:39 +0000 |
parents | dd000ac4d148 |
children | 51c51d89c114 |
comparison
equal
deleted
inserted
replaced
14872:a73b2b332ec2 | 14873:3a23706f9f4b |
---|---|
118 gboolean pending = FALSE; | 118 gboolean pending = FALSE; |
119 | 119 |
120 /* determine if any ims have unseen messages */ | 120 /* determine if any ims have unseen messages */ |
121 convs = get_pending_list(DOCKLET_TOOLTIP_LINE_LIMIT); | 121 convs = get_pending_list(DOCKLET_TOOLTIP_LINE_LIMIT); |
122 | 122 |
123 if (!strcmp(gaim_prefs_get_string("/gaim/gtk/docklet/show"), "pending")) { | |
124 if (convs && ui_ops->create && !visibility_manager) { | |
125 ui_ops->create(); | |
126 return FALSE; | |
127 } else if (!convs && ui_ops->destroy && visibility_manager) { | |
128 ui_ops->destroy(); | |
129 return FALSE; | |
130 } else if (!visibility_manager) { | |
131 return FALSE; | |
132 } | |
133 } | |
134 | |
123 if (convs != NULL) { | 135 if (convs != NULL) { |
124 pending = TRUE; | 136 pending = TRUE; |
125 | 137 |
126 /* set tooltip if messages are pending */ | 138 /* set tooltip if messages are pending */ |
127 if (ui_ops->set_tooltip) { | 139 if (ui_ops->set_tooltip) { |
559 | 571 |
560 void | 572 void |
561 gaim_gtk_docklet_embedded() | 573 gaim_gtk_docklet_embedded() |
562 { | 574 { |
563 if (!visibility_manager) { | 575 if (!visibility_manager) { |
564 gaim_gtk_blist_visibility_manager_add(); | 576 if (strcmp(gaim_prefs_get_string("/gaim/gtk/docklet/show"),"pending")) |
577 gaim_gtk_blist_visibility_manager_add(); | |
565 visibility_manager = TRUE; | 578 visibility_manager = TRUE; |
566 } | 579 } |
567 docklet_update_status(); | 580 docklet_update_status(); |
568 if (ui_ops && ui_ops->update_icon) | 581 if (ui_ops && ui_ops->update_icon) |
569 ui_ops->update_icon(status); | 582 ui_ops->update_icon(status); |
572 void | 585 void |
573 gaim_gtk_docklet_remove() | 586 gaim_gtk_docklet_remove() |
574 { | 587 { |
575 if (visibility_manager) { | 588 if (visibility_manager) { |
576 gaim_gtk_blist_visibility_manager_remove(); | 589 gaim_gtk_blist_visibility_manager_remove(); |
590 if (docklet_blinking_timer) { | |
591 g_source_remove(docklet_blinking_timer); | |
592 docklet_blinking_timer = 0; | |
593 } | |
577 visibility_manager = FALSE; | 594 visibility_manager = FALSE; |
595 status = DOCKLET_STATUS_OFFLINE; | |
578 } | 596 } |
579 } | 597 } |
580 | 598 |
581 void | 599 void |
582 gaim_gtk_docklet_set_ui_ops(struct docklet_ui_ops *ops) | 600 gaim_gtk_docklet_set_ui_ops(struct docklet_ui_ops *ops) |
602 gaim_prefs_add_none("/gaim/gtk/docklet"); | 620 gaim_prefs_add_none("/gaim/gtk/docklet"); |
603 gaim_prefs_add_bool("/gaim/gtk/docklet/blink", FALSE); | 621 gaim_prefs_add_bool("/gaim/gtk/docklet/blink", FALSE); |
604 gaim_prefs_add_string("/gaim/gtk/docklet/show", "always"); | 622 gaim_prefs_add_string("/gaim/gtk/docklet/show", "always"); |
605 | 623 |
606 docklet_ui_init(); | 624 docklet_ui_init(); |
607 if (ui_ops && ui_ops->create) | 625 if (!strcmp(gaim_prefs_get_string("/gaim/gtk/docklet/show"), "always") && ui_ops && ui_ops->create) |
608 ui_ops->create(); | 626 ui_ops->create(); |
627 | |
609 gaim_signal_connect(conn_handle, "signed-on", | 628 gaim_signal_connect(conn_handle, "signed-on", |
610 docklet_handle, GAIM_CALLBACK(docklet_signed_on_cb), NULL); | 629 docklet_handle, GAIM_CALLBACK(docklet_signed_on_cb), NULL); |
611 gaim_signal_connect(conn_handle, "signed-off", | 630 gaim_signal_connect(conn_handle, "signed-off", |
612 docklet_handle, GAIM_CALLBACK(docklet_signed_off_cb), NULL); | 631 docklet_handle, GAIM_CALLBACK(docklet_signed_off_cb), NULL); |
613 gaim_signal_connect(accounts_handle, "account-status-changed", | 632 gaim_signal_connect(accounts_handle, "account-status-changed", |
629 } | 648 } |
630 | 649 |
631 void | 650 void |
632 gaim_gtk_docklet_uninit() | 651 gaim_gtk_docklet_uninit() |
633 { | 652 { |
634 if (ui_ops && ui_ops->destroy) | 653 if (visibility_manager && ui_ops && ui_ops->destroy) |
635 ui_ops->destroy(); | 654 ui_ops->destroy(); |
636 } | 655 } |