refs #199, featuring proxy to server side DBus signals.

So far we only could send server to proxy side signals, causing inconsistencies between remote and local contexts
This commit is contained in:
Klaus Basan
2014-04-08 17:24:45 +02:00
parent 760376d848
commit 60fc8b7074
6 changed files with 95 additions and 5 deletions

View File

@@ -26,12 +26,20 @@ namespace BlackCore
*/
void CContextApplicationProxy::relaySignals(const QString &serviceName, QDBusConnection &connection)
{
// signals originating from impl side
connection.connect(serviceName, IContextApplication::ObjectPath(), IContextApplication::InterfaceName(),
"statusMessage", this, SIGNAL(statusMessage(BlackMisc::CStatusMessage)));
connection.connect(serviceName, IContextApplication::ObjectPath(), IContextApplication::InterfaceName(),
"widgetGuiStarting", this, SIGNAL(widgetGuiStarting()));
"statusMessages", this, SIGNAL(statusMessages(BlackMisc::CStatusMessageList)));
connection.connect(serviceName, IContextApplication::ObjectPath(), IContextApplication::InterfaceName(),
"widgetGuiTerminating", this, SIGNAL(widgetGuiTerminating()));
"redirectedOutput", this, SIGNAL(redirectedOutput(BlackMisc::CStatusMessage, qint64)));
// 1. No need to connect widgetGuiTerminating, only orginates from Proxy side / or is local
// 2. No need to connect widgetGuiStarting
// signals originating from proxy side
connect(this, &CContextApplicationProxy::widgetGuiStarting, [this] { this->signalFromProxy("widgetGuiStarting");});
connect(this, &CContextApplicationProxy::widgetGuiTerminating, [this] { this->signalFromProxy("widgetGuiTerminating");});
}
/*
@@ -43,4 +51,12 @@ namespace BlackCore
return t;
}
/*
* Signal from proxy
*/
void CContextApplicationProxy::signalFromProxy(const QString &signalName)
{
this->m_dBusInterface->callDBus(QLatin1Literal("signalFromProxy"), signalName);
}
} // namespace