@@ -16,13 +16,14 @@
17import QtQuick 2.0
17import QtQuick 2.0
18import MeeGo.QOfono 0.2
18import MeeGo.QOfono 0.2
19−import Ubuntu.Components 0.1
19+import Ubuntu.Components 1.2
20+import Ubuntu.Components.Popups 1.0
20import ".." as LocalComponents
21import ".." as LocalComponents
22LocalComponents.Page {
23LocalComponents.Page {
23 objectName: "simPage"
24 objectName: "simPage"
25− title: i18n.tr("Add a SIM card and restart your device")
26+ title: i18n.tr("No SIM card installed")
26 forwardButtonSourceComponent: forwardButton
27 forwardButtonSourceComponent: forwardButton
28 skipValid: !manager.available ||
29 skipValid: !manager.available ||
@@ -30,14 +31,42 @@ LocalComponents.Page {
30 && (manager.modems.length < 2 || simManager1.ready))
31 && (manager.modems.length < 2 || simManager1.ready))
31 skip: !manager.available || manager.modems.length === 0 || simManager0.present || simManager1.present
32 skip: !manager.available || manager.modems.length === 0 || simManager0.present || simManager1.present
34+ property bool hadModem: false
36+ Component.onCompleted: {
37+ hadModem = simManager0.present || simManager1.present
38+ print("Had modem: " + hadModem)
43+ title: i18n.tr("SIM card added")
44+ text: i18n.tr("You must restart the device to access the mobile network.")
48+ text: i18n.tr("Restart")
50+ // TODO reboot for real
51+ PopupUtils.close(restartDialog)
33 OfonoManager {
56 OfonoManager {
34 id: manager
57 id: manager
35 property bool ready: false
58 property bool ready: false
36− onModemsChanged: ready = true
59+ onModemsChanged: {
60+ print("Modems changed " + modems)
62+ if (!hadModem && (simManager0.present || simManager1.present)) { // show the restart dialog in case a SIM gets inserted
63+ PopupUtils.open(restartDialog)
39 // Ideally we would query the system more cleverly than hardcoding two
68 // Ideally we would query the system more cleverly than hardcoding two
40− // modems. But we don't yet have a more clever way. :(
69+ // sims. But we don't yet have a more clever way. :(
41 OfonoSimManager {
70 OfonoSimManager {
42 id: simManager0
71 id: simManager0
43 modemPath: manager.modems.length >= 1 ? manager.modems[0] : ""
72 modemPath: manager.modems.length >= 1 ? manager.modems[0] : ""
@@ -51,19 +80,26 @@ LocalComponents.Page {
52 anchors.fill: content
81 anchors.fill: content
53 spacing: units.gu(4)
82 spacing: units.gu(4)
83+ anchors.topMargin: units.gu(4)
56 anchors.left: parent.left
86 anchors.left: parent.left
57 anchors.right: parent.right
87 anchors.right: parent.right
58 wrapMode: Text.Wrap
88 wrapMode: Text.Wrap
59− text: i18n.tr("Without it, you won’t be able to make calls or use text messaging.")
89+ text: i18n.tr("You won’t be able to make calls or use text messaging without a SIM.")
91+ font.weight: Font.Light
92+ color: restartDialog.visible ? Theme.palette.normal.backgroundText : "black"
63− id: image
96+ anchors.left: parent.left
64− source: "data/meet_ubuntu_simcard@30.png"
97+ anchors.right: parent.right
65− height: units.gu(6.5)
98+ wrapMode: Text.Wrap
66− width: units.gu(9)
99+ text: i18n.tr("To proceed with no SIM tap <em>Skip</em>.")
101+ font.weight: Font.Light
102+ color: restartDialog.visible ? Theme.palette.normal.backgroundText : "black"