mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 21:15:33 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user