Mercurial > pidgin.yaz
annotate src/buddy_chat.c @ 7811:2e6e269504a4
[gaim-migrate @ 8458]
Add a function definition which pmiller9 kindly pointed out was
missing, and remove a masturbatory variable and statement from
gtkblist.c.
committer: Tailor Script <tailor@pidgin.im>
author | Ethan Blanton <elb@pidgin.im> |
---|---|
date | Mon, 08 Dec 2003 22:55:35 +0000 |
parents | f3f074320156 |
children | 061b39119a1b |
rev | line source |
---|---|
1 | 1 /* |
2 * gaim | |
3 * | |
4 * Copyright (C) 1998-1999, Mark Spencer <markster@marko.net> | |
5 * | |
6 * This program is free software; you can redistribute it and/or modify | |
7 * it under the terms of the GNU General Public License as published by | |
8 * the Free Software Foundation; either version 2 of the License, or | |
9 * (at your option) any later version. | |
10 * | |
11 * This program is distributed in the hope that it will be useful, | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 * GNU General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU General Public License | |
17 * along with this program; if not, write to the Free Software | |
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
19 * | |
20 */ | |
7798 | 21 #include "gtkinternal.h" |
1 | 22 |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
23 #include "debug.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
24 #include "multi.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
25 #include "notify.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
26 #include "prpl.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
27 #include "server.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
28 |
7798 | 29 #include "gtkblist.h" |
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1398
diff
changeset
|
30 #include "gtkimhtml.h" |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
31 #include "gtkutils.h" |
7798 | 32 #include "stock.h" |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
33 #include "ui.h" |
344
2434adbb8703
[gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
34 |
7798 | 35 typedef struct |
36 { | |
37 GaimAccount *account; | |
38 | |
39 GtkWidget *window; | |
40 GtkWidget *account_menu; | |
41 GtkWidget *entries_box; | |
42 GtkSizeGroup *sg; | |
43 | |
44 GList *entries; | |
45 } GaimGtkJoinChatData; | |
3762 | 46 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
47 static void |
7798 | 48 do_join_chat(GaimGtkJoinChatData *data) |
1 | 49 { |
7798 | 50 if (data) { |
5234 | 51 GHashTable *components = g_hash_table_new_full(g_str_hash, g_str_equal, |
52 g_free, g_free); | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
53 GList *tmp; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
54 |
7798 | 55 for (tmp = data->entries; tmp != NULL; tmp = tmp->next) { |
4635 | 56 if (g_object_get_data(tmp->data, "is_spin")) { |
5234 | 57 g_hash_table_replace(components, |
58 g_strdup(g_object_get_data(tmp->data, "identifier")), | |
59 g_strdup_printf("%d", | |
60 gtk_spin_button_get_value_as_int(tmp->data))); | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
61 } |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
62 else { |
5234 | 63 g_hash_table_replace(components, |
64 g_strdup(g_object_get_data(tmp->data, "identifier")), | |
65 g_strdup(gtk_entry_get_text(tmp->data))); | |
2205
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2199
diff
changeset
|
66 } |
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2199
diff
changeset
|
67 } |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
68 |
7798 | 69 serv_join_chat(gaim_account_get_connection(data->account), components); |
2205
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2199
diff
changeset
|
70 |
5234 | 71 g_hash_table_destroy(components); |
1 | 72 } |
73 } | |
74 | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
75 static void |
7798 | 76 rebuild_joinchat_entries(GaimGtkJoinChatData *data) |
1806
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
77 { |
7798 | 78 GaimConnection *gc; |
2205
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2199
diff
changeset
|
79 GList *list, *tmp; |
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2199
diff
changeset
|
80 struct proto_chat_entry *pce; |
2289
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2268
diff
changeset
|
81 gboolean focus = TRUE; |
2205
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2199
diff
changeset
|
82 |
7798 | 83 gc = gaim_account_get_connection(data->account); |
1806
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
84 |
7798 | 85 while (GTK_BOX(data->entries_box)->children) { |
86 gtk_container_remove(GTK_CONTAINER(data->entries_box), | |
87 ((GtkBoxChild *)GTK_BOX(data->entries_box)->children->data)->widget); | |
88 } | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
89 |
7798 | 90 if (data->entries != NULL) |
91 g_list_free(data->entries); | |
92 | |
93 data->entries = NULL; | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
94 |
7798 | 95 list = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info(gc); |
2205
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2199
diff
changeset
|
96 |
7798 | 97 for (tmp = list; tmp; tmp = tmp->next) |
98 { | |
2205
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2199
diff
changeset
|
99 GtkWidget *label; |
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2199
diff
changeset
|
100 GtkWidget *rowbox; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
101 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
102 pce = tmp->data; |
2205
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2199
diff
changeset
|
103 |
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2199
diff
changeset
|
104 rowbox = gtk_hbox_new(FALSE, 5); |
7798 | 105 gtk_box_pack_start(GTK_BOX(data->entries_box), rowbox, FALSE, FALSE, 0); |
2205
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2199
diff
changeset
|
106 |
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2199
diff
changeset
|
107 label = gtk_label_new(pce->label); |
7798 | 108 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
109 gtk_size_group_add_widget(data->sg, label); | |
2205
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2199
diff
changeset
|
110 gtk_box_pack_start(GTK_BOX(rowbox), label, FALSE, FALSE, 0); |
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2199
diff
changeset
|
111 |
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2199
diff
changeset
|
112 if (pce->is_int) { |
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2199
diff
changeset
|
113 GtkObject *adjust; |
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2199
diff
changeset
|
114 GtkWidget *spin; |
7798 | 115 adjust = gtk_adjustment_new(pce->min, pce->min, pce->max, |
116 1, 10, 10); | |
2205
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2199
diff
changeset
|
117 spin = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0); |
4635 | 118 g_object_set_data(G_OBJECT(spin), "is_spin", GINT_TO_POINTER(TRUE)); |
5234 | 119 g_object_set_data(G_OBJECT(spin), "identifier", pce->identifier); |
7798 | 120 data->entries = g_list_append(data->entries, spin); |
4635 | 121 gtk_widget_set_size_request(spin, 50, -1); |
2346
b1c1e3401e10
[gaim-migrate @ 2359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2345
diff
changeset
|
122 gtk_box_pack_end(GTK_BOX(rowbox), spin, FALSE, FALSE, 0); |
7798 | 123 } else { |
124 GtkWidget *entry = gtk_entry_new(); | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
125 |
7798 | 126 gtk_entry_set_activates_default(GTK_ENTRY(entry), TRUE); |
127 g_object_set_data(G_OBJECT(entry), "identifier", pce->identifier); | |
128 data->entries = g_list_append(data->entries, entry); | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
129 |
2205
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2199
diff
changeset
|
130 if (pce->def) |
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2199
diff
changeset
|
131 gtk_entry_set_text(GTK_ENTRY(entry), pce->def); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
132 |
2289
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2268
diff
changeset
|
133 if (focus) { |
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2268
diff
changeset
|
134 gtk_widget_grab_focus(entry); |
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2268
diff
changeset
|
135 focus = FALSE; |
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2268
diff
changeset
|
136 } |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
137 |
7798 | 138 if (pce->secret) |
139 gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
140 |
7798 | 141 gtk_box_pack_end(GTK_BOX(rowbox), entry, TRUE, TRUE, 0); |
2205
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2199
diff
changeset
|
142 } |
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2199
diff
changeset
|
143 |
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2199
diff
changeset
|
144 g_free(pce); |
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2199
diff
changeset
|
145 } |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
146 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
147 g_list_free(list); |
1806
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
148 |
7798 | 149 gtk_widget_show_all(data->entries_box); |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
150 } |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
151 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
152 static void |
7798 | 153 join_chat_select_account_cb(GObject *w, GaimAccount *account, GaimGtkJoinChatData *data) |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
154 { |
7798 | 155 if (gaim_account_get_protocol(data->account) == |
156 gaim_account_get_protocol(account)) { | |
157 data->account = account; | |
158 } else { | |
159 data->account = account; | |
160 rebuild_joinchat_entries(data); | |
161 } | |
162 } | |
5881
cc7870e1e3b3
[gaim-migrate @ 6313]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
163 |
7798 | 164 static gboolean |
165 join_chat_check_account_func(GaimAccount *account) | |
166 { | |
167 GaimConnection *gc = gaim_account_get_connection(account); | |
5881
cc7870e1e3b3
[gaim-migrate @ 6313]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
168 |
7798 | 169 return (GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info != NULL); |
170 } | |
5881
cc7870e1e3b3
[gaim-migrate @ 6313]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
171 |
7798 | 172 static void do_joinchat(GtkWidget *dialog, int id, GaimGtkJoinChatData *info) |
173 { | |
174 switch(id) { | |
175 case GTK_RESPONSE_OK: | |
176 do_join_chat(info); | |
5881
cc7870e1e3b3
[gaim-migrate @ 6313]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
177 |
7798 | 178 break; |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
179 } |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
180 |
7798 | 181 gtk_widget_destroy(GTK_WIDGET(dialog)); |
182 g_list_free(info->entries); | |
183 g_free(info); | |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
184 } |
1 | 185 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
186 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
187 void |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
188 join_chat() |
1 | 189 { |
7798 | 190 GtkWidget *hbox, *mainbox; |
1210 | 191 GtkWidget *rowbox; |
1 | 192 GtkWidget *bbox; |
1210 | 193 GtkWidget *label; |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
194 GList *c; |
7798 | 195 GaimGtkBuddyList *gtkblist; |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
196 GaimConnection *gc = NULL; |
7798 | 197 GaimGtkJoinChatData *data = NULL; |
198 GtkWidget *img = NULL; | |
1356
c22d04db51be
[gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1343
diff
changeset
|
199 |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
200 for (c = gaim_connections_get_all(); c != NULL; c = c->next) { |
1356
c22d04db51be
[gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1343
diff
changeset
|
201 gc = c->data; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
202 |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4859
diff
changeset
|
203 if (GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl)->join_chat) |
1356
c22d04db51be
[gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1343
diff
changeset
|
204 break; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
205 |
1356
c22d04db51be
[gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1343
diff
changeset
|
206 gc = NULL; |
c22d04db51be
[gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1343
diff
changeset
|
207 } |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
208 |
1356
c22d04db51be
[gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1343
diff
changeset
|
209 if (gc == NULL) { |
5436
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
210 gaim_notify_error(NULL, NULL, |
5498
cce2d7868c78
[gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents:
5436
diff
changeset
|
211 _("You are not currently signed on with any " |
5436
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
212 "protocols that have the ability to chat."), |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
213 NULL); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
214 |
1356
c22d04db51be
[gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1343
diff
changeset
|
215 return; |
c22d04db51be
[gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1343
diff
changeset
|
216 } |
456 | 217 |
7798 | 218 gtkblist = GAIM_GTK_BLIST(gaim_get_blist()); |
219 img = gtk_image_new_from_stock(GAIM_STOCK_DIALOG_QUESTION, GTK_ICON_SIZE_DIALOG); | |
220 data = g_new0(GaimGtkJoinChatData, 1); | |
221 data->account = gaim_connection_get_account(gc); | |
456 | 222 |
7798 | 223 data->window = gtk_dialog_new_with_buttons(_("Get User Info"), gtkblist->window ? GTK_WINDOW(gtkblist->window) : NULL, 0, |
224 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, | |
7799 | 225 "Join", GTK_RESPONSE_OK, NULL); |
7798 | 226 gtk_dialog_set_default_response(GTK_DIALOG(data->window), GTK_RESPONSE_OK); |
227 gtk_container_set_border_width(GTK_CONTAINER(data->window), 6); | |
228 gtk_window_set_resizable(GTK_WINDOW(data->window), FALSE); | |
229 gtk_dialog_set_has_separator(GTK_DIALOG(data->window), FALSE); | |
230 gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(data->window)->vbox), 12); | |
231 gtk_container_set_border_width(GTK_CONTAINER(GTK_DIALOG(data->window)->vbox), 6); | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1235
diff
changeset
|
232 |
7798 | 233 data->sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
456 | 234 |
7798 | 235 hbox = gtk_hbox_new(FALSE, 12); |
236 gtk_container_add(GTK_CONTAINER(GTK_DIALOG(data->window)->vbox), hbox); | |
237 gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0); | |
238 gtk_misc_set_alignment(GTK_MISC(img), 0, 0); | |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
239 |
7798 | 240 mainbox = gtk_vbox_new(FALSE, 5); |
241 gtk_container_set_border_width(GTK_CONTAINER(mainbox), 5); | |
242 gtk_container_add(GTK_CONTAINER(hbox), mainbox); | |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
243 |
7798 | 244 rowbox = gtk_hbox_new(FALSE, 5); |
245 gtk_box_pack_start(GTK_BOX(mainbox), rowbox, TRUE, TRUE, 0); | |
1806
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
246 |
7798 | 247 label = gtk_label_new(_("Join Chat As:")); |
248 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | |
249 gtk_box_pack_start(GTK_BOX(rowbox), label, FALSE, FALSE, 0); | |
250 gtk_size_group_add_widget(data->sg, label); | |
692
f4026275bc9f
[gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
666
diff
changeset
|
251 |
7798 | 252 data->account_menu = gaim_gtk_account_option_menu_new(NULL, FALSE, |
253 G_CALLBACK(join_chat_select_account_cb), | |
254 join_chat_check_account_func, data); | |
255 gtk_box_pack_start(GTK_BOX(rowbox), data->account_menu, TRUE, TRUE, 0); | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
256 |
7798 | 257 data->entries_box = gtk_vbox_new(FALSE, 5); |
258 gtk_container_add(GTK_CONTAINER(mainbox), data->entries_box); | |
259 gtk_container_set_border_width(GTK_CONTAINER(data->entries_box), 0); | |
260 | |
1210 | 261 |
7798 | 262 rebuild_joinchat_entries(data); |
263 | |
2374
9e9385cddcc6
[gaim-migrate @ 2387]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
264 |
7798 | 265 bbox = gtk_hbutton_box_new(); |
266 gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END); | |
267 gtk_box_set_spacing(GTK_BOX(bbox), 12); | |
268 gtk_box_pack_start(GTK_BOX(mainbox), bbox, FALSE, FALSE, 6); | |
1504
cac3efeb4d9c
[gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
269 |
7798 | 270 g_signal_connect(G_OBJECT(data->window), "response", G_CALLBACK(do_joinchat), data); |
271 | |
272 g_object_unref(data->sg); | |
273 | |
274 gtk_widget_show_all(data->window); | |
1 | 275 } |