~ken-vandine/ubuntu-system-settings/rtm-14.09_lp1351383

« back to all changes in this revision

Viewing changes to plugins/cellular/CustomApnEditor.qml

[ CI bot ]
* Resync trunk
[ Michael Zanetti ]
* update code to reset launcher after launcher backend implementation
  was reworked (LP: #1376707)
[ Sebastien Bacher ]
* [storage] translator comment for the string "%1 free" (LP: #1377929)
* [system-update] ellipsize labels if needed (LP: #1376286)
* [sound] Use the correct low icon (LP: #1376286)
[ Lars Uebernickel ]
* notification-manager: fix issues with GVariant API usage
[ jonas-drange ]
* [security/privacy] allow user to change HERE and location detection
  settings. (LP: #1375322)
[ Ken VanDine ]
* Updated the pot file.
[ jonas-drange ]
* [cellular] indirectly recreate ConnectionManager interface's dbus
  proxy so it reports the true value of 'Powered' after flight mode
  (LP: #1376957)
[ Iain Lane ]
* [sound] Make listSounds take a list of directories and list all of
  the files in them, instead of assuming "/custom" all the time.
[ Ubuntu daily release ]
* New rebuild forced
[ Sebastien Bacher ]
* [sound] list custom ringtones as well (LP: #1381528)
[ Ken VanDine ]
* Add an APN editor. (LP: #1225174)
[ Michael Terry ]
* Complete the unlock security screens and update a host of other
  small design issues. (LP: #1365034, LP: #1348362) (LP: #1365034,
  #1348362)
[ Diego Sarmentero ]
* Improves in network backend. Detect network connection and show
  "Connect to the internet..." message or retry on netword detected. .
* Detect account added on online accounts (LP: #1362149)
[ jonas-drange ]
* [wifi/phone] dynamically chooses what SIM to use when there's only
  one present. (LP: #1375832)
[ Iain Lane ]
* [storage/about] Use a QSharedPointer to manage freeing of the
  counter which we use to display all of the collected sizes at once.
  If the measuring process was cancelled, we were freeing it multiple
  times - once for each outstanding size measurement. This led to a
  crash. (LP: #1375988)
* [security-privacy] Link with gobject, uses symbols from this
  library. Prevents "[…]libUbuntuSecurityPrivacyPanel.so contains an
  unresolvable reference to symbol
  g_signal_handlers_disconnect_matched: it's probably a plugin"
  warnings.
[ jonas-drange ]
* [cellular] react to application.state changes and update potential
  out-of-date default SIM settings (LP: #1364103)
* [wifi] let removed networks update the previous network model so
  that we can reuse the model (and not pop the pagestack twice,
  causing this ux issue) (LP: #1370389)
[ Sebastien Bacher ]
* [location] use a flickable so the list can be scrolled (LP:
  #1374017)
* [security] get localized application names from the trust-store (LP:
  #1374018)
[ Ken VanDine ]
* Fixed handling of the Downloading/Installing label based on actual
  state. . Forward updateProgress signals for system updates. Layout
  fixes (LP: #1312587)
* Use new splash screen (LP: #1376242)
* Improved tracking download states
* Use new target_build_number from system-image-dbus to determine
  visibility of the update notification (LP: #1355803)
[ CI bot ]
* Resync trunk
[ Sebastien Bacher ]
* [storage] use libclick rather than calling the command line (LP:
  #1368967)
* [storage] tweaks to the disk informations, limit the free space to
  the user available one (excluding the system partitions), don't list
  the external mounts, that's described in the design and is going to
  require work on the categories computation to give correct values
  (LP: #1284247)
* [about] display the free space value next to the storage label (LP:
  #1335144)
[ Albert Astals ]
* Add i18n.tr
[ jonas-drange ]
* [wifi] connect to hidden network is now a dialog (LP: #1366005)
[ Ken VanDine ]
* Provide more keywords to make search useful (LP: #1370219) (LP:
  #1370219)
* [background] set sourceSize in the image preview to work around an
  issue loading large images (LP: #1373462)
[ CI bot ]
* Resync trunk
[ Mathieu Trudel-Lapierre ]
* [bluetooth] Properly handle device types for connection and
  disconnection. (LP: #1369964)
[ Michael Terry ]
* Add a translator comment for what HERE means. (LP: #1368838) (LP:
  #1368838)
* Prevent a crash in unity8 when the wizard also crashes or stops
  early. (LP: #1355892) (LP: #1355892)
[ Michael Terry ]
* Prevent the buttons of the wizard's password page from overlapping
  its content when the OSK appears. (LP: #1368346) (LP: #1368346)
[ Ken VanDine ]
* Set the version information in the SystemUpdate constructor (LP:
  #1371810) (LP: #1371810)
* [reset] Don't bail out on an isValid() check on the SystemImage
  QDBusInterface, the docs say isValid() may not be reliable for
  remote interfaces (LP: #1370815) (LP: #1370815)
* Fixed reference error for count on the various device models (LP:
  #1362517) (LP: #1362517)
* [background] Use the ContentPeerPicker to select sources for
  backgrounds (LP: #1356542) (LP: #1356542)
[ Iain Lane ]
* Don't check if the timedated interface is valid before calling
  SetTime on it, it might have timed out and we should reactivate it
  in that case.
* [about] Fix developerMode property to be QMLish - read & write
  instead of separate "read" and "toggle" properties.
* [about] Don't display a frame for icons that can't be found,
  improving the visual appearance. Also return the correct path for
  click packages which use the icon theme.
[ Sebastien Bacher ]
* [storage] handle the scope click .ini and get the correct icons (LP:
  #1368920)
[ Albert Astals ]
* make pot
[ Oliver Grawert ]
* fix LP: #1365903, add a watch to Developer Mode page so the page
  gets refreshed when going back through the page stack, also fix the
  page id and bounds (LP: #1365903)
* Some packaging fixes
  - > is not a valid relationship. It should be >>
  - Don't recommend suru-icon-theme since we also depend on it
  - Bump S-V to 3.9.6 which for example allows the images we ship in
    /usr/lib/
  - Override binary-no-manpage lintian warnings. We're not going to get man
    pages for u-s-s any time soon
[ Ken VanDine ]
* Make UpdateManager a singleton and refresh the availableUpdates
  count when the model updates (LP: #1325629) (LP: #1325629)
[ Ken VanDine ]
* Include an icon instead of using the themed icon (LP: #1365408) (LP:
  #1365408)
[ Mathieu Trudel-Lapierre ]
* [bluetooth] don't try to enable Discoverable if the device isn't
  powered yet. (LP: #1355904)
[ Ken VanDine ]
* When activated by a url request for a specific panel, clear the
  pageStack to maintain the natural navigation instead of pushing a
  new page on top of a page from a the previous panel (LP: #1362025)
  (LP: #1362025, #1359953)
[ Lars Uebernickel ]
* Use Icon instead of StatusIcon
[ CI bot ]
* Resync trunk
[ John R. Lenton ]
* Take the system settings push helper closer to implementing the spec
  at https://wiki.ubuntu.com/SoftwareUpdates#Prompting (LP: #1363972)
[ Ken VanDine ]
* Don't try to tweak the bottomMargin for the OSK, it was trying to
  calculate it based on an undefined component so failing. It
  shouldn't be needed anyway.
[ jonas-drange ]
* [wifi] "Other Network" -> "Connect to hidden network" (LP: #1365984)
* [wifi] fix bad looking buttons in "Other Networks" panel (LP:
  #1362127)
[ Jussi Pakkanen ]
* Hide entry to connect to hidden network when wifi is off. (LP:
  #1365960)
[ Ken VanDine ]
* Fixed tests for the dialpad settings failing on mako
* Don't call downloadUpdate when we see a system update ready, the
  service does that for us (LP: #1368294) (LP: #1368294)
* Translate desktop file (LP: #1318008) (LP: #1318008)
[ Martin Pitt ]
* update POT
[ Sebastien Bacher ]
* [system-update] open the ubuntuone subpanel rather than the list
  (LP: #1348580)
* [security-privacy] use ngettext strings when needed (LP: #1368159)
* Increase vertical spacing in the settings grid (LP: #1348579)
[ jonas-drange ]
* [background] always keep custom images, and remove press-and-hold
  action. (LP: #1365167)
* [wifi] do not use predictive text for network name input (LP:
  #1365992)
* [language] workaround for transition bug in keyboard layout menu
  (LP: #1350809)
* [wifi] factory was setting the icon property, which was causing the
  icon to not render (LP: #1364366)
[ Alejandro J. Cura ]
* Fixing the refreshing of the apps scope (LP: #1360369)
[ Sebastien Bacher ]
* [sound] use the correct backend to control the keyboard sound toggle
  (LP: #1366208)
[ Ken VanDine ]
* Don't call downloadUpdate for system updates that are already
  downloading (LP: #1365646) (LP: #1311219, #1365646)
[ Ken VanDine ]
* Notify the user if the phone needs to be plug to power for update.
[ Sebastien Bacher ]
* [system-update] don't draw a frame around ubuntu updates (LP:
  #1367136)
[ Mathieu Trudel-Lapierre ]
* Also allow Speakers and Carkits as valid audio devices to pair.
[ Michael Terry ]
* Allow switch from PIN code to passphrase and back using the same
  password. (LP: #1357043) (LP: #1357043)
* Fix false-negatives from AccountsService when switching from swipe
  to password (LP: #1363405) (LP: #1363405)
[ Ricardo Salveti de Araujo ]
* sound: setting default audio role for ringtone and messages
[ Michael Terry ]
* Don't crash when destructing the Wizard.Utils.System plugin. This
  fixes the crash on wizard exit and the crash when pressing back on
  the HERE license.
[ CI bot ]
* Resync trunk
[ Sebastien Bacher ]
* [developer-mode] working scrolling and correct spacing
* Use standard items for the categories and don't display dividers
  (LP: #1365563)
* [orientation-lock] don't display a frame around the icon (LP:
  #1365450)
[ jonas-drange ]
* [about/versions] create reusable component of singlevalue items that
  have long values (LP: #1363927)
[ David Barth ]
* Enable location panel, display contols for authorized applications.
[ Ken VanDine ]
* Tweak the depends for accountsservice-ubuntu-schemas to handle a "~"
  version
[ CI bot ]
* Resync trunk
[ Guillermo Gonzalez ]
* Basic unittest for the push-helper script
[ Mathieu Trudel-Lapierre ]
* Downgrade qFatal failure to register bluetooth agent to a qCritical.
[ Andrea Cimitan ]
* Various fixes for wifi wizard page (LP: #1362296)
[ Sebastien Bacher ]
* [security] don't mark "%1" string as translatable
* [security] give a translation context to the 'None' string (LP:
  #1362143)
* [licenses] display an error when the copyright can't be read (LP:
  #1206150)
[ Michael Terry ]
* Avoid another race condition when switching password types by
  completing all DBus operations synchronously as we exit the
  policykit agent. LP: 1361137 (LP: #1361137)
* Fix the OSK not working on first boot. When the wizard closes, shut
  down maliit-server and the indicators so that unity8 can start them
  itself. LP: 1362679 (LP: #1362679)
[ jonas-drange ]
* [about] print out phone numbers for dual sims as well
* [about/wifi] adding mac addresses for bt and wifi, and ip for wifi
  (LP: #1356239)
* [language] explain to the user that a reboot is necessary for the
  change to take effect (LP: #1240875)
[ Michael Terry ]
* Make the HERE license optional, clearly mark it as a HERE license
  instead of an Ubuntu license, and connect it to the HERE backend.
[ CI bot ]
* Resync trunk
[ Martin Pitt ]
* POT update
[ Ken VanDine ]
* Added setting for dialpad sounds to both the sound and phone panels.
[ CI bot ]
* Resync trunk
[ Diego Sarmentero ]
* Fix out of sync image download. Refresh scope after installation
  (LP: #1324923)
[ Sebastien Bacher ]
* [battery] refresh the graph on a minute basis
* [notifications] use normal text style and ubuntushaped icons
[ Michael Terry ]
* When changing to swipe mode, it was possible that our policykit
  agent would not unregister itself, making the next attempt to change
  modes appear to work, but in truth fail. Also, no longer ask for a
  password to switch to swipe mode if policykit has a cached
  authentication for us. (LP: #1350381)
[ Sebastien Bacher ]
* [security] tweak some pin locking details to match the design better
[ Michael Terry ]
* Implement the "When locked, allow:" portion of the Security &
  Privacy panel, so now the user can control whether the launcher
  and/or indicators are available while locked. (LP: #1358340) (LP:
  #1358340)
[ Michael Terry ]
* Update look and feel of wizard to more closely match the visual
  design.
[ Jussi Pakkanen ]
* Minor cleanups.
[ Roberto Alsina ]
* Don't crash the push helper in locales that have no .mo file (LP:
  #1357506)
[ Ken VanDine ]
* SIM PIN lock implementation
[ jonas-drange ]
* [main panel] add visual feedback on press
* [cellular] uses modemtechnologies property from ofono to populate
  technology preference options (LP: #1346790)
[ Sebastien Bacher ]
* [language] workaround inconsistent languages casing (LP: #1362123)
* [background] Display the default background selected (LP: #1349329)
* [storage] display translated names (LP: #1360207)
* [updates] don't display animations when clicking on update rows (LP:
  #1360364)
* [background] don't use an icon in the headerbar (LP: #1362122)
[ Mathieu Trudel-Lapierre ]
* Fix PIN code or passcode requests by properly matching the tag for
  the original request. (LP: #1355152)
[ Martin Pitt ]
* Update PO template
[ Sebastien Bacher ]
* Include extra files for translations (LP: #1359267)
[ jonas-drange ]
* [main panel] show rotation lock, point to correct setting
[ Ken VanDine ]
* Hide sleep locks immediately setting, which isn't implemented yet
  (LP: #1361297) (LP: #1361297)
[ Sebastien Bacher ]
* [system-update] rework the ui to use a column rather than anchors,
  the layout is quite dynamic and it should be easier to position and
  stack widgets this way (LP: #1343172)
[ Michael Terry ]
* After selecting the language, update the session environment
  immediately and restart indicators so that their notifications (like
  wifi prompt) are translated. (LP: #1354325)
[ Ken VanDine ]
* Added autopilot tests for security-privacy
[ jonas-drange ]
* [phone] adding dual sim functionality to phone panel
[ Charles Kerr ]
* In the welcome wizard, refresh the text in the 'no sim card' and
  'all done' pages to match the latest from design.
[ Michael Terry ]
* Add a location page and a terms and conditions page for the HERE
  service.
[ Ken VanDine ]
* Settings for idle/lock timeout (LP: #1230345)
* Added flickable to fix scrolling (LP: #1354161)
[ Jussi Pakkanen ]
* Fix a bunch of compiler warnings.
[ jonas-drange ]
* [cellular] displays cellular UIs based on how many SIMs are present.
  (LP: #1357393)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * This file is part of system-settings
 
3
 *
 
4
 * Copyright (C) 2014 Canonical Ltd.
 
5
 *
 
6
 * Contact: Pat McGowan <pat.mcgowan@canonical.com>
 
7
 *
 
8
 * This program is free software: you can redistribute it and/or modify it
 
9
 * under the terms of the GNU General Public License version 3, as published
 
10
 * by the Free Software Foundation.
 
11
 *
 
12
 * This program is distributed in the hope that it will be useful, but
 
13
 * WITHOUT ANY WARRANTY; without even the implied warranties of
 
14
 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
 
15
 * PURPOSE.  See the GNU General Public License for more details.
 
16
 *
 
17
 * You should have received a copy of the GNU General Public License along
 
18
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 
19
 */
 
20
 
 
21
import QtQuick 2.0
 
22
import QtQuick.Layouts 1.1
 
23
import SystemSettings 1.0
 
24
import Ubuntu.Components 1.1
 
25
import Ubuntu.Components.ListItems 1.0 as ListItem
 
26
 
 
27
ItemPage {
 
28
    objectName: "customapnPage"
 
29
    id: root
 
30
 
 
31
    // "internet" or "mms"
 
32
    property var type
 
33
 
 
34
    // dict of "type" : ctx
 
35
    property var contexts;
 
36
 
 
37
    /// work around LP(#1361919)
 
38
    property var activateCb;
 
39
 
 
40
    QtObject {
 
41
        id: d
 
42
        property var typeText : type === "internet" ? i18n.tr("Internet") : i18n.tr("MMS")
 
43
        property bool isMms : type === "mms"
 
44
 
 
45
        property bool isValid : false
 
46
 
 
47
        function validateFields() {
 
48
            if (apnName.text === "") {
 
49
                isValid = false;
 
50
                return
 
51
            }
 
52
            if (isMms) {
 
53
                if (mmsc.text === "") {
 
54
                    isValid = false;
 
55
                    return;
 
56
                }
 
57
                /// @todo validate proxy
 
58
                /// @todo force port to be integer and validate it's value
 
59
            }
 
60
 
 
61
            // @todo the rest
 
62
            isValid = true;
 
63
        }
 
64
    }
 
65
 
 
66
    //TRANSLATORS: %1 is either i18n.tr("Internet") or i18n.tr("MMS")
 
67
    title: i18n.tr("Custom %1 APN").arg(d.typeText)
 
68
 
 
69
    // workaround of getting the following error on startup:
 
70
    // WARNING - ... : QML Page: Binding loop detected for property "flickable"
 
71
    flickable: null
 
72
    Component.onCompleted: {
 
73
        flickable: scrollWidget
 
74
 
 
75
        var ctx;
 
76
        if (d.isMms) {
 
77
            ctx = contexts["mms"];
 
78
            if (ctx === undefined) {
 
79
                // @bug LP(:#1362795)
 
80
                return;
 
81
            }
 
82
        } else {
 
83
            ctx = contexts["internet"]
 
84
        }
 
85
 
 
86
        apnName.text = ctx.accessPointName;
 
87
        userName.text = ctx.username;
 
88
        pword.text = ctx.password;
 
89
        mmsc.text = ctx.messageCenter;
 
90
        var proxyText = ctx.messageProxy.split(":");
 
91
        proxy.text = proxyText[0] !== undefined ? proxyText[0] : "";
 
92
        port.text = proxyText[1] !== undefined ? proxyText[1] : "";
 
93
        /// @todo protocol values
 
94
 
 
95
        if (d.isMms) {
 
96
            /// @todo disabled for now
 
97
            doBoth.checked = false;
 
98
            return;
 
99
            var internetApn = contexts["internet"]
 
100
            if (ctx.accessPointName === internetApn.accessPointName &&
 
101
                ctx.username == internetApn.username &&
 
102
                ctx.password == internetApn.password
 
103
                /* auth + procol */) {
 
104
                doBoth.checked = true;
 
105
            }
 
106
            else
 
107
                doBoth.checked = false;
 
108
        }
 
109
    }
 
110
 
 
111
    Flickable {
 
112
        id: scrollWidget
 
113
        anchors {
 
114
            top: parent.top
 
115
            left: parent.left
 
116
            right: parent.right
 
117
            bottom: parent.bottom
 
118
            margins: units.gu(2)
 
119
        }
 
120
        contentWidth: parent.width
 
121
        clip: true
 
122
        contentHeight: theContents.height
 
123
        boundsBehavior: (contentHeight > height) ? Flickable.DragAndOvershootBounds : Flickable.StopAtBounds
 
124
        flickableDirection: Flickable.VerticalFlick
 
125
 
 
126
        ColumnLayout {
 
127
            id: theContents
 
128
            anchors {
 
129
                left: parent.left
 
130
                right: parent.right
 
131
            }
 
132
            spacing: units.gu(2)
 
133
 
 
134
            ListItem.Standard {
 
135
                id: sameSwitch
 
136
                anchors {
 
137
                    left: parent.left
 
138
                    right: parent.right
 
139
                }
 
140
                /// @todo disable for now
 
141
                //visible: d.isMms
 
142
                visible: false                
 
143
                text: i18n.tr("Same APN as for Internet")
 
144
                control: Switch {
 
145
                    id: doBoth
 
146
                    checked: false
 
147
                    anchors.verticalCenter: parent.verticalCenter
 
148
                    onClicked: {
 
149
                        if (checked) {
 
150
                            var internetApn = contexts["internet"]
 
151
                            apnName.text = internetApn.accessPointName;
 
152
                            userName.text = internetApn.username;
 
153
                            pword.text = internetApn.password;
 
154
                        }
 
155
                    }
 
156
                }
 
157
            }
 
158
 
 
159
            GridLayout {
 
160
                id: theGrid
 
161
                columns: 2
 
162
                columnSpacing: units.gu(1)
 
163
                rowSpacing: units.gu(1)
 
164
                anchors{
 
165
                    right: parent.right
 
166
                    left:parent.left
 
167
                }
 
168
 
 
169
                Label {
 
170
                    //TRANSLATORS: %1 is either i18n.tr("Internet") or i18n.tr("MMS")
 
171
                    text: i18n.tr("%1 APN").arg(d.typeText)
 
172
                }
 
173
                TextField {
 
174
                    id: apnName
 
175
                    enabled: !doBoth.checked
 
176
                    onTextChanged: d.validateFields()
 
177
                    inputMethodHints: Qt.ImhUrlCharactersOnly | Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
 
178
                }
 
179
 
 
180
                Label {
 
181
                    text: i18n.tr("MMSC")
 
182
                    visible: d.isMms
 
183
                }
 
184
                TextField {
 
185
                    id: mmsc
 
186
                    visible: d.isMms
 
187
                    onTextChanged: d.validateFields()
 
188
                    inputMethodHints: Qt.ImhUrlCharactersOnly | Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
 
189
                }
 
190
                Label {
 
191
                    text: i18n.tr("Proxy")
 
192
                    visible: d.isMms
 
193
                }
 
194
                TextField {
 
195
                    id: proxy
 
196
                    visible: d.isMms
 
197
                    onTextChanged: d.validateFields()
 
198
                    inputMethodHints: Qt.ImhUrlCharactersOnly | Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
 
199
                }
 
200
                Label {
 
201
                    text: "Port"
 
202
                    visible: d.isMms
 
203
                }
 
204
                TextField {
 
205
                    id: port
 
206
                    visible: d.isMms
 
207
                    maximumLength: 4
 
208
                    onTextChanged: d.validateFields()
 
209
                    inputMethodHints: Qt.ImhDigitsOnly | Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
 
210
                }
 
211
 
 
212
                Label {
 
213
                    text: i18n.tr("Username")
 
214
                }
 
215
                TextField {
 
216
                    id: userName
 
217
                    enabled: !doBoth.checked
 
218
                    inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
 
219
                }
 
220
 
 
221
                Label {
 
222
                    text: i18n.tr("Password")
 
223
                }
 
224
                TextField {
 
225
                    id: pword
 
226
                    enabled: !doBoth.checked
 
227
                    inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
 
228
                }
 
229
                /// @todo support for ipv6 will be added after RTM
 
230
            }
 
231
 
 
232
            Item {
 
233
                id: buttonRectangle
 
234
 
 
235
                height: cancelButton.height + units.gu(2)
 
236
 
 
237
                anchors {
 
238
                    left: parent.left
 
239
                    right: parent.right
 
240
                }
 
241
 
 
242
                Button {
 
243
                    id: cancelButton
 
244
 
 
245
                    text: i18n.tr("Cancel")
 
246
 
 
247
                    anchors {
 
248
                        left: parent.left
 
249
                        right: parent.horizontalCenter
 
250
                        bottom: parent.bottom
 
251
                        topMargin: units.gu(1)
 
252
                        rightMargin: units.gu(1)
 
253
                        bottomMargin: units.gu(1)
 
254
                    }
 
255
 
 
256
                    onClicked: {
 
257
                        pageStack.pop()
 
258
                    }
 
259
                }
 
260
 
 
261
                Button {
 
262
                    id: confirmButton
 
263
 
 
264
                    text: d.isMms ? i18n.tr("Save") : i18n.tr("Activate")
 
265
 
 
266
                    anchors {
 
267
                        left: parent.horizontalCenter
 
268
                        right: parent.right
 
269
                        bottom: parent.bottom
 
270
                        topMargin: units.gu(1)
 
271
                        leftMargin: units.gu(1)
 
272
                        rightMargin: units.gu(4)
 
273
                        bottomMargin: units.gu(1)
 
274
                    }
 
275
 
 
276
                    enabled: d.isValid;
 
277
 
 
278
                    onClicked: {
 
279
                        var ctx;
 
280
                        if (d.isMms)
 
281
                            ctx = contexts["mms"];
 
282
                        else
 
283
                            ctx = contexts["internet"];
 
284
 
 
285
                        /// @bug LP(:#1362795)
 
286
                        if (d.isMms && ctx === undefined) {
 
287
                            var mmsData = ({})
 
288
                            mmsData["accessPointName"] = apnName.text;
 
289
                            mmsData["username"] = userName.text;
 
290
                            mmsData["password"] = pword.text;
 
291
                            mmsData["messageCenter"] = mmsc.text
 
292
                            var proxyValue = "";
 
293
                            if (proxy.text !== "") {
 
294
                                proxyValue = proxy.text;
 
295
                                if (port.text !== "")
 
296
                                    proxyValue = proxyValue + ":" + port.text;
 
297
                            }
 
298
                            mmsData["messageProxy"] = proxyValue;
 
299
                            activateCb("mms", undefined, mmsData);
 
300
                            pageStack.pop();
 
301
                            return;
 
302
                        }
 
303
 
 
304
                        ctx.accessPointName = apnName.text;
 
305
                        ctx.username = userName.text;
 
306
                        ctx.password = pword.text;
 
307
                        if (d.isMms) {
 
308
                            ctx.messageCenter = mmsc.text;
 
309
                            var proxyValue = "";
 
310
                            if (proxy.text !== "") {
 
311
                                proxyValue = proxy.text;
 
312
                                if (port.text !== "")
 
313
                                    proxyValue = proxyValue + ":" + port.text;
 
314
                            }
 
315
                            ctx.messageProxy = proxyValue
 
316
                        }
 
317
                        /// @todo map protocol values
 
318
 
 
319
                        activateCb(ctx.type, ctx.contextPath);
 
320
                        pageStack.pop();
 
321
                    }
 
322
                }
 
323
            } // item for buttons
 
324
        } // the contents
 
325
    } // the flickable
 
326
}