refs #894, dot commands help can be obtained via application context

This commit is contained in:
Klaus Basan
2017-03-03 04:58:18 +01:00
committed by Mathew Sutcliffe
parent 5af5ada4d2
commit b287d8d9d7
6 changed files with 24 additions and 0 deletions

View File

@@ -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);

View File

@@ -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

View File

@@ -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

View File

@@ -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:

View File

@@ -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);

View File

@@ -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?