Fossil SCM
Optionally show or hide the "if-chng" settings on the Setup→Settings page.
Commit
f60bd4a752ea539defdff5061a451fdffb2b309d0d9f57c4675663b83b7759d4
Parent
3e7c7e227733b10…
1 file changed
+17
-2
+17
-2
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -1109,10 +1109,11 @@ | ||
| 1109 | 1109 | */ |
| 1110 | 1110 | void setup_settings(void){ |
| 1111 | 1111 | int nSetting; |
| 1112 | 1112 | int i; |
| 1113 | 1113 | Setting const *pSet; |
| 1114 | + int bExtra = P("extra")!=0; | |
| 1114 | 1115 | const Setting *aSetting = setting_info(&nSetting); |
| 1115 | 1116 | |
| 1116 | 1117 | login_check_credentials(); |
| 1117 | 1118 | if( !g.perm.Setup ){ |
| 1118 | 1119 | login_needed(0); |
| @@ -1132,19 +1133,25 @@ | ||
| 1132 | 1133 | @ "<tt>.fossil-settings/</tt><i>SETTING-NAME</i>". |
| 1133 | 1134 | @ If the file for a versionable setting exists, the value cannot be |
| 1134 | 1135 | @ changed on this screen.</p><hr><p> |
| 1135 | 1136 | @ |
| 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 | + } | |
| 1137 | 1144 | @ <table border="0"><tr><td valign="top"> |
| 1138 | 1145 | login_insert_csrf_secret(); |
| 1139 | 1146 | for(i=0, pSet=aSetting; i<nSetting; i++, pSet++){ |
| 1140 | 1147 | if( pSet->width==0 ){ |
| 1141 | 1148 | int hasVersionableValue = pSet->versionable && |
| 1142 | 1149 | (db_get_versioned(pSet->name, NULL, NULL)!=0); |
| 1143 | - if( pSet->bIfChng ){ | |
| 1150 | + if( pSet->bIfChng && !bExtra ){ | |
| 1144 | 1151 | 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; | |
| 1146 | 1153 | } |
| 1147 | 1154 | onoff_attribute("", pSet->name, |
| 1148 | 1155 | pSet->var!=0 ? pSet->var : pSet->name /*works-like:"x"*/, |
| 1149 | 1156 | is_truth(pSet->def), hasVersionableValue); |
| 1150 | 1157 | @ <a href='%R/help?cmd=%s(pSet->name)'>%h(pSet->name)</a> |
| @@ -1160,10 +1167,14 @@ | ||
| 1160 | 1167 | @ <table> |
| 1161 | 1168 | for(i=0, pSet=aSetting; i<nSetting; i++, pSet++){ |
| 1162 | 1169 | if( pSet->width>0 && !pSet->forceTextArea ){ |
| 1163 | 1170 | int hasVersionableValue = pSet->versionable && |
| 1164 | 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 | + } | |
| 1165 | 1176 | @ <tr><td> |
| 1166 | 1177 | @ <a href='%R/help?cmd=%s(pSet->name)'>%h(pSet->name)</a> |
| 1167 | 1178 | if( pSet->versionable ){ |
| 1168 | 1179 | @ (v) |
| 1169 | 1180 | } else { |
| @@ -1179,10 +1190,14 @@ | ||
| 1179 | 1190 | @</table> |
| 1180 | 1191 | @ </td><td style="width:50px;"></td><td valign="top"> |
| 1181 | 1192 | for(i=0, pSet=aSetting; i<nSetting; i++, pSet++){ |
| 1182 | 1193 | if( pSet->width>0 && pSet->forceTextArea ){ |
| 1183 | 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 | + } | |
| 1184 | 1199 | @ <a href='%R/help?cmd=%s(pSet->name)'>%s(pSet->name)</a> |
| 1185 | 1200 | if( pSet->versionable ){ |
| 1186 | 1201 | @ (v)<br> |
| 1187 | 1202 | } else { |
| 1188 | 1203 | @ <br> |
| 1189 | 1204 |
| --- 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 |