~ahayzen/ubuntu-weather-app/reboot-1452497-add-location-from-home

« back to all changes in this revision

Viewing changes to app/ui/settings/UnitsPage.qml

Remove precip settings from the Settings Page because it is not part of the data shown to the user.

Approved by Nekhelesh Ramananthan, Ubuntu Phone Apps Jenkins Bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
        }
49
49
 
50
50
        ListModel {
51
 
            id: precipationModel
52
 
            Component.onCompleted: initialize()
53
 
            function initialize() {
54
 
                // TRANSLATORS: The strings are standard measurement units
55
 
                // of precipitation in millimeters and are shown in the settings page.
56
 
                // Only the abbreviated form of millimeters should be used.
57
 
                precipationModel.append({"text": i18n.tr("mm"), "value": "mm"})
58
 
 
59
 
                // TRANSLATORS: The strings are standard measurement units
60
 
                // of precipitation in inches and are shown in the settings page.
61
 
                // Only the abbreviated form of inches should be used.
62
 
                precipationModel.append({"text": i18n.tr("in"), "value": "in"})
63
 
            }
64
 
        }
65
 
 
66
 
        ListModel {
67
51
            id: windSpeedModel
68
52
            Component.onCompleted: initialize()
69
53
            function initialize() {
104
88
            }
105
89
 
106
90
            ExpandableListItem {
107
 
                id: precipationSetting
108
 
 
109
 
                listViewHeight: precipationModel.count*units.gu(7) - units.gu(1)
110
 
                model: precipationModel
111
 
                text: i18n.tr("Precipitation")
112
 
                subText: settings.precipUnits === "mm" ? i18n.tr("mm")
113
 
                                                       : i18n.tr("in")
114
 
 
115
 
                delegate: StandardListItem {
116
 
                    title: model.text
117
 
                    icon: "ok"
118
 
                    showIcon: settings.precipUnits === model.value
119
 
                    onClicked: {
120
 
                        settings.precipUnits = model.value
121
 
                        refreshData(true)
122
 
                    }
123
 
                }
124
 
            }
125
 
 
126
 
            ExpandableListItem {
127
91
                id: windSetting
128
92
 
129
93
                listViewHeight: windSpeedModel.count*units.gu(7) - units.gu(1)