# HG changeset patch # User Eric Warmenhoven # Date 995393121 0 # Node ID a4367a6478eb48d56bc78715b4bd579721cfc948 # Parent 306070a693802437735fdb38bc7fb5be1c9e749f [gaim-migrate @ 2084] Adam's patch to do the deny setting properly committer: Tailor Script diff -r 306070a69380 -r a4367a6478eb src/prefs.c --- a/src/prefs.c Tue Jul 17 15:49:05 2001 +0000 +++ b/src/prefs.c Tue Jul 17 18:05:21 2001 +0000 @@ -2006,6 +2006,7 @@ gtk_widget_show(prefdialog); } +static GtkWidget *deny_type = NULL; static GtkWidget *deny_conn_hbox = NULL; static GtkWidget *deny_opt_menu = NULL; static struct gaim_connection *current_deny_gc = NULL; @@ -2044,12 +2045,34 @@ gtk_widget_destroy(d); current_deny_gc = NULL; deny_conn_hbox = NULL; + deny_type = NULL; deny_opt_menu = NULL; current_is_deny = FALSE; allow_list = NULL; block_list = NULL; } +static void set_deny_type() +{ + GSList *bg = gtk_radio_button_group(GTK_RADIO_BUTTON(deny_type)); + + switch (current_deny_gc->permdeny) { + case 4: + break; + case 3: + bg = bg->next->next; + break; + case 2: + bg = bg->next; + break; + case 1: + bg = bg->next->next->next; + break; + } + + gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(bg->data), TRUE); +} + void build_allow_list() { GtkWidget *label; @@ -2103,6 +2126,7 @@ static void deny_gc_opt(GtkWidget *opt, struct gaim_connection *gc) { current_deny_gc = gc; + set_deny_type(); build_allow_list(); build_block_list(); } @@ -2197,7 +2221,6 @@ GtkWidget *hbox; GtkWidget *label; GtkWidget *vbox; - GtkWidget *opt; GtkWidget *sw; GtkWidget *bbox; GtkWidget *button; @@ -2244,8 +2267,8 @@ gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 5); gtk_widget_show(vbox); - opt = deny_opt(_("Allow all users to contact me"), 1, vbox, NULL); - opt = deny_opt(_("Allow only the users below"), 3, vbox, opt); + deny_type = deny_opt(_("Allow all users to contact me"), 1, vbox, NULL); + deny_type = deny_opt(_("Allow only the users below"), 3, vbox, deny_type); label = gtk_label_new(_("Allow List")); gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5); @@ -2278,8 +2301,8 @@ gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 5); gtk_widget_show(vbox); - opt = deny_opt(_("Deny all users"), 2, vbox, opt); - opt = deny_opt(_("Block the users below"), 4, vbox, opt); + deny_type = deny_opt(_("Deny all users"), 2, vbox, deny_type); + deny_type = deny_opt(_("Block the users below"), 4, vbox, deny_type); label = gtk_label_new(_("Block List")); gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5);