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
4545306a
Commit
4545306a
authored
Aug 13, 2021
by
Laurent Montel
😁
Browse files
Add icon for messagebox
parent
64375f19
Pipeline
#74574
canceled with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
kmail/checkbeforedeletemailplugins/confirmbeforedeleting/autotests/confirmbeforedeletingmessageboxwidgettest.cpp
View file @
4545306a
...
...
@@ -24,10 +24,18 @@ void ConfirmBeforeDeletingMessageBoxWidgetTest::shouldHaveDefaultValues()
QVERIFY
(
!
mUseSameResultForOtherCheck
->
text
().
isEmpty
());
QVERIFY
(
!
mUseSameResultForOtherCheck
->
isChecked
());
auto
mainLayout
=
w
.
findChild
<
Q
V
BoxLayout
*>
(
QStringLiteral
(
"mainLayout"
));
auto
mainLayout
=
w
.
findChild
<
Q
H
BoxLayout
*>
(
QStringLiteral
(
"mainLayout"
));
QVERIFY
(
mainLayout
);
QCOMPARE
(
mainLayout
->
contentsMargins
(),
{});
auto
textLayout
=
w
.
findChild
<
QVBoxLayout
*>
(
QStringLiteral
(
"textLayout"
));
QVERIFY
(
textLayout
);
QCOMPARE
(
textLayout
->
contentsMargins
(),
{});
auto
iconLabel
=
w
.
findChild
<
QLabel
*>
(
QStringLiteral
(
"iconLabel"
));
QVERIFY
(
iconLabel
);
QVERIFY
(
iconLabel
->
text
().
isEmpty
());
auto
mLabelInfo
=
w
.
findChild
<
QLabel
*>
(
QStringLiteral
(
"mLabelInfo"
));
QVERIFY
(
mLabelInfo
);
QVERIFY
(
mLabelInfo
->
text
().
isEmpty
());
...
...
kmail/checkbeforedeletemailplugins/confirmbeforedeleting/confirmbeforedeletingmessageboxwidget.cpp
View file @
4545306a
...
...
@@ -10,22 +10,40 @@
#include
<QVBoxLayout>
#include
<KLocalizedString>
#include
<QStyle>
#include
<QStyleOption>
ConfirmBeforeDeletingMessageBoxWidget
::
ConfirmBeforeDeletingMessageBoxWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
,
mLabelInfo
(
new
QLabel
(
this
))
,
mUseSameResultForOtherCheck
(
new
QCheckBox
(
i18n
(
"Reuse..."
),
this
))
// TODO fix i18n
{
auto
mainLayout
=
new
Q
V
BoxLayout
(
this
);
auto
mainLayout
=
new
Q
H
BoxLayout
(
this
);
mainLayout
->
setObjectName
(
QStringLiteral
(
"mainLayout"
));
mainLayout
->
setContentsMargins
({});
const
QIcon
tmpIcon
=
style
()
->
standardIcon
(
QStyle
::
SP_MessageBoxQuestion
,
nullptr
,
this
);
auto
iconLabel
=
new
QLabel
(
this
);
iconLabel
->
setObjectName
(
QStringLiteral
(
"iconLabel"
));
if
(
!
tmpIcon
.
isNull
())
{
QStyleOption
option
;
option
.
initFrom
(
this
);
iconLabel
->
setPixmap
(
tmpIcon
.
pixmap
(
style
()
->
pixelMetric
(
QStyle
::
PM_MessageBoxIconSize
,
&
option
,
this
)));
}
mainLayout
->
addWidget
(
iconLabel
);
auto
textLayout
=
new
QVBoxLayout
;
textLayout
->
setObjectName
(
QStringLiteral
(
"textLayout"
));
textLayout
->
setContentsMargins
({});
mainLayout
->
addLayout
(
textLayout
);
mLabelInfo
->
setObjectName
(
QStringLiteral
(
"mLabelInfo"
));
mLabelInfo
->
setWordWrap
(
true
);
main
Layout
->
addWidget
(
mLabelInfo
);
text
Layout
->
addWidget
(
mLabelInfo
);
mUseSameResultForOtherCheck
->
setObjectName
(
QStringLiteral
(
"mUseSameResultForOtherCheck"
));
main
Layout
->
addWidget
(
mUseSameResultForOtherCheck
);
text
Layout
->
addWidget
(
mUseSameResultForOtherCheck
);
mUseSameResultForOtherCheck
->
setChecked
(
false
);
}
...
...
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