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.4
18 import MeeGo.QOfono 0.2
19 import Ubuntu.Components 1.3
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  skipValid: !manager.available ||
29  (manager.ready && (manager.modems.length < 1 || simManager0.ready)
30  && (manager.modems.length < 2 || simManager1.ready))
31  skip: !manager.available || manager.modems.length === 0 || simManager0.present || simManager1.present
32 
33  OfonoManager {
34  id: manager
35  property bool ready: false
36  onModemsChanged: ready = true
37  }
38 
39  // Ideally we would query the system more cleverly than hardcoding two
40  // modems. But we don't yet have a more clever way. :(
41  OfonoSimManager {
42  id: simManager0
43  modemPath: manager.modems.length >= 1 ? manager.modems[0] : ""
44  }
45 
46  OfonoSimManager {
47  id: simManager1
48  modemPath: manager.modems.length >= 2 ? manager.modems[1] : ""
49  }
50 
51  Column {
52  anchors.fill: content
53  spacing: units.gu(4)
54 
55  Label {
56  anchors.left: parent.left
57  anchors.right: parent.right
58  wrapMode: Text.Wrap
59  text: i18n.tr("Without it, you won’t be able to make calls or use text messaging.")
60  }
61 
62  Image {
63  id: image
64  source: "data/meet_ubuntu_simcard@30.png"
65  height: units.gu(6.5)
66  width: units.gu(9)
67  }
68  }
69 
70  Component {
71  id: forwardButton
72  LocalComponents.StackButton {
73  text: i18n.tr("Skip")
74  onClicked: pageStack.next()
75  }
76  }
77 }