Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/plugins/printcheck/kcm_printcheck.cpp
Show All 21 Lines | |||||
22 | 22 | | |||
23 | // Qt includes | 23 | // Qt includes | ||
24 | #include <QComboBox> | 24 | #include <QComboBox> | ||
25 | #include <QLayout> | 25 | #include <QLayout> | ||
26 | #include <QGroupBox> | 26 | #include <QGroupBox> | ||
27 | #include <QFrame> | 27 | #include <QFrame> | ||
28 | 28 | | |||
29 | // KDE includes | 29 | // KDE includes | ||
30 | #include <khtml_part.h> | | |||
31 | #include <khtmlview.h> | | |||
32 | #include <kurlrequester.h> | | |||
33 | #include <KPluginFactory> | 30 | #include <KPluginFactory> | ||
34 | 31 | | |||
35 | #include "pluginsettings.h" | 32 | #include "pluginsettings.h" | ||
36 | 33 | | |||
37 | PluginSettingsWidget::PluginSettingsWidget(QWidget* parent) : | 34 | PluginSettingsWidget::PluginSettingsWidget(QWidget* parent) : | ||
38 | QWidget(parent) | 35 | QWidget(parent) | ||
39 | { | 36 | { | ||
40 | setupUi(this); | 37 | setupUi(this); | ||
41 | m_checkTemplatePreviewHTMLPart = new KHTMLPart(m_previewFrame); | 38 | m_checkTemplatePreviewHTMLPart = new QWebEngineView(m_previewFrame); | ||
42 | QVBoxLayout *layout = new QVBoxLayout; | 39 | QVBoxLayout *layout = new QVBoxLayout; | ||
43 | m_previewFrame->setLayout(layout); | 40 | m_previewFrame->setLayout(layout); | ||
44 | layout->addWidget(m_checkTemplatePreviewHTMLPart->view()); | 41 | layout->addWidget(m_checkTemplatePreviewHTMLPart); | ||
45 | 42 | | |||
46 | connect(kcfg_checkTemplateFile, SIGNAL(urlSelected(QUrl)), | 43 | connect(kcfg_checkTemplateFile, SIGNAL(urlSelected(QUrl)), | ||
47 | this, SLOT(urlSelected(QUrl))); | 44 | this, SLOT(urlSelected(QUrl))); | ||
48 | connect(kcfg_checkTemplateFile, SIGNAL(returnPressed(QString)), | 45 | connect(kcfg_checkTemplateFile, SIGNAL(returnPressed(QString)), | ||
49 | this, SLOT(returnPressed(QString))); | 46 | this, SLOT(returnPressed(QString))); | ||
50 | } | 47 | } | ||
51 | 48 | | |||
52 | void PluginSettingsWidget::urlSelected(const QUrl &url) | 49 | void PluginSettingsWidget::urlSelected(const QUrl &url) | ||
53 | { | 50 | { | ||
54 | if (!url.isEmpty()) | 51 | if (!url.isEmpty()) | ||
55 | m_checkTemplatePreviewHTMLPart->openUrl(url); | 52 | m_checkTemplatePreviewHTMLPart->load(url); | ||
56 | } | 53 | } | ||
57 | 54 | | |||
58 | void PluginSettingsWidget::returnPressed(const QString& url) | 55 | void PluginSettingsWidget::returnPressed(const QString& url) | ||
59 | { | 56 | { | ||
60 | if (!url.isEmpty()) | 57 | if (!url.isEmpty()) | ||
61 | m_checkTemplatePreviewHTMLPart->openUrl(QUrl::fromUserInput(url)); | 58 | m_checkTemplatePreviewHTMLPart->load(QUrl::fromUserInput(url)); | ||
62 | } | 59 | } | ||
63 | 60 | | |||
64 | K_PLUGIN_FACTORY_WITH_JSON(KCMPrintCheckFactory, "kcm_kmm_printcheck.json", registerPlugin<KCMPrintCheck>();) | 61 | K_PLUGIN_FACTORY_WITH_JSON(KCMPrintCheckFactory, "kcm_kmm_printcheck.json", registerPlugin<KCMPrintCheck>();) | ||
65 | 62 | | |||
66 | // TODO: port to KF5 | 63 | // TODO: port to KF5 | ||
67 | KCMPrintCheck::KCMPrintCheck(QWidget *parent, const QVariantList& args) : KCModule(0/*KCMPrintCheckFactory::componentData()*/, parent, args) | 64 | KCMPrintCheck::KCMPrintCheck(QWidget *parent, const QVariantList& args) : KCModule(0/*KCMPrintCheckFactory::componentData()*/, parent, args) | ||
68 | { | 65 | { | ||
69 | PluginSettingsWidget* w = new PluginSettingsWidget(this); | 66 | PluginSettingsWidget* w = new PluginSettingsWidget(this); | ||
Show All 13 Lines |