Mercurial > pidgin.yaz
comparison src/buddy.c @ 3554:cf00549c53d7
[gaim-migrate @ 3644]
A long annoying patch by one Robert McQueen.
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Thu, 26 Sep 2002 15:23:33 +0000 |
parents | cd938f18f3f8 |
children | ea617b23ddac |
comparison
equal
deleted
inserted
replaced
3553:57a233c032eb | 3554:cf00549c53d7 |
---|---|
1997 /* Useful for the docklet plugin and also for the win32 tray icon*/ | 1997 /* Useful for the docklet plugin and also for the win32 tray icon*/ |
1998 /* This is called when one of those is clicked--it will show/hide the | 1998 /* This is called when one of those is clicked--it will show/hide the |
1999 buddy list/login window--depending on which is active */ | 1999 buddy list/login window--depending on which is active */ |
2000 if (connections) { | 2000 if (connections) { |
2001 if (GTK_WIDGET_VISIBLE(blist)) { | 2001 if (GTK_WIDGET_VISIBLE(blist)) { |
2002 if (DOCKLET_WINDOW_ICONIFIED(blist)) { | 2002 if (GAIM_WINDOW_ICONIFIED(blist)) { |
2003 unhide_buddy_list(); | 2003 unhide_buddy_list(); |
2004 } else { | 2004 } else { |
2005 hide_buddy_list(); | 2005 hide_buddy_list(); |
2006 } | 2006 } |
2007 } else { | 2007 } else { |
2008 unhide_buddy_list(); | 2008 unhide_buddy_list(); |
2009 } | 2009 } |
2010 } else { | 2010 } else { |
2011 if (GTK_WIDGET_VISIBLE(mainwindow)) { | 2011 if (GTK_WIDGET_VISIBLE(mainwindow)) { |
2012 if (DOCKLET_WINDOW_ICONIFIED(mainwindow)) { | 2012 if (GAIM_WINDOW_ICONIFIED(mainwindow)) { |
2013 gtk_window_present(GTK_WINDOW(mainwindow)); | 2013 gtk_window_present(GTK_WINDOW(mainwindow)); |
2014 } else { | 2014 } else { |
2015 gtk_widget_hide(mainwindow); | 2015 gtk_widget_hide(mainwindow); |
2016 } | 2016 } |
2017 } else { | 2017 } else { |
2456 blist_pos.height = event->height; | 2456 blist_pos.height = event->height; |
2457 save_prefs(); | 2457 save_prefs(); |
2458 } | 2458 } |
2459 } | 2459 } |
2460 | 2460 |
2461 static void change_state_blist_window(GtkWidget *w, GdkEventWindowState *event, void *dummy) { | |
2462 if (event->new_window_state & GDK_WINDOW_STATE_ICONIFIED && | |
2463 docklet_count) { | |
2464 gtk_widget_hide(blist); | |
2465 } | |
2466 } | |
2467 | |
2461 /******************************************************************* | 2468 /******************************************************************* |
2462 * | 2469 * |
2463 * Helper funs for making the menu | 2470 * Helper funs for making the menu |
2464 * | 2471 * |
2465 *******************************************************************/ | 2472 *******************************************************************/ |
2491 gtk_container_add(GTK_CONTAINER(menuitem), label); | 2498 gtk_container_add(GTK_CONTAINER(menuitem), label); |
2492 gtk_widget_show(label); | 2499 gtk_widget_show(label); |
2493 | 2500 |
2494 gtk_widget_add_accelerator(menuitem, "activate", accel, str[0], | 2501 gtk_widget_add_accelerator(menuitem, "activate", accel, str[0], |
2495 GDK_MOD1_MASK, GTK_ACCEL_LOCKED); | 2502 GDK_MOD1_MASK, GTK_ACCEL_LOCKED); |
2496 gtk_widget_lock_accelerators(menuitem); | 2503 |
2497 | |
2498 return menuitem; | 2504 return menuitem; |
2499 } | 2505 } |
2500 | 2506 |
2501 GtkWidget *gaim_new_item_with_pixmap(GtkWidget *menu, const char *str, char **xpm, GtkSignalFunc sf, gpointer data, | 2507 GtkWidget *gaim_new_item_with_pixmap(GtkWidget *menu, const char *str, char **xpm, GtkSignalFunc sf, gpointer data, |
2502 guint accel_key, guint accel_mods, char *mod) | 2508 guint accel_key, guint accel_mods, char *mod) |
2542 } | 2548 } |
2543 | 2549 |
2544 if (accel_key) { | 2550 if (accel_key) { |
2545 gtk_widget_add_accelerator(menuitem, "activate", accel, accel_key, | 2551 gtk_widget_add_accelerator(menuitem, "activate", accel, accel_key, |
2546 accel_mods, GTK_ACCEL_LOCKED); | 2552 accel_mods, GTK_ACCEL_LOCKED); |
2547 gtk_widget_lock_accelerators(menuitem); | |
2548 } | 2553 } |
2549 | 2554 |
2550 return menuitem; | 2555 return menuitem; |
2551 } | 2556 } |
2552 | 2557 |
2654 | 2659 |
2655 gtk_window_set_gravity(GTK_WINDOW(blist), GDK_GRAVITY_STATIC); | 2660 gtk_window_set_gravity(GTK_WINDOW(blist), GDK_GRAVITY_STATIC); |
2656 gtk_window_set_policy(GTK_WINDOW(blist), TRUE, TRUE, TRUE); | 2661 gtk_window_set_policy(GTK_WINDOW(blist), TRUE, TRUE, TRUE); |
2657 | 2662 |
2658 accel = gtk_accel_group_new(); | 2663 accel = gtk_accel_group_new(); |
2659 gtk_accel_group_attach(accel, G_OBJECT(blist)); | 2664 gtk_window_add_accel_group(G_OBJECT(blist), accel); |
2660 | 2665 |
2661 menubar = gtk_menu_bar_new(); | 2666 menubar = gtk_menu_bar_new(); |
2662 | 2667 |
2663 menu = gtk_menu_new(); | 2668 menu = gtk_menu_new(); |
2664 gtk_menu_set_accel_group(GTK_MENU(menu), accel); | 2669 gtk_menu_set_accel_group(GTK_MENU(menu), accel); |
2865 gtk_signal_connect(GTK_OBJECT(blist), "delete_event", GTK_SIGNAL_FUNC(close_buddy_list), | 2870 gtk_signal_connect(GTK_OBJECT(blist), "delete_event", GTK_SIGNAL_FUNC(close_buddy_list), |
2866 NULL); | 2871 NULL); |
2867 | 2872 |
2868 gtk_signal_connect(GTK_OBJECT(blist), "configure_event", GTK_SIGNAL_FUNC(configure_blist_window), | 2873 gtk_signal_connect(GTK_OBJECT(blist), "configure_event", GTK_SIGNAL_FUNC(configure_blist_window), |
2869 NULL); | 2874 NULL); |
2875 gtk_signal_connect(GTK_OBJECT(blist), "window_state_event", GTK_SIGNAL_FUNC(change_state_blist_window), | |
2876 NULL); | |
2870 | 2877 |
2871 | 2878 |
2872 | 2879 |
2873 /* The edit tree */ | 2880 /* The edit tree */ |
2874 gtk_container_add(GTK_CONTAINER(tbox), edittree); | 2881 gtk_container_add(GTK_CONTAINER(tbox), edittree); |