Skip to content
GitLab
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
7877a4aa
Commit
7877a4aa
authored
Feb 13, 2022
by
Laurent Montel
Browse files
Update enable ok button
parent
9af6695a
Pipeline
#136962
passed with stage
in 26 minutes and 3 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
plugins/messageviewerconfigureplugins/openurlwith/openurlwithconfigurecreatedialog.cpp
View file @
7877a4aa
...
...
@@ -6,6 +6,7 @@
#include
"openurlwithconfigurecreatedialog.h"
#include
<KLocalizedString>
#include
<QDialogButtonBox>
#include
<QPushButton>
#include
<QVBoxLayout>
OpenUrlWithConfigureCreateDialog
::
OpenUrlWithConfigureCreateDialog
(
QWidget
*
parent
)
...
...
@@ -25,6 +26,11 @@ OpenUrlWithConfigureCreateDialog::OpenUrlWithConfigureCreateDialog(QWidget *pare
connect
(
buttonBox
,
&
QDialogButtonBox
::
accepted
,
this
,
&
OpenUrlWithConfigureCreateDialog
::
accept
);
connect
(
buttonBox
,
&
QDialogButtonBox
::
rejected
,
this
,
&
OpenUrlWithConfigureCreateDialog
::
reject
);
QPushButton
*
okButton
=
buttonBox
->
button
(
QDialogButtonBox
::
Ok
);
okButton
->
setEnabled
(
false
);
connect
(
mOpenUrlWithCreateWidget
,
&
OpenUrlWithConfigureCreateWidget
::
updateOkButton
,
this
,
[
okButton
](
bool
enabled
)
{
okButton
->
setEnabled
(
enabled
);
});
}
OpenUrlWithConfigureCreateDialog
::~
OpenUrlWithConfigureCreateDialog
()
...
...
plugins/messageviewerconfigureplugins/openurlwith/openurlwithconfigurecreatewidget.cpp
View file @
7877a4aa
...
...
@@ -55,8 +55,8 @@ OpenUrlWithConfigureCreateWidget::OpenUrlWithConfigureCreateWidget(QWidget *pare
mExecutable
->
setMode
(
KFile
::
File
|
KFile
::
ExistingOnly
|
KFile
::
LocalOnly
);
mExecutable
->
lineEdit
()
->
setClearButtonEnabled
(
true
);
mainLayout
->
addRow
(
i18n
(
"Executable:"
),
mExecutable
);
//
connect(mName, &QLineEdit::textChanged, this, &
ViewerPluginExternalEdit
Widget::slotInfoChanged);
//
connect(mExecutable->lineEdit(), &QLineEdit::textChanged, this, &
ViewerPluginExternalEdit
Widget::slotInfoChanged);
connect
(
m
Server
Name
,
&
QLineEdit
::
textChanged
,
this
,
&
OpenUrlWithConfigureCreate
Widget
::
slotInfoChanged
);
connect
(
mExecutable
->
lineEdit
(),
&
QLineEdit
::
textChanged
,
this
,
&
OpenUrlWithConfigureCreate
Widget
::
slotInfoChanged
);
}
OpenUrlWithConfigureCreateWidget
::~
OpenUrlWithConfigureCreateWidget
()
...
...
@@ -90,3 +90,8 @@ bool OpenUrlWithConfigureCreateWidget::OpenUrlWithInfo::isValid() const
{
return
!
url
.
trimmed
().
isEmpty
()
&&
!
command
.
trimmed
().
isEmpty
();
}
void
OpenUrlWithConfigureCreateWidget
::
slotInfoChanged
()
{
Q_EMIT
updateOkButton
(
!
mServerName
->
text
().
trimmed
().
isEmpty
()
&&
!
mExecutable
->
text
().
trimmed
().
isEmpty
());
}
plugins/messageviewerconfigureplugins/openurlwith/openurlwithconfigurecreatewidget.h
View file @
7877a4aa
...
...
@@ -25,8 +25,12 @@ public:
Q_REQUIRED_RESULT
OpenUrlWithInfo
info
()
const
;
void
setInfo
(
const
OpenUrlWithInfo
&
i
);
Q_SIGNALS:
void
updateOkButton
(
bool
enabled
);
private:
void
slotLinkClicked
(
const
QString
&
link
);
void
slotInfoChanged
();
QString
mCommandWhatsThis
;
QLineEdit
*
const
mServerName
;
QLineEdit
*
const
mCommandLine
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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