mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 00:16:51 +08:00
Ref T301, application contexts pings (by re-registering) identifiers again. By that it can be detected if the GUI is crashed
* ping timer in proxy * utility function in timestamp list * adjusted UI component displaying identifiers in core
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
|
||||
using namespace BlackCore;
|
||||
using namespace BlackCore::Context;
|
||||
using namespace BlackGui::Views;
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
@@ -26,11 +27,17 @@ namespace BlackGui
|
||||
QFrame(parent),
|
||||
ui(new Ui::CRegisterComponent)
|
||||
{
|
||||
Q_ASSERT_X(sGui, Q_FUNC_INFO, "Need sGui");
|
||||
Q_ASSERT_X(sGui->getIContextApplication(), Q_FUNC_INFO, "Need application context");
|
||||
|
||||
ui->setupUi(this);
|
||||
connect(sGui->getIContextApplication(), &IContextApplication::registrationChanged, this, &CRegisterComponent::ps_update);
|
||||
ui->tvp_RegisteredComponents->menuAddItems(CIdentifierView::MenuRefresh);
|
||||
|
||||
connect(&m_updateTimer, &QTimer::timeout, this, &CRegisterComponent::update);
|
||||
connect(sGui->getIContextApplication(), &IContextApplication::registrationChanged, this, &CRegisterComponent::update);
|
||||
connect(ui->tvp_RegisteredComponents, &CIdentifierView::requestUpdate, this, &CRegisterComponent::update);
|
||||
|
||||
// timer is there just in case something goes wrong
|
||||
connect(&m_updateTimer, &QTimer::timeout, this, &CRegisterComponent::ps_update);
|
||||
m_updateTimer.setInterval(30 * 1000);
|
||||
m_updateTimer.start();
|
||||
}
|
||||
@@ -38,10 +45,10 @@ namespace BlackGui
|
||||
CRegisterComponent::~CRegisterComponent()
|
||||
{ }
|
||||
|
||||
void CRegisterComponent::ps_update()
|
||||
void CRegisterComponent::update()
|
||||
{
|
||||
// if not supported, do nothing
|
||||
if (!sGui || !sGui->supportsContexts()) { return; }
|
||||
if (!sGui || !sGui->supportsContexts() || sGui->isShuttingDown()) { return; }
|
||||
ui->tvp_RegisteredComponents->updateContainer(sGui->getIContextApplication()->getRegisteredApplications());
|
||||
}
|
||||
} // ns
|
||||
|
||||
@@ -35,15 +35,13 @@ namespace BlackGui
|
||||
//! Destructor
|
||||
virtual ~CRegisterComponent();
|
||||
|
||||
private slots:
|
||||
//! Update data
|
||||
void ps_update();
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::CRegisterComponent> ui;
|
||||
QTimer m_updateTimer;
|
||||
};
|
||||
|
||||
//! Update data
|
||||
void update();
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
|
||||
Reference in New Issue
Block a user