Commit Graph

137 Commits

Author SHA1 Message Date
Emmanuel Lepage Vallee 4df8120acb notification: Set the ID earlier.
Otherwise the signals were sent and the widgets created before the ID
was set. This makes some attempt at detecting updated notifications
error prone.
2019-07-09 01:25:00 -04:00
Emmanuel Lepage Vallee a91e2e7378 notification: Fix typos in signal names.
Updating notifications would not work because, among other things,
the signals names had a typo (all of them...).
2019-07-09 01:23:11 -04:00
Emmanuel Lepage Vallee aabbb412fe naughty.action: Fix icon_only.
It could not be specified in the contructor.

Fix #2815
2019-07-07 16:07:37 -04:00
Emmanuel Lepage Vallee 1b4d667b67 doc: Update to the newer doc conventions. 2019-06-08 18:56:08 -04:00
Emmanuel Lepage Vallee 90396f33e7 doc: Tag the callback properties as deprecated.
They exists to comply with the old `naughty.notify` API. They should not
be used for new code.
2019-06-08 18:56:08 -04:00
Emmanuel Lepage Vallee 5261165be4 doc: Add many more examples to naughty.notification
Also document the `test` property as deprecated. It exists because the
older API (`naughty.notify`) had it. It exists on purpose in the
rewrite, it cannot just be removed even if it was never in a release.
2019-06-08 18:56:08 -04:00
Emmanuel Lepage Vallee c47402d002 doc: Add an image for the position of naughty.layout.legacy 2019-06-08 18:56:08 -04:00
Emmanuel Lepage Vallee 9a7a313719 naughty: Destroy the notification when an action is executed.
Whoops, I changed the name of the method at some point and never
updated this instance. It was also not clausing the notification
like people expect.
2019-06-08 18:56:08 -04:00
Emmanuel Lepage Vallee 4aaf6ea730 naughty: Only enable the legacy mode when there is no other handlers.
It was called legacy for a reason, it is meant to be used only when the
rc.lua doesn't have the newer notification section.
2019-06-08 18:56:08 -04:00
Emmanuel Lepage Vallee d956b5411b naughty: Initialize the action `notification` property 2019-06-08 18:56:08 -04:00
Emmanuel Lepage Vallee 4be58fb298 naughty: Add an `icon_only` property to the action object. 2019-06-08 18:56:08 -04:00
Emmanuel Lepage Vallee fded165e41 doc: Document how to select different shapes based on the content. 2019-06-08 18:56:08 -04:00
Emmanuel Lepage Vallee 9acc452b1e naughty: Set an action table even if the notification has none.
Less `if` in the code.
2019-06-08 18:56:08 -04:00
Emmanuel Lepage Vallee 7bf1a276ef naughty: Use cleaner code to update the legacy actions.
The old code surprisingly worked, but reading this again, better
make some changes.
2019-06-08 18:56:08 -04:00
Emmanuel Lepage Vallee 44e9ecdd30 naughty: Add an awful.widget.common based "notification list"
This layout allows to place a list of notifications in a wibar or popup.
2019-06-08 18:56:08 -04:00
Emmanuel Lepage Vallee d8d80ec69a naughty: Add the `awful.popup` based notification `box`
It replaces the legacy box popup.
2019-06-08 18:56:08 -04:00
Emmanuel Lepage Vallee 6e50ee2a41 naughty: Add a shared default widget_template for the notifications.
This will be shared by the notifications stored in a wibox/wibar and the
ones using a popup. It extends the constraint and margins container
to take care of some boilerplate code. While other widgets have their
own public API, those 2 are private since they are not different enough
to warrent a new public module.
2019-06-08 18:56:08 -04:00
Emmanuel Lepage Vallee 5b5a25a57c naughty: Add a background widget.
There is some boilerplate code that make using the widget_template
harder when using the raw `wibox.container.background`. This widget
takes care of it.
2019-06-08 18:56:08 -04:00
Emmanuel Lepage Vallee cf364a7b35 naughty: Add a `message` widget.
It tracks the notification message.
2019-06-08 18:56:08 -04:00
Emmanuel Lepage Vallee f31afd8cb7 naughty: Add an icon widget.
This tracks the notification icon and add some resize strategies.
2019-06-08 18:56:08 -04:00
Emmanuel Lepage Vallee 3592d33b6c naughty: Add a title widget.
It is a normal textbox with some extra boilerplate code. Having this
in a separate widget allows the notification to be defined from rc.lua
without a ton of beautiful options and connect_signal.
2019-06-08 18:56:08 -04:00
Emmanuel Lepage Vallee 916b49bde0 naughty: Add an actionlist widget.
This widget allows to use the actions without all the boilerplate
code associated with managing a list.
2019-06-08 18:56:08 -04:00
Emmanuel Lepage Vallee 90a29f92eb doc: Fix all the property, theme and field types. 2019-06-08 18:14:14 -04:00
Emmanuel Lepage Vallee b4ece0f053 doc: Use an explicit tag for all static functions.
This way their name doesn't get mangle by the broken magic. It will also
eventually allow to `error()` in the template when the implicit
`@function` is used.

