comparison src/gtkconv.c @ 4818:1c371e4244d6

[gaim-migrate @ 5142] brought to you by the letter T and the number 0, I give you tabless conversation windows. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Tue, 18 Mar 2003 03:23:00 +0000
parents 3b0b7c8470ec
children 0ed37c803503
comparison
equal deleted inserted replaced
4817:b4ca2cc6bed9 4818:1c371e4244d6
3324 gtk_notebook_set_tab_vborder(GTK_NOTEBOOK(gtkwin->notebook), 0); 3324 gtk_notebook_set_tab_vborder(GTK_NOTEBOOK(gtkwin->notebook), 0);
3325 #endif 3325 #endif
3326 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(gtkwin->notebook), pos); 3326 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(gtkwin->notebook), pos);
3327 gtk_notebook_set_scrollable(GTK_NOTEBOOK(gtkwin->notebook), TRUE); 3327 gtk_notebook_set_scrollable(GTK_NOTEBOOK(gtkwin->notebook), TRUE);
3328 gtk_notebook_popup_enable(GTK_NOTEBOOK(gtkwin->notebook)); 3328 gtk_notebook_popup_enable(GTK_NOTEBOOK(gtkwin->notebook));
3329 gtk_notebook_set_show_tabs(GTK_NOTEBOOK(gtkwin->notebook), FALSE);
3330
3329 gtk_widget_show(gtkwin->notebook); 3331 gtk_widget_show(gtkwin->notebook);
3330 3332
3331 g_signal_connect_after(G_OBJECT(gtkwin->notebook), "switch_page", 3333 g_signal_connect_after(G_OBJECT(gtkwin->notebook), "switch_page",
3332 G_CALLBACK(switch_conv_cb), win); 3334 G_CALLBACK(switch_conv_cb), win);
3333 3335
3581 gtk_notebook_set_menu_label_text(GTK_NOTEBOOK(gtkwin->notebook), tab_cont, 3583 gtk_notebook_set_menu_label_text(GTK_NOTEBOOK(gtkwin->notebook), tab_cont,
3582 gaim_conversation_get_title(conv)); 3584 gaim_conversation_get_title(conv));
3583 3585
3584 gtk_widget_show(tab_cont); 3586 gtk_widget_show(tab_cont);
3585 3587
3586 /* Er, bug in notebooks? Switch to the page manually. */ 3588 if (gaim_window_get_conversation_count(win) == 1) {
3587 if (gaim_window_get_conversation_count(win) == 1) 3589 /* Er, bug in notebooks? Switch to the page manually. */
3588 gtk_notebook_set_current_page(GTK_NOTEBOOK(gtkwin->notebook), 0); 3590 gtk_notebook_set_current_page(GTK_NOTEBOOK(gtkwin->notebook), 0);
3591 gtk_notebook_set_show_tabs(GTK_NOTEBOOK(gtkwin->notebook),
3592 ((conv_type == GAIM_CONV_IM && im_options & OPT_IM_ONE_WINDOW) ||
3593 (conv_type == GAIM_CONV_CHAT && im_options & OPT_CHAT_ONE_WINDOW)));
3594 } else {
3595 gtk_notebook_set_show_tabs(GTK_NOTEBOOK(gtkwin->notebook), TRUE);
3596 }
3589 3597
3590 if ((gtk_notebook_get_current_page(GTK_NOTEBOOK(gtkwin->notebook)) == 0) || 3598 if ((gtk_notebook_get_current_page(GTK_NOTEBOOK(gtkwin->notebook)) == 0) ||
3591 (conv == g_list_nth_data(gaim_window_get_conversations(win), 0))) { 3599 (conv == g_list_nth_data(gaim_window_get_conversations(win), 0))) {
3592 3600
3593 gtk_widget_grab_focus(gtkconv->entry); 3601 gtk_widget_grab_focus(gtkconv->entry);
3607 struct gaim_conversation *conv) 3615 struct gaim_conversation *conv)
3608 { 3616 {
3609 struct gaim_gtk_window *gtkwin; 3617 struct gaim_gtk_window *gtkwin;
3610 struct gaim_gtk_conversation *gtkconv; 3618 struct gaim_gtk_conversation *gtkconv;
3611 unsigned int index; 3619 unsigned int index;
3612 3620 GaimConversationType conv_type;
3621
3622 conv_type = gaim_conversation_get_type(conv);
3613 index = gaim_conversation_get_index(conv); 3623 index = gaim_conversation_get_index(conv);
3614 3624
3615 gtkwin = GAIM_GTK_WINDOW(win); 3625 gtkwin = GAIM_GTK_WINDOW(win);
3616 gtkconv = GAIM_GTK_CONVERSATION(conv); 3626 gtkconv = GAIM_GTK_CONVERSATION(conv);
3617 3627
3618 g_object_ref(gtkconv->tab_cont); 3628 g_object_ref(gtkconv->tab_cont);
3619 gtk_object_sink(GTK_OBJECT(gtkconv->tab_cont)); 3629 gtk_object_sink(GTK_OBJECT(gtkconv->tab_cont));
3620 3630
3621 gtk_notebook_remove_page(GTK_NOTEBOOK(gtkwin->notebook), index); 3631 gtk_notebook_remove_page(GTK_NOTEBOOK(gtkwin->notebook), index);
3622 3632
3633 /* go back to tabless if need be */
3634 if (gaim_window_get_conversation_count(win) <= 2) {
3635 gtk_notebook_set_show_tabs(GTK_NOTEBOOK(gtkwin->notebook),
3636 ((conv_type == GAIM_CONV_IM && im_options & OPT_IM_ONE_WINDOW) ||
3637 (conv_type == GAIM_CONV_CHAT && im_options & OPT_CHAT_ONE_WINDOW)));
3638 }
3639
3640
3623 /* If this window is setup with an inactive gc, regenerate the menu. */ 3641 /* If this window is setup with an inactive gc, regenerate the menu. */
3624 if (gaim_conversation_get_type(conv) == GAIM_CONV_IM && 3642 if (conv_type == GAIM_CONV_IM &&
3625 gaim_conversation_get_gc(conv) == NULL) { 3643 gaim_conversation_get_gc(conv) == NULL) {
3626 3644
3627 generate_send_as_items(win, conv); 3645 generate_send_as_items(win, conv);
3628 } 3646 }
3629 } 3647 }