summaryrefslogtreecommitdiff
path: root/Accounts.qml
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi92@disroot.org>2026-02-04 11:34:38 +0100
committerXavier Del Campo Romero <xavi92@disroot.org>2026-02-04 15:24:48 +0100
commit23cc4be5bc02328fe73ccbd67493dd71ef2e2b8f (patch)
treeb9e1a7a416f004d96671c0abf597524946b9dda3 /Accounts.qml
parent3b9973552ec613b37fb511f3a0ae24dacb1e4366 (diff)
downloadyachat6-23cc4be5bc02328fe73ccbd67493dd71ef2e2b8f.tar.gz
Add accounts and login pages
Diffstat (limited to 'Accounts.qml')
-rw-r--r--Accounts.qml50
1 files changed, 50 insertions, 0 deletions
diff --git a/Accounts.qml b/Accounts.qml
new file mode 100644
index 0000000..dc91e66
--- /dev/null
+++ b/Accounts.qml
@@ -0,0 +1,50 @@
+import QtQuick 2.12
+import QtQuick.Window 2.12
+import QtQuick.Controls 2.0
+import QtQuick.Layouts 1.0
+import org.yachat.app 1.0
+
+Page
+{
+ header: CustToolbar
+ {
+ id: header
+ title: qsTr("Accounts")
+
+ ToolButton
+ {
+ text: qsTr("+")
+ anchors.right: parent.right
+ onClicked: stack.push("qrc:/org/yachat/app/Login.qml", {})
+ }
+ }
+
+ ListView
+ {
+ ListModel
+ {
+ id: acmodel
+ }
+
+ Component.onCompleted:
+ {
+ var accounts = Yc.accounts()
+
+ for (var i = 0; i < accounts.length; i++)
+ acmodel.append({"jid": accounts[i]})
+ }
+
+ width: parent.width
+ anchors.fill: parent
+ anchors.horizontalCenter: parent.horizontalCenter
+ model: acmodel
+ delegate: ItemDelegate
+ {
+ required property var model
+
+ width: parent.width
+ text: model.jid
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ }
+}