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
c845aa5b
Commit
c845aa5b
authored
Feb 19, 2021
by
Laurent Montel
😁
Browse files
Reactivate code
parent
6dc764fb
Changes
8
Hide whitespace changes
Inline
Side-by-side
kmail/plugins/mailmergeplugin/CMakeLists.txt
View file @
c845aa5b
set
(
kmail_mailmergeplugin_SRCS
mailmergedialog.cpp
widgets/addressbookwidget.cpp
widgets/attachmentlistwidget.cpp
widgets/csvwidget.cpp
widgets/mailmergewidget.cpp
widgets/selectattachmentdialog.cpp
)
add_library
(
mailmerge
${
kmail_mailmergeplugin_SRCS
}
)
generate_export_header
(
mailmerge BASE_NAME mailmerge
)
if
(
COMPILE_WITH_UNITY_CMAKE_SUPPORT
)
set_target_properties
(
mailmerge PROPERTIES UNITY_BUILD ON
)
endif
()
target_link_libraries
(
mailmerge
KF5::I18n
KF5::MessageComposer
KF5::KIOWidgets
)
set_target_properties
(
mailmerge
PROPERTIES OUTPUT_NAME mailmerge VERSION
${
KDEPIMADDONS_LIB_VERSION
}
SOVERSION
${
KDEPIMADDONS_LIB_SOVERSION
}
)
#kcoreaddons_add_plugin(kmail_logactivitiesplugin JSON kmail_logactivitiesplugin.json SOURCES
# ${kmail_logactivitiesplugin_SRCS} INSTALL_NAMESPACE kmail/mainview)
#target_link_libraries(kmail_logactivitiesplugin
# KF5::PimCommon KF5::PimCommonAkonadi KF5::XmlGui KF5::Libkdepim KF5::I18n
#)
#if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
# set_target_properties(kmail_logactivitiesplugin PROPERTIES UNITY_BUILD ON)
#endif()
if
(
BUILD_TESTING
)
#add_subdirectory(autotests)
#add_subdirectory(tests)
endif
()
kmail/plugins/mailmergeplugin/widgets/addressbookwidget.cpp
View file @
c845aa5b
...
...
@@ -11,8 +11,8 @@ using namespace MailMerge;
AddressBookWidget
::
AddressBookWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
{
QHBoxLayout
*
hbox
=
new
QHBoxLayout
;
set
Layout
(
hbox
);
QHBoxLayout
*
mainLayout
=
new
QHBoxLayout
(
this
)
;
mainLayout
->
setObjectName
(
QStringLiteral
(
"main
Layout
"
)
);
}
AddressBookWidget
::~
AddressBookWidget
()
...
...
kmail/plugins/mailmergeplugin/widgets/attachmentlistwidget.cpp
View file @
c845aa5b
...
...
@@ -9,6 +9,7 @@
#include <QPointer>
#include <QPushButton>
#include <QUrl>
using
namespace
MailMerge
;
AttachmentListWidget
::
AttachmentListWidget
(
QWidget
*
parent
,
ButtonCode
buttons
,
const
QString
&
addLabel
,
const
QString
&
removeLabel
,
const
QString
&
modifyLabel
)
...
...
@@ -33,7 +34,7 @@ QString AttachmentListWidget::modifyEntry(const QString &text)
{
QString
attachmentPath
;
QPointer
<
SelectAttachmentDialog
>
dlg
=
new
SelectAttachmentDialog
(
this
);
dlg
->
setAttachmentPath
(
text
);
dlg
->
setAttachmentPath
(
QUrl
::
fromLocalFile
(
text
)
)
;
if
(
dlg
->
exec
())
{
attachmentPath
=
dlg
->
attachmentPath
();
}
...
...
kmail/plugins/mailmergeplugin/widgets/attachmentlistwidget.h
View file @
c845aa5b
...
...
@@ -23,7 +23,7 @@ public:
~
AttachmentListWidget
()
override
;
void
addNewEntry
()
override
;
QString
modifyEntry
(
const
QString
&
text
)
override
;
Q_REQUIRED_RESULT
QString
modifyEntry
(
const
QString
&
text
)
override
;
};
}
#endif // ATTACHMENTLISTWIDGET_H
kmail/plugins/mailmergeplugin/widgets/csvwidget.cpp
View file @
c845aa5b
...
...
@@ -16,14 +16,14 @@ using namespace MailMerge;
CsvWidget
::
CsvWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
{
QVBoxLayout
*
csvWidgetLayout
=
new
QVBoxLayout
;
csvWidgetLayout
->
set
ContentsMargins
(
0
,
0
,
0
,
0
);
setLayout
(
csvWidgetLayout
);
QVBoxLayout
*
csvWidgetLayout
=
new
QVBoxLayout
(
this
)
;
csvWidgetLayout
->
set
ObjectName
(
QStringLiteral
(
"csvWidgetLayout"
)
);
csvWidgetLayout
->
setContentsMargins
({}
);
QLabel
*
lab
=
new
QLabel
(
i18n
(
"Path:"
));
QLabel
*
lab
=
new
QLabel
(
i18n
(
"Path:"
)
,
this
);
lab
->
setObjectName
(
QStringLiteral
(
"label"
));
csvWidgetLayout
->
addWidget
(
lab
);
mCvsUrlRequester
=
new
KUrlRequester
;
mCvsUrlRequester
=
new
KUrlRequester
(
this
)
;
mCvsUrlRequester
->
setObjectName
(
QStringLiteral
(
"cvsurlrequester"
));
csvWidgetLayout
->
addWidget
(
mCvsUrlRequester
);
}
...
...
kmail/plugins/mailmergeplugin/widgets/mailmergewidget.cpp
View file @
c845aa5b
...
...
@@ -23,16 +23,15 @@ using namespace MailMerge;
MailMergeWidget
::
MailMergeWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
{
QVBoxLayout
*
vbox
=
new
QVBoxLayout
;
setLayout
(
vbox
);
QVBoxLayout
*
vbox
=
new
QVBoxLayout
(
this
);
QHBoxLayout
*
hbox
=
new
QHBoxLayout
;
vbox
->
addLayout
(
hbox
);
QLabel
*
lab
=
new
QLabel
(
i18n
(
"Source:"
));
QLabel
*
lab
=
new
QLabel
(
i18n
(
"Source:"
)
,
this
);
hbox
->
addWidget
(
lab
);
mSource
=
new
QComboBox
;
mSource
=
new
QComboBox
(
this
)
;
mSource
->
setObjectName
(
QStringLiteral
(
"source"
));
mSource
->
addItem
(
i18n
(
"Address Book"
),
AddressBook
);
mSource
->
addItem
(
i18n
(
"CSV"
),
CSV
);
...
...
@@ -41,20 +40,20 @@ MailMergeWidget::MailMergeWidget(QWidget *parent)
hbox
->
addWidget
(
mSource
);
mStackedWidget
=
new
QStackedWidget
;
mStackedWidget
=
new
QStackedWidget
(
this
)
;
mStackedWidget
->
setObjectName
(
QStringLiteral
(
"stackedwidget"
));
vbox
->
addWidget
(
mStackedWidget
);
mAddressbookWidget
=
new
MailMerge
::
AddressBookWidget
;
mAddressbookWidget
=
new
MailMerge
::
AddressBookWidget
(
this
)
;
mAddressbookWidget
->
setObjectName
(
QStringLiteral
(
"addressbookwidget"
));
mStackedWidget
->
addWidget
(
mAddressbookWidget
);
mCsvWidget
=
new
MailMerge
::
CsvWidget
;
mCsvWidget
=
new
MailMerge
::
CsvWidget
(
this
)
;
mCsvWidget
->
setObjectName
(
QStringLiteral
(
"csvwidget"
));
mStackedWidget
->
addWidget
(
mCsvWidget
);
lab
=
new
QLabel
(
i18n
(
"Attachment:"
));
lab
=
new
QLabel
(
i18n
(
"Attachment:"
)
,
this
);
vbox
->
addWidget
(
lab
);
PimCommon
::
SimpleStringListEditor
::
ButtonCode
buttonCode
=
static_cast
<
PimCommon
::
SimpleStringListEditor
::
ButtonCode
>
(
...
...
kmail/plugins/mailmergeplugin/widgets/selectattachmentdialog.cpp
View file @
c845aa5b
...
...
@@ -8,6 +8,7 @@
#include <KLocalizedString>
#include <QDialogButtonBox>
#include <QLabel>
#include <QVBoxLayout>
#include <kurlrequester.h>
using
namespace
MailMerge
;
...
...
@@ -15,9 +16,8 @@ SelectAttachmentDialog::SelectAttachmentDialog(QWidget *parent)
:
QDialog
(
parent
)
{
setWindowTitle
(
i18nc
(
"@title:window"
,
"Attachment"
));
QDialogButtonBox
*
buttonBox
=
new
QDialogButtonBox
(
QDialogButtonBox
::
Ok
|
QDialogButtonBox
::
Cancel
);
QVBoxLayout
*
mainLayout
=
new
QVBoxLayout
;
setLayout
(
mainLayout
);
QDialogButtonBox
*
buttonBox
=
new
QDialogButtonBox
(
QDialogButtonBox
::
Ok
|
QDialogButtonBox
::
Cancel
,
this
);
QVBoxLayout
*
mainLayout
=
new
QVBoxLayout
(
this
);
QPushButton
*
okButton
=
buttonBox
->
button
(
QDialogButtonBox
::
Ok
);
okButton
->
setDefault
(
true
);
okButton
->
setShortcut
(
Qt
::
CTRL
|
Qt
::
Key_Return
);
...
...
@@ -30,7 +30,7 @@ SelectAttachmentDialog::SelectAttachmentDialog(QWidget *parent)
QLabel
*
lab
=
new
QLabel
(
i18n
(
"Select attachment:"
));
lab
->
setObjectName
(
QStringLiteral
(
"selectattachment_label"
));
vbox
->
addWidget
(
lab
);
mUrlRequester
=
new
KUrlRequester
;
mUrlRequester
=
new
KUrlRequester
(
this
)
;
mUrlRequester
->
setMode
(
KFile
::
LocalOnly
|
KFile
::
ExistingOnly
);
mUrlRequester
->
setObjectName
(
QStringLiteral
(
"urlrequester"
));
vbox
->
addWidget
(
mUrlRequester
);
...
...
@@ -42,7 +42,7 @@ SelectAttachmentDialog::~SelectAttachmentDialog()
{
}
void
SelectAttachmentDialog
::
setAttachmentPath
(
const
Q
String
&
path
)
void
SelectAttachmentDialog
::
setAttachmentPath
(
const
Q
Url
&
path
)
{
mUrlRequester
->
setUrl
(
path
);
}
...
...
kmail/plugins/mailmergeplugin/widgets/selectattachmentdialog.h
View file @
c845aa5b
...
...
@@ -19,8 +19,8 @@ public:
explicit
SelectAttachmentDialog
(
QWidget
*
parent
=
nullptr
);
~
SelectAttachmentDialog
()
override
;
void
setAttachmentPath
(
const
Q
String
&
path
);
QString
attachmentPath
()
const
;
void
setAttachmentPath
(
const
Q
Url
&
path
);
Q_REQUIRED_RESULT
QString
attachmentPath
()
const
;
private:
KUrlRequester
*
mUrlRequester
=
nullptr
;
...
...
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