Debian Codegraph @

qml/Components/ChooserAlgorithm.qml

raw
1 /*
2 * This file is based on work taken from Ubuntu Weather app as on September 2019. Copyright (C) 2019 UBports
3 * Copyright (C) 2019 Joan Cibersheep
4 *
5 *
6 * This App is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 3 as
8 * published by the Free Software Foundation.
9 *
10 *
11 * This App is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 import QtQuick 2.9
22 import Lomiri.Components 1.3
23
24 Item {
25 height: algSetting.height
26
27 property string selectedAlg: "SHA1"
28
29 ListModel {
30 id: algModel
31 Component.onCompleted: initialize()
32
33 function initialize() {
34 algModel.append({"text": "SHA1"})
35 algModel.append({"text": "SHA256"})
36 algModel.append({"text": "SHA512"})
37 }
38 }
39
40 ExpandableListItem {
41 id: algSetting
42 listViewHeight: algModel.count*units.gu(6.1)
43 model: algModel
44 title.text: selectedAlg
45
46 delegate: StandardListItem {
47 title.text: model.text
48 icon.name: "ok"
49 icon.visible: selectedAlg === model.text
50 onClicked: {
51 selectedAlg = model.text;
52 algSetting.toggleExpansion();
53 }
54 }
55 }
56 }