Index: src/db.c ================================================================== --- src/db.c +++ src/db.c @@ -1790,11 +1790,11 @@ if( z==0 && g.zConfigDbName ){ db_swap_connections(); z = db_text(0, "SELECT value FROM global_config WHERE name=%Q", zName); db_swap_connections(); } - if( ctrlSetting!=0 && ctrlSetting->versionable ){ + if( ctrlSetting!=0 && (ctrlSetting->width&SETUP_VERSIONABLE) ){ /* This is a versionable setting, try and get the info from a ** checked out file */ z = db_get_do_versionable(zName, z); } if( z==0 ){ @@ -2080,11 +2080,11 @@ fossil_print("%-20s %-8s %s\n", ctrlSetting->name, db_column_text(&q, 0), db_column_text(&q, 1)); }else{ fossil_print("%-20s\n", ctrlSetting->name); } - if( ctrlSetting->versionable && localOpen ){ + if( (ctrlSetting->width&SETUP_VERSIONABLE) && localOpen ){ /* Check to see if this is overridden by a versionable settings file */ Blob versionedPathname; blob_zero(&versionedPathname); blob_appendf(&versionedPathname, "%s/.fossil-settings/%s", g.zLocalRoot, ctrlSetting->name); @@ -2105,69 +2105,74 @@ ** is used for on/off checkboxes. ** The behaviour page doesn't use a special layout. It lists all ** set-commands and displays the 'set'-help as info. */ #if INTERFACE + +#define SETUP_WIDTH 63 +#define SETUP_TEXTAREA 64 +#define SETUP_VERSIONABLE 128 + struct stControlSettings { char const *name; /* Name of the setting */ char const *var; /* Internal variable name used by db_set() */ - int width; /* Width of display. 0 for boolean values */ - int versionable; /* Is this setting versionable? */ + int width; /* Width of display. 0 for boolean values. + possibly or'ed with above flags. */ char const *def; /* Default value */ }; #endif /* INTERFACE */ struct stControlSettings const ctrlSettings[] = { - { "access-log", 0, 0, 0, "off" }, - { "allow-symlinks",0, 0, 1, "off" }, - { "auto-captcha", "autocaptcha", 0, 0, "on" }, - { "auto-hyperlink",0, 0, 0, "on", }, - { "auto-shun", 0, 0, 0, "on" }, - { "autosync", 0, 0, 0, "on" }, - { "binary-glob", 0, 40, 1, "" }, - { "clearsign", 0, 0, 0, "off" }, + { "access-log", 0, 0, "off" }, + { "allow-symlinks",0, SETUP_VERSIONABLE, "off" }, + { "auto-captcha", "autocaptcha", 0, "on" }, + { "auto-hyperlink",0, 0, "on", }, + { "auto-shun", 0, 0, "on" }, + { "autosync", 0, 0, "on" }, + { "binary-glob", 0, SETUP_VERSIONABLE|40, "" }, + { "clearsign", 0, 0, "off" }, #if defined(_WIN32) || defined(__CYGWIN__) || defined(__DARWIN__) || defined(__APPLE__) - { "case-sensitive",0, 0, 0, "off" }, + { "case-sensitive",0, 0, "off" }, #else - { "case-sensitive",0, 0, 0, "on" }, + { "case-sensitive",0, 0, "on" }, #endif - { "clean-glob", 0, 40, 1, "" }, - { "crnl-glob", 0, 40, 1, "" }, - { "default-perms", 0, 16, 0, "u" }, - { "diff-binary", 0, 0, 0, "on" }, - { "diff-command", 0, 40, 0, "" }, - { "dont-push", 0, 0, 0, "off" }, - { "editor", 0, 32, 0, "" }, - { "empty-dirs", 0, 40, 1, "" }, - { "encoding-glob", 0, 40, 1, "" }, - { "gdiff-command", 0, 40, 0, "gdiff" }, - { "gmerge-command",0, 40, 0, "" }, - { "http-port", 0, 16, 0, "8080" }, - { "https-login", 0, 0, 0, "off" }, - { "ignore-glob", 0, 40, 1, "" }, - { "keep-glob", 0, 40, 1, "" }, - { "localauth", 0, 0, 0, "off" }, - { "main-branch", 0, 40, 0, "trunk" }, - { "manifest", 0, 0, 1, "off" }, - { "max-upload", 0, 25, 0, "250000" }, - { "mtime-changes", 0, 0, 0, "on" }, - { "pgp-command", 0, 40, 0, "gpg --clearsign -o " }, - { "proxy", 0, 32, 0, "off" }, - { "relative-paths",0, 0, 0, "on" }, - { "repo-cksum", 0, 0, 0, "on" }, - { "self-register", 0, 0, 0, "off" }, - { "ssh-command", 0, 40, 0, "" }, - { "ssl-ca-location",0, 40, 0, "" }, - { "ssl-identity", 0, 40, 0, "" }, + { "clean-glob", 0, SETUP_VERSIONABLE|40, "" }, + { "crnl-glob", 0, SETUP_VERSIONABLE|40, "" }, + { "default-perms", 0, 16, "u" }, + { "diff-binary", 0, 0, "on" }, + { "diff-command", 0, 40, "" }, + { "dont-push", 0, 0, "off" }, + { "editor", 0, 32, "" }, + { "empty-dirs", 0, SETUP_VERSIONABLE|40, "" }, + { "encoding-glob", 0, SETUP_VERSIONABLE|40, "" }, + { "gdiff-command", 0, 40, "gdiff" }, + { "gmerge-command",0, 40, "" }, + { "http-port", 0, 16, "8080" }, + { "https-login", 0, 0, "off" }, + { "ignore-glob", 0, SETUP_VERSIONABLE|40, "" }, + { "keep-glob", 0, SETUP_VERSIONABLE|40, "" }, + { "localauth", 0, 0, "off" }, + { "main-branch", 0, 40, "trunk" }, + { "manifest", 0, SETUP_VERSIONABLE, "off" }, + { "max-upload", 0, 25, "250000" }, + { "mtime-changes", 0, 0, "on" }, + { "pgp-command", 0, 40, "gpg --clearsign -o " }, + { "proxy", 0, 32, "off" }, + { "relative-paths",0, 0, "on" }, + { "repo-cksum", 0, 0, "on" }, + { "self-register", 0, 0, "off" }, + { "ssh-command", 0, 40, "" }, + { "ssl-ca-location",0, 40, "" }, + { "ssl-identity", 0, 40, "" }, #ifdef FOSSIL_ENABLE_TCL - { "tcl", 0, 0, 0, "off" }, - { "tcl-setup", 0, 40, 0, "" }, + { "tcl", 0, 0, "off" }, + { "tcl-setup", 0, SETUP_TEXTAREA|40, "" }, #endif - { "th1-setup", 0, 40, 0, "" }, - { "th1-uri-regexp",0, 40, 0, "" }, - { "web-browser", 0, 32, 0, "" }, - { "white-foreground", 0, 0, 0, "off" }, - { 0,0,0,0,0 } + { "th1-setup", 0, SETUP_TEXTAREA|40, "" }, + { "th1-uri-regexp",0, 40, "" }, + { "web-browser", 0, 32, "" }, + { "white-foreground", 0, 0, "off" }, + { 0,0,0,0 } }; /* ** COMMAND: settings ** COMMAND: unset* Index: src/setup.c ================================================================== --- src/setup.c +++ src/setup.c @@ -1248,36 +1248,53 @@ @ the meaning of each setting.


@
@
login_insert_csrf_secret(); for(pSet=ctrlSettings; pSet->name!=0; pSet++){ - if( pSet->width==0 ){ - int hasVersionableValue = pSet->versionable && + if( (pSet->width&SETUP_WIDTH)==0 ){ + int hasVersionableValue = (pSet->width&SETUP_VERSIONABLE) && (db_get_do_versionable(pSet->name, NULL)!=0); onoff_attribute(pSet->name, pSet->name, pSet->var!=0 ? pSet->var : pSet->name, is_truth(pSet->def), hasVersionableValue); - if( pSet->versionable ){ + if( (pSet->width&SETUP_VERSIONABLE) ){ @ (v)
} else { @
} } } @
for(pSet=ctrlSettings; pSet->name!=0; pSet++){ - if( pSet->width!=0 && !pSet->versionable){ + if( (pSet->width&SETUP_WIDTH)!=0 + && !(pSet->width&(SETUP_VERSIONABLE|SETUP_TEXTAREA)) ){ entry_attribute(pSet->name, /*pSet->width*/ 25, pSet->name, pSet->var!=0 ? pSet->var : pSet->name, (char*)pSet->def, 0); @
} + } + for(pSet=ctrlSettings; pSet->name!=0; pSet++){ + if( (pSet->width&SETUP_WIDTH)!=0 && sqlite3_strglob("*glob", pSet->name) + && (pSet->width&(SETUP_VERSIONABLE|SETUP_TEXTAREA)) ){ + int hasVersionableValue = 0; + @%s(pSet->name) + if( pSet->width&SETUP_VERSIONABLE ){ + hasVersionableValue = db_get_do_versionable(pSet->name, NULL)!=0; + @ (v) + } + @
+ textarea_attribute("", /*rows*/ 3, /*cols*/ 35, pSet->name, + pSet->var!=0 ? pSet->var : pSet->name, + (char*)pSet->def, hasVersionableValue); + @
+ } } @
for(pSet=ctrlSettings; pSet->name!=0; pSet++){ int hasVersionableValue = db_get_do_versionable(pSet->name, NULL)!=0; - if( pSet->width!=0 && pSet->versionable){ + if( (pSet->width&SETUP_WIDTH)!=0 && !sqlite3_strglob("*glob", pSet->name)){ @%s(pSet->name) (v)
textarea_attribute("", /*rows*/ 3, /*cols*/ 20, pSet->name, pSet->var!=0 ? pSet->var : pSet->name, (char*)pSet->def, hasVersionableValue); @