mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
naughty: Allow to set the message from the presets again.
This was never really supported and is really not what the presets were event meant to be used for. But it worked and `lain` used it.
This commit is contained in:
parent
89c84caee4
commit
21a111d154
1 changed files with 21 additions and 0 deletions
|
@ -570,6 +570,27 @@ function notification:set_timeout(timeout)
|
|||
self:emit_signal("property::timeout", timeout)
|
||||
end
|
||||
|
||||
function notification:get_message()
|
||||
-- This property was called "text" in older versions.
|
||||
-- Some modules like `lain` abused of the presets (they
|
||||
-- had little choice at the time) to set the message on
|
||||
-- an existing popup.
|
||||
local p = rawget(self, "preset") or {}
|
||||
local message = self._private.message or p.message or ""
|
||||
|
||||
if message == "" and p.text and p.text ~= "" then
|
||||
gdebug.deprecate(
|
||||
"Using the preset configuration to set the notification "..
|
||||
"message is not supported. Please use `n.message = 'text'`.",
|
||||
{deprecated_in=5}
|
||||
)
|
||||
|
||||
return p.text
|
||||
end
|
||||
|
||||
return message
|
||||
end
|
||||
|
||||
function notification:set_text(txt)
|
||||
gdebug.deprecate(
|
||||
"The `text` attribute is deprecated, use `message`",
|
||||
|
|
Loading…
Reference in a new issue