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
3ba1f109
Commit
3ba1f109
authored
Jun 14, 2021
by
Laurent Montel
😁
Browse files
Enabled/disabled ok button
parent
c0a49cab
Changes
3
Hide whitespace changes
Inline
Side-by-side
messagelist/src/core/widgets/filternamedialog.cpp
View file @
3ba1f109
...
...
@@ -8,6 +8,7 @@
#include "filternamewidget.h"
#include <KLocalizedString>
#include <QDialogButtonBox>
#include <QPushButton>
#include <QVBoxLayout>
using
namespace
MessageList
::
Core
;
...
...
@@ -25,6 +26,9 @@ FilterNameDialog::FilterNameDialog(QWidget *parent)
mainLayout
->
addWidget
(
button
);
connect
(
button
,
&
QDialogButtonBox
::
accepted
,
this
,
&
FilterNameDialog
::
accept
);
connect
(
button
,
&
QDialogButtonBox
::
rejected
,
this
,
&
FilterNameDialog
::
reject
);
auto
okButton
=
button
->
button
(
QDialogButtonBox
::
Ok
);
okButton
->
setEnabled
(
false
);
connect
(
mFilterNameWidget
,
&
FilterNameWidget
::
updateOkButton
,
okButton
,
&
QPushButton
::
setEnabled
);
}
FilterNameDialog
::~
FilterNameDialog
()
...
...
messagelist/src/core/widgets/filternamewidget.cpp
View file @
3ba1f109
...
...
@@ -6,17 +6,26 @@
#include "filternamewidget.h"
#include <KLocalizedString>
#include <QHBoxLayout>
#include <QLabel>
#include <QLineEdit>
#include <QVBoxLayout>
using
namespace
MessageList
::
Core
;
FilterNameWidget
::
FilterNameWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
,
mName
(
new
QLineEdit
(
this
))
{
auto
mainLayout
=
new
Q
V
BoxLayout
(
this
);
auto
mainLayout
=
new
Q
H
BoxLayout
(
this
);
mainLayout
->
setObjectName
(
QStringLiteral
(
"mainLayout"
));
mainLayout
->
setContentsMargins
({});
mName
->
setObjectName
(
QStringLiteral
(
"mName"
));
auto
label
=
new
QLabel
(
i18n
(
"Name:"
),
this
);
label
->
setObjectName
(
QStringLiteral
(
"label"
));
mainLayout
->
addWidget
(
label
);
mainLayout
->
addWidget
(
mName
);
}
FilterNameWidget
::~
FilterNameWidget
()
...
...
messagelist/src/core/widgets/filternamewidget.h
View file @
3ba1f109
...
...
@@ -8,6 +8,7 @@
#include "messagelist_private_export.h"
#include <QWidget>
class
QLineEdit
;
namespace
MessageList
{
namespace
Core
...
...
@@ -20,6 +21,9 @@ public:
~
FilterNameWidget
()
override
;
Q_SIGNALS:
void
updateOkButton
(
bool
enabled
);
private:
QLineEdit
*
const
mName
;
};
}
}
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