~artmello/ubuntu-system-settings/category-list-view

« back to all changes in this revision

Viewing changes to plugins/wifi/MenuItemFactory.qml

  • Committer: Bileto Bot
  • Author(s): Lukáš Tinkl
  • Date: 2017-01-18 16:18:34 UTC
  • mfrom: (1750.2.1 ap-signal-strength)
  • Revision ID: ci-train-bot@canonical.com-20170118161834-mqx5s2altc5sh9bk
Fix WIFI APs signal strength icons

Approved by: Jonas G. Drange

Show diffs side-by-side

added added

removed removed

Lines of Context:
130
130
            property var menuModel: menuFactory.model
131
131
            property int menuIndex: -1
132
132
            property var extendedData: menu && menu.ext || undefined
133
 
            property var strenthAction: QMenuModel.UnityMenuAction {
 
133
            property var strengthAction: QMenuModel.UnityMenuAction {
134
134
                model: menuModel ? menuModel : null
135
135
                name: getExtendedProperty(extendedData, "xCanonicalWifiApStrengthAction", "")
136
136
            }
140
140
            secure: getExtendedProperty(extendedData, "xCanonicalWifiApIsSecure", false)
141
141
            adHoc: getExtendedProperty(extendedData, "xCanonicalWifiApIsAdhoc", false)
142
142
            checked: serverChecked
143
 
            signalStrength: strenthAction.valid ? strenthAction.state : 0
 
143
            signalStrength: {
 
144
                if (strengthAction.valid) {
 
145
                    var state = strengthAction.state; // handle both int and uchar
 
146
                    if (typeof state == "string") {
 
147
                        return state.charCodeAt();
 
148
                    }
 
149
                    return state;
 
150
                }
 
151
                return 0;
 
152
            }
144
153
            enabled: menu ? menu.sensitive : false
145
154
 
146
155
            onMenuModelChanged: {