Mercurial > pidgin
comparison src/dialogs.c @ 6021:d2d5d1984b09
[gaim-migrate @ 6471]
The "ok" button on the privacy dialog no longer gets grayed out when you sign
off your last account.
The privacy dialog now updates itself for new accounts when you sign online.
You can no longer open multiple privacy dialogs.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sat, 05 Jul 2003 06:06:56 +0000 |
parents | 272c761c52e3 |
children | 5a0060191a77 |
comparison
equal
deleted
inserted
replaced
6020:3b6f48766acb | 6021:d2d5d1984b09 |
---|---|
1411 | 1411 |
1412 | 1412 |
1413 /*------------------------------------------------------------------------* | 1413 /*------------------------------------------------------------------------* |
1414 * Privacy Settings * | 1414 * Privacy Settings * |
1415 *------------------------------------------------------------------------*/ | 1415 *------------------------------------------------------------------------*/ |
1416 static GtkWidget *privacy_win; | |
1417 static GtkWidget *privacy_sensbox; | |
1418 | |
1416 static GtkWidget *deny_type = NULL; | 1419 static GtkWidget *deny_type = NULL; |
1417 static GtkWidget *deny_conn_hbox = NULL; | 1420 static GtkWidget *deny_conn_hbox = NULL; |
1418 static GtkWidget *deny_opt_menu = NULL; | 1421 static GtkWidget *deny_opt_menu = NULL; |
1419 static GaimConnection *current_deny_gc = NULL; | 1422 static GaimConnection *current_deny_gc = NULL; |
1420 static gboolean current_is_deny = FALSE; | 1423 static gboolean current_is_deny = FALSE; |
1669 } | 1672 } |
1670 | 1673 |
1671 gaim_blist_save(); | 1674 gaim_blist_save(); |
1672 } | 1675 } |
1673 | 1676 |
1674 static GtkWidget *privacy_win; | |
1675 | |
1676 void update_privacy_connections() { /* This is a slightly better name */ | 1677 void update_privacy_connections() { /* This is a slightly better name */ |
1677 gboolean needdeny = FALSE; | 1678 gboolean needdeny = FALSE; |
1678 GList *c = gaim_connections_get_all(); | 1679 GList *c = gaim_connections_get_all(); |
1679 GaimConnection *gc = NULL; | 1680 GaimConnection *gc = NULL; |
1680 | 1681 |
1690 } | 1691 } |
1691 needdeny = (gc != NULL); | 1692 needdeny = (gc != NULL); |
1692 | 1693 |
1693 | 1694 |
1694 if (needdeny) { | 1695 if (needdeny) { |
1695 gtk_widget_set_sensitive(privacy_win, TRUE); | 1696 gtk_widget_set_sensitive(privacy_sensbox, TRUE); |
1696 build_deny_menu(); | 1697 build_deny_menu(); |
1697 build_allow_list(); | 1698 build_allow_list(); |
1698 build_block_list(); | 1699 build_block_list(); |
1699 } else { | 1700 } else { |
1700 gtk_widget_set_sensitive(privacy_win, FALSE); | 1701 gtk_widget_set_sensitive(privacy_sensbox, FALSE); |
1701 } | 1702 } |
1702 } | 1703 } |
1703 static void destroy_privacy() { | 1704 static void destroy_privacy() { |
1704 current_deny_gc = NULL; | 1705 current_deny_gc = NULL; |
1705 privacy_win = NULL; | 1706 privacy_win = NULL; |
1707 privacy_sensbox = NULL; | |
1706 } | 1708 } |
1707 | 1709 |
1708 void show_privacy_options() { | 1710 void show_privacy_options() { |
1709 GtkWidget *pwin; | 1711 GtkWidget *pwin; |
1710 GtkWidget *box; | 1712 GtkWidget *box; |
1713 GtkWidget *box2; | |
1711 GtkWidget *hbox; | 1714 GtkWidget *hbox; |
1712 GtkWidget *label; | 1715 GtkWidget *label; |
1713 GtkWidget *sw; | 1716 GtkWidget *sw; |
1714 GtkWidget *bbox; | 1717 GtkWidget *bbox; |
1715 GtkWidget *button; | 1718 GtkWidget *button; |
1719 GtkSizeGroup *sg2 = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); | 1722 GtkSizeGroup *sg2 = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); |
1720 GtkCellRenderer *rend; | 1723 GtkCellRenderer *rend; |
1721 GtkTreeViewColumn *col; | 1724 GtkTreeViewColumn *col; |
1722 GtkWidget *table; | 1725 GtkWidget *table; |
1723 | 1726 |
1727 if (privacy_win != NULL) { | |
1728 gtk_widget_show(privacy_win); | |
1729 gdk_window_raise(privacy_win->window); | |
1730 return; | |
1731 } | |
1732 | |
1724 current_deny_gc = gaim_connections_get_all()->data; /* this is safe because this screen will only be | 1733 current_deny_gc = gaim_connections_get_all()->data; /* this is safe because this screen will only be |
1725 available when there are gaim_connections_get_all() */ | 1734 available when there are gaim_connections_get_all() */ |
1726 current_is_deny = TRUE; | 1735 current_is_deny = TRUE; |
1727 | 1736 |
1728 privacy_win = pwin = gtk_window_new(GTK_WINDOW_TOPLEVEL); | 1737 privacy_win = pwin = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
1737 box = gtk_vbox_new(FALSE, 5); | 1746 box = gtk_vbox_new(FALSE, 5); |
1738 gtk_container_set_border_width(GTK_CONTAINER(box), 5); | 1747 gtk_container_set_border_width(GTK_CONTAINER(box), 5); |
1739 gtk_container_add(GTK_CONTAINER(pwin), box); | 1748 gtk_container_add(GTK_CONTAINER(pwin), box); |
1740 gtk_widget_show(box); | 1749 gtk_widget_show(box); |
1741 | 1750 |
1751 privacy_sensbox = box2 = gtk_vbox_new(FALSE, 5); | |
1752 gtk_container_set_border_width(GTK_CONTAINER(box2), 5); | |
1753 gtk_box_pack_start(GTK_BOX(box), box2, TRUE, TRUE, 0); | |
1754 gtk_widget_show(box2); | |
1755 | |
1742 label = gtk_label_new(_("Changes to privacy settings take effect immediately.")); | 1756 label = gtk_label_new(_("Changes to privacy settings take effect immediately.")); |
1743 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5); | 1757 gtk_box_pack_start(GTK_BOX(box2), label, FALSE, FALSE, 0); |
1744 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | 1758 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
1745 gtk_widget_show(label); | 1759 gtk_widget_show(label); |
1746 | 1760 |
1747 deny_conn_hbox = gtk_hbox_new(FALSE, 5); | 1761 deny_conn_hbox = gtk_hbox_new(FALSE, 5); |
1748 gtk_box_pack_start(GTK_BOX(box), deny_conn_hbox, FALSE, FALSE, 0); | 1762 gtk_box_pack_start(GTK_BOX(box2), deny_conn_hbox, FALSE, FALSE, 5); |
1749 gtk_widget_show(deny_conn_hbox); | 1763 gtk_widget_show(deny_conn_hbox); |
1750 | 1764 |
1751 label = gtk_label_new(_("Set privacy for:")); | 1765 label = gtk_label_new(_("Set privacy for:")); |
1752 gtk_box_pack_start(GTK_BOX(deny_conn_hbox), label, FALSE, FALSE, 5); | 1766 gtk_box_pack_start(GTK_BOX(deny_conn_hbox), label, FALSE, FALSE, 5); |
1753 gtk_widget_show(label); | 1767 gtk_widget_show(label); |
1758 gtk_widget_show(deny_opt_menu); | 1772 gtk_widget_show(deny_opt_menu); |
1759 | 1773 |
1760 build_deny_menu(); | 1774 build_deny_menu(); |
1761 | 1775 |
1762 table = gtk_table_new(5, 2, FALSE); | 1776 table = gtk_table_new(5, 2, FALSE); |
1763 gtk_box_pack_start(GTK_BOX(box), table, TRUE, TRUE, 0); | 1777 gtk_box_pack_start(GTK_BOX(box2), table, TRUE, TRUE, 0); |
1764 gtk_table_set_row_spacings(GTK_TABLE(table), 7); | 1778 gtk_table_set_row_spacings(GTK_TABLE(table), 7); |
1765 gtk_table_set_col_spacings(GTK_TABLE(table), 5); | 1779 gtk_table_set_col_spacings(GTK_TABLE(table), 5); |
1766 gtk_widget_show(table); | 1780 gtk_widget_show(table); |
1767 | 1781 |
1768 deny_type = deny_opt(_("Allow all users to contact me"), 1, NULL); | 1782 deny_type = deny_opt(_("Allow all users to contact me"), 1, NULL); |
1865 gtk_box_pack_end(GTK_BOX(hbox), close_button, FALSE, FALSE, 0); | 1879 gtk_box_pack_end(GTK_BOX(hbox), close_button, FALSE, FALSE, 0); |
1866 g_signal_connect_swapped(G_OBJECT(close_button), "clicked", G_CALLBACK(gtk_widget_destroy), pwin); | 1880 g_signal_connect_swapped(G_OBJECT(close_button), "clicked", G_CALLBACK(gtk_widget_destroy), pwin); |
1867 gtk_widget_show(close_button); | 1881 gtk_widget_show(close_button); |
1868 | 1882 |
1869 gtk_widget_show(pwin); | 1883 gtk_widget_show(pwin); |
1870 | |
1871 } | 1884 } |
1872 | 1885 |
1873 | 1886 |
1874 /*------------------------------------------------------------------------*/ | 1887 /*------------------------------------------------------------------------*/ |
1875 /* The dialog for SET INFO / SET DIR INFO */ | 1888 /* The dialog for SET INFO / SET DIR INFO */ |