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
39957193
Commit
39957193
authored
Apr 19, 2021
by
Laurent Montel
😁
Browse files
Add info about arguments
parent
43c422bc
Changes
3
Hide whitespace changes
Inline
Side-by-side
plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternaleditwidgettest.cpp
View file @
39957193
...
...
@@ -8,6 +8,7 @@
#include "../configuredialog/viewerpluginexternaleditwidget.h"
#include <KUrlRequester>
#include <QFormLayout>
#include <QLabel>
#include <QLineEdit>
#include <QTest>
...
...
@@ -38,6 +39,9 @@ void ViewerPluginExternalEditWidgetTest::shouldHaveDefaultValue()
auto
mExecutable
=
w
.
findChild
<
KUrlRequester
*>
(
QStringLiteral
(
"mEditorRequester"
));
QVERIFY
(
mExecutable
);
auto
formatHelp
=
w
.
findChild
<
QLabel
*>
(
QStringLiteral
(
"formatHelp"
));
QVERIFY
(
formatHelp
);
}
void
ViewerPluginExternalEditWidgetTest
::
shouldGetSaveInfo_data
()
...
...
plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternaleditwidget.cpp
View file @
39957193
...
...
@@ -9,6 +9,8 @@
#include <KLocalizedString>
#include <KUrlRequester>
#include <QFormLayout>
#include <QLabel>
#include <QWhatsThis>
ViewerPluginExternalEditWidget
::
ViewerPluginExternalEditWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
...
...
@@ -30,6 +32,27 @@ ViewerPluginExternalEditWidget::ViewerPluginExternalEditWidget(QWidget *parent)
mCommandLine
->
setObjectName
(
QStringLiteral
(
"commandline"
));
mainLayout
->
addRow
(
i18n
(
"Command Line:"
),
mCommandLine
);
auto
formatHelp
=
new
QLabel
(
i18n
(
"<qt><a href=
\"
whatsthis1
\"
>Argument format information...</a></qt>"
),
this
);
formatHelp
->
setObjectName
(
QStringLiteral
(
"formatHelp"
));
formatHelp
->
setContextMenuPolicy
(
Qt
::
NoContextMenu
);
connect
(
formatHelp
,
&
QLabel
::
linkActivated
,
this
,
&
ViewerPluginExternalEditWidget
::
slotLinkClicked
);
mCommandWhatsThis
=
i18n
(
"<qt><p><strong>These expressions may be used for the date:"
"</strong></p>"
"<ul>"
"<li>%s - the subject of message</li>"
"<li>%from - the from email address</li>"
"<li>%cc - the list of cc email address</li>"
"<li>%bcc - the list of bcc email address</li>"
"<li>%body - the body of message</li>"
"<li>%inreplyto - the reply email address</li>"
"</ul>"
"</strong></p></qt>"
);
formatHelp
->
setWhatsThis
(
mCommandWhatsThis
);
mainLayout
->
addWidget
(
formatHelp
);
mExecutable
=
new
KUrlRequester
(
this
);
mExecutable
->
setObjectName
(
QStringLiteral
(
"mEditorRequester"
));
...
...
@@ -47,6 +70,13 @@ ViewerPluginExternalEditWidget::~ViewerPluginExternalEditWidget()
{
}
void
ViewerPluginExternalEditWidget
::
slotLinkClicked
(
const
QString
&
link
)
{
if
(
link
==
QLatin1String
(
"whatsthis1"
))
{
QWhatsThis
::
showText
(
QCursor
::
pos
(),
mCommandWhatsThis
);
}
}
void
ViewerPluginExternalEditWidget
::
slotInfoChanged
()
{
Q_EMIT
scriptIsValid
(
!
mExecutable
->
text
().
trimmed
().
isEmpty
()
&&
!
mName
->
text
().
trimmed
().
isEmpty
()
&&
!
mExistingsNames
.
contains
(
mName
->
text
()));
...
...
plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternaleditwidget.h
View file @
39957193
...
...
@@ -27,9 +27,11 @@ Q_SIGNALS:
void
scriptIsValid
(
bool
valid
);
private:
void
slotLinkClicked
(
const
QString
&
link
);
void
slotInfoChanged
();
ViewerPluginExternalScriptInfo
mScriptInfo
;
QStringList
mExistingsNames
;
QString
mCommandWhatsThis
;
QLineEdit
*
mName
=
nullptr
;
QLineEdit
*
mDescription
=
nullptr
;
QLineEdit
*
mCommandLine
=
nullptr
;
...
...
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