Mercurial > pidgin.yaz
annotate pidgin/plugins/sendbutton.c @ 24321:068557dd121a
Don't add the Send button to a gtkconv->lower_hbox when the data specifying it
already exists. This means you shouldn't get multiple Send buttons for
conversations with contacts with multiple contained buddies with whom you've
started a conversation.
Also, remove that same data when the Send button plugin is removed so that it
will come back properly next time you load the plugin.
| author | Elliott Sales de Andrade <qulogic@pidgin.im> |
|---|---|
| date | Thu, 13 Nov 2008 04:32:54 +0000 |
| parents | 72090ce17864 |
| children | f0d5d78e8e47 |
| rev | line source |
|---|---|
|
22668
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
1 /* |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
2 * SendButton - Add a Send button to the conversation window entry area. |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
3 * Copyright (C) 2008 Etan Reisner <deryni@pidgin.im> |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
4 * |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
5 * This program is free software; you can redistribute it and/or |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
6 * modify it under the terms of the GNU General Public License |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
7 * as published by the Free Software Foundation; either version 2 |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
8 * of the License, or (at your option) any later version. |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
9 * |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
10 * This program is distributed in the hope that it will be useful, |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
13 * GNU General Public License for more details. |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
14 * |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
16 * along with this program; if not, write to the Free Software |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301, USA. |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
18 */ |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
19 |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
20 #ifdef HAVE_CONFIG_H |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
21 #include <config.h> |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
22 #endif |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
23 |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
24 #include "internal.h" |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
25 |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
26 #include "version.h" |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
27 |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
28 #include "pidgin.h" |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
29 |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
30 #include "gtkconv.h" |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
31 #include "gtkplugin.h" |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
32 |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
33 static void |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
34 send_button_cb(GtkButton *button, PidginConversation *gtkconv) |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
35 { |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
36 g_signal_emit_by_name(gtkconv->entry, "message_send"); |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
37 } |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
38 |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
39 static void |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
40 create_send_button_pidgin(PidginConversation *gtkconv) |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
41 { |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
42 GtkWidget *send_button; |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
43 |
|
24321
068557dd121a
Don't add the Send button to a gtkconv->lower_hbox when the data specifying it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22668
diff
changeset
|
44 send_button = g_object_get_data(G_OBJECT(gtkconv->lower_hbox), |
|
068557dd121a
Don't add the Send button to a gtkconv->lower_hbox when the data specifying it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22668
diff
changeset
|
45 "send_button"); |
|
068557dd121a
Don't add the Send button to a gtkconv->lower_hbox when the data specifying it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22668
diff
changeset
|
46 |
|
068557dd121a
Don't add the Send button to a gtkconv->lower_hbox when the data specifying it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22668
diff
changeset
|
47 if (send_button != NULL) |
|
068557dd121a
Don't add the Send button to a gtkconv->lower_hbox when the data specifying it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22668
diff
changeset
|
48 return; |
|
068557dd121a
Don't add the Send button to a gtkconv->lower_hbox when the data specifying it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22668
diff
changeset
|
49 |
|
22668
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
50 send_button = gtk_button_new_with_mnemonic(_("_Send")); |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
51 g_signal_connect(G_OBJECT(send_button), "clicked", |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
52 G_CALLBACK(send_button_cb), gtkconv); |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
53 gtk_box_pack_end(GTK_BOX(gtkconv->lower_hbox), send_button, FALSE, |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
54 FALSE, 0); |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
55 gtk_widget_show(send_button); |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
56 |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
57 g_object_set_data(G_OBJECT(gtkconv->lower_hbox), "send_button", |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
58 send_button); |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
59 } |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
60 |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
61 static void |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
62 remove_send_button_pidgin(PidginConversation *gtkconv) |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
63 { |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
64 GtkWidget *send_button = NULL; |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
65 |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
66 send_button = g_object_get_data(G_OBJECT(gtkconv->lower_hbox), |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
67 "send_button"); |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
68 if (send_button != NULL) { |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
69 gtk_widget_destroy(send_button); |
|
24321
068557dd121a
Don't add the Send button to a gtkconv->lower_hbox when the data specifying it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22668
diff
changeset
|
70 g_object_set_data(G_OBJECT(gtkconv->lower_hbox), |
|
068557dd121a
Don't add the Send button to a gtkconv->lower_hbox when the data specifying it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22668
diff
changeset
|
71 "send_button", NULL); |
|
22668
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
72 } |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
73 } |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
74 |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
75 static void |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
76 conversation_displayed_cb(PidginConversation *gtkconv) |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
77 { |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
78 GtkWidget *send_button = NULL; |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
79 |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
80 send_button = g_object_get_data(G_OBJECT(gtkconv->lower_hbox), |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
81 "send_button"); |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
82 if (send_button == NULL) { |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
83 create_send_button_pidgin(gtkconv); |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
84 } |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
85 } |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
86 |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
87 static gboolean |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
88 plugin_load(PurplePlugin *plugin) |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
89 { |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
90 GList *convs = purple_get_conversations(); |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
91 void *gtk_conv_handle = pidgin_conversations_get_handle(); |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
92 |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
93 purple_signal_connect(gtk_conv_handle, "conversation-displayed", plugin, |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
94 PURPLE_CALLBACK(conversation_displayed_cb), NULL); |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
95 /* |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
96 purple_signal_connect(gtk_conv_handle, "conversation-hiding", plugin, |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
97 PURPLE_CALLBACK(conversation_hiding_cb), NULL); |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
98 */ |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
99 |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
100 while (convs) { |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
101 |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
102 PurpleConversation *conv = (PurpleConversation *)convs->data; |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
103 |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
104 /* Setup Send button */ |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
105 if (PIDGIN_IS_PIDGIN_CONVERSATION(conv)) { |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
106 create_send_button_pidgin(PIDGIN_CONVERSATION(conv)); |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
107 } |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
108 |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
109 convs = convs->next; |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
110 } |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
111 |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
112 return TRUE; |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
113 } |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
114 |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
115 static gboolean |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
116 plugin_unload(PurplePlugin *plugin) |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
117 { |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
118 GList *convs = purple_get_conversations(); |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
119 |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
120 while (convs) { |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
121 PurpleConversation *conv = (PurpleConversation *)convs->data; |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
122 |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
123 /* Remove Send button */ |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
124 if (PIDGIN_IS_PIDGIN_CONVERSATION(conv)) { |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
125 remove_send_button_pidgin(PIDGIN_CONVERSATION(conv)); |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
126 } |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
127 |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
128 convs = convs->next; |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
129 } |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
130 |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
131 return TRUE; |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
132 } |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
133 |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
134 static PurplePluginInfo info = |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
135 { |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
136 PURPLE_PLUGIN_MAGIC, |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
137 PURPLE_MAJOR_VERSION, /**< major version */ |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
138 PURPLE_MINOR_VERSION, /**< minor version */ |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
139 PURPLE_PLUGIN_STANDARD, /**< type */ |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
140 PIDGIN_PLUGIN_TYPE, /**< ui_requirement */ |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
141 0, /**< flags */ |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
142 NULL, /**< dependencies */ |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
143 PURPLE_PRIORITY_DEFAULT, /**< priority */ |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
144 |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
145 "gtksendbutton", /**< id */ |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
146 N_("Send Button"), /**< name */ |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
147 DISPLAY_VERSION, /**< version */ |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
148 N_("Conversation Window Send Button."), /**< summary */ |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
149 N_("Adds a Send button to the entry area of " |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
150 "the conversation window. Intended for when " |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
151 "no physical keyboard is present."), /**< description */ |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
152 "Etan Reisner <deryni@pidgin.im>", /**< author */ |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
153 PURPLE_WEBSITE, /**< homepage */ |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
154 plugin_load, /**< load */ |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
155 plugin_unload, /**< unload */ |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
156 NULL, /**< destroy */ |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
157 NULL, /**< ui_info */ |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
158 NULL, /**< extra_info */ |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
159 NULL, /**< prefs_info */ |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
160 NULL, /**< actions */ |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
161 |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
162 /* padding */ |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
163 NULL, |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
164 NULL, |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
165 NULL, |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
166 NULL |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
167 }; |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
168 |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
169 static void |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
170 init_plugin(PurplePlugin *plugin) |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
171 { |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
172 } |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
173 |
|
72090ce17864
Add a plugin to add a Send button to the conversation windows, users of tablet
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
174 PURPLE_INIT_PLUGIN(sendbutton, init_plugin, info) |
