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
461324a2
Commit
461324a2
authored
Jul 17, 2020
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Continue to implement settings
parent
69283e33
Pipeline
#27496
failed with stage
in 60 minutes and 1 second
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
206 additions
and
3 deletions
+206
-3
plugins/messageviewerconfigureplugins/expireaccounttrashfolder/CMakeLists.txt
...rconfigureplugins/expireaccounttrashfolder/CMakeLists.txt
+2
-0
plugins/messageviewerconfigureplugins/expireaccounttrashfolder/autotests/CMakeLists.txt
...plugins/expireaccounttrashfolder/autotests/CMakeLists.txt
+8
-0
plugins/messageviewerconfigureplugins/expireaccounttrashfolder/expireaccounttrashfolderconfigdialog.cpp
...counttrashfolder/expireaccounttrashfolderconfigdialog.cpp
+71
-0
plugins/messageviewerconfigureplugins/expireaccounttrashfolder/expireaccounttrashfolderconfigdialog.h
...accounttrashfolder/expireaccounttrashfolderconfigdialog.h
+38
-0
plugins/messageviewerconfigureplugins/expireaccounttrashfolder/expireaccounttrashfolderconfigplugin.cpp
...counttrashfolder/expireaccounttrashfolderconfigplugin.cpp
+5
-3
plugins/messageviewerconfigureplugins/expireaccounttrashfolder/expireaccounttrashfolderconfigwidget.cpp
...counttrashfolder/expireaccounttrashfolderconfigwidget.cpp
+46
-0
plugins/messageviewerconfigureplugins/expireaccounttrashfolder/expireaccounttrashfolderconfigwidget.h
...accounttrashfolder/expireaccounttrashfolderconfigwidget.h
+36
-0
No files found.
plugins/messageviewerconfigureplugins/expireaccounttrashfolder/CMakeLists.txt
View file @
461324a2
set
(
messageviewer_expireaccounttrashfolderonfigplugin_SRCS
expireaccounttrashfolderconfigplugin.cpp
expireaccounttrashfolderconfigdialog.cpp
expireaccounttrashfolderconfigwidget.cpp
)
kcoreaddons_add_plugin
(
messageviewer_expireaccounttrashfolderconfigplugin JSON messageviewer_expireaccounttrashfolderconfigplugin.json SOURCES
...
...
plugins/messageviewerconfigureplugins/expireaccounttrashfolder/autotests/CMakeLists.txt
View file @
461324a2
macro
(
add_messageviewer_expireaccounttrash_verify_unittest _source
)
get_filename_component
(
_name
${
_source
}
NAME_WE
)
ecm_add_test
(
${
_source
}
TEST_NAME
${
_name
}
NAME_PREFIX
"messageviewer-"
LINK_LIBRARIES KF5::MessageViewer Qt5::Test
)
endmacro
()
plugins/messageviewerconfigureplugins/expireaccounttrashfolder/expireaccounttrashfolderconfigdialog.cpp
0 → 100644
View file @
461324a2
/*
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 "expireaccounttrashfolderconfigdialog.h"
#include "expireaccounttrashfolderconfigwidget.h"
#include <KLocalizedString>
#include <QVBoxLayout>
#include <QDialogButtonBox>
#include <QDialogButtonBox>
#include <KConfigGroup>
#include <KSharedConfig>
namespace
{
static
const
char
myConfigGroupName
[]
=
"ExpireAccountTrashFolderConfigDialog"
;
}
ExpireAccountTrashFolderConfigDialog
::
ExpireAccountTrashFolderConfigDialog
(
QWidget
*
parent
)
:
QDialog
(
parent
)
{
QVBoxLayout
*
mainLayout
=
new
QVBoxLayout
(
this
);
mainLayout
->
setObjectName
(
QStringLiteral
(
"mainLayout"
));
setWindowTitle
(
i18nc
(
"@title:window"
,
"Check and update Gravatar"
));
mExpireAccountTrashFolderConfig
=
new
ExpireAccountTrashFolderConfigWidget
(
this
);
mExpireAccountTrashFolderConfig
->
setObjectName
(
QStringLiteral
(
"mExpireAccountTrashFolderConfig"
));
mainLayout
->
addWidget
(
mExpireAccountTrashFolderConfig
);
QDialogButtonBox
*
buttonBox
=
new
QDialogButtonBox
(
QDialogButtonBox
::
Cancel
|
QDialogButtonBox
::
Ok
,
this
);
buttonBox
->
setObjectName
(
QStringLiteral
(
"buttonbox"
));
connect
(
buttonBox
,
&
QDialogButtonBox
::
rejected
,
this
,
&
ExpireAccountTrashFolderConfigDialog
::
reject
);
mainLayout
->
addWidget
(
buttonBox
);
readConfig
();
}
ExpireAccountTrashFolderConfigDialog
::~
ExpireAccountTrashFolderConfigDialog
()
{
writeConfig
();
}
void
ExpireAccountTrashFolderConfigDialog
::
readConfig
()
{
KConfigGroup
grp
(
KSharedConfig
::
openConfig
(),
myConfigGroupName
);
const
QSize
size
=
grp
.
readEntry
(
"Size"
,
QSize
(
300
,
200
));
if
(
size
.
isValid
())
{
resize
(
size
);
}
}
void
ExpireAccountTrashFolderConfigDialog
::
writeConfig
()
{
KConfigGroup
grp
(
KSharedConfig
::
openConfig
(),
myConfigGroupName
);
grp
.
writeEntry
(
"Size"
,
size
());
grp
.
sync
();
}
plugins/messageviewerconfigureplugins/expireaccounttrashfolder/expireaccounttrashfolderconfigdialog.h
0 → 100644
View file @
461324a2
/*
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 EXPIREACCOUNTTRASHFOLDERCONFIGDIALOG_H
#define EXPIREACCOUNTTRASHFOLDERCONFIGDIALOG_H
#include <QDialog>
class
ExpireAccountTrashFolderConfigWidget
;
class
ExpireAccountTrashFolderConfigDialog
:
public
QDialog
{
Q_OBJECT
public:
explicit
ExpireAccountTrashFolderConfigDialog
(
QWidget
*
parent
=
nullptr
);
~
ExpireAccountTrashFolderConfigDialog
();
private:
void
writeConfig
();
void
readConfig
();
ExpireAccountTrashFolderConfigWidget
*
mExpireAccountTrashFolderConfig
=
nullptr
;
};
#endif // EXPIREACCOUNTTRASHFOLDERCONFIGDIALOG_H
plugins/messageviewerconfigureplugins/expireaccounttrashfolder/expireaccounttrashfolderconfigplugin.cpp
View file @
461324a2
...
...
@@ -18,7 +18,9 @@
*/
#include "expireaccounttrashfolderconfigplugin.h"
#include "expireaccounttrashfolderconfigdialog.h"
#include <KPluginFactory>
#include <QPointer>
K_PLUGIN_CLASS_WITH_JSON
(
ExpireAccountTrashFolderConfigPlugin
,
"messageviewer_expireaccounttrashfolderconfigplugin.json"
)
...
...
@@ -33,9 +35,9 @@ ExpireAccountTrashFolderConfigPlugin::~ExpireAccountTrashFolderConfigPlugin()
void
ExpireAccountTrashFolderConfigPlugin
::
showConfigureDialog
(
QWidget
*
parent
)
{
//
QPointer<ExpireAccountTrashFolderConfig
Plugin
Dialog> dlg = new ExpireAccountTrashFolderConfig
Plugin
Dialog(parent);
//
dlg->exec();
//
delete dlg;
QPointer
<
ExpireAccountTrashFolderConfigDialog
>
dlg
=
new
ExpireAccountTrashFolderConfigDialog
(
parent
);
dlg
->
exec
();
delete
dlg
;
}
#include "expireaccounttrashfolderconfigplugin.moc"
plugins/messageviewerconfigureplugins/expireaccounttrashfolder/expireaccounttrashfolderconfigwidget.cpp
0 → 100644
View file @
461324a2
/*
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 "expireaccounttrashfolderconfigwidget.h"
#include <QVBoxLayout>
ExpireAccountTrashFolderConfigWidget
::
ExpireAccountTrashFolderConfigWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
{
QVBoxLayout
*
mainLayout
=
new
QVBoxLayout
(
this
);
mainLayout
->
setObjectName
(
QStringLiteral
(
"mainLayout"
));
mainLayout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
//TODO
}
ExpireAccountTrashFolderConfigWidget
::~
ExpireAccountTrashFolderConfigWidget
()
{
}
void
ExpireAccountTrashFolderConfigWidget
::
save
()
{
//TODO
}
void
ExpireAccountTrashFolderConfigWidget
::
init
()
{
//TODO
}
plugins/messageviewerconfigureplugins/expireaccounttrashfolder/expireaccounttrashfolderconfigwidget.h
0 → 100644
View file @
461324a2
/*
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 EXPIREACCOUNTTRASHFOLDERCONFIGWIDGET_H
#define EXPIREACCOUNTTRASHFOLDERCONFIGWIDGET_H
#include <QWidget>
class
ExpireAccountTrashFolderConfigWidget
:
public
QWidget
{
Q_OBJECT
public:
explicit
ExpireAccountTrashFolderConfigWidget
(
QWidget
*
parent
=
nullptr
);
~
ExpireAccountTrashFolderConfigWidget
();
void
save
();
private:
void
init
();
};
#endif // EXPIREACCOUNTTRASHFOLDERCONFIGWIDGET_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