Mercurial > pidgin
comparison src/gtkconv.c @ 4360:c435a29370b8
[gaim-migrate @ 4626]
Cleaning up after myself, and fixing a small bug.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Mon, 20 Jan 2003 09:30:30 +0000 |
parents | 5fb47ec9bfe4 |
children | 25d5b2a7545f |
comparison
equal
deleted
inserted
replaced
4359:5fb47ec9bfe4 | 4360:c435a29370b8 |
---|---|
1988 | 1988 |
1989 gaim_gtk_set_state_lock(FALSE); | 1989 gaim_gtk_set_state_lock(FALSE); |
1990 } | 1990 } |
1991 | 1991 |
1992 static void | 1992 static void |
1993 generate_send_as_items(struct gaim_window *win) | 1993 generate_send_as_items(struct gaim_window *win, |
1994 struct gaim_conversation *deleted_conv) | |
1994 { | 1995 { |
1995 struct gaim_gtk_window *gtkwin; | 1996 struct gaim_gtk_window *gtkwin; |
1996 GtkWidget *menu; | 1997 GtkWidget *menu; |
1997 GtkWidget *menuitem; | 1998 GtkWidget *menuitem; |
1998 GSList *gcs; | 1999 GSList *gcs; |
2075 | 2076 |
2076 struct gaim_conversation *conv; | 2077 struct gaim_conversation *conv; |
2077 struct aim_user *user; | 2078 struct aim_user *user; |
2078 | 2079 |
2079 conv = (struct gaim_conversation *)convs->data; | 2080 conv = (struct gaim_conversation *)convs->data; |
2081 | |
2082 if (conv == deleted_conv) | |
2083 continue; | |
2084 | |
2080 user = gaim_conversation_get_user(conv); | 2085 user = gaim_conversation_get_user(conv); |
2081 | 2086 |
2082 if (user->gc == NULL) { | 2087 if (user->gc == NULL) { |
2083 if (first_offline && found_online) { | 2088 if (first_offline && found_online) { |
2084 menuitem = gtk_separator_menu_item_new(); | 2089 menuitem = gtk_separator_menu_item_new(); |
2085 gtk_widget_show(menuitem); | 2090 gtk_widget_show(menuitem); |
2086 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem); | 2091 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem); |
2087 | 2092 |
2088 first_offline = FALSE; | 2093 first_offline = FALSE; |
2089 } | 2094 } |
2090 | |
2091 printf("Adding '%s'\n", user->username); | |
2092 | 2095 |
2093 menuitem = gtk_radio_menu_item_new_with_label(group, | 2096 menuitem = gtk_radio_menu_item_new_with_label(group, |
2094 user->username); | 2097 user->username); |
2095 group = gtk_radio_menu_item_group(GTK_RADIO_MENU_ITEM(menuitem)); | 2098 group = gtk_radio_menu_item_group(GTK_RADIO_MENU_ITEM(menuitem)); |
2096 | 2099 |
2440 gtkwin->menu.logging = gtk_item_factory_get_widget(item_factory, | 2443 gtkwin->menu.logging = gtk_item_factory_get_widget(item_factory, |
2441 "/Options/Enable Logging"); | 2444 "/Options/Enable Logging"); |
2442 gtkwin->menu.sounds = gtk_item_factory_get_widget(item_factory, | 2445 gtkwin->menu.sounds = gtk_item_factory_get_widget(item_factory, |
2443 "/Options/Enable Sounds"); | 2446 "/Options/Enable Sounds"); |
2444 | 2447 |
2445 generate_send_as_items(win); | 2448 generate_send_as_items(win, NULL); |
2446 | 2449 |
2447 gtk_container_add(GTK_CONTAINER(hb), gtkwin->menu.menubar); | 2450 gtk_container_add(GTK_CONTAINER(hb), gtkwin->menu.menubar); |
2448 | 2451 |
2449 gtk_widget_show(gtkwin->menu.menubar); | 2452 gtk_widget_show(gtkwin->menu.menubar); |
2450 gtk_widget_show(hb); | 2453 gtk_widget_show(hb); |
3408 gtk_notebook_remove_page(GTK_NOTEBOOK(gtkwin->notebook), index); | 3411 gtk_notebook_remove_page(GTK_NOTEBOOK(gtkwin->notebook), index); |
3409 | 3412 |
3410 gaim_gtk_set_state_lock(FALSE); | 3413 gaim_gtk_set_state_lock(FALSE); |
3411 | 3414 |
3412 /* If this window is setup with an inactive gc, regenerate the menu. */ | 3415 /* If this window is setup with an inactive gc, regenerate the menu. */ |
3413 debug_printf("remove_conv: user == %p\n", gaim_conversation_get_user(conv)); | |
3414 debug_printf("remove_conv: user->gc == %p\n", gaim_conversation_get_user(conv)->gc); | |
3415 debug_printf("remove_conv: gc == %p\n", gaim_conversation_get_gc(conv)); | |
3416 if (gaim_conversation_get_type(conv) == GAIM_CONV_IM && | 3416 if (gaim_conversation_get_type(conv) == GAIM_CONV_IM && |
3417 gaim_conversation_get_gc(conv) == NULL) { | 3417 gaim_conversation_get_gc(conv) == NULL) { |
3418 | 3418 |
3419 debug_printf("Going to generate send as items.\n"); | 3419 generate_send_as_items(win, conv); |
3420 generate_send_as_items(win); | |
3421 } | 3420 } |
3422 } | 3421 } |
3423 | 3422 |
3424 static void | 3423 static void |
3425 gaim_gtk_move_conversation(struct gaim_window *win, | 3424 gaim_gtk_move_conversation(struct gaim_window *win, |
4122 gaim_chat_get_topic(chat)); | 4121 gaim_chat_get_topic(chat)); |
4123 } | 4122 } |
4124 else if (type == GAIM_CONV_ACCOUNT_ONLINE || | 4123 else if (type == GAIM_CONV_ACCOUNT_ONLINE || |
4125 type == GAIM_CONV_ACCOUNT_OFFLINE) { | 4124 type == GAIM_CONV_ACCOUNT_OFFLINE) { |
4126 | 4125 |
4127 generate_send_as_items(win); | 4126 generate_send_as_items(win, NULL); |
4128 } | 4127 } |
4129 } | 4128 } |
4130 | 4129 |
4131 static struct gaim_conversation_ops conversation_ops = | 4130 static struct gaim_conversation_ops conversation_ops = |
4132 { | 4131 { |