From: Christian H. <ch...@us...> - 2004-01-21 03:22:55
|
Update of /cvsroot/gaim/gaim/src In directory sc8-pr-cvs1:/tmp/cvs-serv8465/src Modified Files: conversation.c conversation.h gtkconv.c gtkutils.c Log Message: Patch by Etan Reisner. The tabs now stay green when they are supposed to, and the offline accounts in account drop-down lists are now greyed, like in the accounts window. Index: conversation.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/conversation.c,v retrieving revision 1.584 retrieving revision 1.585 diff -u -d -p -r1.584 -r1.585 --- conversation.c 11 Jan 2004 23:45:23 -0000 1.584 +++ conversation.c 21 Jan 2004 03:22:52 -0000 1.585 @@ -1089,8 +1089,8 @@ gaim_conversation_set_title(GaimConversa ops = gaim_conversation_get_ui_ops(conv); - if (ops != NULL && ops->set_title != NULL) - ops->set_title(conv, conv->title); + if (ops != NULL && ops->updated != NULL) + ops->updated(conv, GAIM_CONV_UPDATE_TITLE); } const char * Index: conversation.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/conversation.h,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -p -r1.39 -r1.40 --- conversation.h 10 Jan 2004 04:04:56 -0000 1.39 +++ conversation.h 21 Jan 2004 03:22:52 -0000 1.40 @@ -68,14 +68,14 @@ typedef enum typedef enum { GAIM_CONV_UPDATE_ADD = 0, /**< The buddy associated with the conversation - was added. */ + was added. */ GAIM_CONV_UPDATE_REMOVE, /**< The buddy associated with the conversation - was removed. */ + was removed. */ GAIM_CONV_UPDATE_ACCOUNT, /**< The gaim_account was changed. */ GAIM_CONV_UPDATE_TYPING, /**< The typing state was updated. */ GAIM_CONV_UPDATE_UNSEEN, /**< The unseen state was updated. */ GAIM_CONV_UPDATE_LOGGING, /**< Logging for this conversation was - enabled or disabled. */ + enabled or disabled. */ GAIM_CONV_UPDATE_TOPIC, /**< The topic for a chat was updated. */ /* @@ -85,7 +85,8 @@ typedef enum GAIM_CONV_ACCOUNT_ONLINE, /**< One of the user's accounts went online. */ GAIM_CONV_ACCOUNT_OFFLINE, /**< One of the user's accounts went offline. */ GAIM_CONV_UPDATE_AWAY, /**< The other user went away. */ - GAIM_CONV_UPDATE_ICON /**< The other user's buddy icon changed. */ + GAIM_CONV_UPDATE_ICON, /**< The other user's buddy icon changed. */ + GAIM_CONV_UPDATE_TITLE } GaimConvUpdateType; @@ -144,7 +145,7 @@ struct _GaimConvWindowUiOps void (*add_conversation)(GaimConvWindow *win, GaimConversation *conv); void (*remove_conversation)(GaimConvWindow *win, GaimConversation *conv); void (*move_conversation)(GaimConvWindow *win, GaimConversation *conv, - unsigned int newIndex); + unsigned int newIndex); int (*get_active_index)(const GaimConvWindow *win); }; @@ -158,23 +159,22 @@ struct _GaimConversationUiOps { void (*destroy_conversation)(GaimConversation *conv); void (*write_chat)(GaimConversation *conv, const char *who, - const char *message, GaimMessageFlags flags, - time_t mtime); + const char *message, GaimMessageFlags flags, + time_t mtime); void (*write_im)(GaimConversation *conv, const char *who, - const char *message, GaimMessageFlags flags, - time_t mtime); + const char *message, GaimMessageFlags flags, + time_t mtime); void (*write_conv)(GaimConversation *conv, const char *who, - const char *message, GaimMessageFlags flags, - time_t mtime); + const char *message, GaimMessageFlags flags, + time_t mtime); void (*chat_add_user)(GaimConversation *conv, const char *user); void (*chat_add_users)(GaimConversation *conv, GList *users); void (*chat_rename_user)(GaimConversation *conv, - const char *old_name, const char *new_name); + const char *old_name, const char *new_name); void (*chat_remove_user)(GaimConversation *conv, const char *user); void (*chat_remove_users)(GaimConversation *conv, GList *users); - void (*set_title)(GaimConversation *conv, const char *title); void (*update_progress)(GaimConversation *conv, float percent); /* Events */ Index: gtkconv.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkconv.c,v retrieving revision 1.302 retrieving revision 1.303 diff -u -d -p -r1.302 -r1.303 --- gtkconv.c 19 Jan 2004 22:40:17 -0000 1.302 +++ gtkconv.c 21 Jan 2004 03:22:52 -0000 1.303 @@ -5038,24 +5038,6 @@ gaim_gtkconv_chat_remove_users(GaimConve } static void -gaim_gtkconv_set_title(GaimConversation *conv, const char *title) -{ - GaimGtkConversation *gtkconv; - GaimConvWindow *win; - GaimGtkWindow *gtkwin; - - win = gaim_conversation_get_window(conv); - gtkwin = GAIM_GTK_WINDOW(win); - gtkconv = GAIM_GTK_CONVERSATION(conv); - - gtk_label_set_text(GTK_LABEL(gtkconv->tab_label), title); - gtk_label_set_text(GTK_LABEL(gtkconv->menu_label), title); - - if(conv == gaim_conv_window_get_active_conversation(win)) - gtk_window_set_title(GTK_WINDOW(gtkwin->window), title); -} - -static void update_tab_icon(GaimConversation *conv) { GaimGtkConversation *gtkconv; @@ -5110,7 +5092,8 @@ gaim_gtkconv_updated(GaimConversation *c update_tab_icon(conv); } else if (type == GAIM_CONV_UPDATE_TYPING || - type == GAIM_CONV_UPDATE_UNSEEN) + type == GAIM_CONV_UPDATE_UNSEEN || + type == GAIM_CONV_UPDATE_TITLE) { const char *title; GaimConvIm *im = NULL; @@ -5152,7 +5135,7 @@ gaim_gtkconv_updated(GaimConversation *c char *label; label = g_strdup_printf("<span color=\"%s\">%s</span>", - color, title); + color, title); gtk_label_set_markup(GTK_LABEL(gtkconv->tab_label), label); g_free(label); } @@ -5161,6 +5144,12 @@ gaim_gtkconv_updated(GaimConversation *c if (conv == gaim_conv_window_get_active_conversation(win)) update_typing_icon(conv); + + if (type == GAIM_CONV_UPDATE_TITLE) { + gtk_label_set_text(GTK_LABEL(gtkconv->menu_label), title); + if (conv == gaim_conv_window_get_active_conversation(win)) + gtk_window_set_title(GTK_WINDOW(gtkwin->window), title); + } } else if (type == GAIM_CONV_UPDATE_TOPIC) { @@ -5172,7 +5161,7 @@ gaim_gtkconv_updated(GaimConversation *c gtk_entry_set_text(GTK_ENTRY(gtkchat->topic_text),topic); gtk_tooltips_set_tip(gtkconv->tooltips, gtkchat->topic_text, - topic, NULL); + topic, NULL); } else if (type == GAIM_CONV_ACCOUNT_ONLINE || type == GAIM_CONV_ACCOUNT_OFFLINE) @@ -5208,7 +5197,6 @@ static GaimConversationUiOps conversatio gaim_gtkconv_chat_rename_user, /* chat_rename_user */ gaim_gtkconv_chat_remove_user, /* chat_remove_user */ gaim_gtkconv_chat_remove_users, /* chat_remove_users */ - gaim_gtkconv_set_title, /* set_title */ NULL, /* update_progress */ gaim_gtkconv_updated /* updated */ }; Index: gtkutils.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkutils.c,v retrieving revision 1.63 retrieving revision 1.64 diff -u -d -p -r1.63 -r1.64 --- gtkutils.c 19 Jan 2004 22:40:17 -0000 1.63 +++ gtkutils.c 21 Jan 2004 03:22:52 -0000 1.64 @@ -823,14 +823,18 @@ create_account_menu(GtkWidget *optmenu, g_snprintf(buf, sizeof(buf), "%s.png", proto_name); filename = g_build_filename(DATADIR, "pixmaps", "gaim", "status", - "default", buf, NULL); + "default", buf, NULL); pixbuf = gdk_pixbuf_new_from_file(filename, NULL); g_free(filename); if (pixbuf != NULL) { /* Scale and insert the image */ scale = gdk_pixbuf_scale_simple(pixbuf, 16, 16, - GDK_INTERP_BILINEAR); + GDK_INTERP_BILINEAR); + + if (!gaim_account_is_connected(account)) + gdk_pixbuf_saturate_and_pixelate(scale, scale, 0.0, FALSE); + image = gtk_image_new_from_pixbuf(scale); g_object_unref(G_OBJECT(pixbuf)); |