summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-05-11 15:47:01 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-05-11 15:47:01 +0200
commitcea2ea5c366ad621d8c5d9da9b2131ef1729ce61 (patch)
tree0da945f1aed7d11dd6e0c690873b09f8e8ca5671
parent40258f645a5d20c6cdb0c8679029993569ad119c (diff)
downloadkube-cea2ea5c366ad621d8c5d9da9b2131ef1729ce61.tar.gz
kube-cea2ea5c366ad621d8c5d9da9b2131ef1729ce61.zip
Select the last added account
-rw-r--r--components/package/contents/ui/Settings.qml24
1 files changed, 16 insertions, 8 deletions
diff --git a/components/package/contents/ui/Settings.qml b/components/package/contents/ui/Settings.qml
index ecea592c..a20078dc 100644
--- a/components/package/contents/ui/Settings.qml
+++ b/components/package/contents/ui/Settings.qml
@@ -82,26 +82,34 @@ Rectangle {
82 82
83 currentIndex: -1 83 currentIndex: -1
84 84
85 delegate: Kirigami.AbstractListItem { 85 onCountChanged: {
86 listView.currentIndex = count - 1
87 }
86 88
89 delegate: Kirigami.AbstractListItem {
87 enabled: true 90 enabled: true
88 supportsMouseEvents: true 91 supportsMouseEvents: true
89 checked: listView.currentIndex == index 92 checked: listView.currentIndex == index
90 93
94 onCheckedChanged: {
95 if (checked) {
96 console.warn("Current index changed ", accountFactory.accountId);
97 accountDetails.source = accountFactory.uiPath
98 accountDetails.item.accountId = accountFactory.accountId
99 accountDetails.item.icon = accountFactory.icon
100 accountDetails.item.accountName = accountFactory.name
101 }
102 }
103
91 onClicked: { 104 onClicked: {
92 console.warn("Loading module is ", accountFactory.accountId);
93 accountDetails.source = accountFactory.uiPath
94 accountDetails.item.accountId = accountFactory.accountId
95 accountDetails.item.icon = accountFactory.icon
96 accountDetails.item.accountName = accountFactory.name
97 listView.currentIndex = model.index 105 listView.currentIndex = model.index
98 } 106 }
99 107
100 contentItem: RowLayout { 108 contentItem: RowLayout {
101 109
102 KubeFramework.AccountFactory { 110 KubeFramework.AccountFactory {
103 id: accountFactory 111 id: accountFactory
104 accountId: model.accountId 112 accountId: model.accountId
105 } 113 }
106 114
107 Kirigami.Icon { 115 Kirigami.Icon {