Mercurial > pidgin.yaz
comparison pidgin/plugins/xmppconsole.c @ 32827:4a34689eeb33 default tip
merged from im.pidgin.pidgin
| author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
|---|---|
| date | Sat, 19 Nov 2011 14:42:54 +0900 |
| parents | 9bbbd4a7dcea |
| children |
comparison
equal
deleted
inserted
replaced
| 32692:0f94ec89f0bc | 32827:4a34689eeb33 |
|---|---|
| 188 char *text; | 188 char *text; |
| 189 | 189 |
| 190 gc = console->gc; | 190 gc = console->gc; |
| 191 | 191 |
| 192 if (gc) | 192 if (gc) |
| 193 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl); | 193 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc)); |
| 194 | 194 |
| 195 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(console->entry)); | 195 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(console->entry)); |
| 196 gtk_text_buffer_get_start_iter(buffer, &start); | 196 gtk_text_buffer_get_start_iter(buffer, &start); |
| 197 gtk_text_buffer_get_end_iter(buffer, &end); | 197 gtk_text_buffer_get_end_iter(buffer, &end); |
| 198 | 198 |
| 641 signing_on_cb(PurpleConnection *gc) | 641 signing_on_cb(PurpleConnection *gc) |
| 642 { | 642 { |
| 643 if (!console) | 643 if (!console) |
| 644 return; | 644 return; |
| 645 | 645 |
| 646 gtk_combo_box_append_text(GTK_COMBO_BOX(console->dropdown), purple_account_get_username(gc->account)); | 646 gtk_combo_box_append_text(GTK_COMBO_BOX(console->dropdown), purple_account_get_username(purple_connection_get_account(gc))); |
| 647 console->accounts = g_list_append(console->accounts, gc); | 647 console->accounts = g_list_append(console->accounts, gc); |
| 648 console->count++; | 648 console->count++; |
| 649 | 649 |
| 650 if (console->count == 1) | 650 if (console->count == 1) |
| 651 console->gc = gc; | 651 console->gc = gc; |
| 731 if (!console) | 731 if (!console) |
| 732 return; | 732 return; |
| 733 | 733 |
| 734 account = purple_accounts_find(gtk_combo_box_get_active_text(GTK_COMBO_BOX(console->dropdown)), | 734 account = purple_accounts_find(gtk_combo_box_get_active_text(GTK_COMBO_BOX(console->dropdown)), |
| 735 "prpl-jabber"); | 735 "prpl-jabber"); |
| 736 if (!account || !account->gc) | 736 if (!account || !purple_account_get_connection(account)) |
| 737 return; | 737 return; |
| 738 | 738 |
| 739 console->gc = account->gc; | 739 console->gc = purple_account_get_connection(account); |
| 740 gtk_imhtml_clear(GTK_IMHTML(console->imhtml)); | 740 gtk_imhtml_clear(GTK_IMHTML(console->imhtml)); |
| 741 } | 741 } |
| 742 | 742 |
| 743 static void | 743 static void |
| 744 create_console(PurplePluginAction *action) | 744 create_console(PurplePluginAction *action) |
| 791 pidgin_make_scrollable(console->imhtml, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC, GTK_SHADOW_ETCHED_IN, -1, -1), | 791 pidgin_make_scrollable(console->imhtml, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC, GTK_SHADOW_ETCHED_IN, -1, -1), |
| 792 TRUE, TRUE, 0); | 792 TRUE, TRUE, 0); |
| 793 | 793 |
| 794 toolbar = gtk_toolbar_new(); | 794 toolbar = gtk_toolbar_new(); |
| 795 button = gtk_tool_button_new(NULL, "<iq/>"); | 795 button = gtk_tool_button_new(NULL, "<iq/>"); |
| 796 gtk_tool_item_set_is_important(button, TRUE); | |
| 796 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(iq_clicked_cb), NULL); | 797 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(iq_clicked_cb), NULL); |
| 797 gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(button)); | 798 gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(button)); |
| 798 | 799 |
| 799 button = gtk_tool_button_new(NULL, "<presence/>"); | 800 button = gtk_tool_button_new(NULL, "<presence/>"); |
| 801 gtk_tool_item_set_is_important(button, TRUE); | |
| 800 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(presence_clicked_cb), NULL); | 802 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(presence_clicked_cb), NULL); |
| 801 gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(button)); | 803 gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(button)); |
| 802 | 804 |
| 803 button = gtk_tool_button_new(NULL, "<message/>"); | 805 button = gtk_tool_button_new(NULL, "<message/>"); |
| 806 gtk_tool_item_set_is_important(button, TRUE); | |
| 804 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(message_clicked_cb), NULL); | 807 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(message_clicked_cb), NULL); |
| 805 gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(button)); | 808 gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(button)); |
| 806 | 809 |
| 807 gtk_box_pack_start(GTK_BOX(vbox), toolbar, FALSE, FALSE, 0); | 810 gtk_box_pack_start(GTK_BOX(vbox), toolbar, FALSE, FALSE, 0); |
| 808 | 811 |
