mirror of
https://github.com/bitcoin-core/gui-qml.git
synced 2026-12-02 07:54:42 +00:00
Brainstorming: Detecting network state #348
Labels
No labels
Android
Bug
Build system
Design suggestion
Doc
Needs design review
Needs rebase
Stage
UX
Up for grabs
Upstream
Wallet
duplicate
enhancement
good first issue
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin-core/gui-qml#348
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
We need to have the ability to detect network state to allow for states such as the following (specified in the design file):
We have two options to go down through, at least with platforms aside from android.
1. Enable the Qt Network API
This gives us access to the QNetworkConfigurationManager class. Here we have access to the following signals and functions that give us the information we need:
It should be noted that with these functions, Qt checks that the computer is connected to any signal, and not if that signal really has an internet connection.
2. Use system specific terminal commands in a Process
For example, on macOS, this could be something like the following:
There should be available commands for macOS, linux, and Windows; but this approach won't work for Android, where we'll just plug into some android api for this information.
cc @johnny9 @hebasto @promag
related: https://github.com/bitcoin-core/gui-qml/issues/324
We can try out the QNetworkInterface class https://doc.qt.io/qt-5/qnetworkinterface.html with the QNetwork module. Qt 6.1 has QNetworkInformation https://doc.qt.io/qt-6/qnetworkinformation.html. I think we should avoid trying to implement platform specific network tests ourselves.
Hi!
We have some limitations for QProcess in some platforms such as Android and iOS.
Have you tried the ping method?
We don't need Qt API or terminal commands, we can use platform specific api's that don't ping any server to know if the device has internet access
Closing as brainstorming is not needed, and we can move discussion into https://github.com/bitcoin-core/gui-qml/issues/324 and subsequent designs on the no internet access state