Commit 6343ff7e authored by Laurent Montel's avatar Laurent Montel 😁

Start to reimplement message display settings

parent ddabe31a
......@@ -72,6 +72,7 @@ set(akonadicontact_editor_generalinfo_SRCS
editor/generalinfoeditor/nameeditdialog.cpp
editor/generalinfoeditor/displaynameeditwidget.cpp
editor/generalinfoeditor/akonadicontactselecttypecombobox.cpp
editor/generalinfoeditor/messageformattingwidget.cpp
${akonadicontact_editor_generalinfo_messaging_SRCS}
${akonadicontact_editor_generalinfo_phone_SRCS}
${akonadicontact_editor_generalinfo_web_SRCS}
......
/*
This file is part of Akonadi Contact.
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 "messageformattingwidget.h"
#include <KLocalizedString>
#include <QCheckBox>
#include <QComboBox>
#include <QHBoxLayout>
#include <QLabel>
MessageFormattingWidget::MessageFormattingWidget(QWidget *parent)
: QWidget(parent)
{
QVBoxLayout *topLayout = new QVBoxLayout(this);
topLayout->setMargin(0);
QLabel *label = new QLabel(i18n("Show messages received from this contact as:"), this);
label->setObjectName(QStringLiteral("label"));
topLayout->addWidget(label);
mMailPreferFormatting = new QComboBox(this);
mMailPreferFormatting->setObjectName(QStringLiteral("mMailPreferFormatting"));
topLayout->addWidget(mMailPreferFormatting);
label->setBuddy(mMailPreferFormatting);
const QStringList listFormat {i18n("Default"), i18n("Plain Text"), i18n("HTML")};
mMailPreferFormatting->addItems(listFormat);
mAllowRemoteContent = new QCheckBox(i18n("Allow remote content in received HTML messages"), this);
mAllowRemoteContent->setObjectName(QStringLiteral("mAllowRemoteContent"));
topLayout->addWidget(mAllowRemoteContent);
}
MessageFormattingWidget::~MessageFormattingWidget()
{
}
void MessageFormattingWidget::loadContact(const KContacts::Addressee &contact)
{
}
void MessageFormattingWidget::storeContact(KContacts::Addressee &contact) const
{
}
void MessageFormattingWidget::setReadOnly(bool readOnly)
{
mMailPreferFormatting->setEnabled(!readOnly);
mAllowRemoteContent->setEnabled(!readOnly);
}
/*
This file is part of Akonadi Contact.
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 MESSAGEFORMATTINGWIDGET_H
#define MESSAGEFORMATTINGWIDGET_H
#include <QWidget>
#include <KContacts/Addressee>
class QComboBox;
class QCheckBox;
class MessageFormattingWidget : public QWidget
{
Q_OBJECT
public:
explicit MessageFormattingWidget(QWidget *parent = nullptr);
~MessageFormattingWidget();
void loadContact(const KContacts::Addressee &contact);
void storeContact(KContacts::Addressee &contact) const;
void setReadOnly(bool readOnly);
private:
QComboBox *mMailPreferFormatting;
QCheckBox *mAllowRemoteContent;
};
#endif // MESSAGEFORMATTINGWIDGET_H
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