comparison src/gtkutils.c @ 6485:70d5122bc3ff

[gaim-migrate @ 6999] Removed the old event system and replaced it with a much better signal system. There will most likely be some bugs in this, but it seems to be working for now. Plugins can now generate their own signals, and other plugins can find those plugins and connect to them. This could give plugins a form of IPC. It's also useful for other things. It's rather flexible, except for the damn marshalling, but there's no way around that that I or the glib people can see. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Mon, 18 Aug 2003 01:03:43 +0000
parents fb64cc87bc96
children b89d98f0bf79
comparison
equal deleted inserted replaced
6484:5ced8e111473 6485:70d5122bc3ff
38 38
39 #include "debug.h" 39 #include "debug.h"
40 #include "notify.h" 40 #include "notify.h"
41 #include "prefs.h" 41 #include "prefs.h"
42 #include "prpl.h" 42 #include "prpl.h"
43 #include "signals.h"
43 #include "util.h" 44 #include "util.h"
44 45
45 #include "gtkconv.h" 46 #include "gtkconv.h"
46 #include "gtkimhtml.h" 47 #include "gtkimhtml.h"
47 #include "gtkutils.h" 48 #include "gtkutils.h"
885 886
886 static gboolean 887 static gboolean
887 account_menu_destroyed_cb(GtkWidget *optmenu, GdkEvent *event, 888 account_menu_destroyed_cb(GtkWidget *optmenu, GdkEvent *event,
888 void *user_data) 889 void *user_data)
889 { 890 {
890 gaim_signal_disconnect(optmenu, event_signon, account_menu_sign_on_off_cb); 891 gaim_signals_disconnect_by_handle(optmenu);
891 gaim_signal_disconnect(optmenu, event_signoff, account_menu_sign_on_off_cb);
892 892
893 return FALSE; 893 return FALSE;
894 } 894 }
895 895
896 GtkWidget * 896 GtkWidget *
906 906
907 g_signal_connect(G_OBJECT(optmenu), "destroy", 907 g_signal_connect(G_OBJECT(optmenu), "destroy",
908 G_CALLBACK(account_menu_destroyed_cb), NULL); 908 G_CALLBACK(account_menu_destroyed_cb), NULL);
909 909
910 /* Register the gaim sign on/off event callbacks. */ 910 /* Register the gaim sign on/off event callbacks. */
911 gaim_signal_connect(optmenu, event_signon, 911 gaim_signal_connect(gaim_connections_get_handle(), "signed-on",
912 account_menu_sign_on_off_cb, optmenu); 912 optmenu, GAIM_CALLBACK(account_menu_sign_on_off_cb),
913 gaim_signal_connect(optmenu, event_signoff, 913 optmenu);
914 account_menu_sign_on_off_cb, optmenu); 914 gaim_signal_connect(gaim_connections_get_handle(), "signed-off",
915 optmenu, GAIM_CALLBACK(account_menu_sign_on_off_cb),
916 optmenu);
915 917
916 /* Set some data. */ 918 /* Set some data. */
917 g_object_set_data(G_OBJECT(optmenu), "user_data", user_data); 919 g_object_set_data(G_OBJECT(optmenu), "user_data", user_data);
918 g_object_set_data(G_OBJECT(optmenu), "show_all", GINT_TO_POINTER(show_all)); 920 g_object_set_data(G_OBJECT(optmenu), "show_all", GINT_TO_POINTER(show_all));
919 921