Commit 6d41df37 authored by Laurent Montel's avatar Laurent Montel 😁

Use new folderconfiguresettingspagebase

parent 60c2a151
Pipeline #35733 failed with stage
in 99 minutes and 43 seconds
...@@ -9,15 +9,12 @@ ...@@ -9,15 +9,12 @@
#include <QVBoxLayout> #include <QVBoxLayout>
FolderConfigureSettingsGeneralWidget::FolderConfigureSettingsGeneralWidget(QWidget *parent) FolderConfigureSettingsGeneralWidget::FolderConfigureSettingsGeneralWidget(QWidget *parent)
: QWidget(parent) : FolderConfigureSettingsPageBase(parent)
{ {
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainLayout"));
mCollectionGeneralWidget = new MailCommon::CollectionGeneralWidget(this); mCollectionGeneralWidget = new MailCommon::CollectionGeneralWidget(this);
mCollectionGeneralWidget->setObjectName(QStringLiteral("mCollectionGeneralWidget")); mCollectionGeneralWidget->setObjectName(QStringLiteral("mCollectionGeneralWidget"));
mainLayout->addWidget(mCollectionGeneralWidget); addMainWidget(mCollectionGeneralWidget);
mainLayout->addStretch(); mMainLayout->addStretch();
} }
FolderConfigureSettingsGeneralWidget::~FolderConfigureSettingsGeneralWidget() FolderConfigureSettingsGeneralWidget::~FolderConfigureSettingsGeneralWidget()
...@@ -26,5 +23,7 @@ FolderConfigureSettingsGeneralWidget::~FolderConfigureSettingsGeneralWidget() ...@@ -26,5 +23,7 @@ FolderConfigureSettingsGeneralWidget::~FolderConfigureSettingsGeneralWidget()
void FolderConfigureSettingsGeneralWidget::save(Akonadi::Collection &col) void FolderConfigureSettingsGeneralWidget::save(Akonadi::Collection &col)
{ {
mCollectionGeneralWidget->save(col); if (wasModified()) {
mCollectionGeneralWidget->save(col);
}
} }
...@@ -9,11 +9,12 @@ ...@@ -9,11 +9,12 @@
#include <QWidget> #include <QWidget>
#include "folderconfiguresettings_private_export.h" #include "folderconfiguresettings_private_export.h"
#include "folderconfiguresettingspagebase.h"
#include <AkonadiCore/Collection> #include <AkonadiCore/Collection>
namespace MailCommon { namespace MailCommon {
class CollectionGeneralWidget; class CollectionGeneralWidget;
} }
class LIBFOLDERCONFIGURESETTINGS_TESTS_EXPORT FolderConfigureSettingsGeneralWidget : public QWidget class LIBFOLDERCONFIGURESETTINGS_TESTS_EXPORT FolderConfigureSettingsGeneralWidget : public FolderConfigureSettingsPageBase
{ {
Q_OBJECT Q_OBJECT
public: public:
......
...@@ -19,6 +19,7 @@ FolderConfigureSettingsPageBase::FolderConfigureSettingsPageBase(QWidget *parent ...@@ -19,6 +19,7 @@ FolderConfigureSettingsPageBase::FolderConfigureSettingsPageBase(QWidget *parent
mModifyCheckBox = new QCheckBox(i18n("Modify Settings"), this); mModifyCheckBox = new QCheckBox(i18n("Modify Settings"), this);
mModifyCheckBox->setObjectName(QStringLiteral("mModifiedCheckBox")); mModifyCheckBox->setObjectName(QStringLiteral("mModifiedCheckBox"));
mModifyCheckBox->setChecked(false); mModifyCheckBox->setChecked(false);
mMainLayout->addWidget(mModifyCheckBox);
connect(mModifyCheckBox, &QCheckBox::clicked, this, &FolderConfigureSettingsPageBase::slotModifyClicked); connect(mModifyCheckBox, &QCheckBox::clicked, this, &FolderConfigureSettingsPageBase::slotModifyClicked);
} }
......
...@@ -9,14 +9,11 @@ ...@@ -9,14 +9,11 @@
#include <QVBoxLayout> #include <QVBoxLayout>
FolderConfigureSettingsTemplateWidget::FolderConfigureSettingsTemplateWidget(QWidget *parent) FolderConfigureSettingsTemplateWidget::FolderConfigureSettingsTemplateWidget(QWidget *parent)
: QWidget(parent) : FolderConfigureSettingsPageBase(parent)
{ {
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainLayout"));
mainLayout->setContentsMargins(0, 0, 0, 0);
mCollectionTemplateWidget = new MailCommon::CollectionTemplatesWidget(this); mCollectionTemplateWidget = new MailCommon::CollectionTemplatesWidget(this);
mCollectionTemplateWidget->setObjectName(QStringLiteral("mCollectionTemplateWidget")); mCollectionTemplateWidget->setObjectName(QStringLiteral("mCollectionTemplateWidget"));
mainLayout->addWidget(mCollectionTemplateWidget); addMainWidget(mCollectionTemplateWidget);
} }
FolderConfigureSettingsTemplateWidget::~FolderConfigureSettingsTemplateWidget() FolderConfigureSettingsTemplateWidget::~FolderConfigureSettingsTemplateWidget()
...@@ -25,5 +22,7 @@ FolderConfigureSettingsTemplateWidget::~FolderConfigureSettingsTemplateWidget() ...@@ -25,5 +22,7 @@ FolderConfigureSettingsTemplateWidget::~FolderConfigureSettingsTemplateWidget()
void FolderConfigureSettingsTemplateWidget::save(Akonadi::Collection &col) void FolderConfigureSettingsTemplateWidget::save(Akonadi::Collection &col)
{ {
mCollectionTemplateWidget->save(col); if (wasModified()) {
mCollectionTemplateWidget->save(col);
}
} }
...@@ -7,12 +7,14 @@ ...@@ -7,12 +7,14 @@
#ifndef FOLDERCONFIGURESETTINGSTEMPLATEWIDGET_H #ifndef FOLDERCONFIGURESETTINGSTEMPLATEWIDGET_H
#define FOLDERCONFIGURESETTINGSTEMPLATEWIDGET_H #define FOLDERCONFIGURESETTINGSTEMPLATEWIDGET_H
#include "folderconfiguresettingspagebase.h"
#include <QWidget> #include <QWidget>
#include <AkonadiCore/Collection> #include <AkonadiCore/Collection>
namespace MailCommon { namespace MailCommon {
class CollectionTemplatesWidget; class CollectionTemplatesWidget;
} }
class FolderConfigureSettingsTemplateWidget : public QWidget class FolderConfigureSettingsTemplateWidget : public FolderConfigureSettingsPageBase
{ {
Q_OBJECT Q_OBJECT
public: public:
......
...@@ -9,13 +9,11 @@ ...@@ -9,13 +9,11 @@
#include <QVBoxLayout> #include <QVBoxLayout>
FolderConfigureSettingsViewWidget::FolderConfigureSettingsViewWidget(QWidget *parent) FolderConfigureSettingsViewWidget::FolderConfigureSettingsViewWidget(QWidget *parent)
: QWidget(parent) : FolderConfigureSettingsPageBase(parent)
{ {
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainLayout"));
mCollectionViewWidget = new MailCommon::CollectionViewWidget(this); mCollectionViewWidget = new MailCommon::CollectionViewWidget(this);
mCollectionViewWidget->setObjectName(QStringLiteral("mCollectionTemplateWidget")); mCollectionViewWidget->setObjectName(QStringLiteral("mCollectionTemplateWidget"));
mainLayout->addWidget(mCollectionViewWidget); addMainWidget(mCollectionViewWidget);
} }
FolderConfigureSettingsViewWidget::~FolderConfigureSettingsViewWidget() FolderConfigureSettingsViewWidget::~FolderConfigureSettingsViewWidget()
...@@ -24,5 +22,7 @@ FolderConfigureSettingsViewWidget::~FolderConfigureSettingsViewWidget() ...@@ -24,5 +22,7 @@ FolderConfigureSettingsViewWidget::~FolderConfigureSettingsViewWidget()
void FolderConfigureSettingsViewWidget::save(Akonadi::Collection &col) void FolderConfigureSettingsViewWidget::save(Akonadi::Collection &col)
{ {
mCollectionViewWidget->save(col); if (wasModified()) {
mCollectionViewWidget->save(col);
}
} }
...@@ -7,12 +7,14 @@ ...@@ -7,12 +7,14 @@
#ifndef FOLDERCONFIGURESETTINGSVIEWWIDGET_H #ifndef FOLDERCONFIGURESETTINGSVIEWWIDGET_H
#define FOLDERCONFIGURESETTINGSVIEWWIDGET_H #define FOLDERCONFIGURESETTINGSVIEWWIDGET_H
#include "folderconfiguresettingspagebase.h"
#include <QWidget> #include <QWidget>
#include <AkonadiCore/Collection> #include <AkonadiCore/Collection>
namespace MailCommon { namespace MailCommon {
class CollectionViewWidget; class CollectionViewWidget;
} }
class FolderConfigureSettingsViewWidget : public QWidget class FolderConfigureSettingsViewWidget : public FolderConfigureSettingsPageBase
{ {
Q_OBJECT Q_OBJECT
public: public:
......
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