DB watchdog also emits URL in signal (allows to display the failed URL)

This commit is contained in:
Klaus Basan
2018-04-02 02:21:53 +02:00
parent 0b4637054a
commit b6b37c9c0f
6 changed files with 27 additions and 15 deletions

View File

@@ -38,9 +38,9 @@ namespace BlackGui
m_timer.setObjectName("CInfoBarWebReadersStatusBase::CheckSwiftDbTimer");
bool c = connect(&m_timer, &QTimer::timeout, this, &CInfoBarWebReadersStatusBase::checkServerAndData);
Q_ASSERT_X(c, Q_FUNC_INFO, "Failed connect");
c = connect(sGui, &CGuiApplication::changedInternetAccessibility, this, &CInfoBarWebReadersStatusBase::accessibilityChanged);
c = connect(sGui, &CGuiApplication::changedInternetAccessibility, this, &CInfoBarWebReadersStatusBase::networkAccessibilityChanged);
Q_ASSERT_X(c, Q_FUNC_INFO, "Failed connect");
c = connect(sGui, &CGuiApplication::changedSwiftDbAccessibility, this, &CInfoBarWebReadersStatusBase::accessibilityChanged);
c = connect(sGui, &CGuiApplication::changedSwiftDbAccessibility, this, &CInfoBarWebReadersStatusBase::dbAccessibilityChanged);
Q_ASSERT_X(c, Q_FUNC_INFO, "Failed connect");
if (sGui->hasWebDataServices())
@@ -85,12 +85,19 @@ namespace BlackGui
if (!leds.isEmpty()) { this->setLedReadStates(leds, readState); }
}
void CInfoBarWebReadersStatusBase::accessibilityChanged(bool accessible)
void CInfoBarWebReadersStatusBase::networkAccessibilityChanged(bool accessible)
{
Q_UNUSED(accessible);
this->checkServerAndData();
}
void CInfoBarWebReadersStatusBase::dbAccessibilityChanged(bool accessible, const CUrl &testedUrl)
{
Q_UNUSED(accessible);
Q_UNUSED(testedUrl);
this->checkServerAndData();
}
void CInfoBarWebReadersStatusBase::checkServerAndData()
{
const bool swift = sGui && sGui->isSwiftDbAccessible();

View File

@@ -14,6 +14,7 @@
#include "blackgui/blackguiexport.h"
#include "blackgui/led.h"
#include "blackmisc/network/url.h"
#include "blackmisc/network/entityflags.h"
#include <QFrame>
@@ -72,8 +73,11 @@ namespace BlackGui
//! Data have been read
void dataRead(BlackMisc::Network::CEntityFlags::Entity entities, BlackMisc::Network::CEntityFlags::ReadState readState, int count);
//! DB or network accessibility changed
void accessibilityChanged(bool accessible);
//! Network accessibility changed
void networkAccessibilityChanged(bool accessible);
//! DB accessibility changed
void dbAccessibilityChanged(bool accessible, const BlackMisc::Network::CUrl &testedUrl);
//! Check server status
void checkServerAndData();