Unity 8
20-sim.qml
1 /*
2  * Copyright (C) 2013 Canonical, Ltd.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; version 3.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 import QtQuick 2.0
18 import MeeGo.QOfono 0.2
19 import Ubuntu.Components 0.1
20 import ".." as LocalComponents
21 
22 LocalComponents.Page {
23  objectName: "simPage"
24 
25  title: i18n.tr("Add a SIM card and restart your device")
26  forwardButtonSourceComponent: forwardButton
27 
28  // No need for skipValid, since OfonoManager does everything synchronously
29  skip: !manager.available || manager.modems.length === 0 || simManager0.present || simManager1.present
30 
31  OfonoManager {
32  id: manager
33  }
34 
35  // Ideally we would query the system more cleverly than hardcoding two
36  // modems. But we don't yet have a more clever way. :(
37  OfonoSimManager {
38  id: simManager0
39  modemPath: manager.modems.length >= 1 ? manager.modems[0] : ""
40  }
41 
42  OfonoSimManager {
43  id: simManager1
44  modemPath: manager.modems.length >= 2 ? manager.modems[1] : ""
45  }
46 
47  Column {
48  anchors.fill: content
49  spacing: units.gu(4)
50 
51  Label {
52  anchors.left: parent.left
53  anchors.right: parent.right
54  wrapMode: Text.Wrap
55  text: i18n.tr("Without it, you won’t be able to make calls or use text messaging.")
56  }
57 
58  Image {
59  id: image
60  source: "data/meet_ubuntu_simcard@30.png"
61  height: units.gu(6.5)
62  width: units.gu(9)
63  }
64  }
65 
66  Component {
67  id: forwardButton
68  LocalComponents.StackButton {
69  text: i18n.tr("Skip")
70  onClicked: pageStack.next()
71  }
72  }
73 }