aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'widgets')
-rw-r--r--widgets/account.go4
-rw-r--r--widgets/aerc.go4
-rw-r--r--widgets/status.go6
3 files changed, 14 insertions, 0 deletions
diff --git a/widgets/account.go b/widgets/account.go
index cdb43cbf..f1360b8f 100644
--- a/widgets/account.go
+++ b/widgets/account.go
@@ -137,6 +137,10 @@ func (acct *AccountView) PushError(err error) {
acct.aerc.PushError(fmt.Sprintf("%s: %v", acct.acct.Name, err))
}
+func (acct *AccountView) PushWarning(warning string) {
+ acct.aerc.PushWarning(fmt.Sprintf("%s: %s", acct.acct.Name, warning))
+}
+
func (acct *AccountView) AccountConfig() *config.AccountConfig {
return acct.acct
}
diff --git a/widgets/aerc.go b/widgets/aerc.go
index 81d07474..aef874b3 100644
--- a/widgets/aerc.go
+++ b/widgets/aerc.go
@@ -542,6 +542,10 @@ func (aerc *Aerc) PushError(text string) *StatusMessage {
return aerc.statusline.PushError(text)
}
+func (aerc *Aerc) PushWarning(text string) *StatusMessage {
+ return aerc.statusline.PushWarning(text)
+}
+
func (aerc *Aerc) PushSuccess(text string) *StatusMessage {
return aerc.statusline.PushSuccess(text)
}
diff --git a/widgets/status.go b/widgets/status.go
index d8d0328a..a6fd5c8f 100644
--- a/widgets/status.go
+++ b/widgets/status.go
@@ -97,6 +97,12 @@ func (status *StatusLine) PushError(text string) *StatusMessage {
return msg
}
+func (status *StatusLine) PushWarning(text string) *StatusMessage {
+ msg := status.Push(text, 10*time.Second)
+ msg.Color(status.uiConfig().GetStyle(config.STYLE_STATUSLINE_WARNING))
+ return msg
+}
+
func (status *StatusLine) PushSuccess(text string) *StatusMessage {
msg := status.Push(text, 10*time.Second)
msg.Color(status.uiConfig().GetStyle(config.STYLE_STATUSLINE_SUCCESS))