~ubuntu-branches/ubuntu/raring/plasma-mobile/raring-proposed

« back to all changes in this revision

Viewing changes to applets/org.kde.active.connman/contents/ui/WifiExpandingBox.qml

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2012-07-17 12:04:43 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20120717120443-q3ig9u2fnltx67yg
Tags: 2.0+git2012071701-0ubuntu1
* New upstream snapshot
* Remove build-dep on kde-runtime-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
import MeeGo.Labs.Components 0.1 as Labs
11
11
import MeeGo.Settings 0.1
12
12
import MeeGo.Connman 0.1
13
 
import MeeGo.Components 0.1 as MeeGo
14
13
import org.kde.plasma.components 0.1 as PlasmaComponents
15
14
 
16
15
import "helper.js" as WifiHelper
17
16
 
18
 
MeeGo.ExpandingBox {
 
17
ExpandingBox {
19
18
    id: container
20
19
 
21
20
    property int containerHeight: 80
65
64
            return 0;
66
65
    }
67
66
 
68
 
    MeeGo.Theme {
69
 
        id: meegoTheme
70
 
    }
71
 
 
72
67
    Component.onCompleted: {
73
68
        WifiHelper.connmanSecurityType["wpa"] = i18n("WPA");
74
69
        WifiHelper.connmanSecurityType["rsn"] = i18n("WPA2");
90
85
    Row {
91
86
        id: headerArea
92
87
        spacing: 8
93
 
        anchors.top:  parent.top       
 
88
        anchors.top:  parent.top
94
89
        height: container.containerHeight
95
90
        anchors.left: parent.left
96
91
        anchors.leftMargin: 20
127
122
            spacing: 5
128
123
            anchors.verticalCenter: parent.verticalCenter
129
124
            width: parent.width
130
 
            Text {
 
125
            PlasmaComponents.Label {
131
126
                id: mainText
132
127
                text: status == "" ? ssid:(ssid + " - " + status)
133
 
                font.pixelSize: meegoTheme.fontPixelSizeNormal
134
 
                color: meegoTheme.fontColorNormal
135
128
                width:  container.width - 40
136
129
                elide: Text.ElideRight
137
130
            }
138
131
 
139
 
            Text {
 
132
            PlasmaComponents.Label {
140
133
                id: securityText
141
134
                text: finished ? WifiHelper.connmanSecurityType[container.security] : ""
142
 
                font.pixelSize: meegoTheme.fontPixelSizeNormal
143
 
                color: meegoTheme.fontColorNormal
144
135
                visible: text != ""
145
136
                width: parent.width
146
137
                elide: Text.ElideRight
208
199
                console.log("height: !!!! " + height)
209
200
            }
210
201
 
211
 
            Text {
 
202
            PlasmaComponents.Label {
212
203
                text: i18n("Do you want to remove %1 ?  This action will forget any passwords and you will no longer be automatically connected to %2").arg(networkItem.name).arg(networkItem.name);
213
 
                font.pixelSize: meegoTheme.fontPixelSizeNormal
214
 
                color: meegoTheme.fontColorNormal
215
204
                wrapMode: Text.WordWrap
216
205
                width: parent.width
217
206
            }
224
213
                    id: yesDelete
225
214
                    text: i18n("Yes, Delete")
226
215
                    width: removeConfirmArea.width / 2 - 20
227
 
                    height: 50
228
216
                    onClicked: {
229
217
                        networkItem.passphrase=""
230
218
                        networkItem.removeService();
236
224
                    id: noSave
237
225
                    text: i18n("No, Save")
238
226
                    width: removeConfirmArea.width / 2 - 20
239
 
                    height: 50
240
227
                    onClicked: {
241
228
                        container.expanded = false;
242
229
                        container.detailsComponent = detailsArea
265
252
            PlasmaComponents.Button {
266
253
                id: disconnectButton
267
254
                text: i18n("Disconnect")
268
 
                height: 50
269
255
                width: parent.width / 2
270
256
                onClicked: {
271
257
                    networkItem.disconnectService();
276
262
            PlasmaComponents.Button {
277
263
                id: removeConnection
278
264
                text: i18n("Remove connection")
279
 
                height: 50
280
265
                width: parent.width / 2
281
266
                onClicked: {
282
267
                    container.detailsComponent = removeConfirmAreaComponent
284
269
 
285
270
            }
286
271
 
287
 
            Text {
 
272
            PlasmaComponents.Label {
288
273
                id: connectByLabel
289
274
                text: i18n("Connect by:")
290
 
                font.pixelSize: meegoTheme.fontPixelSizeNormal
291
 
                color: meegoTheme.fontColorNormal
292
275
                width: parent.width / 2
293
276
                wrapMode: Text.WrapAtWordBoundaryOrAnywhere
294
277
            }
295
278
 
296
 
            /*MeeGo.DropDown {
297
 
                id: dropdown
298
 
                width: parent.width / 2
299
 
                property string method
300
 
                visible: container.networkItem.type != "cellular"
301
 
                model: finished ? [ WifiHelper.IPv4Type["dhcp"], WifiHelper.IPv4Type["static"] ]: []
302
 
                payload: finished ? [ WifiHelper.IPv4Type["dhcp"], WifiHelper.IPv4Type["static"] ]: []
303
 
                selectedIndex: finished && networkItem.method == "dhcp" ? 0:1
304
 
                replaceDropDownTitle: true
305
 
                method: selectedIndex == 0 ? "dhcp":"static"
306
 
 
307
 
                Connections {
308
 
                    target: networkItem
309
 
                    onMethodChanged: {
310
 
                        settingsGrid.editable = networkItem.method != "dhcp" && networkItem.type != "cellular"
311
 
                        dropdown.selectedIndex = networkItem.method == "dhcp" ? 0:1
312
 
                        dropdown.method = dropdown.selectedIndex == 0 ? "dhcp":"static"
313
 
                    }
314
 
                }
315
 
            }*/
316
 
 
317
 
            Text {
318
 
                width: parent.width / 2
319
 
                font.pixelSize: meegoTheme.fontPixelSizeNormal
320
 
                color: meegoTheme.fontColorNormal
 
279
            PlasmaComponents.Label {
 
280
                width: parent.width / 2
321
281
                text: finished ? WifiHelper.IPv4Type[networkItem.method] : ""
322
282
            }
323
283
 
324
 
                        Text {
 
284
                        PlasmaComponents.Label {
325
285
                                id: ipaddyLabel
326
 
                                font.pixelSize: meegoTheme.fontPixelSizeNormal
327
 
                                color: meegoTheme.fontColorNormal
328
286
                                text: i18n("IP Address:")
329
287
                                width: parent.width / 2
330
288
                                wrapMode: Text.WrapAtWordBoundaryOrAnywhere
331
289
                        }
332
290
 
333
 
                        Text {
334
 
                                font.pixelSize: meegoTheme.fontPixelSizeNormal
335
 
                                color: meegoTheme.fontColorNormal
 
291
                        PlasmaComponents.Label {
336
292
                                text: container.ipaddy
337
293
                                visible:  !editable
338
294
                                width: parent.width / 2
346
302
                                //textInput.inputMask: "000.000.000.000;_"
347
303
                        }
348
304
 
349
 
                        Text {
350
 
                                font.pixelSize: meegoTheme.fontPixelSizeNormal
351
 
                                color: meegoTheme.fontColorNormal
 
305
                        PlasmaComponents.Label {
352
306
                                id: subnetMaskLabel
353
307
                                text: i18n("Subnet mask:")
354
308
                                width: parent.width / 2
355
309
                                wrapMode: Text.WrapAtWordBoundaryOrAnywhere
356
310
                        }
357
311
 
358
 
                        Text {
359
 
                                font.pixelSize: meegoTheme.fontPixelSizeNormal
360
 
                                color: meegoTheme.fontColorNormal
 
312
                        PlasmaComponents.Label {
361
313
                                text: container.subnet
362
314
                                visible:  !editable
363
315
                                width: parent.width / 2
370
322
                                visible: editable
371
323
                                //textInput.inputMask: "000.000.000.000;_"
372
324
                        }
373
 
                        Text {
 
325
                        PlasmaComponents.Label {
374
326
                                id: gatewayLabel
375
327
                                text: i18n("Gateway")
376
 
                                font.pixelSize: meegoTheme.fontPixelSizeNormal
377
 
                                color: meegoTheme.fontColorNormal
378
328
                                width: parent.width / 2
379
329
                                wrapMode: Text.WrapAtWordBoundaryOrAnywhere
380
330
                        }
381
331
 
382
 
                        Text {
 
332
                        PlasmaComponents.Label {
383
333
                                text: container.gateway
384
 
                                font.pixelSize: meegoTheme.fontPixelSizeNormal
385
 
                                color: meegoTheme.fontColorNormal
386
334
                                visible:  !editable
387
335
                                width: parent.width / 2
388
336
                        }
394
342
                                visible: editable
395
343
                                //textInput.inputMask: "000.000.000.000;_"
396
344
                        }
397
 
                        Text {
 
345
                        PlasmaComponents.Label {
398
346
                                id: dnsLabel
399
 
                                font.pixelSize: meegoTheme.fontPixelSizeNormal
400
 
                                color: meegoTheme.fontColorNormal
401
347
                                text: i18n("DNS:")
402
348
                                width: parent.width / 2
403
349
                                wrapMode: Text.WrapAtWordBoundaryOrAnywhere
405
351
                        Grid {
406
352
                                id: nameserverstextedit
407
353
                                width: parent.width / 2
408
 
                                //height: 20
409
354
                                columns: 2
410
355
                                Repeater {
411
356
                                        model: container.nameservers
412
 
                                        delegate: Text {
 
357
                                        delegate: PlasmaComponents.Label {
413
358
                                                width: parent.width
414
359
                                                text: modelData
415
 
                                                font.pixelSize: meegoTheme.fontPixelSizeNormal
416
 
                                                color: meegoTheme.fontColorNormal
417
360
                                        }
418
361
                                }
419
362
 
420
363
                        }
421
 
                        Text {
 
364
                        PlasmaComponents.Label {
422
365
                                id: hwaddyLabel
423
366
                                text: i18n("Hardware address:")
424
 
                                font.pixelSize: meegoTheme.fontPixelSizeNormal
425
 
                                color: meegoTheme.fontColorNormal
426
367
                                visible: container.networkItem.type != "cellular"
427
368
                                width: parent.width / 2
428
369
                                wrapMode: Text.WrapAtWordBoundaryOrAnywhere
429
370
                        }
430
371
 
431
 
                        Text {
432
 
                                font.pixelSize: meegoTheme.fontPixelSizeNormal
433
 
                                color: meegoTheme.fontColorNormal
 
372
                        PlasmaComponents.Label {
434
373
                                width: parent.width / 2
435
374
                                text: container.hwaddy
436
375
                                visible: container.networkItem.type != "cellular"
443
382
                                key: "/meego/ux/settings/connectionshacks"
444
383
                        }
445
384
 
446
 
                        Text {
 
385
                        PlasmaComponents.Label {
447
386
                                id: securityLabel
448
387
                                visible: connectionsHacksGconf.value
449
 
                                font.pixelSize: meegoTheme.fontPixelSizeNormal
450
 
                                color: meegoTheme.fontColorNormal
451
388
                                text: i18n("Security: ")
452
389
                                width: parent.width / 2
453
390
                                wrapMode: Text.WrapAtWordBoundaryOrAnywhere
454
391
                        }
455
 
                        Text {
 
392
                        PlasmaComponents.Label {
456
393
                                visible: connectionsHacksGconf.value
457
394
                                width: parent.width / 2
458
 
                                font.pixelSize: meegoTheme.fontPixelSizeNormal
459
 
                                color: meegoTheme.fontColorNormal
460
395
                                text: WifiHelper.connmanSecurityType[container.security]
461
396
                        }
462
397
 
463
 
                        Text {
 
398
                        PlasmaComponents.Label {
464
399
                                id: strengthLabel
465
 
                                font.pixelSize: meegoTheme.fontPixelSizeNormal
466
 
                                color: meegoTheme.fontColorNormal
467
400
                                visible: connectionsHacksGconf.value
468
401
                                width: parent.width / 2
469
402
                                wrapMode: Text.WrapAtWordBoundaryOrAnywhere
470
403
                                text: i18n("Strength: ")
471
404
                        }
472
 
                        Text {
473
 
                                font.pixelSize: meegoTheme.fontPixelSizeNormal
474
 
                                color: meegoTheme.fontColorNormal
 
405
                        PlasmaComponents.Label {
475
406
                                visible: connectionsHacksGconf.value
476
407
                                width: parent.width / 2
477
408
                                text: container.networkItem.strength
480
411
                        PlasmaComponents.Button {
481
412
                                id: applyButton
482
413
                                text: i18n("Apply")
483
 
                                height: 50
484
414
                                width: parent.width / 2
485
415
                                onClicked: {
486
416
                                        networkItem.method = dropdown.method
493
423
                        PlasmaComponents.Button {
494
424
                                id: cancelButton
495
425
                                text: i18n("Cancel")
496
 
                                height: 50
497
426
                                width: parent.width / 2
498
427
                                onClicked: {
499
428
                                        container.expanded = false
536
465
 
537
466
                    PlasmaComponents.Button {
538
467
                        id: setupButton
539
 
                        height: 50
540
468
 
541
469
                        text:  i18n("Setup")
542
470
                        visible: container.networkItem.type == "cellular"
547
475
 
548
476
                    PlasmaComponents.Button {
549
477
                        id: connectButtonOfAwesome
550
 
                        height: 50
551
478
                        property bool shouldBeActive: container.statusint != NetworkItemModel.StateAssociation &&
552
479
                                                      container.statusint != NetworkItemModel.StateConfiguration
553
480
                        enabled: shouldBeActive
577
504
                        }
578
505
                    }
579
506
 
580
 
                    Text {
 
507
                    PlasmaComponents.Label {
581
508
                        visible: passwordGrid.passwordRequired
582
509
                        text: i18n("Show password")
583
510
                        font.pixelSize: 14//theme_fontPixelSizeLarge