[gq-commit] gq/src configfile.c,1.52,1.53 configfile.h,1.37,1.38 gq-xml.c,1.12,1.13 gq.c,1.21,1.22 i
Status: Beta
Brought to you by:
sur5r
From: <sta...@us...> - 2003-11-03 21:28:41
|
Update of /cvsroot/gqclient/gq/src In directory sc8-pr-cvs1:/tmp/cvs-serv5819 Modified Files: configfile.c configfile.h gq-xml.c gq.c input.c prefs.c Log Message: * Added two new configuration settings: - do-not-use-ldap-conf to turn off parsing of the standard client configuration files - browse-use-user-friendly to switch on/off the use of user-friendly attribute names Index: configfile.c =================================================================== RCS file: /cvsroot/gqclient/gq/src/configfile.c,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** configfile.c 3 Nov 2003 21:19:53 -0000 1.52 --- configfile.c 3 Nov 2003 21:28:37 -0000 1.53 *************** *** 625,628 **** --- 625,629 ---- config_write_bool(wc, cfg->sort_search, "sort-search-mode", NULL); config_write_bool(wc, cfg->sort_browse, "sort-browse-mode", NULL); + config_write_bool(wc, cfg->browse_use_user_friendly, "browse-use-user-friendly", NULL); config_write_bool(wc, cfg->restore_window_sizes, *************** *** 636,639 **** --- 637,642 ---- config_write_bool(wc, cfg->never_leak_credentials, "never-leak-credentials", NULL); + config_write_bool(wc, cfg->do_not_use_ldap_conf, + "do-not-use-ldap-conf", NULL); config_write_string(wc, detokenize(token_ldifformat, cfg->ldifformat), *************** *** 837,841 **** --- 840,848 ---- cfg->restore_tabs = DEFAULT_RESTORE_TABS; + cfg->browse_use_user_friendly = DEFAULT_BROWSE_USE_USER_FRIENDLY; + + cfg->never_leak_credentials = DEFAULT_NEVER_LEAK_CREDENTIALS; + cfg->do_not_use_ldap_conf = DEFAULT_DO_NOT_USE_LDAP_CONF; return cfg; Index: configfile.h =================================================================== RCS file: /cvsroot/gqclient/gq/src/configfile.h,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** configfile.h 3 Nov 2003 21:07:57 -0000 1.37 --- configfile.h 3 Nov 2003 21:28:37 -0000 1.38 *************** *** 63,66 **** --- 63,68 ---- #define DEFAULT_SHOW_REF 0 + #define DEFAULT_BROWSE_USE_USER_FRIENDLY 1 + #define DEFAULT_RESTORE_SIZES 1 #define DEFAULT_RESTORE_POSITIONS 0 *************** *** 71,74 **** --- 73,77 ---- referrals */ #define DEFAULT_NEVER_LEAK_CREDENTIALS 1 + #define DEFAULT_DO_NOT_USE_LDAP_CONF 0 /* The following do not _really_ belong in here right now... */ *************** *** 111,116 **** --- 114,122 ---- int restore_search_history; int restore_tabs; + int browse_use_user_friendly; int never_leak_credentials; + int do_not_use_ldap_conf; /* turn off parsing of ldap.conf and + .ldaprc */ GHashTable *attrs; /* attribute specific data */ Index: gq-xml.c =================================================================== RCS file: /cvsroot/gqclient/gq/src/gq-xml.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** gq-xml.c 3 Nov 2003 21:07:57 -0000 1.12 --- gq-xml.c 3 Nov 2003 21:28:37 -0000 1.13 *************** *** 195,198 **** --- 195,207 ---- } + static void browse_use_user_friendlyE(struct parser_context *ctx, + struct tagstack_entry *e) + { + struct gq_config *c = peek_tag(ctx->stack, 1)->data; + + int b = booleanCDATA(ctx, e); + if (b >= 0) c->browse_use_user_friendly = b; + } + static void restore_window_sizesE(struct parser_context *ctx, struct tagstack_entry *e) *************** *** 240,243 **** --- 249,261 ---- } + static void do_not_use_ldap_confE(struct parser_context *ctx, + struct tagstack_entry *e) + { + struct gq_config *c = peek_tag(ctx->stack, 1)->data; + + int b = booleanCDATA(ctx, e); + if (b >= 0) c->do_not_use_ldap_conf = b; + } + static void ldif_formatE(struct parser_context *ctx, struct tagstack_entry *e) *************** *** 743,746 **** --- 761,769 ---- }, { + "browse-use-user-friendly", 0, + NULL, browse_use_user_friendlyE, + { "gq-config", NULL }, + }, + { "restore-window-sizes", 0, NULL, restore_window_sizesE, *************** *** 765,768 **** --- 788,796 ---- "never-leak-credentials", 0, NULL, never_leak_credentialsE, + { "gq-config", NULL }, + }, + { + "do-not-use-ldap-conf", 0, + NULL, do_not_use_ldap_confE, { "gq-config", NULL }, }, Index: gq.c =================================================================== RCS file: /cvsroot/gqclient/gq/src/gq.c,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** gq.c 2 Nov 2003 07:20:44 -0000 1.21 --- gq.c 3 Nov 2003 21:28:37 -0000 1.22 *************** *** 1,5 **** /* GQ -- a GTK-based LDAP client ! Copyright (C) 1998-2001 Bert Vermeulen Copyright (C) 2002-2003 Peter Stamfest --- 1,5 ---- /* GQ -- a GTK-based LDAP client ! Copyright (C) 1998-2003 Bert Vermeulen Copyright (C) 2002-2003 Peter Stamfest *************** *** 124,127 **** --- 124,131 ---- init_config(); init_state(); + + if (config->do_not_use_ldap_conf) { + setenv(g_strdup("LDAPNOINIT"), g_strdup("1"), 1); + } setup_fonts(); Index: input.c =================================================================== RCS file: /cvsroot/gqclient/gq/src/input.c,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** input.c 3 Nov 2003 21:07:57 -0000 1.82 --- input.c 3 Nov 2003 21:28:37 -0000 1.83 *************** *** 1029,1034 **** if (build || ff->label == NULL) { /* attribute name */ - ff->label = gtk_label_new(human_readable_attrname(ff->attrname)); gtk_misc_set_alignment(GTK_MISC(ff->label), LABEL_JUSTIFICATION, .5); --- 1029,1039 ---- if (build || ff->label == NULL) { /* attribute name */ + + if (config->browse_use_user_friendly) { + ff->label = gtk_label_new(human_readable_attrname(ff->attrname)); + } else { + ff->label = gtk_label_new(ff->attrname); + } gtk_misc_set_alignment(GTK_MISC(ff->label), LABEL_JUSTIFICATION, .5); Index: prefs.c =================================================================== RCS file: /cvsroot/gqclient/gq/src/prefs.c,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** prefs.c 3 Nov 2003 21:07:57 -0000 1.55 --- prefs.c 3 Nov 2003 21:28:38 -0000 1.56 *************** *** 80,83 **** --- 80,85 ---- GtkWidget *restore_tabs; + GtkWidget *browse_use_user_friendly; + /* template tab */ GtkWidget *schemaserver; *************** *** 88,91 **** --- 90,95 ---- /* security */ GtkWidget *never_leak_credentials; + GtkWidget *do_not_use_ldap_conf; + }; *************** *** 1233,1236 **** --- 1237,1243 ---- CONFIG_TOGGLE_BUTTON(config, pw, sort_browse); + /* browse mode: Use user-friendly attribute names */ + CONFIG_TOGGLE_BUTTON(config, pw, browse_use_user_friendly); + /* GUI */ /* restore window sizes */ *************** *** 1249,1252 **** --- 1256,1262 ---- CONFIG_TOGGLE_BUTTON(config, pw, never_leak_credentials); + /* do_not_use_ldap_conf */ + CONFIG_TOGGLE_BUTTON(config, pw, do_not_use_ldap_conf); + /* LDIF: format */ for(type = 0; type < sizeof(pw->ldif_format)/sizeof(pw->ldif_format[0]); *************** *** 1864,1867 **** --- 1874,1896 ---- + /* browse_use_user_friendly button */ + pw->browse_use_user_friendly = gq_check_button_new_with_label(_("Use _user friendly attribute names")); + + if(config->browse_use_user_friendly) + gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(pw->browse_use_user_friendly), TRUE); + #ifdef OLD_FOCUS_HANDLING + GTK_WIDGET_UNSET_FLAGS(GTK_CHECK_BUTTON(pw->browse_use_user_friendly), + GTK_CAN_FOCUS); + #endif + gtk_tooltips_set_tip(tips, pw->browse_use_user_friendly, + _("If set, turns on to use user-friendly attribute " + "names (if configured) in browse mode."), + S_("tooltip|") + ); + + gtk_widget_show(pw->browse_use_user_friendly); + gtk_box_pack_start(GTK_BOX(vbox_view), pw->browse_use_user_friendly, + FALSE, FALSE, 5); + } *************** *** 2040,2043 **** --- 2069,2088 ---- ); + /* Do not use ldap.conf ... checkbox */ + button = gq_check_button_new_with_label(_("Do not _use ldap.conf/.ldaprc file")); + pw->do_not_use_ldap_conf = button; + + if(config->do_not_use_ldap_conf) + gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(button), TRUE); + #ifdef OLD_FOCUS_HANDLING + GTK_WIDGET_UNSET_FLAGS(GTK_CHECK_BUTTON(button), GTK_CAN_FOCUS); + #endif + gtk_widget_show(button); + gtk_box_pack_start(GTK_BOX(vbox1), button, FALSE, TRUE, 5); + + gtk_tooltips_set_tip(tips, button, + _("Turn off the standard use of the system-wide ldap.conf configuration file and/or the per-user .ldaprc. This works by setting the environment variable LDAPNOINIT. Note that the this feature only set this variable, but never deletes it. This means that the default behaviour when not selecting this depends on the environment variable being set or not prior to the start of gq. Changing this will only affect future program runs."), + S_("tooltip|") + ); } |