~ubuntu-branches/ubuntu/wily/ubuntu-system-settings/wily-proposed

« back to all changes in this revision

Viewing changes to plugins/about/PhoneNumbers.qml

  • Committer: Package Import Robot
  • Author(s): CI Train Bot, Ken VanDine, Robert Ancell, Sebastien Bacher, jonas-drange
  • Date: 2015-08-27 07:47:59 UTC
  • mfrom: (1.4.23)
  • Revision ID: package-import@ubuntu.com-20150827074759-l3cwh1fyhlre91zy
Tags: 0.3+15.10.20150827-0ubuntu1
[ Ken VanDine ]
* Don't show the phone number in the about page, that is now provided
  by address-book-app (LP: #1364452)

[ Robert Ancell ]
* Use new QML package names for qml-module-qt-labs-folderlistmodel,
  qml-module-qtsysteminfo.

[ Sebastien Bacher ]
* [security-privacy] rename the "Lock phone" item to "Locking and
  unlocking" and do not include the screen delay as a value, it
  misleads users to think that the section is only about that where it
  also includes security options (LP: #1361127)
* [security-privacy] use the correct access to location string (LP:
  #1388184)

[ jonas-drange ]
* Use wait_select_single instead of select_single to make the test
  less flaky
* [plugin] add has-dynamic-name to allow for dynamic renaming of a
  plugin. (LP: #1475629)

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: Jonas G. Drange <jonas.drange@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 GSettings 1.0
23
 
import MeeGo.QOfono 0.2
24
 
import Ubuntu.Components.ListItems 0.1 as ListItem
25
 
 
26
 
Column {
27
 
 
28
 
    property var paths
29
 
 
30
 
    ListItem.Standard {
31
 
        text: i18n.tr("Phone number:")
32
 
        visible: phoneNumber1.visible
33
 
    }
34
 
 
35
 
    ListItem.SingleValue {
36
 
 
37
 
        id: phoneNumber1
38
 
        objectName: "numberItem1"
39
 
 
40
 
        OfonoSimManager {
41
 
            id: sim1
42
 
            modemPath: paths[0]
43
 
        }
44
 
        property string phoneNumber
45
 
        phoneNumber: sim1.subscriberNumbers.length > 0 ?
46
 
            sim1.subscriberNumbers[0] : ""
47
 
        value: phoneNumber
48
 
        visible: value
49
 
    }
50
 
 
51
 
    ListItem.SingleValue {
52
 
 
53
 
        id: phoneNumber2
54
 
        objectName: "numberItem2"
55
 
 
56
 
        OfonoSimManager {
57
 
            id: sim2
58
 
            modemPath: paths[1]
59
 
        }
60
 
        property string phoneNumber
61
 
        phoneNumber: sim2.subscriberNumbers.length > 0 ?
62
 
            sim2.subscriberNumbers[0] : ""
63
 
        value: phoneNumber
64
 
        visible: value
65
 
    }
66
 
 
67
 
    GSettings {
68
 
        id: phoneSettings
69
 
        schema.id: "com.ubuntu.phone"
70
 
        Component.onCompleted: {
71
 
            // set default names
72
 
            var simNames = phoneSettings.simNames;
73
 
            var m0 = paths[0];
74
 
            var m1 = paths[1];
75
 
            if (!simNames[m0]) {
76
 
                simNames[m0] = "SIM 1";
77
 
            }
78
 
            if (!simNames[m1]) {
79
 
                simNames[m1] = "SIM 2";
80
 
            }
81
 
            phoneSettings.simNames = simNames;
82
 
        }
83
 
    }
84
 
 
85
 
    Binding {
86
 
        target: phoneNumber1
87
 
        property: "text"
88
 
        value: phoneSettings.simNames[paths[0]]
89
 
    }
90
 
 
91
 
    Binding {
92
 
        target: phoneNumber2
93
 
        property: "text"
94
 
        value: phoneSettings.simNames[paths[1]]
95
 
    }
96
 
}