aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/config.go8
-rw-r--r--config/ui.go26
2 files changed, 28 insertions, 6 deletions
diff --git a/config/config.go b/config/config.go
index 12da665b..2e45b0c8 100644
--- a/config/config.go
+++ b/config/config.go
@@ -183,3 +183,11 @@ func contains(list []string, v string) bool {
}
return false
}
+
+// warning message related to configuration (deprecation, etc.)
+type Warning struct {
+ Title string
+ Body string
+}
+
+var Warnings []Warning
diff --git a/config/ui.go b/config/ui.go
index 752296a3..6c880293 100644
--- a/config/ui.go
+++ b/config/ui.go
@@ -321,24 +321,38 @@ func (config *UIConfig) parse(section *ini.Section) error {
config.MessageViewThisDayTimeFormat = config.TimestampFormat
}
- if config.IndexFormat != "" {
- log.Warnf("%s %s",
- "The index-format setting has been replaced by index-columns.",
- "index-format will be removed in aerc 0.17.")
- }
if key, err := section.GetKey("index-columns"); err == nil {
columns, err := ParseColumnDefs(key, section)
if err != nil {
return err
}
config.IndexColumns = columns
- config.IndexFormat = "" // to silence popup at startup
} else if config.IndexFormat != "" {
columns, err := convertIndexFormat(config.IndexFormat)
if err != nil {
return err
}
config.IndexColumns = columns
+ log.Warnf("%s %s",
+ "The index-format setting has been replaced by index-columns.",
+ "index-format will be removed in aerc 0.17.")
+ w := Warning{
+ Title: "DEPRECATION WARNING: [" + section.Name() + "].index-format",
+ Body: fmt.Sprintf(`
+The index-format setting is deprecated. It has been replaced by index-columns.
+
+Your configuration in this instance was automatically converted to:
+
+[%s]
+%s
+Your configuration file was not changed. To make this change permanent and to
+dismiss this deprecation warning on launch, copy the above lines into aerc.conf
+and remove index-format from it. See aerc-config(5) for more details.
+
+index-format will be removed in aerc 0.17.
+`, section.Name(), ColumnDefsToIni(columns, "index-columns")),
+ }
+ Warnings = append(Warnings, w)
}
if key, err := section.GetKey("tab-title-account"); err == nil {
val := key.Value()