#include "PluginFreeRDP.h"
#include "ConnecterFreeRDP.h"
#include "winpr/wlog.h"
#include <QLoggingCategory>
#ifdef HAVE_LIBSSH
#include "ChannelSSHTunnel.h"
#endif
static Q_LOGGING_CATEGORY(log, "FreeRDP.Plugin")
static Q_LOGGING_CATEGORY(LoggerFreeRDP, "FreeRDP.Log")
{
qDebug(log) << Q_FUNC_INFO;
qInfo(log) << "FreeRDP version:" << freerdp_get_version_string()
<< "revision:" << freerdp_get_build_revision();
static wLogCallbacks* pCbLog = new wLogCallbacks;
BOOL bRet = WLog_SetLogAppenderType(WLog_GetRoot(), WLOG_APPENDER_CALLBACK);
if(bRet && pCbLog)
{
memset(pCbLog, 0, sizeof(wLogCallbacks));
pCbLog->message = [](const wLogMessage* msg)->BOOL{
switch(msg->Level)
{
case WLOG_TRACE:
break;
case WLOG_DEBUG:
qDebug(LoggerFreeRDP) << msg->TextString;
break;
case WLOG_INFO:
qInfo(LoggerFreeRDP) << msg->TextString;
break;
case WLOG_WARN:
qWarning(LoggerFreeRDP) << msg->TextString;
case WLOG_ERROR:
qCritical(LoggerFreeRDP) << msg->TextString;
break;
case WLOG_FATAL:
case WLOG_OFF:
qFatal(msg->FormatString, msg->TextString);
break;
default:
break;
}
return TRUE;
};
WLog_ConfigureAppender(WLog_GetLogAppender(WLog_GetRoot()), "callbacks", pCbLog);
}
WLog_SetLogLevel(WLog_GetRoot(), WLOG_TRACE);
}
{
qDebug(log) << Q_FUNC_INFO;
}
{
return "FreeRDP";
}
{
return tr("Free remote desktop");
}
{
return tr("RDP(Windows remote desktop Protocol): Access remote desktops such as windows.");
}
{
return "RDP";
}
const QIcon CPluginFreeRDP::Icon() const
{
return QIcon::fromTheme("windows");
}
{
return PluginFreeDP_VERSION;
}
{
QString szDetails;
szDetails = "- " + tr("FreeRDP");
szDetails += "\n";
szDetails += " - " + tr("version: ");
szDetails += freerdp_get_version_string();
szDetails += "\n";
szDetails += " - " + tr("Build version: ");
szDetails += freerdp_get_build_revision();
szDetails += ":";
szDetails += freerdp_get_build_revision();
szDetails += "\n";
#if FreeRDP_VERSION_MAJOR < 3
szDetails += " - " + tr("Build date: ");
szDetails += freerdp_get_build_date();
szDetails += "\n";
#endif
szDetails += " - ";
szDetails += freerdp_get_build_config();
#ifdef HAVE_LIBSSH
szDetails += channel.GetDetails();
#endif
return szDetails;
}
{
{
}
return nullptr;
}
virtual const QString Id() const
ID. Default: Protocol() + ":" + Name()
virtual const QString DisplayName() const override
The plugin display name.
virtual CConnecter * CreateConnecter(const QString &szId) override
New CConnecter instance.
virtual const QString Version() const override
Version.
virtual const QString Name() const override
[Clean resource]
virtual const QString Description() const override
Plugin description.
virtual const QString Details() const override
Show the plugin depends on the freerdp version.
virtual const QString Protocol() const override
Plugin Protocol.
virtual ~CPluginFreeRDP() override
[Initialize resource]