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
8b57daaa
Commit
8b57daaa
authored
Aug 11, 2021
by
Laurent Montel
😁
Browse files
Continue to implement dialogbox
parent
d8cc1678
Pipeline
#74331
passed with stage
in 55 minutes and 11 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
kmail/checkbeforedeletemailplugins/confirmbeforedeleting/autotests/confirmbeforedeletingmessageboxwidgettest.cpp
View file @
8b57daaa
...
...
@@ -5,9 +5,35 @@
*/
#include
"confirmbeforedeletingmessageboxwidgettest.h"
#include
"confirmbeforedeletingmessageboxwidget.h"
#include
<QCheckBox>
#include
<QLabel>
#include
<QTest>
#include
<QVBoxLayout>
QTEST_MAIN
(
ConfirmBeforeDeletingMessageBoxWidgetTest
)
ConfirmBeforeDeletingMessageBoxWidgetTest
::
ConfirmBeforeDeletingMessageBoxWidgetTest
(
QObject
*
parent
)
:
QObject
(
parent
)
{
}
void
ConfirmBeforeDeletingMessageBoxWidgetTest
::
shouldHaveDefaultValues
()
{
ConfirmBeforeDeletingMessageBoxWidget
w
;
// TODO
#if 0
, mLabelInfo(new QLabel(this))
, mUseSameResultForOtherCheck(new QCheckBox(i18n("Reuse..."), this)) //TODO fix i18n
{
auto mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainLayout"));
mainLayout->setContentsMargins({});
mLabelInfo->setObjectName(QStringLiteral("mLabelInfo"));
mLabelInfo->setWordWrap(true);
mainLayout->addWidget(mLabelInfo);
mUseSameResultForOtherCheck->setObjectName(QStringLiteral("mUseSameResultForOtherCheck"));
mainLayout->addWidget(mUseSameResultForOtherCheck);
#endif
}
kmail/checkbeforedeletemailplugins/confirmbeforedeleting/autotests/confirmbeforedeletingmessageboxwidgettest.h
View file @
8b57daaa
...
...
@@ -13,4 +13,6 @@ class ConfirmBeforeDeletingMessageBoxWidgetTest : public QObject
public:
explicit
ConfirmBeforeDeletingMessageBoxWidgetTest
(
QObject
*
parent
=
nullptr
);
~
ConfirmBeforeDeletingMessageBoxWidgetTest
()
override
=
default
;
private
Q_SLOTS
:
void
shouldHaveDefaultValues
();
};
kmail/checkbeforedeletemailplugins/confirmbeforedeleting/confirmbeforedeletingmessageboxdialog.cpp
View file @
8b57daaa
...
...
@@ -34,5 +34,10 @@ ConfirmBeforeDeletingMessageBoxDialog::~ConfirmBeforeDeletingMessageBoxDialog()
void
ConfirmBeforeDeletingMessageBoxDialog
::
setInfo
(
const
QString
&
str
)
{
// TODO
mConfirmBeforeDeletingWidget
->
setInfo
(
str
);
}
bool
ConfirmBeforeDeletingMessageBoxDialog
::
useSameResult
()
const
{
return
mConfirmBeforeDeletingWidget
->
useSameResult
();
}
kmail/checkbeforedeletemailplugins/confirmbeforedeleting/confirmbeforedeletingmessageboxdialog.h
View file @
8b57daaa
...
...
@@ -16,6 +16,8 @@ public:
~
ConfirmBeforeDeletingMessageBoxDialog
()
override
;
void
setInfo
(
const
QString
&
str
);
Q_REQUIRED_RESULT
bool
useSameResult
()
const
;
private:
ConfirmBeforeDeletingMessageBoxWidget
*
const
mConfirmBeforeDeletingWidget
;
};
kmail/checkbeforedeletemailplugins/confirmbeforedeleting/confirmbeforedeletingmessageboxwidget.cpp
View file @
8b57daaa
...
...
@@ -5,15 +5,39 @@
*/
#include
"confirmbeforedeletingmessageboxwidget.h"
#include
<QCheckBox>
#include
<QLabel>
#include
<QVBoxLayout>
#include
<KLocalizedString>
ConfirmBeforeDeletingMessageBoxWidget
::
ConfirmBeforeDeletingMessageBoxWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
,
mLabelInfo
(
new
QLabel
(
this
))
,
mUseSameResultForOtherCheck
(
new
QCheckBox
(
i18n
(
"Reuse..."
),
this
))
// TODO fix i18n
{
auto
mainLayout
=
new
QVBoxLayout
(
this
);
mainLayout
->
setObjectName
(
QStringLiteral
(
"mainLayout"
));
mainLayout
->
setContentsMargins
({});
mLabelInfo
->
setObjectName
(
QStringLiteral
(
"mLabelInfo"
));
mLabelInfo
->
setWordWrap
(
true
);
mainLayout
->
addWidget
(
mLabelInfo
);
mUseSameResultForOtherCheck
->
setObjectName
(
QStringLiteral
(
"mUseSameResultForOtherCheck"
));
mainLayout
->
addWidget
(
mUseSameResultForOtherCheck
);
}
ConfirmBeforeDeletingMessageBoxWidget
::~
ConfirmBeforeDeletingMessageBoxWidget
()
{
}
void
ConfirmBeforeDeletingMessageBoxWidget
::
setInfo
(
const
QString
&
str
)
{
mLabelInfo
->
setText
(
str
);
}
bool
ConfirmBeforeDeletingMessageBoxWidget
::
useSameResult
()
const
{
return
mUseSameResultForOtherCheck
->
isChecked
();
}
kmail/checkbeforedeletemailplugins/confirmbeforedeleting/confirmbeforedeletingmessageboxwidget.h
View file @
8b57daaa
...
...
@@ -8,11 +8,19 @@
#include
<QWidget>
#include
"confirmbeforedeleting_private_export.h"
class
QLabel
;
class
QCheckBox
;
class
KMAILCONFIRMBEFOREDELETING_TESTS_EXPORT
ConfirmBeforeDeletingMessageBoxWidget
:
public
QWidget
{
Q_OBJECT
public:
explicit
ConfirmBeforeDeletingMessageBoxWidget
(
QWidget
*
parent
=
nullptr
);
~
ConfirmBeforeDeletingMessageBoxWidget
()
override
;
void
setInfo
(
const
QString
&
str
);
Q_REQUIRED_RESULT
bool
useSameResult
()
const
;
private:
QLabel
*
const
mLabelInfo
;
QCheckBox
*
const
mUseSameResultForOtherCheck
;
};
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