summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-12-15 13:32:51 +0100
committerMontel Laurent <[email protected]>2017-12-15 13:32:51 +0100
commit03d535fdb3dd82161c3d5769c892bd4fd868d40c (patch)
tree18b2d5c9030ad52eb1fac0999a070f8375de34d4
parent0427113c2247f4282a2210db50a7ec3051225ccf (diff)
Create detail dialog
-rw-r--r--messageviewer/src/CMakeLists.txt1
-rw-r--r--messageviewer/src/widgets/mailtrackingdetailsdialog.cpp74
-rw-r--r--messageviewer/src/widgets/mailtrackingdetailsdialog.h47
-rw-r--r--messageviewer/src/widgets/mailtrackingwarningwidget.cpp1
4 files changed, 122 insertions, 1 deletions
diff --git a/messageviewer/src/CMakeLists.txt b/messageviewer/src/CMakeLists.txt
index c39083f..c522f86 100644
--- a/messageviewer/src/CMakeLists.txt
+++ b/messageviewer/src/CMakeLists.txt
@@ -85,6 +85,7 @@ set(libmessageviewer_widgets_SRCS
widgets/mailsourceviewtextbrowserwidget.cpp
widgets/submittedformwarningwidget.cpp
widgets/mailtrackingwarningwidget.cpp
+ widgets/mailtrackingdetailsdialog.cpp
)
set(libmessageviewer_widgets_webengine_SRCS
diff --git a/messageviewer/src/widgets/mailtrackingdetailsdialog.cpp b/messageviewer/src/widgets/mailtrackingdetailsdialog.cpp
new file mode 100644
index 0000000..e60d86d
--- /dev/null
+++ b/messageviewer/src/widgets/mailtrackingdetailsdialog.cpp
@@ -0,0 +1,74 @@
+/*
+ Copyright (C) 2017 Laurent Montel <[email protected]>
+
+ 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 "mailtrackingdetailsdialog.h"
+#include <QVBoxLayout>
+#include <KLocalizedString>
+#include <QDialogButtonBox>
+#include <KConfigGroup>
+#include <KSharedConfig>
+#include <KPIMTextEdit/RichTextEditorWidget>
+
+using namespace MessageViewer;
+MailTrackingDetailsDialog::MailTrackingDetailsDialog(QWidget *parent)
+ : QDialog(parent)
+{
+ setWindowTitle(i18n("Details"));
+ setAttribute(Qt::WA_DeleteOnClose);
+ setModal(false);
+
+ QVBoxLayout *mainLayout = new QVBoxLayout(this);
+ mainLayout->setObjectName(QStringLiteral("mainLayout"));
+
+ QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, this);
+ buttonBox->setObjectName(QStringLiteral("buttonbox"));
+
+ mDetails = new KPIMTextEdit::RichTextEditorWidget(this);
+ mDetails->setObjectName(QStringLiteral("detail"));
+ mainLayout->addWidget(mDetails);
+ mainLayout->addWidget(buttonBox);
+ mDetails->setReadOnly(true);
+ readConfig();
+}
+
+MailTrackingDetailsDialog::~MailTrackingDetailsDialog()
+{
+ writeConfig();
+}
+
+void MailTrackingDetailsDialog::readConfig()
+{
+ KConfigGroup group(KSharedConfig::openConfig(), "MailTrackingDetailsDialog");
+ const QSize size = group.readEntry("Size", QSize(600, 400));
+ if (size.isValid()) {
+ resize(size);
+ }
+}
+
+void MailTrackingDetailsDialog::writeConfig()
+{
+ KConfigGroup group(KSharedConfig::openConfig(), "MailTrackingDetailsDialog");
+ group.writeEntry("Size", size());
+ group.sync();
+}
+
+void MailTrackingDetailsDialog::setDetails(const QString &details)
+{
+ mDetails->setHtml(details);
+}
diff --git a/messageviewer/src/widgets/mailtrackingdetailsdialog.h b/messageviewer/src/widgets/mailtrackingdetailsdialog.h
new file mode 100644
index 0000000..5680a94
--- /dev/null
+++ b/messageviewer/src/widgets/mailtrackingdetailsdialog.h
@@ -0,0 +1,47 @@
+/*
+ Copyright (C) 2017 Laurent Montel <[email protected]>
+
+ 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 MAILTRACKINGDETAILSDIALOG_H
+#define MAILTRACKINGDETAILSDIALOG_H
+
+#include <QDialog>
+
+namespace KPIMTextEdit
+{
+class RichTextEditorWidget;
+}
+
+namespace MessageViewer {
+class MailTrackingDetailsDialog : public QDialog
+{
+ Q_OBJECT
+public:
+ explicit MailTrackingDetailsDialog(QWidget *parent = nullptr);
+ ~MailTrackingDetailsDialog();
+
+ void setDetails(const QString &details);
+private:
+ void writeConfig();
+ void readConfig();
+
+ KPIMTextEdit::RichTextEditorWidget *mDetails = nullptr;
+};
+}
+
+#endif // MAILTRACKINGDETAILSDIALOG_H
diff --git a/messageviewer/src/widgets/mailtrackingwarningwidget.cpp b/messageviewer/src/widgets/mailtrackingwarningwidget.cpp
index d1fba2a..24eec92 100644
--- a/messageviewer/src/widgets/mailtrackingwarningwidget.cpp
+++ b/messageviewer/src/widgets/mailtrackingwarningwidget.cpp
@@ -62,7 +62,6 @@ void MailTrackingWarningWidget::addTracker(const MessageViewer::BlockMailTrackin
if (!isVisible()) {
animatedShow();
}
- //show info
}
void MailTrackingWarningWidget::hideAndClear()