aboutsummaryrefslogtreecommitdiff
path: root/qml
diff options
context:
space:
mode:
authorlink2xt <link2xt@testrun.org>2020-11-05 23:29:48 +0300
committerlink2xt <link2xt@testrun.org>2020-11-05 23:29:48 +0300
commit33d7f5ce602255464cf1b56941e9bf83813236b5 (patch)
tree0ac8f836976981079857eb71b31f748d8fcc5f07 /qml
parenta441a4ae1223e745c41ad7b9a111ad4401125d16 (diff)
downloadkdeltachat-33d7f5ce602255464cf1b56941e9bf83813236b5.tar.gz
kdeltachat-33d7f5ce602255464cf1b56941e9bf83813236b5.zip
Display account addresses on accounts page
Diffstat (limited to 'qml')
-rw-r--r--qml/AccountsPage.qml30
1 files changed, 27 insertions, 3 deletions
diff --git a/qml/AccountsPage.qml b/qml/AccountsPage.qml
index 3278031..ca27df8 100644
--- a/qml/AccountsPage.qml
+++ b/qml/AccountsPage.qml
@@ -14,7 +14,19 @@ Kirigami.Page {
text: "Add account"
onTriggered: {
let accountId = dcAccounts.addAccount()
- accountsModel.insert(accountsModel.count, { number: accountId })
+ let context = dcAccounts.getAccount(accountId);
+
+ let title;
+ if (context.isConfigured()) {
+ title = context.getConfig("addr");
+ } else {
+ title = `Unconfigured ${accountId}`
+ }
+
+ accountsModel.insert(accountsModel.count, {
+ number: accountId,
+ title: title
+ })
}
}
@@ -53,7 +65,19 @@ Kirigami.Page {
accountsModel.clear()
for (let i = 0; i < accountsList.length; i++) {
- accountsModel.insert(i, { number: accountsList[i] })
+ let accountId = accountsList[i];
+ let title;
+ let context = dcAccounts.getAccount(accountId);
+ if (context.isConfigured()) {
+ title = context.getConfig("addr");
+ } else {
+ title = `Unconfigured ${accountId}`
+ }
+
+ accountsModel.insert(i, {
+ number: accountId,
+ title: title
+ })
}
}
@@ -71,7 +95,7 @@ Kirigami.Page {
Label {
Layout.fillWidth: true
- text: model.number
+ text: model.title
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}