lib/config, lib/model: Tweaks to the auto accept feature
Fix the folder restart behavior (ignore Label), improve the API for that (imho). Also removes the tab switch animation in the settings modal, because annoying. GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4577
This commit is contained in:
committed by
Audrius Butkevicius
parent
445c4edeca
commit
47429d01e8
@@ -10,6 +10,8 @@ import (
|
||||
"encoding/json"
|
||||
"encoding/xml"
|
||||
"fmt"
|
||||
|
||||
"github.com/syncthing/syncthing/lib/util"
|
||||
)
|
||||
|
||||
type WeakHashSelectionMethod int
|
||||
@@ -162,3 +164,17 @@ func (orig OptionsConfiguration) Copy() OptionsConfiguration {
|
||||
copy(c.UnackedNotificationIDs, orig.UnackedNotificationIDs)
|
||||
return c
|
||||
}
|
||||
|
||||
// RequiresRestartOnly returns a copy with only the attributes that require
|
||||
// restart on change.
|
||||
func (orig OptionsConfiguration) RequiresRestartOnly() OptionsConfiguration {
|
||||
copy := orig
|
||||
blank := OptionsConfiguration{}
|
||||
util.CopyMatchingTag(&blank, ©, "restart", func(v string) bool {
|
||||
if len(v) > 0 && v != "true" {
|
||||
panic(fmt.Sprintf(`unexpected tag value: %s. expected untagged or "true"`, v))
|
||||
}
|
||||
return v != "true"
|
||||
})
|
||||
return copy
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user