Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
PIM
KDE PIM Add-ons
Commits
354473f1
Commit
354473f1
authored
Jul 22, 2020
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create own widget
parent
739dd45a
Pipeline
#28005
canceled with stage
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
104 additions
and
29 deletions
+104
-29
plugins/messageviewerconfigureplugins/foldersettings/CMakeLists.txt
...ssageviewerconfigureplugins/foldersettings/CMakeLists.txt
+1
-0
plugins/messageviewerconfigureplugins/foldersettings/folderconfiguresettingswidget.cpp
...eplugins/foldersettings/folderconfiguresettingswidget.cpp
+4
-28
plugins/messageviewerconfigureplugins/foldersettings/folderconfiguresettingswidget.h
...ureplugins/foldersettings/folderconfiguresettingswidget.h
+3
-1
plugins/messageviewerconfigureplugins/foldersettings/folderconfiguretreewidget.cpp
...igureplugins/foldersettings/folderconfiguretreewidget.cpp
+63
-0
plugins/messageviewerconfigureplugins/foldersettings/folderconfiguretreewidget.h
...nfigureplugins/foldersettings/folderconfiguretreewidget.h
+33
-0
No files found.
plugins/messageviewerconfigureplugins/foldersettings/CMakeLists.txt
View file @
354473f1
...
...
@@ -3,6 +3,7 @@ set(messageviewer_folderconfiguresettingsplugin_SRCS
folderconfiguresettingsdialog.cpp
folderconfiguresettingswidget.cpp
foldersettingfilterproxymodel.cpp
folderconfiguretreewidget.cpp
)
kcoreaddons_add_plugin
(
messageviewer_folderconfiguresettingsplugin JSON messageviewer_folderconfiguresettingsplugin.json SOURCES
...
...
plugins/messageviewerconfigureplugins/foldersettings/folderconfiguresettingswidget.cpp
View file @
354473f1
...
...
@@ -18,11 +18,8 @@
*/
#include "folderconfiguresettingswidget.h"
#include "foldersettingfilterproxymodel.h"
#include <KCheckableProxyModel>
#include "folderconfiguretreewidget.h"
#include <QHBoxLayout>
#include <MailCommon/FolderTreeWidget>
#include <MailCommon/FolderTreeView>
FolderConfigureSettingsWidget
::
FolderConfigureSettingsWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
...
...
@@ -30,31 +27,10 @@ FolderConfigureSettingsWidget::FolderConfigureSettingsWidget(QWidget *parent)
QHBoxLayout
*
mainLayout
=
new
QHBoxLayout
(
this
);
mainLayout
->
setObjectName
(
QStringLiteral
(
"mainLayout"
));
mainLayout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
auto
ftw
=
new
MailCommon
::
FolderTreeWidget
(
this
,
nullptr
,
MailCommon
::
FolderTreeWidget
::
TreeViewOptions
(
MailCommon
::
FolderTreeWidget
::
UseDistinctSelectionModel
|
MailCommon
::
FolderTreeWidget
::
HideStatistics
|
MailCommon
::
FolderTreeWidget
::
HideHeaderViewMenu
));
ftw
->
setObjectName
(
QStringLiteral
(
"foldertreewidget"
));
ftw
->
folderTreeView
()
->
setDragEnabled
(
false
);
auto
ftv
=
ftw
->
folderTreeView
();
auto
sourceModel
=
ftv
->
model
();
auto
selectionModel
=
ftw
->
selectionModel
();
auto
checkable
=
new
KCheckableProxyModel
(
this
);
checkable
->
setObjectName
(
QStringLiteral
(
"checkable"
));
checkable
->
setSourceModel
(
sourceModel
);
checkable
->
setSelectionModel
(
selectionModel
);
auto
folderSettingFilterProxyModel
=
new
FolderSettingFilterProxyModel
(
this
);
folderSettingFilterProxyModel
->
setObjectName
(
QStringLiteral
(
"folderSettingFilterProxyModel"
));
folderSettingFilterProxyModel
->
setSourceModel
(
checkable
);
ftv
->
setModel
(
folderSettingFilterProxyModel
);
ftv
->
expandAll
();
mainLayout
->
addWidget
(
ftw
);
mFolderConfigureTreeWidget
=
new
FolderConfigureTreeWidget
(
this
);
mFolderConfigureTreeWidget
->
setObjectName
(
QStringLiteral
(
"mFolderConfigureTreeWidget"
));
mainLayout
->
addWidget
(
mFolderConfigureTreeWidget
);
}
FolderConfigureSettingsWidget
::~
FolderConfigureSettingsWidget
()
...
...
plugins/messageviewerconfigureplugins/foldersettings/folderconfiguresettingswidget.h
View file @
354473f1
...
...
@@ -21,7 +21,7 @@
#define FOLDERCONFIGURESETTINGSWIDGET_H
#include <QWidget>
class
FolderConfigureTreeWidget
;
class
FolderConfigureSettingsWidget
:
public
QWidget
{
Q_OBJECT
...
...
@@ -29,6 +29,8 @@ public:
explicit
FolderConfigureSettingsWidget
(
QWidget
*
parent
=
nullptr
);
~
FolderConfigureSettingsWidget
();
void
save
();
private:
FolderConfigureTreeWidget
*
mFolderConfigureTreeWidget
=
nullptr
;
};
#endif // FOLDERCONFIGURESETTINGSWIDGET_H
plugins/messageviewerconfigureplugins/foldersettings/folderconfiguretreewidget.cpp
0 → 100644
View file @
354473f1
/*
Copyright (C) 2020 Laurent Montel <montel@kde.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This program 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
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "folderconfiguretreewidget.h"
#include "foldersettingfilterproxymodel.h"
#include <QVBoxLayout>
#include <KCheckableProxyModel>
#include <MailCommon/FolderTreeWidget>
#include <MailCommon/FolderTreeView>
FolderConfigureTreeWidget
::
FolderConfigureTreeWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
{
QVBoxLayout
*
mainLayout
=
new
QVBoxLayout
(
this
);
mainLayout
->
setObjectName
(
QStringLiteral
(
"mainLayout"
));
mainLayout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
auto
ftw
=
new
MailCommon
::
FolderTreeWidget
(
this
,
nullptr
,
MailCommon
::
FolderTreeWidget
::
TreeViewOptions
(
MailCommon
::
FolderTreeWidget
::
UseDistinctSelectionModel
|
MailCommon
::
FolderTreeWidget
::
HideStatistics
|
MailCommon
::
FolderTreeWidget
::
HideHeaderViewMenu
));
ftw
->
setObjectName
(
QStringLiteral
(
"foldertreewidget"
));
ftw
->
folderTreeView
()
->
setDragEnabled
(
false
);
auto
ftv
=
ftw
->
folderTreeView
();
auto
sourceModel
=
ftv
->
model
();
auto
selectionModel
=
ftw
->
selectionModel
();
auto
checkable
=
new
KCheckableProxyModel
(
this
);
checkable
->
setObjectName
(
QStringLiteral
(
"checkable"
));
checkable
->
setSourceModel
(
sourceModel
);
checkable
->
setSelectionModel
(
selectionModel
);
auto
folderSettingFilterProxyModel
=
new
FolderSettingFilterProxyModel
(
this
);
folderSettingFilterProxyModel
->
setObjectName
(
QStringLiteral
(
"folderSettingFilterProxyModel"
));
folderSettingFilterProxyModel
->
setSourceModel
(
checkable
);
ftv
->
setModel
(
folderSettingFilterProxyModel
);
ftv
->
expandAll
();
mainLayout
->
addWidget
(
ftw
);
}
FolderConfigureTreeWidget
::~
FolderConfigureTreeWidget
()
{
}
plugins/messageviewerconfigureplugins/foldersettings/folderconfiguretreewidget.h
0 → 100644
View file @
354473f1
/*
Copyright (C) 2020 Laurent Montel <montel@kde.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This program 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
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef FOLDERCONFIGURETREEWIDGET_H
#define FOLDERCONFIGURETREEWIDGET_H
#include <QWidget>
class
FolderConfigureTreeWidget
:
public
QWidget
{
Q_OBJECT
public:
explicit
FolderConfigureTreeWidget
(
QWidget
*
parent
=
nullptr
);
~
FolderConfigureTreeWidget
();
};
#endif // FOLDERCONFIGURETREEWIDGET_H
Write
Preview
Markdown
is supported
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