Commit ea5199a7 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

[Look and Feel KCM] Make GHNS dialog modal

Makes it consistent with the other KCMs.

Differential Revision: https://phabricator.kde.org/D13103
parent 150f8877
......@@ -36,11 +36,10 @@
#include <KAutostart>
#include <KRun>
#include <QVBoxLayout>
#include <QPushButton>
#include <QMessageBox>
#include <QQmlEngine>
#include <QQmlContext>
#include <QQuickItem>
#include <QQuickWindow>
#include <QStandardItemModel>
#include <QX11Info>
......@@ -106,13 +105,20 @@ KCMLookandFeel::~KCMLookandFeel()
{
}
void KCMLookandFeel::getNewStuff()
void KCMLookandFeel::getNewStuff(QQuickItem *ctx)
{
if (!m_newStuffDialog) {
m_newStuffDialog = new KNS3::DownloadDialog( QLatin1String("lookandfeel.knsrc") );
m_newStuffDialog.data()->setWindowTitle(i18n("Download New Look And Feel Packages"));
m_newStuffDialog->setWindowModality(Qt::WindowModal);
m_newStuffDialog->winId(); // so it creates the windowHandle();
connect(m_newStuffDialog.data(), &KNS3::DownloadDialog::accepted, this, &KCMLookandFeel::loadModel);
}
if (ctx && ctx->window()) {
m_newStuffDialog->windowHandle()->setTransientParent(ctx->window());
}
m_newStuffDialog.data()->show();
}
......
......@@ -30,7 +30,7 @@
#include <Plasma/Package>
#include <KQuickAddons/ConfigModule>
class QQuickView;
class QQuickItem;
class QStandardItemModel;
class KCMLookandFeel : public KQuickAddons::ConfigModule
......@@ -108,7 +108,7 @@ public:
void loadModel();
Q_INVOKABLE void getNewStuff();
Q_INVOKABLE void getNewStuff(QQuickItem *ctx);
public Q_SLOTS:
void load() override;
......
......@@ -80,7 +80,7 @@ KCM.GridViewKCM {
QtControls.Button {
text: i18n("Get New Looks...")
icon.name: "get-hot-new-stuff"
onClicked: kcm.getNewStuff();
onClicked: kcm.getNewStuff(this);
}
}
}
......
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