summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-11-17 12:19:30 (GMT)
committerMontel Laurent <montel@kde.org>2016-11-17 12:19:30 (GMT)
commita11336eaf194485c33813082043edf6a13137ca6 (patch)
treed3f86a0cb4016988b1fe91ec50654a45d501cc14
parente358ef84a032813a61642c8ba28921a1eaa84cfe (diff)
Add new test apps
-rw-r--r--webengineviewer/src/checkphishingurl/tests/managelocaldatabasegui.cpp67
-rw-r--r--webengineviewer/src/checkphishingurl/tests/managelocaldatabasegui.h37
2 files changed, 104 insertions, 0 deletions
diff --git a/webengineviewer/src/checkphishingurl/tests/managelocaldatabasegui.cpp b/webengineviewer/src/checkphishingurl/tests/managelocaldatabasegui.cpp
new file mode 100644
index 0000000..03a0c9e
--- /dev/null
+++ b/webengineviewer/src/checkphishingurl/tests/managelocaldatabasegui.cpp
@@ -0,0 +1,67 @@
+/*
+ Copyright (C) 2016 Laurent Montel <montel@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "managelocaldatabasegui.h"
+#include <QStandardPaths>
+#include "../localdatabasemanager.h"
+
+#include <QApplication>
+#include <QStandardPaths>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QTextEdit>
+#include <QLabel>
+#include <QVBoxLayout>
+
+ManageLocalDataBaseGui::ManageLocalDataBaseGui(QWidget *parent)
+ : QWidget(parent)
+{
+ QVBoxLayout *layout = new QVBoxLayout(this);
+
+ mResult = new QTextEdit(this);
+ mResult->setReadOnly(true);
+ mResult->setAcceptRichText(false);
+ layout->addWidget(mResult);
+
+ QPushButton *button = new QPushButton(QStringLiteral("Create Database"), this);
+ connect(button, &QPushButton::clicked, this, &ManageLocalDataBaseGui::slotDownloadFullDatabase);
+ layout->addWidget(button);
+}
+
+ManageLocalDataBaseGui::~ManageLocalDataBaseGui()
+{
+
+}
+
+void ManageLocalDataBaseGui::slotDownloadFullDatabase()
+{
+}
+
+
+int main(int argc, char **argv)
+{
+ QApplication app(argc, argv);
+ QStandardPaths::setTestModeEnabled(true);
+ ManageLocalDataBaseGui *w = new ManageLocalDataBaseGui;
+
+ w->show();
+ app.exec();
+ delete w;
+ return 0;
+}
diff --git a/webengineviewer/src/checkphishingurl/tests/managelocaldatabasegui.h b/webengineviewer/src/checkphishingurl/tests/managelocaldatabasegui.h
new file mode 100644
index 0000000..9ba16be
--- /dev/null
+++ b/webengineviewer/src/checkphishingurl/tests/managelocaldatabasegui.h
@@ -0,0 +1,37 @@
+/*
+ Copyright (C) 2016 Laurent Montel <montel@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef MANAGELOCALDATABASEGUI_H
+#define MANAGELOCALDATABASEGUI_H
+
+#include <QWidget>
+class QTextEdit;
+class ManageLocalDataBaseGui : public QWidget
+{
+ Q_OBJECT
+public:
+ explicit ManageLocalDataBaseGui(QWidget *parent = Q_NULLPTR);
+ ~ManageLocalDataBaseGui();
+private Q_SLOTS:
+ void slotDownloadFullDatabase();
+private:
+ QTextEdit *mResult;
+};
+
+#endif // MANAGELOCALDATABASEGUI_H