Commit 776e365d authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add info about argument

parent 92a4ecbc
Pipeline #134291 failed with stage
in 13 minutes and 49 seconds
......@@ -9,6 +9,7 @@
#include <QFormLayout>
#include <QLabel>
#include <QLineEdit>
#include <QWhatsThis>
OpenUrlWithConfigureCreateWidget::OpenUrlWithConfigureCreateWidget(QWidget *parent)
: QWidget{parent}
, mServerName(new QLineEdit(this))
......@@ -22,6 +23,20 @@ OpenUrlWithConfigureCreateWidget::OpenUrlWithConfigureCreateWidget(QWidget *pare
mServerName->setObjectName(QStringLiteral("mServerName"));
mainLayout->addRow(i18n("Server Name:"), mServerName);
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, &OpenUrlWithConfigureCreateWidget::slotLinkClicked);
mCommandWhatsThis = i18n(
"<qt><p><strong>These expressions may be used for the arguments:"
"</strong></p>"
"<ul>"
"<li>%u - url used by command</li>"
"</ul>"
"</strong></p></qt>");
formatHelp->setWhatsThis(mCommandWhatsThis);
mCommand->setObjectName(QStringLiteral("mCommand"));
mainLayout->addRow(i18n("Command:"), mCommand);
}
......@@ -30,6 +45,13 @@ OpenUrlWithConfigureCreateWidget::~OpenUrlWithConfigureCreateWidget()
{
}
void OpenUrlWithConfigureCreateWidget::slotLinkClicked(const QString &link)
{
if (link == QLatin1String("whatsthis1")) {
QWhatsThis::showText(QCursor::pos(), mCommandWhatsThis);
}
}
OpenUrlWithConfigureCreateWidget::OpenUrlWithInfo OpenUrlWithConfigureCreateWidget::info() const
{
OpenUrlWithConfigureCreateWidget::OpenUrlWithInfo info;
......
......@@ -24,6 +24,8 @@ public:
Q_REQUIRED_RESULT OpenUrlWithInfo info() const;
void setInfo(const OpenUrlWithInfo &i);
private:
void slotLinkClicked(const QString &link);
QString mCommandWhatsThis;
QLineEdit *const mServerName;
QLineEdit *const mCommand;
};
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment