Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 3558afa9 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

[Wallpaper Configuration] Make Get New Stuff dialog modal to config window

Differential Revision: https://phabricator.kde.org/D7073
parent bd468dce
......@@ -37,6 +37,8 @@
#include <QTimer>
#include <QMimeDatabase>
#include <QImageReader>
#include <QQuickItem>
#include <QQuickWindow>
#include <QDebug>
#include <KDirWatch>
......@@ -589,7 +591,7 @@ void Image::backgroundsFound(const QStringList &paths, const QString &token)
}
}
void Image::getNewWallpaper()
void Image::getNewWallpaper(QQuickItem *ctx)
{
if (!m_newStuffDialog) {
m_newStuffDialog = new KNS3::DownloadDialog( QString::fromLatin1("wallpaper.knsrc") );
......@@ -597,6 +599,13 @@ void Image::getNewWallpaper()
strong->setTitle(i18n("Download Wallpapers"));
connect(m_newStuffDialog.data(), &QDialog::accepted, this, &Image::newStuffFinished);
}
if (ctx && ctx->window()) {
m_newStuffDialog->setWindowModality(Qt::WindowModal);
m_newStuffDialog->winId(); // so it creates the windowHandle();
m_newStuffDialog->windowHandle()->setTransientParent(ctx->window());
}
m_newStuffDialog.data()->show();
}
......
......@@ -38,6 +38,7 @@
class QPropertyAnimation;
class QFileDialog;
class QQuickItem;
class KDirWatch;
class KJob;
......@@ -82,7 +83,7 @@ class Image : public QObject, public QQmlParserStatus
Q_INVOKABLE void addSlidePath(const QString &path);
Q_INVOKABLE void removeSlidePath(const QString &path);
Q_INVOKABLE void getNewWallpaper();
Q_INVOKABLE void getNewWallpaper(QQuickItem *ctx = nullptr);
Q_INVOKABLE void showFileDialog();
Q_INVOKABLE void addUsersWallpaper(const QString &file);
......
......@@ -353,7 +353,7 @@ ColumnLayout {
iconName: "get-hot-new-stuff"
text: i18nd("plasma_applet_org.kde.image","Get New Wallpapers...")
visible: KAuthorized.authorize("ghns")
onClicked: imageWallpaper.getNewWallpaper();
onClicked: imageWallpaper.getNewWallpaper(this);
}
}
}
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