Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KDE PIM Add-ons
Commits
7f90a655
Commit
7f90a655
authored
Sep 24, 2020
by
Laurent Montel
😁
Browse files
Add messagebox
parent
b9314792
Changes
4
Hide whitespace changes
Inline
Side-by-side
plugins/messageviewerconfigureplugins/foldersettings/folderconfiguresettingsgeneralwidget.cpp
View file @
7f90a655
...
...
@@ -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"
));
...
...
plugins/messageviewerconfigureplugins/foldersettings/folderconfiguresettingspagewidget.cpp
View file @
7f90a655
...
...
@@ -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
}
}
}
plugins/messageviewerconfigureplugins/foldersettings/foldersettingfilterproxymodel.cpp
View file @
7f90a655
...
...
@@ -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;
}
}
...
...
plugins/messageviewerconfigureplugins/foldersettings/foldersettingfilterproxymodel.h
View file @
7f90a655
...
...
@@ -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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment