shift-shell/kcms/waydroidintegration/ui/WaydroidConfigurationForm.qml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

145 lines
4.4 KiB
QML
Raw Normal View History

kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
/*
* SPDX-FileCopyrightText: 2025 Florian RICHER <florian.richer@protonmail.com>
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
import QtQuick
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15 as QQC2
import org.kde.kirigami 2.19 as Kirigami
import org.kde.kirigamiaddons.formcard 1.0 as FormCard
import org.kde.plasma.components 3.0 as PC3
import org.kde.plasma.private.mobileshell.waydroidintegrationplugin as AIP
ColumnLayout {
id: root
FormCard.FormHeader {
title: i18n("General information")
}
FormCard.FormCard {
FormCard.FormTextDelegate {
text: i18n("IP address")
description: AIP.WaydroidState.ipAddress
trailing: PC3.Button {
2025-07-10 16:57:34 +00:00
visible: AIP.WaydroidState.ipAddress !== ""
text: i18n("Copy")
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
icon.name: 'edit-copy-symbolic'
onClicked: AIP.WaydroidState.copyToClipboard(AIP.WaydroidState.ipAddress)
}
}
FormCard.FormTextDelegate {
text: i18n("Waydroid status")
description: i18n("Running")
trailing: PC3.Button {
text: i18n("Stop session")
2025-07-28 17:20:33 +00:00
onClicked: AIP.WaydroidState.stopSessionQml()
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
}
}
2025-07-10 16:57:34 +00:00
FormCard.FormButtonDelegate {
visible: AIP.WaydroidState.systemType === AIP.WaydroidState.Gapps
2025-07-10 16:57:34 +00:00
text: i18n("Certify my device for Google Play Protect")
onClicked: kcm.push("WaydroidGooglePlayProtectConfigurationPage.qml")
}
2025-07-14 10:47:21 +00:00
FormCard.FormButtonDelegate {
text: i18n("Installed applications")
onClicked: kcm.push("WaydroidApplicationsPage.qml")
}
2025-07-28 17:37:19 +00:00
FormCard.FormButtonDelegate {
text: i18n("Reset waydroid")
onClicked: confirmDialog.open()
}
Kirigami.PromptDialog {
id: confirmDialog
title: i18nc("@title:window", "Confirm Waydroid Reset")
subtitle: i18n("Are you sure you want to reset Waydroid ? This is a destructive action, and will wipe all user data.")
standardButtons: Kirigami.Dialog.Ok | Kirigami.Dialog.Cancel
2025-07-28 17:37:19 +00:00
onAccepted: AIP.WaydroidState.resetWaydroidQml()
}
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
}
// Some information such as IP address can take time to be set by Waydroid
kcm: Implement minimal Waydroid support I prefer create MR now to avoid biggest merge request. It add minimalist implementation: - First configuration of Waydroid - Stop / Start Waydroid session - Configure properties of Waydroid - Display current ip of Waydroid | Not installed | First initialization | initializing | SessionNotStarted | SessionStarting | SessionStarted | | ------ | ------ | ------ | ------ | ------ | ------ | | ![Copie_d_écran_20250705_162112](/uploads/66844057ee6c955803288993809616fa/Copie_d_écran_20250705_162112.png) | ![Copie_d_écran_20250707_234822](/uploads/133779f8d4a70551a321938a7193aa3d/Copie_d_écran_20250707_234822.png) | ![Copie_d_écran_20250707_234829](/uploads/bacecd42875e3afd48dba2f9472b0f13/Copie_d_écran_20250707_234829.png) | ![Copie_d_écran_20250707_234908](/uploads/c6eff9833e33f30797088e327fcf6ea3/Copie_d_écran_20250707_234908.png) | ![Copie_d_écran_20250707_234919](/uploads/1927e2334d7e3b5790e5fab9037feff7/Copie_d_écran_20250707_234919.png) | ![Copie_d_écran_20250707_235239](/uploads/9be45b0a7b5f988de0e9ac297a2447c8/Copie_d_écran_20250707_235239.png) | Linked to https://invent.kde.org/teams/plasma-mobile/issues/-/issues/307 **Note for Reviewer**: In my local environment, i need to add manually the KAuth files otherwise polkit not recognize the implementation. ``` sudo cp ~/kde/usr/share/dbus-1/system-services/org.kde.plasma.mobileshell.waydroidhelper.service /usr/share/dbus-1/system-services/ sudo cp ~/kde/usr/share/dbus-1/system.d/org.kde.plasma.mobileshell.waydroidhelper.conf /usr/share/dbus-1/system.d/ sudo cp ~/kde/usr/share/polkit-1/actions/org.kde.plasma.mobileshell.waydroidhelper.policy /usr/share/polkit-1/actions/ ```
2025-07-10 16:00:41 +00:00
Timer {
id: autoRefreshSessionTimer
interval: 2000
repeat: true
running: root.visible
onTriggered: AIP.WaydroidState.refreshSessionInfo()
}
FormCard.FormHeader {
title: i18n("Waydroid properties")
}
FormCard.FormCard {
id: infoMessage
visible: false
Kirigami.Theme.inherit: false
Kirigami.Theme.backgroundColor: root.Kirigami.Theme.neutralBackgroundColor
FormCard.FormTextDelegate {
text: i18n("May require restarting the waydroid session to apply")
textItem.wrapMode: Text.WordWrap
icon.name: "dialog-warning"
}
}
Connections {
target: AIP.WaydroidState
function onSessionStatusChanged() {
infoMessage.visible = false
}
}
FormCard.FormCard {
FormCard.FormSwitchDelegate {
id: multiWindows
text: i18n("Multi Windows")
description: i18n("Enables/Disables window integration with the desktop")
checked: AIP.WaydroidState.multiWindows
onToggled: {
AIP.WaydroidState.multiWindows = checked
infoMessage.visible = true
}
}
FormCard.FormDelegateSeparator { above: multiWindows; below: suspend }
FormCard.FormSwitchDelegate {
id: suspend
text: i18n("Suspend")
description: i18n("Let the Waydroid container sleep (after the display timeout) when no apps are active")
checked: AIP.WaydroidState.suspend
onToggled: {
AIP.WaydroidState.suspend = checked
infoMessage.visible = true
}
}
FormCard.FormDelegateSeparator { above: suspend; below: uevent }
FormCard.FormSwitchDelegate {
id: uevent
text: i18n("UEvent")
description: i18n("Allow android direct access to hotplugged devices")
checked: AIP.WaydroidState.uevent
onToggled: {
AIP.WaydroidState.uevent = checked
infoMessage.visible = true
}
}
}
}