Mercurial > pidgin.yaz
comparison src/prefs.c @ 1144:b1454d019277
[gaim-migrate @ 1154]
yay. the UI for the permit/deny stuff is done. the rest should be easy. :-P
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Mon, 27 Nov 2000 12:45:03 +0000 |
parents | fb1490e8f9f8 |
children | 65e0608e19f7 |
comparison
equal
deleted
inserted
replaced
1143:403989ecc1cc | 1144:b1454d019277 |
---|---|
1397 { | 1397 { |
1398 GtkWidget *label; | 1398 GtkWidget *label; |
1399 GtkWidget *list_item; | 1399 GtkWidget *list_item; |
1400 GSList *p; | 1400 GSList *p; |
1401 | 1401 |
1402 if (current_is_deny) | 1402 if (!current_is_deny) |
1403 return; | 1403 return; |
1404 | 1404 |
1405 p = current_deny_gc->permit; | 1405 p = current_deny_gc->permit; |
1406 | 1406 |
1407 gtk_list_remove_items(GTK_LIST(allow_list), GTK_LIST(allow_list)->children); | 1407 gtk_list_remove_items(GTK_LIST(allow_list), GTK_LIST(allow_list)->children); |
1492 | 1492 |
1493 gtk_widget_show(menu); | 1493 gtk_widget_show(menu); |
1494 gtk_widget_show(deny_opt_menu); | 1494 gtk_widget_show(deny_opt_menu); |
1495 } | 1495 } |
1496 | 1496 |
1497 static void pref_deny_add(GtkWidget *button, gboolean permit) | |
1498 { | |
1499 show_add_perm(current_deny_gc, NULL, permit); | |
1500 } | |
1501 | |
1502 static void pref_deny_rem(GtkWidget *button, gboolean permit) | |
1503 { | |
1504 GList *i; | |
1505 char *who; | |
1506 | |
1507 if (permit && !allow_list) | |
1508 return; | |
1509 if (!permit && !block_list) | |
1510 return; | |
1511 | |
1512 if (permit) | |
1513 i = GTK_LIST(allow_list)->selection; | |
1514 else | |
1515 i = GTK_LIST(block_list)->selection; | |
1516 | |
1517 if (!i) | |
1518 return; | |
1519 who = gtk_object_get_user_data(GTK_OBJECT(i->data)); | |
1520 if (permit) { | |
1521 current_deny_gc->permit = g_slist_remove(current_deny_gc->permit, who); | |
1522 serv_rem_permit(current_deny_gc, who); | |
1523 build_allow_list(); | |
1524 } else { | |
1525 current_deny_gc->deny = g_slist_remove(current_deny_gc->deny, who); | |
1526 serv_rem_deny(current_deny_gc, who); | |
1527 build_block_list(); | |
1528 } | |
1529 | |
1530 do_export(0, 0); | |
1531 } | |
1532 | |
1497 static void deny_page() | 1533 static void deny_page() |
1498 { | 1534 { |
1499 GtkWidget *parent; | 1535 GtkWidget *parent; |
1500 GtkWidget *box; | 1536 GtkWidget *box; |
1501 GtkWidget *hbox; | 1537 GtkWidget *hbox; |
1572 bbox = gtk_hbox_new(TRUE, 5); | 1608 bbox = gtk_hbox_new(TRUE, 5); |
1573 gtk_box_pack_end(GTK_BOX(vbox), bbox, FALSE, FALSE, 5); | 1609 gtk_box_pack_end(GTK_BOX(vbox), bbox, FALSE, FALSE, 5); |
1574 gtk_widget_show(bbox); | 1610 gtk_widget_show(bbox); |
1575 | 1611 |
1576 button = picture_button(prefs, _("Add"), gnome_add_xpm); | 1612 button = picture_button(prefs, _("Add"), gnome_add_xpm); |
1613 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(pref_deny_add), (void *)TRUE); | |
1577 gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 5); | 1614 gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 5); |
1578 | 1615 |
1579 button = picture_button(prefs, _("Remove"), gnome_remove_xpm); | 1616 button = picture_button(prefs, _("Remove"), gnome_remove_xpm); |
1617 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(pref_deny_rem), (void *)TRUE); | |
1580 gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 5); | 1618 gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 5); |
1581 | 1619 |
1582 vbox = gtk_vbox_new(FALSE, 5); | 1620 vbox = gtk_vbox_new(FALSE, 5); |
1583 gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 5); | 1621 gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 5); |
1584 gtk_widget_show(vbox); | 1622 gtk_widget_show(vbox); |
1605 bbox = gtk_hbox_new(TRUE, 5); | 1643 bbox = gtk_hbox_new(TRUE, 5); |
1606 gtk_box_pack_end(GTK_BOX(vbox), bbox, FALSE, FALSE, 5); | 1644 gtk_box_pack_end(GTK_BOX(vbox), bbox, FALSE, FALSE, 5); |
1607 gtk_widget_show(bbox); | 1645 gtk_widget_show(bbox); |
1608 | 1646 |
1609 button = picture_button(prefs, _("Add"), gnome_add_xpm); | 1647 button = picture_button(prefs, _("Add"), gnome_add_xpm); |
1648 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(pref_deny_add), FALSE); | |
1610 gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 5); | 1649 gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 5); |
1611 | 1650 |
1612 button = picture_button(prefs, _("Remove"), gnome_remove_xpm); | 1651 button = picture_button(prefs, _("Remove"), gnome_remove_xpm); |
1652 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(pref_deny_rem), FALSE); | |
1613 gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 5); | 1653 gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 5); |
1614 | 1654 |
1615 gtk_widget_show(prefdialog); | 1655 gtk_widget_show(prefdialog); |
1616 } | 1656 } |
1617 | 1657 |