Skip to content

Service internet.checker.service

syl edited this page Oct 23, 2020 · 4 revisions

Description

This service checks if your internet connection is still valid. If not it notifies the frontend and shows an error popup where you can try to reconnect.

Functional scheme

API

internet_reacheable (frontend)

Signature

bool internet_reacheable;

Description

This member tells if the internet status is valid.

Example

Rectangle {
    id: app
    visible: !API.app.internet_checker.internet_reacheable
}

retry (backend and frontend)

Signature

Q_INVOKABLE void retry() noexcept;

Description

This function can be called from the frontend. It attemps to check if the connexion status is valid or not. If it succeeds, it sets is_internet_alive Q_PROPERTY to true. Otherwise it sets the property to false.

Example

DefaultButton {
    text: qsTr("Retry")
    onClicked: API.app.internet_checker.retry()
    Layout.alignment: Qt.AlignHCenter
}