| 28 #include <gdk/gdkwin32.h> |
28 #include <gdk/gdkwin32.h> |
| 29 |
29 |
| 30 #include "internal.h" |
30 #include "internal.h" |
| 31 #include "gtkinternal.h" |
31 #include "gtkinternal.h" |
| 32 |
32 |
| |
33 #include "core.h" |
| 33 #include "prefs.h" |
34 #include "prefs.h" |
| 34 #include "debug.h" |
35 #include "debug.h" |
| 35 |
36 |
| 36 #include "gtkplugin.h" |
37 #include "gtkplugin.h" |
| 37 #include "gtkutils.h" |
38 #include "gtkutils.h" |
| 38 #include "gtkblist.h" |
39 #include "gtkblist.h" |
| 39 #include "gtkappbar.h" |
40 #include "gtkappbar.h" |
| |
41 #include "signals.h" |
| 40 |
42 |
| 41 /* |
43 /* |
| 42 * MACROS & DEFINES |
44 * MACROS & DEFINES |
| 43 */ |
45 */ |
| 44 #define WINPREFS_PLUGIN_ID "gtk-win-prefs" |
46 #define WINPREFS_PLUGIN_ID "gtk-win-prefs" |
| 143 /* Needed when the last account is signed off.. and we get the login window */ |
145 /* Needed when the last account is signed off.. and we get the login window */ |
| 144 static void blist_destroy_cb() { |
146 static void blist_destroy_cb() { |
| 145 gaim_debug(GAIM_DEBUG_INFO, "winprefs", "blist_destroy_cb\n"); |
147 gaim_debug(GAIM_DEBUG_INFO, "winprefs", "blist_destroy_cb\n"); |
| 146 blist_save_state(); |
148 blist_save_state(); |
| 147 blist_set_dockable(FALSE); |
149 blist_set_dockable(FALSE); |
| 148 gaim_signal_connect(plugin_id, event_signon, blist_create_cb, NULL); |
150 gaim_signal_connect((void*)gaim_connections_get_handle(), "signed-on", plugin_id, GAIM_CALLBACK(blist_create_cb), NULL); |
| 149 } |
151 } |
| 150 |
152 |
| 151 static gboolean blist_create_cb_remove(gpointer data) { |
153 static gboolean blist_create_cb_remove(gpointer data) { |
| 152 gaim_signal_disconnect(plugin_id, event_signon, blist_create_cb); |
154 gaim_signal_disconnect(gaim_connections_get_handle(), "signed-on", plugin_id, GAIM_CALLBACK(blist_create_cb)); |
| 153 return FALSE; |
155 return FALSE; |
| 154 } |
156 } |
| 155 |
157 |
| 156 static void blist_create_cb() { |
158 static void blist_create_cb() { |
| 157 gaim_debug(GAIM_DEBUG_INFO, WINPREFS_PLUGIN_ID, "event_signon\n"); |
159 gaim_debug(GAIM_DEBUG_INFO, WINPREFS_PLUGIN_ID, "event_signon\n"); |
| 288 if(gaim_prefs_get_bool(OPT_WINPREFS_BLIST_ON_TOP)) |
290 if(gaim_prefs_get_bool(OPT_WINPREFS_BLIST_ON_TOP)) |
| 289 blist_set_ontop(TRUE); |
291 blist_set_ontop(TRUE); |
| 290 g_signal_connect(blist, "destroy", blist_destroy_cb, NULL); |
292 g_signal_connect(blist, "destroy", blist_destroy_cb, NULL); |
| 291 } |
293 } |
| 292 else |
294 else |
| 293 gaim_signal_connect(plugin, event_signon, blist_create_cb, NULL); |
295 gaim_signal_connect((void*)gaim_connections_get_handle(), "signed-on", plugin_id, GAIM_CALLBACK(blist_create_cb), NULL); |
| 294 |
296 |
| 295 wgaim_im_blink_state(gaim_prefs_get_bool(OPT_WINPREFS_IM_BLINK)); |
297 wgaim_im_blink_state(gaim_prefs_get_bool(OPT_WINPREFS_IM_BLINK)); |
| 296 |
298 |
| 297 gaim_signal_connect(plugin, event_quit, gaim_quit_cb, NULL); |
299 gaim_signal_connect((void*)gaim_get_core(), "quitting", plugin, GAIM_CALLBACK(gaim_quit_cb), NULL); |
| 298 |
300 |
| 299 return TRUE; |
301 return TRUE; |
| 300 } |
302 } |
| 301 |
303 |
| 302 gboolean plugin_unload(GaimPlugin *plugin) { |
304 gboolean plugin_unload(GaimPlugin *plugin) { |