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
2026-03-07 03:08:07 +00:00
import org . kde . kirigami as Kirigami
2025-07-10 16:00:41 +00:00
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
2026-04-24 07:35:28 +00:00
visible: AIP . WaydroidDBusClient . status === AIP . WaydroidDBusClient . Initialized
&& AIP . WaydroidDBusClient . sessionStatus === AIP . WaydroidDBusClient . SessionRunning
function packagePatternSummary ( value: string ) : string {
return value === "" ? i18n ( "Not set" ) : value
}
2025-07-10 16:00:41 +00:00
FormCard . FormHeader {
title: i18n ( "General information" )
}
FormCard . FormCard {
FormCard . FormTextDelegate {
text: i18n ( "IP address" )
2025-08-06 20:06:17 +00:00
description: AIP . WaydroidDBusClient . ipAddress
2025-07-10 16:00:41 +00:00
trailing: PC3 . Button {
2025-08-06 20:06:17 +00:00
visible: AIP . WaydroidDBusClient . ipAddress !== ""
2025-08-10 18:52:25 +00:00
text: i18n ( "Copy" )
2025-07-10 16:00:41 +00:00
icon.name: 'edit-copy-symbolic'
2025-08-06 20:06:17 +00:00
onClicked: AIP . WaydroidDBusClient . copyToClipboard ( AIP . WaydroidDBusClient . ipAddress )
2025-07-10 16:00:41 +00:00
}
}
FormCard . FormTextDelegate {
text: i18n ( "Waydroid status" )
description: i18n ( "Running" )
trailing: PC3 . Button {
text: i18n ( "Stop session" )
2025-08-06 20:06:17 +00:00
onClicked: AIP . WaydroidDBusClient . stopSession ( )
2025-07-10 16:00:41 +00:00
}
}
2025-07-10 16:57:34 +00:00
FormCard . FormButtonDelegate {
2025-08-06 20:06:17 +00:00
visible: AIP . WaydroidDBusClient . systemType === AIP . WaydroidDBusClient . 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 {
2025-12-27 13:57:22 +00:00
text: i18n ( "Reset Waydroid" )
2025-07-28 17:37:19 +00:00
onClicked: confirmDialog . open ( )
}
Kirigami . PromptDialog {
id: confirmDialog
title: i18nc ( "@title:window" , "Confirm Waydroid Reset" )
2025-12-27 13:57:22 +00:00
subtitle: i18n ( "Are you sure you want to reset Waydroid? This is a destructive action, and will wipe all user data." )
2025-07-28 17:37:19 +00:00
standardButtons: Kirigami . Dialog . Ok | Kirigami . Dialog . Cancel
2025-08-10 18:52:25 +00:00
2025-08-06 20:06:17 +00:00
onAccepted: AIP . WaydroidDBusClient . resetWaydroid ( )
2025-07-28 17:37:19 +00:00
}
2026-04-24 07:35:28 +00:00
Kirigami . PromptDialog {
id: fakeTouchDialog
title: i18n ( "Touch input override" )
standardButtons: Kirigami . Dialog . Ok | Kirigami . Dialog . Cancel
onOpened: {
fakeTouchField . text = AIP . WaydroidDBusClient . fakeTouch
fakeTouchField . forceActiveFocus ( )
}
onAccepted: AIP . WaydroidDBusClient . fakeTouch = fakeTouchField . text . trim ( )
ColumnLayout {
spacing: Kirigami . Units . largeSpacing
QQC2 . Label {
Layout.fillWidth: true
wrapMode: Text . WordWrap
text: i18n ( "Comma-separated package names for apps where mouse input should be interpreted as touch. Supports * wildcards. Leave empty to clear the override." )
}
QQC2 . TextField {
id: fakeTouchField
Layout.fillWidth: true
placeholderText: "com.rovio.*"
}
}
}
Kirigami . PromptDialog {
id: fakeWifiDialog
title: i18n ( "Wi-Fi override" )
standardButtons: Kirigami . Dialog . Ok | Kirigami . Dialog . Cancel
onOpened: {
fakeWifiField . text = AIP . WaydroidDBusClient . fakeWifi
fakeWifiField . forceActiveFocus ( )
}
onAccepted: AIP . WaydroidDBusClient . fakeWifi = fakeWifiField . text . trim ( )
ColumnLayout {
spacing: Kirigami . Units . largeSpacing
QQC2 . Label {
Layout.fillWidth: true
wrapMode: Text . WordWrap
text: i18n ( "Comma-separated package names for apps that should always appear to be on Wi-Fi. Supports * wildcards. Leave empty to clear the override." )
}
QQC2 . TextField {
id: fakeWifiField
Layout.fillWidth: true
placeholderText: "com.gameloft.*"
}
}
}
2025-07-10 16:00:41 +00:00
}
Fix various typos
Fixes typos in various source comments.
Found via `codespell -S "*.po,*.svg,*.pgm,*.xml,./po,*.desktop,*.json,*.actions" -L aline,aparent,childs,distroname,indexin,indx,logicaly,lokal,nd,splitted,te`
2025-09-05 12:21:15 +00:00
// Some information such as IP address can take time to be set by Waydroid
2025-07-10 16:00:41 +00:00
Timer {
id: autoRefreshSessionTimer
interval: 2000
repeat: true
running: root . visible
2025-08-06 20:06:17 +00:00
onTriggered: AIP . WaydroidDBusClient . refreshSessionInfo ( )
2025-07-10 16:00:41 +00:00
}
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 {
2025-12-27 13:57:22 +00:00
text: i18n ( "May require restarting the Waydroid session to apply" )
2025-07-10 16:00:41 +00:00
textItem.wrapMode: Text . WordWrap
icon.name: "dialog-warning"
}
}
Connections {
2025-08-06 20:06:17 +00:00
target: AIP . WaydroidDBusClient
2025-07-10 16:00:41 +00:00
function onSessionStatusChanged ( ) {
infoMessage . visible = false
}
}
FormCard . FormCard {
FormCard . FormSwitchDelegate {
id: multiWindows
text: i18n ( "Multi Windows" )
description: i18n ( "Enables/Disables window integration with the desktop" )
2025-08-06 20:06:17 +00:00
checked: AIP . WaydroidDBusClient . multiWindows
2025-07-10 16:00:41 +00:00
onToggled: {
2025-08-06 20:06:17 +00:00
AIP . WaydroidDBusClient . multiWindows = checked
2025-07-10 16:00:41 +00:00
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" )
2025-08-06 20:06:17 +00:00
checked: AIP . WaydroidDBusClient . suspend
2025-07-10 16:00:41 +00:00
onToggled: {
2025-08-06 20:06:17 +00:00
AIP . WaydroidDBusClient . suspend = checked
2025-07-10 16:00:41 +00:00
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" )
2025-08-06 20:06:17 +00:00
checked: AIP . WaydroidDBusClient . uevent
2025-07-10 16:00:41 +00:00
onToggled: {
2025-08-06 20:06:17 +00:00
AIP . WaydroidDBusClient . uevent = checked
2025-07-10 16:00:41 +00:00
infoMessage . visible = true
}
}
2026-04-24 07:35:28 +00:00
FormCard . FormDelegateSeparator { above: uevent ; below: fakeTouch }
FormCard . FormTextDelegate {
id: fakeTouch
text: i18n ( "Touch input override" )
description: root . packagePatternSummary ( AIP . WaydroidDBusClient . fakeTouch )
trailing: PC3 . Button {
text: i18n ( "Edit" )
onClicked: fakeTouchDialog . open ( )
}
}
FormCard . FormDelegateSeparator { above: fakeTouch ; below: fakeWifi }
FormCard . FormTextDelegate {
id: fakeWifi
text: i18n ( "Wi-Fi override" )
description: root . packagePatternSummary ( AIP . WaydroidDBusClient . fakeWifi )
trailing: PC3 . Button {
text: i18n ( "Edit" )
onClicked: fakeWifiDialog . open ( )
}
}
2025-07-10 16:00:41 +00:00
}
2025-08-10 18:52:25 +00:00
}