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
PIM Messagelib
Commits
e807670b
Commit
e807670b
authored
Jan 04, 2021
by
Laurent Montel
😁
Browse files
Continue to implement dialogbox
parent
96644d6a
Pipeline
#46303
passed with stage
in 45 minutes and 34 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
messageviewer/src/remote-content/autotests/remotecontentconfiguredialogtest.cpp
View file @
e807670b
...
...
@@ -6,7 +6,10 @@
#include "remotecontentconfiguredialogtest.h"
#include "remote-content/remotecontentconfiguredialog.h"
#include "remote-content/remotecontentconfigurewidget.h"
#include <QDialogButtonBox>
#include <QTest>
#include <QVBoxLayout>
QTEST_MAIN
(
RemoteContentConfigureDialogTest
)
RemoteContentConfigureDialogTest
::
RemoteContentConfigureDialogTest
(
QObject
*
parent
)
:
QObject
(
parent
)
...
...
@@ -16,6 +19,17 @@ RemoteContentConfigureDialogTest::RemoteContentConfigureDialogTest(QObject *pare
void
RemoteContentConfigureDialogTest
::
shouldHaveDefaultValues
()
{
MessageViewer
::
RemoteContentConfigureDialog
d
;
//TODO
MessageViewer
::
RemoteContentConfigureDialog
w
;
QVERIFY
(
!
w
.
windowTitle
().
isEmpty
());
auto
mainLayout
=
w
.
findChild
<
QVBoxLayout
*>
(
QStringLiteral
(
"mainLayout"
));
QVERIFY
(
mainLayout
);
auto
mRemoteContentConfigureWidget
=
w
.
findChild
<
MessageViewer
::
RemoteContentConfigureWidget
*>
(
QStringLiteral
(
"mRemoteContentConfigureWidget"
));
QVERIFY
(
mRemoteContentConfigureWidget
);
auto
buttonBox
=
w
.
findChild
<
QDialogButtonBox
*>
(
QStringLiteral
(
"buttonBox"
));
QVERIFY
(
buttonBox
);
QCOMPARE
(
buttonBox
->
standardButtons
(),
{
QDialogButtonBox
::
Ok
|
QDialogButtonBox
::
Cancel
});
}
messageviewer/src/remote-content/remotecontentconfiguredialog.cpp
View file @
e807670b
...
...
@@ -5,6 +5,7 @@
*/
#include "remotecontentconfiguredialog.h"
#include "remotecontentconfigurewidget.h"
#include <KLocalizedString>
#include <QVBoxLayout>
#include <QDialogButtonBox>
...
...
@@ -18,12 +19,17 @@ static const char myRemoteContentConfigureConfigGroupName[] = "RemoteContentConf
using
namespace
MessageViewer
;
RemoteContentConfigureDialog
::
RemoteContentConfigureDialog
(
QWidget
*
parent
)
:
QDialog
(
parent
)
,
mRemoteContentConfigureWidget
(
new
RemoteContentConfigureWidget
(
this
))
{
setWindowTitle
(
i18nc
(
"@title:window"
,
"Details"
));
setAttribute
(
Qt
::
WA_DeleteOnClose
);
auto
mainLayout
=
new
QVBoxLayout
(
this
);
mainLayout
->
setObjectName
(
QStringLiteral
(
"mainLayout"
));
mRemoteContentConfigureWidget
->
setObjectName
(
QStringLiteral
(
"mRemoteContentConfigureWidget"
));
mainLayout
->
addWidget
(
mRemoteContentConfigureWidget
);
auto
buttonBox
=
new
QDialogButtonBox
(
QDialogButtonBox
::
Ok
|
QDialogButtonBox
::
Cancel
,
this
);
buttonBox
->
setObjectName
(
QStringLiteral
(
"buttonBox"
));
connect
(
buttonBox
,
&
QDialogButtonBox
::
accepted
,
this
,
&
RemoteContentConfigureDialog
::
accept
);
connect
(
buttonBox
,
&
QDialogButtonBox
::
rejected
,
this
,
&
RemoteContentConfigureDialog
::
reject
);
mainLayout
->
addWidget
(
buttonBox
);
...
...
messageviewer/src/remote-content/remotecontentconfiguredialog.h
View file @
e807670b
...
...
@@ -10,6 +10,7 @@
#include <QDialog>
#include "messageviewer_private_export.h"
namespace
MessageViewer
{
class
RemoteContentConfigureWidget
;
class
MESSAGEVIEWER_TESTS_EXPORT
RemoteContentConfigureDialog
:
public
QDialog
{
Q_OBJECT
...
...
@@ -20,6 +21,7 @@ public:
private:
void
readConfig
();
void
writeConfig
();
RemoteContentConfigureWidget
*
const
mRemoteContentConfigureWidget
;
};
}
...
...
messageviewer/src/remote-content/remotecontentconfigurewidget.cpp
View file @
e807670b
...
...
@@ -6,11 +6,15 @@
#include "remotecontentconfigurewidget.h"
#include <KLocalizedString>
#include <QVBoxLayout>
using
namespace
MessageViewer
;
RemoteContentConfigureWidget
::
RemoteContentConfigureWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
{
auto
vboxLayout
=
new
QVBoxLayout
(
this
);
vboxLayout
->
setObjectName
(
QStringLiteral
(
"vboxLayout"
));
vboxLayout
->
setContentsMargins
({});
}
RemoteContentConfigureWidget
::~
RemoteContentConfigureWidget
()
...
...
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