Mercurial > pidgin
annotate src/buddy_chat.c @ 7950:7b8407d8c546
[gaim-migrate @ 8624]
Move the "Logged In:" tooltip thingy to the core.
Much thanks to Evan Schoenberg of Adium.
This shouldn't affect anything for oscar. For jabber
some servers/accounts might start showing a "Logged In:"
line in people's tooltips. I'm really not sure when it
will or won't. I bet faceprint knows!
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Mon, 29 Dec 2003 06:13:36 +0000 |
parents | 340df1652af1 |
children | fa6395637e2c |
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 |
7841 | 104 rowbox = gtk_hbox_new(FALSE, 12); |
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 |
7841 | 107 label = gtk_label_new_with_mnemonic(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); |
7841 | 123 gtk_label_set_mnemonic_widget(GTK_LABEL(label), GTK_WIDGET(spin)); |
7798 | 124 } else { |
125 GtkWidget *entry = gtk_entry_new(); | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
126 |
7798 | 127 gtk_entry_set_activates_default(GTK_ENTRY(entry), TRUE); |
128 g_object_set_data(G_OBJECT(entry), "identifier", pce->identifier); | |
129 data->entries = g_list_append(data->entries, entry); | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
130 |
2205
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2199
diff
changeset
|
131 if (pce->def) |
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2199
diff
changeset
|
132 gtk_entry_set_text(GTK_ENTRY(entry), pce->def); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
133 |
2289
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2268
diff
changeset
|
134 if (focus) { |
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2268
diff
changeset
|
135 gtk_widget_grab_focus(entry); |
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2268
diff
changeset
|
136 focus = FALSE; |
38e156136896
[gaim-migrate @ 2299]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2268
diff
changeset
|
137 } |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
138 |
7798 | 139 if (pce->secret) |
140 gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
141 |
7798 | 142 gtk_box_pack_end(GTK_BOX(rowbox), entry, TRUE, TRUE, 0); |
7841 | 143 gtk_label_set_mnemonic_widget(GTK_LABEL(label), GTK_WIDGET(entry)); |
2205
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2199
diff
changeset
|
144 } |
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2199
diff
changeset
|
145 |
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2199
diff
changeset
|
146 g_free(pce); |
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2199
diff
changeset
|
147 } |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
148 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
149 g_list_free(list); |
1806
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
150 |
7798 | 151 gtk_widget_show_all(data->entries_box); |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
152 } |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
153 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
154 static void |
7798 | 155 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
|
156 { |
7798 | 157 if (gaim_account_get_protocol(data->account) == |
158 gaim_account_get_protocol(account)) { | |
159 data->account = account; | |
160 } else { | |
161 data->account = account; | |
162 rebuild_joinchat_entries(data); | |
163 } | |
164 } | |
5881
cc7870e1e3b3
[gaim-migrate @ 6313]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
165 |
7798 | 166 static gboolean |
167 join_chat_check_account_func(GaimAccount *account) | |
168 { | |
169 GaimConnection *gc = gaim_account_get_connection(account); | |
5881
cc7870e1e3b3
[gaim-migrate @ 6313]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
170 |
7798 | 171 return (GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info != NULL); |
172 } | |
5881
cc7870e1e3b3
[gaim-migrate @ 6313]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
173 |
7798 | 174 static void do_joinchat(GtkWidget *dialog, int id, GaimGtkJoinChatData *info) |
175 { | |
176 switch(id) { | |
177 case GTK_RESPONSE_OK: | |
178 do_join_chat(info); | |
5881
cc7870e1e3b3
[gaim-migrate @ 6313]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
179 |
7798 | 180 break; |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
181 } |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
182 |
7798 | 183 gtk_widget_destroy(GTK_WIDGET(dialog)); |
184 g_list_free(info->entries); | |
185 g_free(info); | |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
186 } |
1 | 187 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
188 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
189 void |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
190 join_chat() |
1 | 191 { |
7816 | 192 GtkWidget *hbox, *vbox; |
1210 | 193 GtkWidget *rowbox; |
194 GtkWidget *label; | |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
195 GList *c; |
7798 | 196 GaimGtkBuddyList *gtkblist; |
7816 | 197 GtkWidget *img = NULL; |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
198 GaimConnection *gc = NULL; |
7798 | 199 GaimGtkJoinChatData *data = NULL; |
7816 | 200 int numaccounts = 0; |
1356
c22d04db51be
[gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1343
diff
changeset
|
201 |
7816 | 202 /* Count how many protocols support chat */ |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
203 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
|
204 gc = c->data; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
205 |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4859
diff
changeset
|
206 if (GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl)->join_chat) |
7816 | 207 numaccounts++; |
1356
c22d04db51be
[gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1343
diff
changeset
|
208 } |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
209 |
7816 | 210 if (numaccounts <= 0) { |
5436
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
211 gaim_notify_error(NULL, NULL, |
5498
cce2d7868c78
[gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents:
5436
diff
changeset
|
212 _("You are not currently signed on with any " |
5436
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
213 "protocols that have the ability to chat."), |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5234
diff
changeset
|
214 NULL); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
215 |
1356
c22d04db51be
[gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1343
diff
changeset
|
216 return; |
c22d04db51be
[gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1343
diff
changeset
|
217 } |
456 | 218 |
7798 | 219 gtkblist = GAIM_GTK_BLIST(gaim_get_blist()); |
220 img = gtk_image_new_from_stock(GAIM_STOCK_DIALOG_QUESTION, GTK_ICON_SIZE_DIALOG); | |
221 data = g_new0(GaimGtkJoinChatData, 1); | |
456 | 222 |
7853 | 223 data->window = gtk_dialog_new_with_buttons(_("Join a Chat"), gtkblist->window ? GTK_WINDOW(gtkblist->window) : NULL, 0, |
7798 | 224 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, |
7841 | 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 hbox = gtk_hbox_new(FALSE, 12); |
7841 | 234 gtk_container_add(GTK_CONTAINER(GTK_DIALOG(data->window)->vbox), hbox); |
235 gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0); | |
236 gtk_misc_set_alignment(GTK_MISC(img), 0, 0); | |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
237 |
7816 | 238 vbox = gtk_vbox_new(FALSE, 5); |
7841 | 239 gtk_container_set_border_width(GTK_CONTAINER(vbox), 0); |
7816 | 240 gtk_container_add(GTK_CONTAINER(hbox), vbox); |
241 | |
242 label = gtk_label_new(_("Please enter the appropriate information about the chat you would like to join.\n")); | |
243 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); | |
244 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
245 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); | |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
246 |
7841 | 247 rowbox = gtk_hbox_new(FALSE, 12); |
7816 | 248 gtk_box_pack_start(GTK_BOX(vbox), rowbox, TRUE, TRUE, 0); |
249 | |
250 data->sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
1806
c649b63382b7
[gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1793
diff
changeset
|
251 |
7816 | 252 if (numaccounts > 1) { |
7841 | 253 label = gtk_label_new_with_mnemonic(_("_Account:")); |
7816 | 254 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
255 gtk_box_pack_start(GTK_BOX(rowbox), label, FALSE, FALSE, 0); | |
256 gtk_size_group_add_widget(data->sg, label); | |
692
f4026275bc9f
[gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
666
diff
changeset
|
257 |
7816 | 258 data->account_menu = gaim_gtk_account_option_menu_new(NULL, FALSE, |
259 G_CALLBACK(join_chat_select_account_cb), | |
260 join_chat_check_account_func, data); | |
261 gtk_box_pack_start(GTK_BOX(rowbox), data->account_menu, TRUE, TRUE, 0); | |
7841 | 262 gtk_label_set_mnemonic_widget(GTK_LABEL(label), GTK_WIDGET(data->account_menu)); |
7816 | 263 } |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
264 |
7798 | 265 data->entries_box = gtk_vbox_new(FALSE, 5); |
7816 | 266 gtk_container_add(GTK_CONTAINER(vbox), data->entries_box); |
7798 | 267 gtk_container_set_border_width(GTK_CONTAINER(data->entries_box), 0); |
268 | |
1210 | 269 |
7816 | 270 data->account = gaim_connection_get_account(gaim_connections_get_all()->data); |
7798 | 271 rebuild_joinchat_entries(data); |
272 | |
2374
9e9385cddcc6
[gaim-migrate @ 2387]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
273 |
7798 | 274 g_signal_connect(G_OBJECT(data->window), "response", G_CALLBACK(do_joinchat), data); |
275 | |
276 g_object_unref(data->sg); | |
277 | |
278 gtk_widget_show_all(data->window); | |
1 | 279 } |