Fossil SCM

Optionally show or hide the "if-chng" settings on the Setup→Settings page.

drh 2025-03-19 11:50 trunk
Commit f60bd4a752ea539defdff5061a451fdffb2b309d0d9f57c4675663b83b7759d4
1 file changed +17 -2
+17 -2
--- src/setup.c
+++ src/setup.c
@@ -1109,10 +1109,11 @@
11091109
*/
11101110
void setup_settings(void){
11111111
int nSetting;
11121112
int i;
11131113
Setting const *pSet;
1114
+ int bExtra = P("extra")!=0;
11141115
const Setting *aSetting = setting_info(&nSetting);
11151116
11161117
login_check_credentials();
11171118
if( !g.perm.Setup ){
11181119
login_needed(0);
@@ -1132,19 +1133,25 @@
11321133
@ "<tt>.fossil-settings/</tt><i>SETTING-NAME</i>".
11331134
@ If the file for a versionable setting exists, the value cannot be
11341135
@ changed on this screen.</p><hr><p>
11351136
@
11361137
@ <form action="%R/setup_settings" method="post"><div>
1138
+ if( bExtra ){
1139
+ @ <input type="hidden" name="extra" value="1">
1140
+ style_submenu_element("No-Extras", "%R/setup_settings");
1141
+ }else{
1142
+ style_submenu_element("Extras", "%R/setup_settings?extra");
1143
+ }
11371144
@ <table border="0"><tr><td valign="top">
11381145
login_insert_csrf_secret();
11391146
for(i=0, pSet=aSetting; i<nSetting; i++, pSet++){
11401147
if( pSet->width==0 ){
11411148
int hasVersionableValue = pSet->versionable &&
11421149
(db_get_versioned(pSet->name, NULL, NULL)!=0);
1143
- if( pSet->bIfChng ){
1150
+ if( pSet->bIfChng && !bExtra ){
11441151
const char *zVal = db_get(pSet->name, 0);
1145
- if( zVal==0 || fossil_strcmp(zVal,pSet->def)==0 ) continue;
1152
+ if( zVal==0 || is_false(zVal)==is_false(pSet->def) ) continue;
11461153
}
11471154
onoff_attribute("", pSet->name,
11481155
pSet->var!=0 ? pSet->var : pSet->name /*works-like:"x"*/,
11491156
is_truth(pSet->def), hasVersionableValue);
11501157
@ <a href='%R/help?cmd=%s(pSet->name)'>%h(pSet->name)</a>
@@ -1160,10 +1167,14 @@
11601167
@ <table>
11611168
for(i=0, pSet=aSetting; i<nSetting; i++, pSet++){
11621169
if( pSet->width>0 && !pSet->forceTextArea ){
11631170
int hasVersionableValue = pSet->versionable &&
11641171
(db_get_versioned(pSet->name, NULL, NULL)!=0);
1172
+ if( pSet->bIfChng && !bExtra ){
1173
+ const char *zVal = db_get(pSet->name, 0);
1174
+ if( zVal==0 || fossil_strcmp(zVal,pSet->def)==0 ) continue;
1175
+ }
11651176
@ <tr><td>
11661177
@ <a href='%R/help?cmd=%s(pSet->name)'>%h(pSet->name)</a>
11671178
if( pSet->versionable ){
11681179
@ (v)
11691180
} else {
@@ -1179,10 +1190,14 @@
11791190
@</table>
11801191
@ </td><td style="width:50px;"></td><td valign="top">
11811192
for(i=0, pSet=aSetting; i<nSetting; i++, pSet++){
11821193
if( pSet->width>0 && pSet->forceTextArea ){
11831194
int hasVersionableValue = db_get_versioned(pSet->name, NULL, NULL)!=0;
1195
+ if( pSet->bIfChng && !bExtra ){
1196
+ const char *zVal = db_get(pSet->name, 0);
1197
+ if( zVal==0 || fossil_strcmp(zVal,pSet->def)==0 ) continue;
1198
+ }
11841199
@ <a href='%R/help?cmd=%s(pSet->name)'>%s(pSet->name)</a>
11851200
if( pSet->versionable ){
11861201
@ (v)<br>
11871202
} else {
11881203
@ <br>
11891204
--- src/setup.c
+++ src/setup.c
@@ -1109,10 +1109,11 @@
1109 */
1110 void setup_settings(void){
1111 int nSetting;
1112 int i;
1113 Setting const *pSet;
 
1114 const Setting *aSetting = setting_info(&nSetting);
1115
1116 login_check_credentials();
1117 if( !g.perm.Setup ){
1118 login_needed(0);
@@ -1132,19 +1133,25 @@
1132 @ "<tt>.fossil-settings/</tt><i>SETTING-NAME</i>".
1133 @ If the file for a versionable setting exists, the value cannot be
1134 @ changed on this screen.</p><hr><p>
1135 @
1136 @ <form action="%R/setup_settings" method="post"><div>
 
 
 
 
 
 
1137 @ <table border="0"><tr><td valign="top">
1138 login_insert_csrf_secret();
1139 for(i=0, pSet=aSetting; i<nSetting; i++, pSet++){
1140 if( pSet->width==0 ){
1141 int hasVersionableValue = pSet->versionable &&
1142 (db_get_versioned(pSet->name, NULL, NULL)!=0);
1143 if( pSet->bIfChng ){
1144 const char *zVal = db_get(pSet->name, 0);
1145 if( zVal==0 || fossil_strcmp(zVal,pSet->def)==0 ) continue;
1146 }
1147 onoff_attribute("", pSet->name,
1148 pSet->var!=0 ? pSet->var : pSet->name /*works-like:"x"*/,
1149 is_truth(pSet->def), hasVersionableValue);
1150 @ <a href='%R/help?cmd=%s(pSet->name)'>%h(pSet->name)</a>
@@ -1160,10 +1167,14 @@
1160 @ <table>
1161 for(i=0, pSet=aSetting; i<nSetting; i++, pSet++){
1162 if( pSet->width>0 && !pSet->forceTextArea ){
1163 int hasVersionableValue = pSet->versionable &&
1164 (db_get_versioned(pSet->name, NULL, NULL)!=0);
 
 
 
 
1165 @ <tr><td>
1166 @ <a href='%R/help?cmd=%s(pSet->name)'>%h(pSet->name)</a>
1167 if( pSet->versionable ){
1168 @ (v)
1169 } else {
@@ -1179,10 +1190,14 @@
1179 @</table>
1180 @ </td><td style="width:50px;"></td><td valign="top">
1181 for(i=0, pSet=aSetting; i<nSetting; i++, pSet++){
1182 if( pSet->width>0 && pSet->forceTextArea ){
1183 int hasVersionableValue = db_get_versioned(pSet->name, NULL, NULL)!=0;
 
 
 
 
1184 @ <a href='%R/help?cmd=%s(pSet->name)'>%s(pSet->name)</a>
1185 if( pSet->versionable ){
1186 @ (v)<br>
1187 } else {
1188 @ <br>
1189
--- src/setup.c
+++ src/setup.c
@@ -1109,10 +1109,11 @@
1109 */
1110 void setup_settings(void){
1111 int nSetting;
1112 int i;
1113 Setting const *pSet;
1114 int bExtra = P("extra")!=0;
1115 const Setting *aSetting = setting_info(&nSetting);
1116
1117 login_check_credentials();
1118 if( !g.perm.Setup ){
1119 login_needed(0);
@@ -1132,19 +1133,25 @@
1133 @ "<tt>.fossil-settings/</tt><i>SETTING-NAME</i>".
1134 @ If the file for a versionable setting exists, the value cannot be
1135 @ changed on this screen.</p><hr><p>
1136 @
1137 @ <form action="%R/setup_settings" method="post"><div>
1138 if( bExtra ){
1139 @ <input type="hidden" name="extra" value="1">
1140 style_submenu_element("No-Extras", "%R/setup_settings");
1141 }else{
1142 style_submenu_element("Extras", "%R/setup_settings?extra");
1143 }
1144 @ <table border="0"><tr><td valign="top">
1145 login_insert_csrf_secret();
1146 for(i=0, pSet=aSetting; i<nSetting; i++, pSet++){
1147 if( pSet->width==0 ){
1148 int hasVersionableValue = pSet->versionable &&
1149 (db_get_versioned(pSet->name, NULL, NULL)!=0);
1150 if( pSet->bIfChng && !bExtra ){
1151 const char *zVal = db_get(pSet->name, 0);
1152 if( zVal==0 || is_false(zVal)==is_false(pSet->def) ) continue;
1153 }
1154 onoff_attribute("", pSet->name,
1155 pSet->var!=0 ? pSet->var : pSet->name /*works-like:"x"*/,
1156 is_truth(pSet->def), hasVersionableValue);
1157 @ <a href='%R/help?cmd=%s(pSet->name)'>%h(pSet->name)</a>
@@ -1160,10 +1167,14 @@
1167 @ <table>
1168 for(i=0, pSet=aSetting; i<nSetting; i++, pSet++){
1169 if( pSet->width>0 && !pSet->forceTextArea ){
1170 int hasVersionableValue = pSet->versionable &&
1171 (db_get_versioned(pSet->name, NULL, NULL)!=0);
1172 if( pSet->bIfChng && !bExtra ){
1173 const char *zVal = db_get(pSet->name, 0);
1174 if( zVal==0 || fossil_strcmp(zVal,pSet->def)==0 ) continue;
1175 }
1176 @ <tr><td>
1177 @ <a href='%R/help?cmd=%s(pSet->name)'>%h(pSet->name)</a>
1178 if( pSet->versionable ){
1179 @ (v)
1180 } else {
@@ -1179,10 +1190,14 @@
1190 @</table>
1191 @ </td><td style="width:50px;"></td><td valign="top">
1192 for(i=0, pSet=aSetting; i<nSetting; i++, pSet++){
1193 if( pSet->width>0 && pSet->forceTextArea ){
1194 int hasVersionableValue = db_get_versioned(pSet->name, NULL, NULL)!=0;
1195 if( pSet->bIfChng && !bExtra ){
1196 const char *zVal = db_get(pSet->name, 0);
1197 if( zVal==0 || fossil_strcmp(zVal,pSet->def)==0 ) continue;
1198 }
1199 @ <a href='%R/help?cmd=%s(pSet->name)'>%s(pSet->name)</a>
1200 if( pSet->versionable ){
1201 @ (v)<br>
1202 } else {
1203 @ <br>
1204

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button