Mercurial > pidgin
changeset 29280:9407348dc714
propagate from branch 'im.pidgin.pidgin' (head 73e463add9a124c86554c2958526e1a6ee5fc22f)
to branch 'im.pidgin.cpw.attention_ui' (head 70298cc7b74e537376e55f04be1e6f40aabe3d9d)
author | Marcus Lundblad <ml@update.uu.se> |
---|---|
date | Mon, 16 Mar 2009 21:45:24 +0000 |
parents | 5640246d96c1 (diff) 3d997c09b94e (current diff) |
children | ea0494a3a299 |
files | libpurple/connection.h libpurple/protocols/jabber/jabber.c libpurple/protocols/jabber/si.c libpurple/protocols/msn/msn.c libpurple/protocols/yahoo/yahoo.c pidgin/gtkconv.c |
diffstat | 18 files changed, 213 insertions(+), 30 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/connection.h Mon Mar 16 17:07:41 2009 +0000 +++ b/libpurple/connection.h Mon Mar 16 21:45:24 2009 +0000 @@ -45,7 +45,7 @@ PURPLE_CONNECTION_NO_URLDESC = 0x0040, /**< Connection does not support descriptions with links */ PURPLE_CONNECTION_NO_IMAGES = 0x0080, /**< Connection does not support sending of images */ PURPLE_CONNECTION_ALLOW_CUSTOM_SMILEY = 0x0100 /**< Connection supports sending and receiving custom smileys */ - + } PurpleConnectionFlags; typedef enum
--- a/libpurple/conversation.c Mon Mar 16 17:07:41 2009 +0000 +++ b/libpurple/conversation.c Mon Mar 16 21:45:24 2009 +0000 @@ -960,6 +960,16 @@ g_free(displayed); } +void +purple_conversation_attention(PurpleConversation *conv, const char *who, + guint type, PurpleMessageFlags flags, time_t mtime) +{ + PurpleAccount *account = purple_conversation_get_account(conv); + purple_signal_emit(purple_conversations_get_handle(), + flags == PURPLE_MESSAGE_SEND ? "sent-attention" : "got-attention", + account, who, conv, type); +} + gboolean purple_conversation_has_focus(PurpleConversation *conv) { @@ -2180,7 +2190,27 @@ purple_value_new(PURPLE_TYPE_SUBTYPE, PURPLE_SUBTYPE_CONVERSATION), purple_value_new(PURPLE_TYPE_UINT)); - + + purple_signal_register(handle, "sent-attention", + purple_marshal_VOID__POINTER_POINTER_POINTER_UINT, + NULL, 4, + purple_value_new(PURPLE_TYPE_SUBTYPE, + PURPLE_SUBTYPE_ACCOUNT), + purple_value_new(PURPLE_TYPE_STRING), + purple_value_new(PURPLE_TYPE_SUBTYPE, + PURPLE_SUBTYPE_CONVERSATION), + purple_value_new(PURPLE_TYPE_UINT)); + + purple_signal_register(handle, "got-attention", + purple_marshal_VOID__POINTER_POINTER_POINTER_UINT, + NULL, 4, + purple_value_new(PURPLE_TYPE_SUBTYPE, + PURPLE_SUBTYPE_ACCOUNT), + purple_value_new(PURPLE_TYPE_STRING), + purple_value_new(PURPLE_TYPE_SUBTYPE, + PURPLE_SUBTYPE_CONVERSATION), + purple_value_new(PURPLE_TYPE_UINT)); + purple_signal_register(handle, "sending-im-msg", purple_marshal_VOID__POINTER_POINTER_POINTER, NULL, 3,
--- a/libpurple/conversation.h Mon Mar 16 17:07:41 2009 +0000 +++ b/libpurple/conversation.h Mon Mar 16 21:45:24 2009 +0000 @@ -645,7 +645,21 @@ const char *message, PurpleMessageFlags flags, time_t mtime); - +/** + * Sends an attention to a conversation window. + * + * This is to be called by prpls to tell UIs to set off the action for + * an attention message + * + * @param conv The conversation + * @param who The user who sent the attention + * @param type The attention type (will be 0 for protocols that only have 1 type) + * @param flags The message flags (send, receive) + * @param mtime The time the attentsion was sent + */ +void purple_conversation_attention(PurpleConversation *conv, const char *who, + guint attention_type, PurpleMessageFlags flags, time_t mtime); + /** Set the features as supported for the given conversation. @param conv The conversation
--- a/libpurple/protocols/jabber/jabber.c Mon Mar 16 17:07:41 2009 +0000 +++ b/libpurple/protocols/jabber/jabber.c Mon Mar 16 21:45:24 2009 +0000 @@ -2523,6 +2523,11 @@ { JabberStream *js = conv->account->gc->proto_data; const gchar *who; + gchar *description; + PurpleBuddy *buddy; + const char *alias; + PurpleAttentionType *attn = + purple_get_attention_type_from_code(conv->account, 0); if (!args || !args[0]) { /* use the buddy from conversation, if it's a one-to-one conversation */ @@ -2535,27 +2540,19 @@ who = args[0]; } - if (_jabber_send_buzz(js, who, error)) { - const gchar *alias; - gchar *str; - PurpleBuddy *buddy = - purple_find_buddy(purple_connection_get_account(conv->account->gc), - who); - - if (buddy != NULL) - alias = purple_buddy_get_contact_alias(buddy); - else - alias = who; - - str = g_strdup_printf(_("Buzzing %s..."), alias); - purple_conversation_write(conv, NULL, str, - PURPLE_MESSAGE_SYSTEM|PURPLE_MESSAGE_NOTIFY, time(NULL)); - g_free(str); - - return PURPLE_CMD_RET_OK; - } else { - return PURPLE_CMD_RET_FAILED; - } + buddy = purple_find_buddy(conv->account, who); + if (buddy != NULL) + alias = purple_buddy_get_contact_alias(buddy); + else + alias = who; + + description = + g_strdup_printf(purple_attention_type_get_outgoing_desc(attn), alias); + purple_conversation_attention(conv, who, 0, PURPLE_MESSAGE_SEND, time(NULL)); + purple_conversation_write(conv, NULL, description, + PURPLE_MESSAGE_NOTIFY | PURPLE_MESSAGE_SYSTEM, time(NULL)); + g_free(description); + return _jabber_send_buzz(js, who, error) ? PURPLE_CMD_RET_OK : PURPLE_CMD_RET_FAILED; } GList *jabber_attention_types(PurpleAccount *account)
--- a/libpurple/protocols/jabber/message.c Mon Mar 16 17:07:41 2009 +0000 +++ b/libpurple/protocols/jabber/message.c Mon Mar 16 21:45:24 2009 +0000 @@ -289,6 +289,8 @@ static void handle_buzz(JabberMessage *jm) { PurpleBuddy *buddy; PurpleAccount *account; + PurpleConversation *c; + char *username; /* Delayed buzz MUST NOT be accepted */ if(jm->delayed) @@ -303,8 +305,16 @@ if ((buddy = purple_find_buddy(account, jm->from)) == NULL) return; /* Do not accept buzzes from unknown people */ + c = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, jm->from, account); + if (c == NULL) + c = purple_conversation_new(PURPLE_CONV_TYPE_IM, account, jm->from); + + username = g_markup_escape_text(purple_buddy_get_alias(buddy), -1); /* xmpp only has 1 attention type, so index is 0 */ purple_prpl_got_attention(jm->js->gc, jm->from, 0); + purple_conversation_attention(c, jm->from, 0, PURPLE_MESSAGE_RECV, time(NULL)); + + g_free(username); } /* used internally by the functions below */
--- a/libpurple/protocols/msn/msg.c Mon Mar 16 17:07:41 2009 +0000 +++ b/libpurple/protocols/msn/msg.c Mon Mar 16 21:45:24 2009 +0000 @@ -964,6 +964,8 @@ else purple_prpl_got_attention(account->gc, user, MSN_NUDGE); + purple_conversation_attention(swboard->conv, user, MSN_NUDGE, + PURPLE_MESSAGE_SEND, time(NULL)); } else { purple_prpl_got_attention(account->gc, user, MSN_NUDGE); }
--- a/libpurple/protocols/msn/msn.c Mon Mar 16 17:07:41 2009 +0000 +++ b/libpurple/protocols/msn/msn.c Mon Mar 16 21:45:24 2009 +0000 @@ -162,6 +162,8 @@ username = purple_conversation_get_name(conv); purple_prpl_send_attention(gc, username, MSN_NUDGE); + purple_conversation_attention(conv, username, 0, PURPLE_MESSAGE_SEND, + time(NULL)); return PURPLE_CMD_RET_OK; }
--- a/libpurple/protocols/msnp9/msn.c Mon Mar 16 17:07:41 2009 +0000 +++ b/libpurple/protocols/msnp9/msn.c Mon Mar 16 21:45:24 2009 +0000 @@ -775,7 +775,8 @@ gc->proto_data = session; gc->flags |= PURPLE_CONNECTION_HTML | PURPLE_CONNECTION_FORMATTING_WBFO | PURPLE_CONNECTION_NO_BGCOLOR | - PURPLE_CONNECTION_NO_FONTSIZE | PURPLE_CONNECTION_NO_URLDESC | PURPLE_CONNECTION_ALLOW_CUSTOM_SMILEY; + PURPLE_CONNECTION_NO_FONTSIZE | PURPLE_CONNECTION_NO_URLDESC | PURPLE_CONNECTION_ALLOW_CUSTOM_SMILEY | + PURPLE_CONNECTION_ALLOW_ATTENTION; msn_session_set_login_step(session, MSN_LOGIN_STEP_START);
--- a/libpurple/protocols/yahoo/yahoo.c Mon Mar 16 17:07:41 2009 +0000 +++ b/libpurple/protocols/yahoo/yahoo.c Mon Mar 16 21:45:24 2009 +0000 @@ -1039,6 +1039,8 @@ username = g_markup_escape_text(im->from, -1); purple_prpl_got_attention(gc, username, YAHOO_BUZZ); + purple_conversation_attention(c, username, 0, PURPLE_MESSAGE_RECV, + time(NULL)); g_free(username); g_free(m); g_free(im); @@ -5109,6 +5111,7 @@ return PURPLE_CMD_RET_FAILED; purple_prpl_send_attention(account->gc, c->name, YAHOO_BUZZ); + purple_conversation_attention(c, c->name, 0, PURPLE_MESSAGE_SEND, time(NULL)); return PURPLE_CMD_RET_OK; }
--- a/libpurple/sound.h Mon Mar 16 17:07:41 2009 +0000 +++ b/libpurple/sound.h Mon Mar 16 21:45:24 2009 +0000 @@ -51,6 +51,8 @@ PURPLE_SOUND_CHAT_SAY, /**< Someone else says somthing in a chat. */ PURPLE_SOUND_POUNCE_DEFAULT, /**< Default sound for a buddy pounce. */ PURPLE_SOUND_CHAT_NICK, /**< Someone says your name in a chat. */ + PURPLE_SOUND_SEND_ATTENTION, /**< Send an attention */ + PURPLE_SOUND_GOT_ATTENTION, /**< Got an attention */ PURPLE_NUM_SOUNDS /**< Total number of sounds. */ } PurpleSoundEventID;
--- a/pidgin/gtkconv.c Mon Mar 16 17:07:41 2009 +0000 +++ b/pidgin/gtkconv.c Mon Mar 16 21:45:24 2009 +0000 @@ -1214,6 +1214,20 @@ } static void +menu_get_attention_cb(gpointer data, guint action, GtkWidget *widget) +{ + PidginWindow *win = data; + PurpleConversation *conv = pidgin_conv_window_get_active_conversation(win); + + if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) { + purple_prpl_send_attention(purple_conversation_get_gc(conv), + purple_conversation_get_name(conv), 0); + purple_conversation_attention(conv, purple_conversation_get_name(conv), + 0, PURPLE_MESSAGE_SEND, time(NULL)); + } +} + +static void menu_add_pounce_cb(gpointer data, guint action, GtkWidget *widget) { PidginWindow *win = data; @@ -2279,6 +2293,11 @@ gtkconv = PIDGIN_CONVERSATION(conv); old_conv = gtkconv->active_conv; + purple_debug_info("gtkconv", "setting active conversation on toolbar %p\n", + conv); + gtk_imhtmltoolbar_switch_active_conversation(GTK_IMHTMLTOOLBAR(gtkconv->toolbar), + conv); + if (old_conv == conv) return; @@ -3115,6 +3134,7 @@ { "/Conversation/sep1", NULL, NULL, 0, "<Separator>", NULL }, { N_("/Conversation/Se_nd File..."), NULL, menu_send_file_cb, 0, "<StockItem>", PIDGIN_STOCK_TOOLBAR_SEND_FILE }, + { N_("/Conversation/Get _Attention"), NULL, menu_get_attention_cb, 0, "<StockItem>", PIDGIN_STOCK_TOOLBAR_SEND_ATTENTION }, { N_("/Conversation/Add Buddy _Pounce..."), NULL, menu_add_pounce_cb, 0, "<Item>", NULL }, { N_("/Conversation/_Get Info"), "<CTL>O", menu_get_info_cb, 0, @@ -3430,6 +3450,9 @@ gtk_item_factory_get_widget(win->menu.item_factory, N_("/Conversation/Send File...")); + win->menu.get_attention = + gtk_item_factory_get_widget(win->menu.item_factory, + N_("/Conversation/Get Attention")); win->menu.add_pounce = gtk_item_factory_get_widget(win->menu.item_factory, N_("/Conversation/Add Buddy Pounce...")); @@ -6321,6 +6344,7 @@ /* Deal with menu items */ gtk_widget_show(win->menu.view_log); gtk_widget_show(win->menu.send_file); + gtk_widget_show(win->menu.get_attention); gtk_widget_show(win->menu.add_pounce); gtk_widget_show(win->menu.get_info); gtk_widget_hide(win->menu.invite); @@ -6349,6 +6373,7 @@ /* Deal with menu items */ gtk_widget_show(win->menu.view_log); gtk_widget_hide(win->menu.send_file); + gtk_widget_hide(win->menu.get_attention); gtk_widget_hide(win->menu.add_pounce); gtk_widget_hide(win->menu.get_info); gtk_widget_show(win->menu.invite); @@ -6426,6 +6451,7 @@ gtk_widget_set_sensitive(win->menu.send_file, (prpl_info->send_file != NULL && (!prpl_info->can_receive_file || prpl_info->can_receive_file(gc, purple_conversation_get_name(conv))))); + gtk_widget_set_sensitive(win->menu.get_attention, (prpl_info->send_attention != NULL)); gtk_widget_set_sensitive(win->menu.alias, (account != NULL) && (purple_find_buddy(account, purple_conversation_get_name(conv)) != NULL)); @@ -6446,6 +6472,7 @@ /* Then deal with menu items */ gtk_widget_set_sensitive(win->menu.view_log, TRUE); gtk_widget_set_sensitive(win->menu.send_file, FALSE); + gtk_widget_set_sensitive(win->menu.get_attention, FALSE); gtk_widget_set_sensitive(win->menu.add_pounce, TRUE); gtk_widget_set_sensitive(win->menu.get_info, FALSE); gtk_widget_set_sensitive(win->menu.invite, FALSE); @@ -6750,6 +6777,7 @@ } } + static PurpleConversationUiOps conversation_ui_ops = { pidgin_conv_new,
--- a/pidgin/gtkconvwin.h Mon Mar 16 17:07:41 2009 +0000 +++ b/pidgin/gtkconvwin.h Mon Mar 16 21:45:24 2009 +0000 @@ -51,6 +51,7 @@ GtkWidget *view_log; GtkWidget *send_file; + GtkWidget *get_attention; GtkWidget *add_pounce; GtkWidget *get_info; GtkWidget *invite;
--- a/pidgin/gtkimhtmltoolbar.c Mon Mar 16 17:07:41 2009 +0000 +++ b/pidgin/gtkimhtmltoolbar.c Mon Mar 16 21:45:24 2009 +0000 @@ -33,6 +33,7 @@ #include "request.h" #include "pidginstock.h" #include "util.h" +#include "debug.h" #include "gtkdialogs.h" #include "gtkimhtmltoolbar.h" @@ -913,6 +914,18 @@ gtk_widget_grab_focus(toolbar->imhtml); } +static void send_attention_cb(GtkWidget *attention, GtkIMHtmlToolbar *toolbar) +{ + PurpleConversation *conv = toolbar->active_conv; + const gchar *who = purple_conversation_get_name(conv); + PurpleConnection *gc = purple_conversation_get_gc(conv); + + toggle_button_set_active_block(GTK_TOGGLE_BUTTON(toolbar->attention), FALSE, + toolbar); + purple_conversation_attention(conv, who, 0, PURPLE_MESSAGE_SEND, time(NULL)); + purple_prpl_send_attention(gc, who, 0); +} + static void update_buttons_cb(GtkIMHtml *imhtml, GtkIMHtmlButtons buttons, GtkIMHtmlToolbar *toolbar) { gtk_widget_set_sensitive(GTK_WIDGET(toolbar->bold), buttons & GTK_IMHTML_BOLD); @@ -1232,6 +1245,8 @@ {PIDGIN_STOCK_TOOLBAR_INSERT_LINK, insert_link_cb, &toolbar->link, _("Insert Link")}, {PIDGIN_STOCK_TOOLBAR_INSERT_IMAGE, insert_image_cb, &toolbar->image, _("Insert IM Image")}, {PIDGIN_STOCK_TOOLBAR_SMILEY, insert_smiley_cb, &toolbar->smiley, _("Insert Smiley")}, + {PIDGIN_STOCK_TOOLBAR_SEND_ATTENTION, send_attention_cb, &toolbar->attention, + _("Send Attention")}, {NULL, NULL, NULL, NULL} }; int iter; @@ -1297,6 +1312,7 @@ GtkWidget *insert_button; GtkWidget *font_button; GtkWidget *smiley_button; + GtkWidget *attention_button; GtkWidget *font_menu; GtkWidget *insert_menu; GtkWidget *menuitem; @@ -1438,6 +1454,32 @@ g_signal_connect_swapped(G_OBJECT(smiley_button), "clicked", G_CALLBACK(gtk_button_clicked), toolbar->smiley); gtk_widget_show_all(smiley_button); + /* Sep */ + sep = gtk_vseparator_new(); + gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 0); + gtk_widget_show_all(sep); + + /* Attention */ + attention_button = gtk_button_new(); + gtk_button_set_relief(GTK_BUTTON(attention_button), GTK_RELIEF_NONE); + bbox = gtk_hbox_new(FALSE, 3); + gtk_container_add(GTK_CONTAINER(attention_button), bbox); + image = gtk_image_new_from_stock(PIDGIN_STOCK_TOOLBAR_SEND_ATTENTION, + gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL)); + gtk_box_pack_start(GTK_BOX(bbox), image, FALSE, FALSE, 0); + label = gtk_label_new_with_mnemonic(_("_Attention!")); + gtk_box_pack_start(GTK_BOX(bbox), label, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(box), attention_button, FALSE, FALSE, 0); + g_signal_connect_swapped(G_OBJECT(attention_button), "clicked", + G_CALLBACK(gtk_button_clicked), toolbar->attention); + gtk_widget_show_all(attention_button); + + g_signal_connect(G_OBJECT(toolbar->attention), "notify::sensitive", + G_CALLBACK(button_sensitiveness_changed), attention_button); + + /* set attention button to be greyed out until we get a conversation */ + gtk_widget_set_sensitive(toolbar->attention, FALSE); + gtk_box_pack_start(GTK_BOX(hbox), box, FALSE, FALSE, 0); g_object_set_data(G_OBJECT(hbox), "lean-view", box); gtk_widget_show(box); @@ -1519,3 +1561,21 @@ g_free(toolbar->sml); toolbar->sml = g_strdup(proto_id); } + +void gtk_imhtmltoolbar_switch_active_conversation(GtkIMHtmlToolbar *toolbar, + PurpleConversation *conv) +{ + PurpleConnection *gc = purple_conversation_get_gc(conv); + PurplePlugin *prpl = purple_connection_get_prpl(gc); + + purple_debug_info("gtkimhtmltoolbar", "switch active conversation to %p\n", + conv); + toolbar->active_conv = conv; + + /* gray out attention button on protocols that don't support it + for the time being it is always disabled for chats */ + gtk_widget_set_sensitive(toolbar->attention, + conv && prpl && purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM && + PURPLE_PLUGIN_PROTOCOL_INFO(prpl)->send_attention != NULL); +} +
--- a/pidgin/gtkimhtmltoolbar.h Mon Mar 16 17:07:41 2009 +0000 +++ b/pidgin/gtkimhtmltoolbar.h Mon Mar 16 21:45:24 2009 +0000 @@ -65,7 +65,8 @@ GtkWidget *image; GtkWidget *link; GtkWidget *smiley; - + GtkWidget *attention; + GtkWidget *font_dialog; GtkWidget *fgcolor_dialog; GtkWidget *bgcolor_dialog; @@ -76,6 +77,8 @@ char *sml; GtkWidget *strikethrough; GtkWidget *insert_hr; + + PurpleConversation *active_conv; }; struct _GtkIMHtmlToolbarClass { @@ -89,6 +92,8 @@ void gtk_imhtmltoolbar_attach (GtkIMHtmlToolbar *toolbar, GtkWidget *imhtml); void gtk_imhtmltoolbar_associate_smileys (GtkIMHtmlToolbar *toolbar, const char *proto_id); +void gtk_imhtmltoolbar_switch_active_conversation(GtkIMHtmlToolbar *toolbar, + PurpleConversation *conv); #ifdef __cplusplus }
--- a/pidgin/gtksound.c Mon Mar 16 17:07:41 2009 +0000 +++ b/pidgin/gtksound.c Mon Mar 16 21:45:24 2009 +0000 @@ -72,7 +72,9 @@ {N_("Others talk in chat"), "chat_msg_recv", "receive.wav"}, /* this isn't a terminator, it's the buddy pounce default sound event ;-) */ {NULL, "pounce_default", "alert.wav"}, - {N_("Someone says your username in chat"), "nick_said", "alert.wav"} + {N_("Someone says your username in chat"), "nick_said", "alert.wav"}, + {N_("Attention received"), "got_attention", "alert.wav"}, + {N_("Attention sent"), "sent_attention", "alert.wav"} }; static gboolean @@ -217,6 +219,20 @@ play_conv_event(conv, event); } +static void +sent_attention_cb(PurpleAccount *account, const char *who, + PurpleConversation *conv, guint type, PurpleSoundEventID event) +{ + play_conv_event(conv, event); +} + +static void +got_attention_cb(PurpleAccount *account, const char *who, + PurpleConversation *conv, guint type, PurpleSoundEventID event) +{ + play_conv_event(conv, event); +} + /* * We mute sounds for the 10 seconds after you log in so that * you don't get flooded with sounds when the blist shows all @@ -297,6 +313,10 @@ purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/sound/enabled/pounce_default", TRUE); purple_prefs_add_path(PIDGIN_PREFS_ROOT "/sound/file/pounce_default", ""); purple_prefs_add_string(PIDGIN_PREFS_ROOT "/sound/theme", ""); + purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/sound/enabled/sent_attention", TRUE); + purple_prefs_add_path(PIDGIN_PREFS_ROOT "/sound/file/sent_attention", ""); + purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/sound/enabled/got_attention", TRUE); + purple_prefs_add_path(PIDGIN_PREFS_ROOT "/sound/file/got_attention", ""); purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/sound/conv_focus", TRUE); purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/sound/mute", FALSE); purple_prefs_add_path(PIDGIN_PREFS_ROOT "/sound/command", ""); @@ -343,6 +363,12 @@ purple_signal_connect(conv_handle, "received-chat-msg", gtk_sound_handle, PURPLE_CALLBACK(chat_msg_received_cb), GINT_TO_POINTER(PURPLE_SOUND_CHAT_SAY)); + purple_signal_connect(conv_handle, "sent-attention", gtk_sound_handle, + PURPLE_CALLBACK(sent_attention_cb), + GINT_TO_POINTER(PURPLE_SOUND_SEND_ATTENTION)); + purple_signal_connect(conv_handle, "got-attention", gtk_sound_handle, + PURPLE_CALLBACK(got_attention_cb), + GINT_TO_POINTER(PURPLE_SOUND_GOT_ATTENTION)); } static void
--- a/pidgin/pidginstock.c Mon Mar 16 17:07:41 2009 +0000 +++ b/pidgin/pidginstock.c Mon Mar 16 21:45:24 2009 +0000 @@ -197,7 +197,8 @@ { PIDGIN_STOCK_TOOLBAR_UNBLOCK, "toolbar", "unblock.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, { PIDGIN_STOCK_TOOLBAR_SELECT_AVATAR, "toolbar", "select-avatar.png", FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, NULL }, { PIDGIN_STOCK_TOOLBAR_SEND_FILE, "toolbar", "send-file.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, - { PIDGIN_STOCK_TOOLBAR_TRANSFER, "toolbar", "transfer.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL } + { PIDGIN_STOCK_TOOLBAR_TRANSFER, "toolbar", "transfer.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, + { PIDGIN_STOCK_TOOLBAR_SEND_ATTENTION, "toolbar", "get-attention.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL } }; const SizedStockIcon sized_status_icons [] = { @@ -277,7 +278,6 @@ return ret; } - /* Altered from do_colorshift in gnome-panel */ static void do_alphashift(GdkPixbuf *dest, GdkPixbuf *src)
--- a/pidgin/pidginstock.h Mon Mar 16 17:07:41 2009 +0000 +++ b/pidgin/pidginstock.h Mon Mar 16 21:45:24 2009 +0000 @@ -154,6 +154,7 @@ #define PIDGIN_STOCK_TOOLBAR_SELECT_AVATAR "pidgin-select-avatar" #define PIDGIN_STOCK_TOOLBAR_SEND_FILE "pidgin-send-file" #define PIDGIN_STOCK_TOOLBAR_TRANSFER "pidgin-transfer" +#define PIDGIN_STOCK_TOOLBAR_SEND_ATTENTION "pidgin-send-attention" /* Tray icons */ #define PIDGIN_STOCK_TRAY_AVAILABLE "pidgin-tray-available"
--- a/pidgin/pixmaps/Makefile.am Mon Mar 16 17:07:41 2009 +0000 +++ b/pidgin/pixmaps/Makefile.am Mon Mar 16 21:45:24 2009 +0000 @@ -442,7 +442,8 @@ toolbar/16/plugins.png \ toolbar/16/send-file.png \ toolbar/16/transfer.png \ - toolbar/16/unblock.png + toolbar/16/unblock.png \ + toolbar/16/get-attention.png TOOLBAR_22_SCALABLE = \ toolbar/22/scalable/select-avatar.svg