Commit 969d5e29 authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

Refactor KNS3::Button to use new dialog internally

parent 79c683bc
......@@ -10,7 +10,8 @@
#include <KLocalizedString>
#include <KAuthorized>
#include <KMessageBox>
#include "downloaddialog.h"
#include "qtquickdialogwrapper.h"
#include "entry_p.h"
#include "ui/widgetquestionlistener.h"
#include <QPointer>
......@@ -21,7 +22,7 @@ class ButtonPrivate
{
public:
QString configFile;
QPointer<DownloadDialog> dialog;
QPointer<QtQuickDialogWrapper> dialog;
};
Button::Button(const QString &text,
......@@ -82,13 +83,14 @@ void Button::showDialog()
Q_EMIT aboutToShowDialog();
if (!d->dialog) {
d->dialog = new DownloadDialog(d->configFile, this);
d->dialog = new QtQuickDialogWrapper(d->configFile, this);
}
d->dialog->exec();
if (d->dialog) {
Q_EMIT dialogFinished(d->dialog->changedEntries());
const auto changedInternalEntries = d->dialog->exec();
QList<KNS3::Entry> changedEntries;
for (const KNSCore::EntryInternal &e : changedInternalEntries) {
changedEntries << EntryPrivate::fromInternal(&e);
}
Q_EMIT dialogFinished(changedEntries);
}
}
......
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