| 143 g_signal_connect(G_OBJECT(dialog), "response", |
143 g_signal_connect(G_OBJECT(dialog), "response", |
| 144 G_CALLBACK(__input_response_cb), data); |
144 G_CALLBACK(__input_response_cb), data); |
| 145 |
145 |
| 146 /* Setup the dialog */ |
146 /* Setup the dialog */ |
| 147 gtk_container_set_border_width(GTK_CONTAINER(dialog), 6); |
147 gtk_container_set_border_width(GTK_CONTAINER(dialog), 6); |
| |
148 gtk_container_set_border_width(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), 6); |
| 148 gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); |
149 gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); |
| 149 gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE); |
150 gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE); |
| |
151 gtk_dialog_set_default_response(GTK_DIALOG(dialog), 0); |
| 150 gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog)->vbox), 12); |
152 gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog)->vbox), 12); |
| 151 gtk_container_set_border_width(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), 6); |
|
| 152 |
153 |
| 153 /* Setup the main horizontal box */ |
154 /* Setup the main horizontal box */ |
| 154 hbox = gtk_hbox_new(FALSE, 12); |
155 hbox = gtk_hbox_new(FALSE, 12); |
| 155 gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), hbox); |
156 gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), hbox); |
| 156 |
157 |
| 207 gtk_text_buffer_set_text(buffer, default_value, -1); |
208 gtk_text_buffer_set_text(buffer, default_value, -1); |
| 208 } |
209 } |
| 209 } |
210 } |
| 210 else { |
211 else { |
| 211 entry = gtk_entry_new(); |
212 entry = gtk_entry_new(); |
| |
213 |
| |
214 gtk_entry_set_activates_default(GTK_ENTRY(entry), TRUE); |
| 212 |
215 |
| 213 gtk_box_pack_start(GTK_BOX(vbox), entry, FALSE, FALSE, 0); |
216 gtk_box_pack_start(GTK_BOX(vbox), entry, FALSE, FALSE, 0); |
| 214 |
217 |
| 215 if (default_value != NULL) |
218 if (default_value != NULL) |
| 216 gtk_entry_set_text(GTK_ENTRY(entry), default_value); |
219 gtk_entry_set_text(GTK_ENTRY(entry), default_value); |
| 266 |
269 |
| 267 /* Create the dialog. */ |
270 /* Create the dialog. */ |
| 268 data->dialog = dialog = gtk_dialog_new(); |
271 data->dialog = dialog = gtk_dialog_new(); |
| 269 |
272 |
| 270 for (i = 0; i < action_count; i++) { |
273 for (i = 0; i < action_count; i++) { |
| 271 gaim_debug(GAIM_DEBUG_MISC, "gtkrequest", |
|
| 272 "buttons[2 * %d] = '%s'\n", |
|
| 273 i, buttons[2 * i]); |
|
| 274 gtk_dialog_add_button(GTK_DIALOG(dialog), |
274 gtk_dialog_add_button(GTK_DIALOG(dialog), |
| 275 __text_to_stock(buttons[2 * i]), i); |
275 __text_to_stock(buttons[2 * i]), i); |
| 276 |
276 |
| 277 data->cbs[i] = buttons[2 * i + 1]; |
277 data->cbs[i] = buttons[2 * i + 1]; |
| 278 } |
278 } |
| 316 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
316 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
| 317 gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 0); |
317 gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 0); |
| 318 |
318 |
| 319 g_free(label_text); |
319 g_free(label_text); |
| 320 |
320 |
| |
321 if (default_action != -1) |
| |
322 gtk_dialog_set_default_response(GTK_DIALOG(dialog), default_action); |
| |
323 |
| 321 /* Show everything. */ |
324 /* Show everything. */ |
| 322 gtk_widget_show_all(dialog); |
325 gtk_widget_show_all(dialog); |
| 323 |
326 |
| 324 return data; |
327 return data; |
| 325 } |
328 } |