Skip to content

Create KAboutPluginDialogTabManager class to display additional tabs

Alexander Lohnau requested to merge (removed):tabs_manager into master

As described in https://phabricator.kde.org/T13073 the runner syntaxes should be documented. The most intuitive way to do this is by adding a tab with the syntaxes to the about dialog.

With this merge request, the KAboutPluginDialog can generate additional tabs if the corresponding constructor overload is used.

A really simple demo implementation would be:

class DemoTab : public KAboutPluginDialogTabManager {
public:
    DemoTab(QObject *parent) : KAboutPluginDialogTabManager(parent) {}

    QList<QPair<QString, QWidget *>> createTabs(const KPluginMetaData &pluginMetaData, QWidget *parent) override
    {
        return {{QStringLiteral("Hello There"), new QLabel(QStringLiteral(":-)"), parent)}};
    }
};

And use this class in kpluginselector.cpp (kcmutils) line 809:

KAboutPluginDialog aboutPlugin(new DemoTab(this), pluginMetaData, KAboutPluginDialog::NoOptions, itemView());

The KAboutPluginDialogTabManager pointer needs to be added as a property to the KPluginSelector in a follow up merge request.

With the demo code installed you will see a new tab when clicking the about button in the KRunner KCM (or any other about plugin button).
image

Merge request reports