Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 03d535fd authored by Laurent Montel's avatar Laurent Montel 😁

Create detail dialog

parent 0427113c
......@@ -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
......
/*
Copyright (C) 2017 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 "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);
}
/*
Copyright (C) 2017 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 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
......@@ -62,7 +62,6 @@ void MailTrackingWarningWidget::addTracker(const MessageViewer::BlockMailTrackin
if (!isVisible()) {
animatedShow();
}
//show info
}
void MailTrackingWarningWidget::hideAndClear()
......
Markdown is supported
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