| 3121 plugin_changed_cb(GaimPlugin *p, gpointer *data) |
3121 plugin_changed_cb(GaimPlugin *p, gpointer *data) |
| 3122 { |
3122 { |
| 3123 gaim_gtk_blist_update_plugin_actions(); |
3123 gaim_gtk_blist_update_plugin_actions(); |
| 3124 } |
3124 } |
| 3125 |
3125 |
| |
3126 static void |
| |
3127 unseen_conv_menu_cb(GtkMenuItem *item, GaimConversation *conv) |
| |
3128 { |
| |
3129 g_return_if_fail(conv != NULL); |
| |
3130 gaim_gtkconv_present_conversation(conv); |
| |
3131 } |
| |
3132 |
| |
3133 static void |
| |
3134 unseen_conv_menu() |
| |
3135 { |
| |
3136 static GtkWidget *menu = NULL; |
| |
3137 GList *convs; |
| |
3138 |
| |
3139 if (menu) |
| |
3140 gtk_widget_destroy(menu); |
| |
3141 |
| |
3142 if (!gaim_gtk_conversations_get_first_unseen(GAIM_CONV_TYPE_IM, GAIM_UNSEEN_TEXT)) |
| |
3143 return; |
| |
3144 |
| |
3145 menu = gtk_menu_new(); |
| |
3146 |
| |
3147 for (convs = gaim_get_ims(); convs != NULL ; convs = convs->next) { |
| |
3148 GaimConversation *conv = convs->data; |
| |
3149 GaimGtkConversation *gtkconv = GAIM_GTK_CONVERSATION(conv); |
| |
3150 |
| |
3151 if (gtkconv->unseen_state >= GAIM_UNSEEN_TEXT) { |
| |
3152 GtkWidget *icon = gtk_image_new(); |
| |
3153 GdkPixbuf *pbuf = gaim_gtkconv_get_tab_icon(conv, TRUE); |
| |
3154 GtkWidget *item; |
| |
3155 |
| |
3156 gtk_image_set_from_pixbuf(GTK_IMAGE(icon), pbuf); |
| |
3157 g_object_unref(pbuf); |
| |
3158 |
| |
3159 item = gtk_image_menu_item_new_with_label( |
| |
3160 gtk_label_get_text(GTK_LABEL(gtkconv->tab_label))); |
| |
3161 gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), icon); |
| |
3162 g_signal_connect(G_OBJECT(item), "activate", G_CALLBACK(unseen_conv_menu_cb), conv); |
| |
3163 gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); |
| |
3164 } |
| |
3165 } |
| |
3166 |
| |
3167 gtk_widget_show_all(menu); |
| |
3168 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, 3, |
| |
3169 gtk_get_current_event_time()); |
| |
3170 } |
| |
3171 |
| 3126 static gboolean |
3172 static gboolean |
| 3127 menutray_press_cb(GtkWidget *widget, GdkEventButton *event) |
3173 menutray_press_cb(GtkWidget *widget, GdkEventButton *event) |
| 3128 { |
3174 { |
| 3129 gaim_gtkconv_present_conversation(gaim_gtk_conversations_get_first_unseen( |
3175 switch (event->button) { |
| 3130 GAIM_CONV_TYPE_IM, GAIM_UNSEEN_TEXT)); |
3176 case 1: |
| |
3177 gaim_gtkconv_present_conversation(gaim_gtk_conversations_get_first_unseen( |
| |
3178 GAIM_CONV_TYPE_IM, GAIM_UNSEEN_TEXT)); |
| |
3179 break; |
| |
3180 case 3: |
| |
3181 unseen_conv_menu(); |
| |
3182 break; |
| |
3183 } |
| 3131 return TRUE; |
3184 return TRUE; |
| 3132 } |
3185 } |
| 3133 |
3186 |
| 3134 static void |
3187 static void |
| 3135 conversation_updated_cb(GaimConversation *conv, GaimConvUpdateType type, |
3188 conversation_updated_cb(GaimConversation *conv, GaimConvUpdateType type, |