comparison pidgin/gtkconv.c @ 15505:762b6547adf9

GAIM_UNSEEN to PIDGIN_UNSEEN
author Sean Egan <seanegan@gmail.com>
date Sat, 03 Feb 2007 08:19:27 +0000
parents 6fde15c1dcfc
children 311315e979f7
comparison
equal deleted inserted replaced
15504:b53b783846a8 15505:762b6547adf9
597 gtk_imhtml_clear(GTK_IMHTML(gtkconv->entry)); 597 gtk_imhtml_clear(GTK_IMHTML(gtkconv->entry));
598 if (gtkconv->entry_growing) { 598 if (gtkconv->entry_growing) {
599 reset_default_size(gtkconv); 599 reset_default_size(gtkconv);
600 gtkconv->entry_growing = FALSE; 600 gtkconv->entry_growing = FALSE;
601 } 601 }
602 gtkconv_set_unseen(gtkconv, GAIM_UNSEEN_NONE); 602 gtkconv_set_unseen(gtkconv, PIDGIN_UNSEEN_NONE);
603 } 603 }
604 604
605 static void 605 static void
606 add_remove_cb(GtkWidget *widget, PidginConversation *gtkconv) 606 add_remove_cb(GtkWidget *widget, PidginConversation *gtkconv)
607 { 607 {
4544 gtkconv->send_history = g_list_append(NULL, NULL); 4544 gtkconv->send_history = g_list_append(NULL, NULL);
4545 4545
4546 /* Setup some initial variables. */ 4546 /* Setup some initial variables. */
4547 gtkconv->sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); 4547 gtkconv->sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH);
4548 gtkconv->tooltips = gtk_tooltips_new(); 4548 gtkconv->tooltips = gtk_tooltips_new();
4549 gtkconv->unseen_state = GAIM_UNSEEN_NONE; 4549 gtkconv->unseen_state = PIDGIN_UNSEEN_NONE;
4550 gtkconv->unseen_count = 0; 4550 gtkconv->unseen_count = 0;
4551 4551
4552 if (conv_type == GAIM_CONV_TYPE_IM) { 4552 if (conv_type == GAIM_CONV_TYPE_IM) {
4553 gtkconv->u.im = g_malloc0(sizeof(PidginImPane)); 4553 gtkconv->u.im = g_malloc0(sizeof(PidginImPane));
4554 4554
5160 g_free(sml_attrib); 5160 g_free(sml_attrib);
5161 5161
5162 /* Tab highlighting stuff */ 5162 /* Tab highlighting stuff */
5163 if (!(flags & GAIM_MESSAGE_SEND) && !pidgin_conv_has_focus(conv)) 5163 if (!(flags & GAIM_MESSAGE_SEND) && !pidgin_conv_has_focus(conv))
5164 { 5164 {
5165 GaimUnseenState unseen = GAIM_UNSEEN_NONE; 5165 GaimUnseenState unseen = PIDGIN_UNSEEN_NONE;
5166 5166
5167 if ((flags & GAIM_MESSAGE_NICK) == GAIM_MESSAGE_NICK) 5167 if ((flags & GAIM_MESSAGE_NICK) == GAIM_MESSAGE_NICK)
5168 unseen = GAIM_UNSEEN_NICK; 5168 unseen = PIDGIN_UNSEEN_NICK;
5169 else if (((flags & GAIM_MESSAGE_SYSTEM) == GAIM_MESSAGE_SYSTEM) || 5169 else if (((flags & GAIM_MESSAGE_SYSTEM) == GAIM_MESSAGE_SYSTEM) ||
5170 ((flags & GAIM_MESSAGE_ERROR) == GAIM_MESSAGE_ERROR)) 5170 ((flags & GAIM_MESSAGE_ERROR) == GAIM_MESSAGE_ERROR))
5171 unseen = GAIM_UNSEEN_EVENT; 5171 unseen = PIDGIN_UNSEEN_EVENT;
5172 else if ((flags & GAIM_MESSAGE_NO_LOG) == GAIM_MESSAGE_NO_LOG) 5172 else if ((flags & GAIM_MESSAGE_NO_LOG) == GAIM_MESSAGE_NO_LOG)
5173 unseen = GAIM_UNSEEN_NO_LOG; 5173 unseen = PIDGIN_UNSEEN_NO_LOG;
5174 else 5174 else
5175 unseen = GAIM_UNSEEN_TEXT; 5175 unseen = PIDGIN_UNSEEN_TEXT;
5176 5176
5177 gtkconv_set_unseen(gtkconv, unseen); 5177 gtkconv_set_unseen(gtkconv, unseen);
5178 } 5178 }
5179 5179
5180 gaim_signal_emit(pidgin_conversations_get_handle(), 5180 gaim_signal_emit(pidgin_conversations_get_handle(),
5888 gaim_conv_im_get_typing_state(im) == GAIM_TYPED) 5888 gaim_conv_im_get_typing_state(im) == GAIM_TYPED)
5889 { 5889 {
5890 atk_object_set_description(accessibility_obj, _("Stopped Typing")); 5890 atk_object_set_description(accessibility_obj, _("Stopped Typing"));
5891 strncpy(style, "color=\"#D1940C\"", sizeof(style)); 5891 strncpy(style, "color=\"#D1940C\"", sizeof(style));
5892 } 5892 }
5893 else if (gtkconv->unseen_state == GAIM_UNSEEN_NICK) 5893 else if (gtkconv->unseen_state == PIDGIN_UNSEEN_NICK)
5894 { 5894 {
5895 atk_object_set_description(accessibility_obj, _("Nick Said")); 5895 atk_object_set_description(accessibility_obj, _("Nick Said"));
5896 strncpy(style, "color=\"#0D4E91\" style=\"italic\" weight=\"bold\"", sizeof(style)); 5896 strncpy(style, "color=\"#0D4E91\" style=\"italic\" weight=\"bold\"", sizeof(style));
5897 } 5897 }
5898 else if (gtkconv->unseen_state == GAIM_UNSEEN_TEXT) 5898 else if (gtkconv->unseen_state == PIDGIN_UNSEEN_TEXT)
5899 { 5899 {
5900 atk_object_set_description(accessibility_obj, _("Unread Messages")); 5900 atk_object_set_description(accessibility_obj, _("Unread Messages"));
5901 strncpy(style, "color=\"#DF421E\" weight=\"bold\"", sizeof(style)); 5901 strncpy(style, "color=\"#DF421E\" weight=\"bold\"", sizeof(style));
5902 } 5902 }
5903 else if (gtkconv->unseen_state == GAIM_UNSEEN_EVENT) 5903 else if (gtkconv->unseen_state == PIDGIN_UNSEEN_EVENT)
5904 { 5904 {
5905 atk_object_set_description(accessibility_obj, _("New Event")); 5905 atk_object_set_description(accessibility_obj, _("New Event"));
5906 strncpy(style, "color=\"#868272\" style=\"italic\"", sizeof(style)); 5906 strncpy(style, "color=\"#868272\" style=\"italic\"", sizeof(style));
5907 } 5907 }
5908 5908
7080 for (l = pidgin_conv_window_get_gtkconvs(win); 7080 for (l = pidgin_conv_window_get_gtkconvs(win);
7081 l != NULL; l = l->next) 7081 l != NULL; l = l->next)
7082 { 7082 {
7083 PidginConversation *gtkconv = l->data; 7083 PidginConversation *gtkconv = l->data;
7084 if (gaim_conversation_get_type(gtkconv->active_conv) == GAIM_CONV_TYPE_IM && 7084 if (gaim_conversation_get_type(gtkconv->active_conv) == GAIM_CONV_TYPE_IM &&
7085 gtkconv->unseen_state >= GAIM_UNSEEN_TEXT) 7085 gtkconv->unseen_state >= PIDGIN_UNSEEN_TEXT)
7086 { 7086 {
7087 build_warn_close_dialog(win); 7087 build_warn_close_dialog(win);
7088 gtk_widget_show_all(warn_close_dialog); 7088 gtk_widget_show_all(warn_close_dialog);
7089 7089
7090 return TRUE; 7090 return TRUE;
7097 } 7097 }
7098 7098
7099 static void 7099 static void
7100 gtkconv_set_unseen(PidginConversation *gtkconv, GaimUnseenState state) 7100 gtkconv_set_unseen(PidginConversation *gtkconv, GaimUnseenState state)
7101 { 7101 {
7102 if (state == GAIM_UNSEEN_NONE) 7102 if (state == PIDGIN_UNSEEN_NONE)
7103 { 7103 {
7104 gtkconv->unseen_count = 0; 7104 gtkconv->unseen_count = 0;
7105 gtkconv->unseen_state = GAIM_UNSEEN_NONE; 7105 gtkconv->unseen_state = PIDGIN_UNSEEN_NONE;
7106 } 7106 }
7107 else 7107 else
7108 { 7108 {
7109 if (state >= GAIM_UNSEEN_TEXT) 7109 if (state >= PIDGIN_UNSEEN_TEXT)
7110 gtkconv->unseen_count++; 7110 gtkconv->unseen_count++;
7111 7111
7112 if (state > gtkconv->unseen_state) 7112 if (state > gtkconv->unseen_state)
7113 gtkconv->unseen_state = state; 7113 gtkconv->unseen_state = state;
7114 } 7114 }
7125 focus_win_cb(GtkWidget *w, GdkEventFocus *e, gpointer d) 7125 focus_win_cb(GtkWidget *w, GdkEventFocus *e, gpointer d)
7126 { 7126 {
7127 PidginWindow *win = d; 7127 PidginWindow *win = d;
7128 PidginConversation *gtkconv = pidgin_conv_window_get_active_gtkconv(win); 7128 PidginConversation *gtkconv = pidgin_conv_window_get_active_gtkconv(win);
7129 7129
7130 gtkconv_set_unseen(gtkconv, GAIM_UNSEEN_NONE); 7130 gtkconv_set_unseen(gtkconv, PIDGIN_UNSEEN_NONE);
7131 7131
7132 return FALSE; 7132 return FALSE;
7133 } 7133 }
7134 7134
7135 #if !GTK_CHECK_VERSION(2,6,0) 7135 #if !GTK_CHECK_VERSION(2,6,0)
7633 7633
7634 g_return_if_fail(conv != NULL); 7634 g_return_if_fail(conv != NULL);
7635 7635
7636 /* clear unseen flag if conversation is not hidden */ 7636 /* clear unseen flag if conversation is not hidden */
7637 if(!pidgin_conv_is_hidden(gtkconv)) { 7637 if(!pidgin_conv_is_hidden(gtkconv)) {
7638 gtkconv_set_unseen(gtkconv, GAIM_UNSEEN_NONE); 7638 gtkconv_set_unseen(gtkconv, PIDGIN_UNSEEN_NONE);
7639 } 7639 }
7640 7640
7641 /* Update the menubar */ 7641 /* Update the menubar */
7642 7642
7643 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gtkconv->win->menu.logging), 7643 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gtkconv->win->menu.logging),