Commit 0cf461f8 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Don't use button for unlocked it (use url directly)

parent 7d76d821
......@@ -15,13 +15,18 @@ TabLockedWarning::TabLockedWarning(QWidget *parent)
setCloseButtonVisible(false);
setMessageType(Warning);
setWordWrap(true);
setText(i18n("Current Tab is locked."));
setText(QStringLiteral("%1 <a href=\"unlock\">%2</a>").arg(i18n("Current Tab is locked."), i18n("(Unlock it)")));
setVisible(false);
auto unlockAction = new QAction(i18n("Unlock"), this);
connect(unlockAction, &QAction::triggered, this, &TabLockedWarning::unlockTabRequested);
addAction(unlockAction);
connect(this, &TabLockedWarning::linkActivated, this, &TabLockedWarning::slotLinkActivated);
}
TabLockedWarning::~TabLockedWarning()
{
}
void TabLockedWarning::slotLinkActivated(const QString &contents)
{
if (contents == QLatin1String("unlock")) {
Q_EMIT unlockTabRequested();
}
}
......@@ -22,6 +22,9 @@ public:
~TabLockedWarning() override;
Q_SIGNALS:
void unlockTabRequested();
private:
void slotLinkActivated(const QString &contents);
};
}
}
......
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