This commit also fixes a large number of issues found while
proof-reading everything.
2019-06-08 18:14:13 -04:00
Emmanuel Lepage Vallee 11d7a614d9 doc: Add a constructor stereotype for everything.
This forces the constructor functions to be at the top of the API
documentation rather than in a random position.
2019-06-08 18:13:42 -04:00
Emmanuel Lepage Vallee 63ca0f0d8f doc: Use an explicit @method stereotype for all methods.
ldoc has a magical `@classmod` module type which tries to detect
what is a method and what is a static function. It fails about as
often as it works. This commit makes everything explicit to remove
such issues.

Fixes #2640
Ref #1373
2019-06-08 18:13:42 -04:00
Emmanuel Lepage Vallee f1dceb02f6 doc: Move all popups to a section. 2019-06-08 18:13:42 -04:00
Emmanuel Lepage Vallee 9d0c2200b2 doc: Add a section for the important classes.
The choice is very subjective, but at least they stand out.
2019-06-08 18:13:28 -04:00
Michael Beaumont 9e2a544ba3 naughty: Add position "middle" to center notifications in screen (#2775)
Signed-off-by: Michael Beaumont <mjboamail@gmail.com>
2019-06-08 16:10:14 -04:00
Emmanuel Lepage Vallée 63e7c68b6c
Fix the broken test due to the "soft" merge conflict of two notification pull requests. (#2751)
* naughty.legacy: Fix a regression caused by a prior fix.

The title was only set "later" because it was called too early.

The intended result was to prevent the code from being executed when
there is no leagcy popup, but it had this side effect.

* naughty.dbus: Expose the new "private" methods so they can be tested.

Because it now uses Gio instead of capi.dbus, it isn't possible to
just shim the backend anymore.

* shims: Upgrade the dbus shims to also emulate some Gio behavior.

As usual, it is the most basic version that produces the correct
result. It doesn't try to comply to the real API.
2019-04-15 13:07:53 -04:00
Emmanuel Lepage Vallée dc1f87ef84
Merge pull request #2738 from Elv13/doc_tests_and_notif_p5_1
Split the reviewed groundwork commits from the notification widgets pull request
2019-04-13 12:57:58 -04:00
Emmanuel Lepage Vallée 9163eef01c
Merge pull request #2722 from psychon/dbus-gio-naughty
naughty.dbus: Switch to using Gio for DBus bindings
2019-04-13 12:57:14 -04:00
Emmanuel Lepage Vallee dce1830b89 naughty: Fix a rebase mistake when using actions.
Some older revisions called it `trigger` instead of `invoke`.
Apparently some rebase conflicts introduced the old name in
merged code.

See #2729
2019-04-05 22:20:16 -04:00
Emmanuel Lepage Vallee 1a5685ee45 naughty: Require `naughty.action` by default.
Fixes #2730
2019-04-05 22:16:44 -04:00
Emmanuel Lepage Vallee 97417121ad naughty: Add a property to get all active notifications. 2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee d99f8461ef naughty.legacy: Do not update the text if the notification has no widget
If the notification has been created without a legacy widget, it would
try to update some widgets that have never been created.
2019-04-05 21:06:11 -04:00
Uli Schlachter c2f29b04ee naughty.dbus: Fix inline icon data handling
LGI truncates GVariant bytestring instances at the first embedded \0
byte when using .value for "unwrapping". This commit works around that
problem by avoiding the .value API for accessing the image data [0].

Thanks a lot to Will Dietz for finding this problem and for providing a
preliminary patch fixing the problem. That saved me a lot of time [1].

[0]: https://github.com/pavouk/lgi/pull/223
[1]: eecdeb7d46

Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-03-22 18:08:24 +01:00
Will Dietz 9af1ed9a0f dbus.lua: don't include types, it's magical enough to not need them
(and so we were including "s" capabilities)
2019-03-18 21:16:54 +01:00
Uli Schlachter 047ef30d59 naughty.dbus: Switch to using Gio for DBus bindings
This starts the switch from our own, semi-broken DBus bindings to using
the sane bindings that Gio provides.

Part-of: https://github.com/awesomeWM/awesome/issues/1093
Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-03-18 21:16:54 +01:00
Will Dietz ed0c3ceb2c don't replace 'destroy' in existing notification, set destroy_cb (#2728)
The value passed as `args.destroy` becomes `destroy_cb`,
so use that name when updating an existing notification.

Fixes #2721.
Might also resolve #2692.
2019-03-18 14:03:14 -04:00
Anton Bulakh 8493fd1829
Add forgotten nil-check to `notification.reset_timeout`
When you call `reset_timeout` on a notification with 0 timeout and thus no timer, a nil field error occures.
(can be tested with `awesome-client 'require"naughty".notification{message="TEST",timeout=0}:reset_timeout()'`)
Everywhere else in similar places (even at the beginning of the `reset_timeout`) the `self.timer` field is checked so i guess it was just forgotten there.
2019-03-11 20:45:31 +02:00
Emmanuel Lepage Vallee b0cf594de5 naughty: Set a default reason in `:destroy()`.
Fix #2713
2019-03-03 16:24:17 -05:00
Emmanuel Lepage Vallee 4930978424 naighty: Fix to use the same object using `naugthy.notify{replace_id}`
Fix #2678
2019-03-03 16:24:17 -05:00
Emmanuel Lepage Vallée f049046332
Merge pull request #2696 from alfunx/naughty-legacy-resize-on-update
naughty: Resize notification when setting text
2019-02-24 15:12:35 -05:00
Alphonse Mariya 494474ba0a
naughty: Resize notification when setting text 2019-02-23 18:54:39 +01:00
Emmanuel Lepage Vallee 347d87418b naughty: Always have an id.
Fixes #2678
2019-02-22 11:47:46 -05:00
Daniel Hahler 8072d717cf Fix extra newline with legacy naughty layout
Fixes 9df77e5c76 (commitcomment-32354198).
2019-02-18 08:34:59 +01:00
Emmanuel Lepage Vallée dd3c270819
Print a warning when trying to destroy the same notification multiple time. (#2662)
* notification: Print a warning when destroying more than once.

* doc: Fix a copy paste issue.
2019-02-17 12:36:02 -05:00
Emmanuel Lepage Vallee 7c96a98a0d naughty: Correctly update the content of the legacy popup 2019-02-16 15:49:39 -05:00
Emmanuel Lepage Vallee d859f671a1 naughty: Add hicolor to the default icon path.
Ref #2533
2019-02-16 15:49:39 -05:00