# HG changeset patch # User Christian Hammond # Date 1074655372 0 # Node ID 77d1252b38030abdebd4cf23ccd4ac705889ef6f # Parent 064ecf11a36aa7c15995984b37e3ccfe4ac1ce35 [gaim-migrate @ 8867] 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. committer: Tailor Script diff -r 064ecf11a36a -r 77d1252b3803 ChangeLog --- a/ChangeLog Tue Jan 20 20:03:24 2004 +0000 +++ b/ChangeLog Wed Jan 21 03:22:52 2004 +0000 @@ -8,6 +8,8 @@ * Improved accessibility in conversation windows (Nathan Fredrickson) * Keyboard access to context menus via Shift+F10 (Marc Mulcahy) * TCL Plugin API changed + * Tabs now stay green when they are supposed to (Etan Reisner) + * Offline accounts in account drop-down lists are now greyed (Etan Reisner) * Catalan translation updated (Xan (DXpublica)) * English (British) translation updated (Luke Ross (lukeross)) * Hebrew translation had 1 character removed (Ambrose C. LI) diff -r 064ecf11a36a -r 77d1252b3803 src/conversation.c --- a/src/conversation.c Tue Jan 20 20:03:24 2004 +0000 +++ b/src/conversation.c Wed Jan 21 03:22:52 2004 +0000 @@ -1089,8 +1089,8 @@ 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 * diff -r 064ecf11a36a -r 77d1252b3803 src/conversation.h --- a/src/conversation.h Tue Jan 20 20:03:24 2004 +0000 +++ b/src/conversation.h Wed Jan 21 03:22:52 2004 +0000 @@ -68,14 +68,14 @@ 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 @@ 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 @@ 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 @@ { 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 */ diff -r 064ecf11a36a -r 77d1252b3803 src/gtkconv.c --- a/src/gtkconv.c Tue Jan 20 20:03:24 2004 +0000 +++ b/src/gtkconv.c Wed Jan 21 03:22:52 2004 +0000 @@ -5038,24 +5038,6 @@ } 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 @@ 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 @@ char *label; label = g_strdup_printf("%s", - color, title); + color, title); gtk_label_set_markup(GTK_LABEL(gtkconv->tab_label), label); g_free(label); } @@ -5161,6 +5144,12 @@ 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 @@ 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 @@ 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 */ }; diff -r 064ecf11a36a -r 77d1252b3803 src/gtkutils.c --- a/src/gtkutils.c Tue Jan 20 20:03:24 2004 +0000 +++ b/src/gtkutils.c Wed Jan 21 03:22:52 2004 +0000 @@ -823,14 +823,18 @@ 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));