Fossil SCM

Fix the "Behavior" setup page so that it has the correct default values for unspecified attributes. Ticket [0101a97fefd5ca91d]

drh 2009-10-31 13:50 trunk
Commit 671e7c34e9a78bd49212e149760c51625fbb9a82
1 file changed +5 -11
+5 -11
--- src/setup.c
+++ src/setup.c
@@ -634,18 +634,12 @@
634634
const char *zLabel, /* The text label on the checkbox */
635635
const char *zVar, /* The corresponding row in the VAR table */
636636
const char *zQParm, /* The query parameter */
637637
int dfltVal /* Default value if VAR table entry does not exist */
638638
){
639
- const char *zVal = db_get(zVar, 0);
640639
const char *zQ = P(zQParm);
641
- int iVal;
642
- if( zVal ){
643
- iVal = atoi(zVal);
644
- }else{
645
- iVal = dfltVal;
646
- }
640
+ int iVal = db_get_boolean(zVar, dfltVal);
647641
if( zQ==0 && P("submit") ){
648642
zQ = "off";
649643
}
650644
if( zQ ){
651645
int iQ = strcmp(zQ,"on")==0 || atoi(zQ);
@@ -806,18 +800,18 @@
806800
@ <form action="%s(g.zBaseURL)/setup_behavior" method="POST">
807801
login_insert_csrf_secret();
808802
809803
@ <hr>
810804
onoff_attribute("Automatically synchronize with repository",
811
- "autosync", "autosync", 0);
805
+ "autosync", "autosync", 1);
812806
@ <p>Automatically keeps your work in sync with a centralized server.</p>
813807
814808
@ <hr>
815
- onoff_attribute("Sign all commits with gpg",
816
- "clearsign", "clearsign", 0);
809
+ onoff_attribute("Sign all commits with GPG",
810
+ "clearsign", "clearsign", 1);
817811
@ <p>When enabled (the default), fossil will attempt to
818
- @ sign all commits with gpg. When disabled, commits will
812
+ @ sign all commits with GPG. When disabled, commits will
819813
@ be unsigned.</p>
820814
821815
@ <hr>
822816
onoff_attribute("Require local authentication",
823817
"localauth", "localauth", 0);
824818
--- src/setup.c
+++ src/setup.c
@@ -634,18 +634,12 @@
634 const char *zLabel, /* The text label on the checkbox */
635 const char *zVar, /* The corresponding row in the VAR table */
636 const char *zQParm, /* The query parameter */
637 int dfltVal /* Default value if VAR table entry does not exist */
638 ){
639 const char *zVal = db_get(zVar, 0);
640 const char *zQ = P(zQParm);
641 int iVal;
642 if( zVal ){
643 iVal = atoi(zVal);
644 }else{
645 iVal = dfltVal;
646 }
647 if( zQ==0 && P("submit") ){
648 zQ = "off";
649 }
650 if( zQ ){
651 int iQ = strcmp(zQ,"on")==0 || atoi(zQ);
@@ -806,18 +800,18 @@
806 @ <form action="%s(g.zBaseURL)/setup_behavior" method="POST">
807 login_insert_csrf_secret();
808
809 @ <hr>
810 onoff_attribute("Automatically synchronize with repository",
811 "autosync", "autosync", 0);
812 @ <p>Automatically keeps your work in sync with a centralized server.</p>
813
814 @ <hr>
815 onoff_attribute("Sign all commits with gpg",
816 "clearsign", "clearsign", 0);
817 @ <p>When enabled (the default), fossil will attempt to
818 @ sign all commits with gpg. When disabled, commits will
819 @ be unsigned.</p>
820
821 @ <hr>
822 onoff_attribute("Require local authentication",
823 "localauth", "localauth", 0);
824
--- src/setup.c
+++ src/setup.c
@@ -634,18 +634,12 @@
634 const char *zLabel, /* The text label on the checkbox */
635 const char *zVar, /* The corresponding row in the VAR table */
636 const char *zQParm, /* The query parameter */
637 int dfltVal /* Default value if VAR table entry does not exist */
638 ){
 
639 const char *zQ = P(zQParm);
640 int iVal = db_get_boolean(zVar, dfltVal);
 
 
 
 
 
641 if( zQ==0 && P("submit") ){
642 zQ = "off";
643 }
644 if( zQ ){
645 int iQ = strcmp(zQ,"on")==0 || atoi(zQ);
@@ -806,18 +800,18 @@
800 @ <form action="%s(g.zBaseURL)/setup_behavior" method="POST">
801 login_insert_csrf_secret();
802
803 @ <hr>
804 onoff_attribute("Automatically synchronize with repository",
805 "autosync", "autosync", 1);
806 @ <p>Automatically keeps your work in sync with a centralized server.</p>
807
808 @ <hr>
809 onoff_attribute("Sign all commits with GPG",
810 "clearsign", "clearsign", 1);
811 @ <p>When enabled (the default), fossil will attempt to
812 @ sign all commits with GPG. When disabled, commits will
813 @ be unsigned.</p>
814
815 @ <hr>
816 onoff_attribute("Require local authentication",
817 "localauth", "localauth", 0);
818

Keyboard Shortcuts

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