Commit 7f90a655 authored by Laurent Montel's avatar Laurent Montel 😁

Add messagebox

parent b9314792
......@@ -13,7 +13,6 @@ FolderConfigureSettingsGeneralWidget::FolderConfigureSettingsGeneralWidget(QWidg
{
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainLayout"));
mainLayout->setContentsMargins(0, 0, 0, 0);
mCollectionGeneralWidget = new MailCommon::CollectionGeneralWidget(this);
mCollectionGeneralWidget->setObjectName(QStringLiteral("mCollectionGeneralWidget"));
......
......@@ -10,6 +10,7 @@
#include "folderconfiguresettingsviewwidget.h"
#include <MailCommon/CollectionExpiryWidget>
#include <KLocalizedString>
#include <KMessageBox>
#include <QTabWidget>
#include <QVBoxLayout>
......@@ -51,12 +52,15 @@ FolderConfigureSettingsPageWidget::~FolderConfigureSettingsPageWidget()
void FolderConfigureSettingsPageWidget::save(const Akonadi::Collection::List &cols)
{
const MailCommon::CollectionExpirySettings settings = mCollectionExpiryWidget->settings();
for (Akonadi::Collection col : cols) {
mFolderConfigureSettingsGeneralWidget->save(col);
mCollectionExpiryWidget->save(settings, col, true, false); //TODO verify boolean
mFolderConfigureSettingsViewWidget->save(col);
mCollectionTemplateWidget->save(col);
//TODO sync col
if (KMessageBox::Continue ==
KMessageBox::warningContinueCancel(this, i18n("It will override all settings for each selectioned folder. Do you want to continue?"),i18n("Save Folder Settings"))) {
const MailCommon::CollectionExpirySettings settings = mCollectionExpiryWidget->settings();
for (Akonadi::Collection col : cols) {
mFolderConfigureSettingsGeneralWidget->save(col);
mCollectionExpiryWidget->save(settings, col, true, false); //TODO verify boolean
mFolderConfigureSettingsViewWidget->save(col);
mCollectionTemplateWidget->save(col);
//TODO sync col
}
}
}
......@@ -46,10 +46,13 @@ bool FolderSettingFilterProxyModel::setData(const QModelIndex &index, const QVar
if (index.isValid()) {
const Akonadi::Collection collection
= data(index, Akonadi::EntityTreeModel::CollectionRole).value<Akonadi::Collection>();
//mNotificationCollection[collection] = (value == Qt::Checked);
if (value == Qt::Checked) {
mListCollections.append(collection);
} else {
mListCollections.removeAll(collection);
}
qDebug() << " collectionId " << collection.id();
Q_EMIT dataChanged(index, index);
//return true;
}
}
......
......@@ -8,6 +8,7 @@
#define FOLDERSETTINGFILTERPROXYMODEL_H
#include <QSortFilterProxyModel>
#include <AkonadiCore/Collection>
class FolderSettingFilterProxyModel : public QSortFilterProxyModel
{
......@@ -20,6 +21,8 @@ public:
bool setData(const QModelIndex &index, const QVariant &value, int role) override;
Q_REQUIRED_RESULT Qt::ItemFlags flags(const QModelIndex &index) const override;
private:
Akonadi::Collection::List mListCollections;
};
#endif // FOLDERSETTINGFILTERPROXYMODEL_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