Mercurial > pidgin.yaz
comparison plugins/docklet/docklet.c @ 5905:dbe2a2174be9
[gaim-migrate @ 6337]
Some stuff from Robot101. It puts some docklet functionality back in,
fixes a bug where connected accounts was being listed as connecting accounts,
and something I'm not allowed to say, because it's just that cool.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Mon, 16 Jun 2003 04:15:35 +0000 |
parents | 059d95c67cda |
children | 7d385de2f9cd |
comparison
equal
deleted
inserted
replaced
5904:ad8497bee878 | 5905:dbe2a2174be9 |
---|---|
77 | 77 |
78 static void docklet_set_bool(GtkWidget *widget, const char *key) { | 78 static void docklet_set_bool(GtkWidget *widget, const char *key) { |
79 gaim_prefs_set_bool(key, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))); | 79 gaim_prefs_set_bool(key, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))); |
80 } | 80 } |
81 | 81 |
82 static void docklet_auto_login() { | |
83 gaim_accounts_auto_login(GAIM_GTK_UI); | |
84 } | |
85 | |
82 static void docklet_flush_queue() { | 86 static void docklet_flush_queue() { |
83 if (unread_message_queue) { | 87 if (unread_message_queue) { |
84 purge_away_queue(&unread_message_queue); | 88 purge_away_queue(&unread_message_queue); |
85 } | 89 } |
86 } | 90 } |
96 menu = gtk_menu_new(); | 100 menu = gtk_menu_new(); |
97 | 101 |
98 switch (status) { | 102 switch (status) { |
99 case offline: | 103 case offline: |
100 case offline_connecting: | 104 case offline_connecting: |
101 /* XXX CHIP KILLED AUTO CONNECTING */ | 105 gaim_new_item_from_stock(menu, _("Auto-login"), GAIM_STOCK_SIGN_ON, G_CALLBACK(docklet_auto_login), NULL, 0, 0, NULL); |
102 #if 0 | |
103 gaim_new_item_from_stock(menu, _("Auto-login"), GAIM_STOCK_SIGN_ON, G_CALLBACK(auto_login), NULL, 0, 0, NULL); | |
104 #endif | |
105 break; | 106 break; |
106 default: | 107 default: |
107 gaim_new_item_from_stock(menu, _("New Message.."), GAIM_STOCK_IM, G_CALLBACK(show_im_dialog), NULL, 0, 0, NULL); | 108 gaim_new_item_from_stock(menu, _("New Message.."), GAIM_STOCK_IM, G_CALLBACK(show_im_dialog), NULL, 0, 0, NULL); |
108 gaim_new_item_from_stock(menu, _("Join A Chat..."), GAIM_STOCK_CHAT, G_CALLBACK(join_chat), NULL, 0, 0, NULL); | 109 gaim_new_item_from_stock(menu, _("Join A Chat..."), GAIM_STOCK_CHAT, G_CALLBACK(join_chat), NULL, 0, 0, NULL); |
109 break; | 110 break; |
192 } else { | 193 } else { |
193 gaim_gtk_blist_docklet_toggle(); | 194 gaim_gtk_blist_docklet_toggle(); |
194 } | 195 } |
195 break; | 196 break; |
196 case 2: | 197 case 2: |
198 switch (status) { | |
199 case offline: | |
200 case offline_connecting: | |
201 docklet_auto_login(); | |
202 break; | |
203 default: | |
204 break; | |
205 } | |
197 break; | 206 break; |
198 case 3: | 207 case 3: |
199 docklet_menu(event); | 208 docklet_menu(event); |
200 break; | 209 break; |
201 } | 210 } |
268 if (message_queue) { | 277 if (message_queue) { |
269 status = away_pending; | 278 status = away_pending; |
270 } else { | 279 } else { |
271 status = away; | 280 status = away; |
272 } | 281 } |
273 /* XXX Chip killed my dog... */ | 282 } else if (gaim_connections_get_connecting()) { |
274 #if 0 | |
275 } else if (connecting_count) { | |
276 status = online_connecting; | 283 status = online_connecting; |
277 #endif | |
278 } else { | 284 } else { |
279 status = online; | 285 status = online; |
280 } | 286 } |
281 } else { | 287 } else { |
282 /* XXX ... and my pet goldfish ... */ | 288 if (gaim_connections_get_connecting()) { |
283 #if 0 | |
284 if (connecting_count) { | |
285 status = offline_connecting; | 289 status = offline_connecting; |
286 } else { | 290 } else { |
287 #endif | |
288 status = offline; | 291 status = offline; |
289 /* XXX ... both of them. */ | |
290 #if 0 | |
291 } | 292 } |
292 #endif | |
293 } | 293 } |
294 | 294 |
295 /* update the icon if we changed status */ | 295 /* update the icon if we changed status */ |
296 if (status != oldstatus) { | 296 if (status != oldstatus) { |
297 icon = status; | 297 icon = status; |
376 | 376 |
377 static void gaim_signoff(GaimConnection *gc, void *data) { | 377 static void gaim_signoff(GaimConnection *gc, void *data) { |
378 /* do this when idle so that if the prpl was connecting | 378 /* do this when idle so that if the prpl was connecting |
379 and was cancelled, we register that connecting_count | 379 and was cancelled, we register that connecting_count |
380 has returned to 0 */ | 380 has returned to 0 */ |
381 g_idle_add(docklet_update_status, &docklet); | 381 /* no longer necessary because Chip decided that us plugins |
382 * didn't need to know if an account was connecting or not | |
383 * g_idle_add(docklet_update_status, &docklet); */ | |
384 docklet_update_status(); | |
382 } | 385 } |
383 | 386 |
384 static void gaim_connecting(GaimAccount *account, void *data) { | 387 static void gaim_connecting(GaimAccount *account, void *data) { |
385 docklet_update_status(); | 388 docklet_update_status(); |
386 } | 389 } |
450 gtk_widget_destroy(GTK_WIDGET(docklet)); | 453 gtk_widget_destroy(GTK_WIDGET(docklet)); |
451 | 454 |
452 g_object_unref(G_OBJECT(docklet)); | 455 g_object_unref(G_OBJECT(docklet)); |
453 docklet = NULL; | 456 docklet = NULL; |
454 | 457 |
455 /* do this while gaim has no other way to toggle the global mute */ | 458 /* XXX: do this while gaim has no other way to toggle the global mute */ |
456 gaim_gtk_sound_set_mute(FALSE); | 459 gaim_gtk_sound_set_mute(FALSE); |
457 | 460 |
458 gaim_debug(GAIM_DEBUG_INFO, "docklet", "Tray Icon: removed\n"); | 461 gaim_debug(GAIM_DEBUG_INFO, "docklet", "Tray Icon: removed\n"); |
459 | 462 |
460 return TRUE; | 463 return TRUE; |