7#include <QLoggingCategory>
9#include "PluginClient.h"
10#include "RabbitCommonTools.h"
12static Q_LOGGING_CATEGORY(log,
"Client.Plugin")
19 qDebug(log) <<
"CPluginClient::~CPluginClient()";
21 RabbitCommon::CTools::Instance()->RemoveTranslator(m_Translator);
27 m_Translator = RabbitCommon::CTools::Instance()->InstallTranslator(
29 RabbitCommon::CTools::TranslationType::Plugin,
47const QIcon CPluginClient::Icon()
const
49 return QIcon::fromTheme(
"network-wired");
64 bool bRet = QMetaObject::invokeMethod(
68 Q_RETURN_ARG(
int, nRet));
70 qCritical(log) <<
"Call p->Initial() fail.";
74 qCritical(log) <<
"Connecter initial fail" << nRet;
79 bRet = QMetaObject::invokeMethod(
83 Q_RETURN_ARG(
int, nRet),
86 qCritical(log) <<
"Call p->SetParameterClient(para) fail.";
90 qCritical(log) <<
"SetParameterClient fail" << nRet;
100 qDebug(log) << Q_FUNC_INFO;
105 bRet = QMetaObject::invokeMethod(
108 Qt::DirectConnection,
109 Q_RETURN_ARG(
int, nRet));
111 qCritical(log) <<
"Call p->Clean() fail.";
115 qWarning(log) <<
"Connecter clean fail" << nRet;
The parameters of client.
virtual const QString Details() const
Display more information in About dialog or log.
virtual const QString Id() const
ID. Default: Protocol() + ":" + Name()
virtual const QString DisplayName() const
The plugin display name.
virtual const QString Name() const =0
This name must be the same as the project name (${PROJECT_NAME}). The translation file (${PROJECT_NAM...
virtual Q_INVOKABLE CConnecter * CreateConnecter(const QString &szId, CParameterClient *para)
New CConnecter instance.
Q_INVOKABLE int InitTranslator()
Initialize the translation resource, which is only called by CClient.
virtual const QString Protocol() const =0
Plugin Protocol.
virtual ~CPluginClient()
When the derived class is implemented, the resources are clean are unloaded here.
virtual Q_INVOKABLE int DeleteConnecter(CConnecter *p)
Delete CConnecter.