Several fixes related to the network state and applet messages/notifications.

Authored by Antonio Larrosa <antonio.larrosa@gmail.com> on Mar 18 2019, 5:00 PM.

Description

Several fixes related to the network state and applet messages/notifications.

Summary:
Hide actions that can't be taken if the system doesn't have a network
connection.

Add its own messageChanged NOTIFY signal to the message property

The message property also changes when the network state changes, not only
when isActiveChanged is emitted, so let's create its own signal that is
emitted in both cases.

Delay PkUpdates::checkUpdates calls if the network state is offline

If PkUpdates::checkUpdates is called and the network state is offline,
delay the check for updates until the network is online again.

This fixes the problem that when the user logs in, the applet is run
and just after the PkUpdates object is created, checkUpdates is called
(from main itself). But at that point the user might have not entered
the wifi password so the check would fail. Now, if we detect there's
no network, we just delay the check until the network state is online.

Note that some of these fixes may also need either one or more of the following
fixes depending on your system:

https://gitlab.gnome.org/GNOME/glib/merge_requests/719
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/138
https://github.com/hughsie/PackageKit-Qt/pull/30

Test Plan:
Reboot a laptop with no network connection. The applet showed
network failure notifications before the commits but not after them.
Also, connect and disconnect and check the applet contents. Before the
commits are applied the applet contained options that make no sense without
network. After the commits are applied it just shows a "Network is offline"
message which makes more sense.

Reviewers: jgrulich

Reviewed By: jgrulich

Differential Revision: https://phabricator.kde.org/D19862

Details

Committed
Antonio Larrosa <antonio.larrosa@gmail.com>Mar 21 2019, 3:16 PM
Reviewer
jgrulich
Differential Revision
D19862: Several fixes related to the network state and applet messages/notifications.
Parents
R623:fb786c99f977: SVN_SILENT made messages (.desktop file) - always resolve ours
Branches
Unknown
Tags
Unknown
Antonio Larrosa <antonio.larrosa@gmail.com> committed R623:1acf9fc8a642: Several fixes related to the network state and applet messages/notifications. (authored by Antonio Larrosa <antonio.larrosa@gmail.com>).Mar 21 2019, 3:16 PM