mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 07:15:35 +08:00
refs #894, dot commands help can be obtained via application context
This commit is contained in:
committed by
Mathew Sutcliffe
parent
5af5ada4d2
commit
b287d8d9d7
@@ -194,6 +194,10 @@ namespace BlackCore
|
||||
|
||||
//! Remote enabled version of file exists
|
||||
virtual bool existsFile(const QString &fileName) const = 0;
|
||||
|
||||
//! The HTML help for dot commands
|
||||
virtual QString dotCommandsHtmlHelp() const = 0;
|
||||
|
||||
protected:
|
||||
//! Constructor
|
||||
IContextApplication(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime);
|
||||
|
||||
@@ -190,6 +190,13 @@ namespace BlackCore
|
||||
logEmptyContextWarning(Q_FUNC_INFO);
|
||||
return false;
|
||||
}
|
||||
|
||||
//! \copydoc IContextApplication::dotCommandsHtmlHelp
|
||||
virtual QString dotCommandsHtmlHelp() const override
|
||||
{
|
||||
logEmptyContextWarning(Q_FUNC_INFO);
|
||||
return QString();
|
||||
}
|
||||
};
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "blackmisc/loghandler.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "blackmisc/settingscache.h"
|
||||
#include "blackmisc/simplecommandparser.h"
|
||||
|
||||
#include <QFile>
|
||||
#include <QFlags>
|
||||
@@ -201,5 +202,10 @@ namespace BlackCore
|
||||
if (fileName.isEmpty()) return false;
|
||||
return QFile::exists(fileName);
|
||||
}
|
||||
|
||||
QString CContextApplication::dotCommandsHtmlHelp() const
|
||||
{
|
||||
return CSimpleCommandParser::commandsHtmlHelp();
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -67,6 +67,7 @@ namespace BlackCore
|
||||
virtual QString readFromFile(const QString &fileName) const override;
|
||||
virtual bool removeFile(const QString &fileName) override;
|
||||
virtual bool existsFile(const QString &fileName) const override;
|
||||
virtual QString dotCommandsHtmlHelp() const override;
|
||||
//! @}
|
||||
|
||||
protected:
|
||||
|
||||
@@ -181,6 +181,11 @@ namespace BlackCore
|
||||
return this->m_dBusInterface->callDBusRet<bool>(QLatin1String("existsFile"), fileName);
|
||||
}
|
||||
|
||||
QString CContextApplicationProxy::dotCommandsHtmlHelp() const
|
||||
{
|
||||
return this->m_dBusInterface->callDBusRet<QString>(QLatin1String("dotCommandsHtmlHelp"));
|
||||
}
|
||||
|
||||
bool CContextApplicationProxy::isContextResponsive(const QString &dBusAddress, QString &msg, int timeoutMs)
|
||||
{
|
||||
const bool connected = CDBusServer::isDBusAvailable(dBusAddress, msg, timeoutMs);
|
||||
|
||||
@@ -72,6 +72,7 @@ namespace BlackCore
|
||||
virtual QString readFromFile(const QString &fileName) const override;
|
||||
virtual bool removeFile(const QString &fileName) override;
|
||||
virtual bool existsFile(const QString &fileName) const override;
|
||||
virtual QString dotCommandsHtmlHelp() const override;
|
||||
//! @}
|
||||
|
||||
//! Used to test if there is a core running?
|
||||
|
||||
Reference in New Issue
Block a user