Mercurial > pidgin.yaz
comparison src/dialogs.c @ 4107:06435b94c3d7
[gaim-migrate @ 4322]
(20:29:32) deryni: LSchiere: http://deryni.perlmonk.org/block.patch I missed the add/deny dialog also
(20:29:39) LSchiere: kay
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Sat, 21 Dec 2002 01:31:41 +0000 |
parents | 3f15ccb54f95 |
children | 64d983d6b7bb |
comparison
equal
deleted
inserted
replaced
4106:a843ce9d77ea | 4107:06435b94c3d7 |
---|---|
2448 GtkWidget *add; | 2448 GtkWidget *add; |
2449 GtkWidget *label; | 2449 GtkWidget *label; |
2450 GtkWidget *bbox; | 2450 GtkWidget *bbox; |
2451 GtkWidget *vbox; | 2451 GtkWidget *vbox; |
2452 GtkWidget *topbox; | 2452 GtkWidget *topbox; |
2453 GtkWidget *frame; | |
2454 | 2453 |
2455 struct addperm *p = g_new0(struct addperm, 1); | 2454 struct addperm *p = g_new0(struct addperm, 1); |
2456 p->gc = gc; | 2455 p->gc = gc; |
2457 p->permit = permit; | 2456 p->permit = permit; |
2458 | 2457 |
2461 gtk_window_set_policy(GTK_WINDOW(p->window), FALSE, FALSE, TRUE); | 2460 gtk_window_set_policy(GTK_WINDOW(p->window), FALSE, FALSE, TRUE); |
2462 gtk_widget_realize(p->window); | 2461 gtk_widget_realize(p->window); |
2463 | 2462 |
2464 dialogwindows = g_list_prepend(dialogwindows, p->window); | 2463 dialogwindows = g_list_prepend(dialogwindows, p->window); |
2465 | 2464 |
2466 bbox = gtk_hbox_new(TRUE, 10); | 2465 bbox = gtk_hbox_new(FALSE, 5); |
2467 topbox = gtk_hbox_new(FALSE, 5); | 2466 topbox = gtk_hbox_new(FALSE, 5); |
2468 vbox = gtk_vbox_new(FALSE, 5); | 2467 vbox = gtk_vbox_new(FALSE, 5); |
2469 p->entry = gtk_entry_new(); | 2468 p->entry = gtk_entry_new(); |
2470 | |
2471 if (permit) | |
2472 frame = gtk_frame_new(_("Permit")); | |
2473 else | |
2474 frame = gtk_frame_new(_("Deny")); | |
2475 | 2469 |
2476 /* Build Add Button */ | 2470 /* Build Add Button */ |
2477 | 2471 |
2478 if (permit) | 2472 if (permit) |
2479 add = picture_button(p->window, _("Permit"), add_xpm); | 2473 add = picture_button(p->window, _("Permit"), add_xpm); |
2485 if (who != NULL) | 2479 if (who != NULL) |
2486 gtk_entry_set_text(GTK_ENTRY(p->entry), who); | 2480 gtk_entry_set_text(GTK_ENTRY(p->entry), who); |
2487 | 2481 |
2488 /* Put the buttons in the box */ | 2482 /* Put the buttons in the box */ |
2489 | 2483 |
2490 gtk_box_pack_start(GTK_BOX(bbox), add, FALSE, FALSE, 5); | 2484 gtk_box_pack_end(GTK_BOX(bbox), add, FALSE, FALSE, 5); |
2491 gtk_box_pack_end(GTK_BOX(bbox), cancel, FALSE, FALSE, 5); | 2485 gtk_box_pack_end(GTK_BOX(bbox), cancel, FALSE, FALSE, 5); |
2492 | 2486 |
2493 label = gtk_label_new(_("Add")); | 2487 label = gtk_label_new(_("Add")); |
2494 gtk_widget_show(label); | 2488 gtk_widget_show(label); |
2495 gtk_box_pack_start(GTK_BOX(topbox), label, FALSE, FALSE, 5); | 2489 gtk_box_pack_start(GTK_BOX(topbox), label, FALSE, FALSE, 5); |
2496 gtk_box_pack_start(GTK_BOX(topbox), p->entry, FALSE, FALSE, 5); | 2490 gtk_box_pack_start(GTK_BOX(topbox), p->entry, FALSE, FALSE, 5); |
2497 /* And the boxes in the box */ | 2491 /* And the boxes in the box */ |
2498 gtk_box_pack_start(GTK_BOX(vbox), topbox, TRUE, TRUE, 5); | 2492 gtk_box_pack_start(GTK_BOX(vbox), topbox, TRUE, TRUE, 5); |
2499 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 5); | 2493 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 5); |
2500 gtk_container_add(GTK_CONTAINER(frame), vbox); | 2494 gtk_widget_show(topbox); |
2495 topbox=gtk_hbox_new(FALSE, 5); | |
2496 gtk_box_pack_start(GTK_BOX(topbox), vbox, FALSE, FALSE, 5); | |
2501 | 2497 |
2502 | 2498 |
2503 /* Handle closes right */ | 2499 /* Handle closes right */ |
2504 gtk_signal_connect(GTK_OBJECT(p->window), "destroy", GTK_SIGNAL_FUNC(destroy_dialog), p->window); | 2500 gtk_signal_connect(GTK_OBJECT(p->window), "destroy", GTK_SIGNAL_FUNC(destroy_dialog), p->window); |
2505 gtk_signal_connect(GTK_OBJECT(cancel), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), p->window); | 2501 gtk_signal_connect(GTK_OBJECT(cancel), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), p->window); |
2511 gtk_widget_show(cancel); | 2507 gtk_widget_show(cancel); |
2512 gtk_widget_show(p->entry); | 2508 gtk_widget_show(p->entry); |
2513 gtk_widget_show(topbox); | 2509 gtk_widget_show(topbox); |
2514 gtk_widget_show(bbox); | 2510 gtk_widget_show(bbox); |
2515 gtk_widget_show(vbox); | 2511 gtk_widget_show(vbox); |
2516 gtk_widget_show(frame); | |
2517 if (permit) | 2512 if (permit) |
2518 gtk_window_set_title(GTK_WINDOW(p->window), _("Gaim - Add Permit")); | 2513 gtk_window_set_title(GTK_WINDOW(p->window), _("Gaim - Add Permit")); |
2519 else | 2514 else |
2520 gtk_window_set_title(GTK_WINDOW(p->window), _("Gaim - Add Deny")); | 2515 gtk_window_set_title(GTK_WINDOW(p->window), _("Gaim - Add Deny")); |
2521 gtk_window_set_focus(GTK_WINDOW(p->window), p->entry); | 2516 gtk_window_set_focus(GTK_WINDOW(p->window), p->entry); |
2522 gtk_container_add(GTK_CONTAINER(p->window), frame); | 2517 gtk_container_add(GTK_CONTAINER(p->window), topbox); |
2523 gtk_widget_realize(p->window); | 2518 gtk_widget_realize(p->window); |
2524 | 2519 |
2525 gtk_widget_show(p->window); | 2520 gtk_widget_show(p->window); |
2526 } | 2521 } |
2527 | 2522 |