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

Authored by antlarr on Mar 18 2019, 5:30 PM.



Hide actions that can't be taken if the system doesn't have a network

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:

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.

Diff Detail

R623 Plasma PackageKit Updater
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
antlarr requested review of this revision.Mar 18 2019, 5:30 PM
antlarr created this revision.
jgrulich accepted this revision.Mar 21 2019, 1:47 PM

Looks good to me. Thanks.

This revision is now accepted and ready to land.Mar 21 2019, 1:47 PM
This revision was automatically updated to reflect the committed changes.