-
-
Notifications
You must be signed in to change notification settings - Fork 78
Expand file tree
/
Copy pathPluginWebBrowser.cpp
More file actions
93 lines (79 loc) · 2.29 KB
/
PluginWebBrowser.cpp
File metadata and controls
93 lines (79 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
// Author: Kang Lin <kl222@126.com>
#include <QWebEngineProfile>
#include <QLoggingCategory>
#include "PluginWebBrowser.h"
#include "OperateWebBrowser.h"
static Q_LOGGING_CATEGORY(log, "WebBrowser.Plugin")
CPluginWebBrowser::CPluginWebBrowser(QObject *parent)
: CPlugin(parent)
{
qDebug(log) << Q_FUNC_INFO;
}
CPluginWebBrowser::~CPluginWebBrowser()
{
qDebug(log) << Q_FUNC_INFO;
}
const CPluginWebBrowser::TYPE CPluginWebBrowser::Type() const
{
return TYPE::Tools;
}
const QString CPluginWebBrowser::Protocol() const
{
return QString();
}
const QString CPluginWebBrowser::Name() const
{
return "WebBrowser";
}
const QString CPluginWebBrowser::DisplayName() const
{
return tr("Web browser") + tr("(Experimental)");
}
const QString CPluginWebBrowser::Description() const
{
return tr("Web browser: Browsing the web") + tr("(Experimental)");
}
const QString CPluginWebBrowser::Version() const
{
return PluginWebBrowser_VERSION;
}
const QIcon CPluginWebBrowser::Icon() const
{
return QIcon::fromTheme("web-browser");
}
COperate *CPluginWebBrowser::OnCreateOperate(const QString &szId)
{
if(Id() == szId)
return new COperateWebBrowser(this);
return nullptr;
}
const QString CPluginWebBrowser::Details() const
{
QString szDetails;
#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)
szDetails += "- QWebEngine" + QString("\n");
szDetails += " - " + tr("version:") + " " + qWebEngineVersion() + "\n";
#if QT_VERSION >= QT_VERSION_CHECK(6, 8, 0)
szDetails += " - " + tr("Process name:") + " " + qWebEngineProcessName() + "\n";
#endif
szDetails += " - " + tr("Chromium:") + "\n";
szDetails += " - " + tr("version:") + " " + qWebEngineChromiumVersion() + "\n";
#endif
#if QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)
szDetails += " - " + tr("Security patch version:") + " " + qWebEngineChromiumSecurityPatchVersion() + "\n";
#endif
return szDetails;
}
QWidget* CPluginWebBrowser::GetSettingsWidget(QWidget* parent)
{
//TODO: Add set global parameters
return nullptr;
QWidget* pSetting = new QWidget(parent);
if(pSetting)
pSetting->setWindowTitle(tr("Set Web Wrowser"));
return pSetting;
}
COperate* CPluginWebBrowser::CreateOperate(const QString &szId, CParameterPlugin *para)
{
return CPlugin::CreateOperate(szId, para);
}