diff --git a/src/portaltest.cpp b/src/portaltest.cpp index e34e12a..d9f421f 100644 --- a/src/portaltest.cpp +++ b/src/portaltest.cpp @@ -35,6 +35,8 @@ #include #include #include +#include +#include #include @@ -106,6 +108,12 @@ PortalTest::PortalTest(QWidget *parent, Qt::WindowFlags f) } }); + connect(m_mainWindow->krun, &QPushButton::clicked, this, [this] { + new KRun(m_mainWindow->kurlrequester->url(), this); + }); + connect(m_mainWindow->openurl, &QPushButton::clicked, this, [this] { + QDesktopServices::openUrl(m_mainWindow->kurlrequester->url()); + }); connect(m_mainWindow->inhibit, &QPushButton::clicked, this, &PortalTest::inhibitRequested); connect(m_mainWindow->uninhibit, &QPushButton::clicked, this, &PortalTest::uninhibitRequested); connect(m_mainWindow->openFile, &QPushButton::clicked, this, &PortalTest::openFileRequested); @@ -266,7 +274,7 @@ void PortalTest::gotPreparePrintResponse(uint response, const QVariantMap &resul // TODO num-copies, pages - writer.setPageSize(QPagedPaintDevice::A4); + writer.setPageSize(QPageSize(QPageSize::A4)); painter.drawPixmap(QPoint(0,0), QPixmap(m_mainWindow->selectedFiles->text())); painter.end(); @@ -388,7 +396,7 @@ void PortalTest::requestDeviceAccess() QDBusPendingCall pendingCall = QDBusConnection::sessionBus().asyncCall(message); QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingCall); - connect(watcher, &QDBusPendingCallWatcher::finished, [this] (QDBusPendingCallWatcher *watcher) { + connect(watcher, &QDBusPendingCallWatcher::finished, [] (QDBusPendingCallWatcher *watcher) { QDBusPendingReply reply = *watcher; if (reply.isError()) { qWarning() << "Couldn't get reply"; diff --git a/src/portaltest.ui b/src/portaltest.ui index 2368b12..749291c 100644 --- a/src/portaltest.ui +++ b/src/portaltest.ui @@ -85,7 +85,31 @@ - + + + + + + https://kde.org + + + + + + + + openUrl + + + + + + + KRun + + + + @@ -415,6 +439,7 @@ label_14 screenshotButton label_15 + krun