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 844716dc authored by Jan Grulich's avatar Jan Grulich

Remote desktop: implement missing device selection

parent 23b11bf6
......@@ -73,7 +73,10 @@ uint RemoteDesktopPortal::SelectDevices(const QDBusObjectPath &handle,
qCDebug(XdgDesktopPortalKdeRemoteDesktop) << " app_id: " << app_id;
qCDebug(XdgDesktopPortalKdeRemoteDesktop) << " options: " << options;
RemoteDesktopPortal::DeviceTypes types = RemoteDesktopPortal::All;
RemoteDesktopPortal::DeviceTypes types = RemoteDesktopPortal::None;
if (options.contains(QStringLiteral("types"))) {
types = static_cast<RemoteDesktopPortal::DeviceTypes>(options.value(QStringLiteral("types")).toUInt());
}
RemoteDesktopSession *session = qobject_cast<RemoteDesktopSession*>(Session::getSession(session_handle.path()));
......@@ -137,7 +140,7 @@ uint RemoteDesktopPortal::Start(const QDBusObjectPath &handle,
results.insert(QLatin1String("streams"), streams);
}
// TODO devices
results.insert(QLatin1String("types"), QVariant::fromValue<uint>(remoteDesktopDialog->deviceTypes()));
return 0;
}
......
......@@ -120,6 +120,7 @@ public Q_SLOTS:
const QVariantMap &options,
uint slot);
};
Q_DECLARE_OPERATORS_FOR_FLAGS(RemoteDesktopPortal::DeviceTypes)
#endif // XDG_DESKTOP_PORTAL_KDE_REMOTEDESKTOP_H
......@@ -44,7 +44,9 @@ RemoteDesktopDialog::RemoteDesktopDialog(const QString &appName, RemoteDesktopPo
}
}
// TODO
m_dialog->keyboardCheckbox->setChecked(deviceTypes.testFlag(RemoteDesktopPortal::Keyboard));
m_dialog->pointerCheckbox->setChecked(deviceTypes.testFlag(RemoteDesktopPortal::Pointer));
m_dialog->touchScreenCheckbox->setChecked(deviceTypes.testFlag(RemoteDesktopPortal::TouchScreen));
connect(m_dialog->buttonBox, &QDialogButtonBox::accepted, this, &RemoteDesktopDialog::accept);
connect(m_dialog->buttonBox, &QDialogButtonBox::rejected, this, &RemoteDesktopDialog::reject);
......@@ -87,5 +89,13 @@ QList<quint32> RemoteDesktopDialog::selectedScreens() const
RemoteDesktopPortal::DeviceTypes RemoteDesktopDialog::deviceTypes() const
{
return 0;
RemoteDesktopPortal::DeviceTypes types = RemoteDesktopPortal::None;
if (m_dialog->keyboardCheckbox->isChecked())
types |= RemoteDesktopPortal::Keyboard;
if (m_dialog->pointerCheckbox->isChecked())
types |= RemoteDesktopPortal::Pointer;
if (m_dialog->touchScreenCheckbox->isChecked())
types |= RemoteDesktopPortal::TouchScreen;
return types;
}
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