Commit 2f2ff89f authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add warning widget about submitted form

parent 9597ca21
......@@ -80,6 +80,7 @@ set(libmessageviewer_widgets_SRCS
widgets/invitationsettings.cpp
widgets/openattachmentfolderwidget.cpp
widgets/mailsourceviewtextbrowserwidget.cpp
widgets/submittedformwarningwidget.cpp
)
set(libmessageviewer_widgets_webengine_SRCS
......
......@@ -120,11 +120,11 @@
#include <WebEngineViewer/FindBarWebEngineView>
#include "viewer/webengine/mailwebengineview.h"
#include <QWebEngineSettings>
#include "htmlwriter/webengineparthtmlwriter.h"
#include <widgets/mailsourcewebengineviewer.h>
#include <WebEngineViewer/WebHitTestResult>
#include "header/headerstylemenumanager.h"
#include "widgets/submittedformwarningwidget.h"
#include <MimeTreeParser/BodyPart>
#include <MimeTreeParser/HtmlWriter>
......@@ -142,6 +142,7 @@
#include <KJobWidgets/KJobWidgets>
#include <QApplication>
#include <QStandardPaths>
#include <QWebEngineSettings>
#include <header/headerstyleplugin.h>
#include <viewerplugins/viewerplugininterface.h>
#include <WebEngineViewer/ZoomActionMenu>
......@@ -1487,6 +1488,10 @@ void ViewerPrivate::createWidgets()
mColorBar->setObjectName(QStringLiteral("mColorBar"));
mColorBar->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
mSubmittedFormWarning = new SubmittedFormWarningWidget(readerBox);
mSubmittedFormWarning->setObjectName(QStringLiteral("submittedformwarning"));
readerBoxVBoxLayout->addWidget(mSubmittedFormWarning);
mScamDetectionWarning = new ScamDetectionWarningWidget(readerBox);
mScamDetectionWarning->setObjectName(QStringLiteral("scandetectionwarning"));
readerBoxVBoxLayout->addWidget(mScamDetectionWarning);
......@@ -3010,7 +3015,7 @@ void ViewerPrivate::slotAddToWhiteList()
void ViewerPrivate::slotFormSubmittedForbidden()
{
//TODO
mSubmittedFormWarning->slotShowWarning();
}
void ViewerPrivate::addHelpTextAction(QAction *act, const QString &text)
......
......@@ -91,6 +91,7 @@ class OpenAttachmentFolderWidget;
class HeaderStyleMenuManager;
class ViewerPluginToolManager;
class ViewerPluginInterface;
class SubmittedFormWarningWidget;
/**
\brief Private class for the Viewer, the main widget in the messageviewer library.
......@@ -670,6 +671,7 @@ public:
MessageViewer::ScamDetectionWarningWidget *mScamDetectionWarning;
MessageViewer::OpenAttachmentFolderWidget *mOpenAttachmentFolderWidget;
MessageViewer::SubmittedFormWarningWidget *mSubmittedFormWarning;
KPIMTextEdit::TextToSpeechWidget *mTextToSpeechWidget;
Viewer::DisplayFormatMessage mDisplayFormatMessageOverwrite;
KPIMTextEdit::SlideContainer *mSliderContainer;
......
/*
Copyright (c) 2016 Montel Laurent <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 "submittedformwarningwidget.h"
#include <KLocalizedString>
#include <QAction>
using namespace MessageViewer;
SubmittedFormWarningWidget::SubmittedFormWarningWidget(QWidget *parent)
: KMessageWidget(parent)
{
setVisible(false);
setCloseButtonVisible(true);
setMessageType(Warning);
setWordWrap(true);
setText(i18n("Submit form is not allowed in mailer. Please open url in a browser."));
}
SubmittedFormWarningWidget::~SubmittedFormWarningWidget()
{
}
void SubmittedFormWarningWidget::slotShowWarning()
{
animatedShow();
}
/*
Copyright (c) 2016 Montel Laurent <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 SUBMITTEDFORMWARNINGWIDGET_H
#define SUBMITTEDFORMWARNINGWIDGET_H
#include "messageviewer_export.h"
#include <KMessageWidget>
namespace MessageViewer
{
class SubmittedFormWarningWidgetPrivate;
class MESSAGEVIEWER_EXPORT SubmittedFormWarningWidget : public KMessageWidget
{
Q_OBJECT
public:
explicit SubmittedFormWarningWidget(QWidget *parent = Q_NULLPTR);
~SubmittedFormWarningWidget();
public Q_SLOTS:
void slotShowWarning();
};
}
#endif // SUBMITTEDFORMWARNINGWIDGET_H
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment