Commit ae89638e authored by Alexander Lohnau's avatar Alexander Lohnau Committed by Nate Graham
Browse files

KRunner: Disable help button when runner is disabled

BUG: 451509
parent 88c3f465
Pipeline #158908 passed with stage
in 5 minutes and 42 seconds
......@@ -58,6 +58,8 @@ View::View(QWindow *)
Q_UNUSED(names);
if (group.name() == QLatin1String("General")) {
loadConfig();
} else if (group.name() == QLatin1String("Plugins")) {
Q_EMIT helpEnabledChanged();
}
});
......
......@@ -8,6 +8,7 @@
#include <KConfigGroup>
#include <KConfigWatcher>
#include <KPluginMetaData>
#include <KSharedConfig>
#include <QPointer>
#include <QQuickView>
......@@ -42,6 +43,7 @@ class View : public PlasmaQuick::Dialog
Q_PROPERTY(QStringList history READ history NOTIFY historyChanged)
// TODO KF6 This is kept for compatibility with third party themes which override the RunCommand.qml file
Q_PROPERTY(Plasma::RunnerManager *runnerManager WRITE setRunnerManager)
Q_PROPERTY(bool helpEnabled READ helpEnabled NOTIFY helpEnabledChanged)
public:
explicit View(QWindow *parent = nullptr);
......@@ -69,8 +71,16 @@ public:
m_manager = manager;
}
bool helpEnabled()
{
const static auto metaData = KPluginMetaData(QStringLiteral("kf5/krunner/helprunner"));
const KConfigGroup grp = KSharedConfig::openConfig()->group("Plugins");
return metaData.isEnabled(grp);
}
Q_SIGNALS:
void pinnedChanged();
void helpEnabledChanged();
protected:
bool event(QEvent *event) override;
......
......@@ -221,6 +221,7 @@ ColumnLayout {
}
}
PlasmaComponents3.ToolButton {
visible: runnerWindow.helpEnabled
checkable: true
checked: root.query.startsWith("?")
// Reset if out quers starts with "?", otherwise set it to "?"
......
Supports Markdown
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