on cd4bc68 help sign in
110 lines 3.3 kB history raw
1/*
2 * Copyright (C) 2013-2015 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 */
17import QtQuick 2.3
18import MeeGo.QOfono 0.2
19import Ubuntu.Components 1.2
20import Ubuntu.Components.Popups 1.0
21import Unity.Session 0.1
22import ".." as LocalComponents
24LocalComponents.Page {
25 objectName: "simPage"
27 title: i18n.tr("No SIM card installed")
28 forwardButtonSourceComponent: forwardButton
29 customTitle: true
30 hasBackButton: false
32 property bool hadSIM: simManager0.present || simManager1.present
34 Timer {
35 id: timer
36 interval: 250
37 running: true
38 onTriggered: {
39 print("=== SIM page: timer triggered");
40 hadSIM = simManager0.present || simManager1.present;
41 print("=== SIM page: had sim:", hadSIM);
42 }
43 }
45 Connections {
46 target: modemManager
47 onGotSimCardChanged: {
48 print("=== SIM page: SIM card inserted");
49 if (!hadSIM && modemManager.gotSimCard) { // show the restart dialog in case a SIM gets inserted
50 print("=== SIM page: showing reboot dialog");
51 restartDialog.visible = true;
52 }
53 }
54 }
56 Dialog {
57 id: restartDialog
58 title: i18n.tr("SIM card added")
59 text: i18n.tr("You must restart the device to access the mobile network.")
61 Button {
62 id: restartButton
63 text: i18n.tr("Restart")
64 onClicked: {
65 DBusUnitySessionService.reboot();
66 }
67 }
68 }
70 Column {
71 anchors {
72 fill: content
73 leftMargin: leftMargin
74 rightMargin: rightMargin
75 }
76 spacing: units.gu(4)
78 Label {
79 anchors.left: parent.left
80 anchors.right: parent.right
81 wrapMode: Text.Wrap
82 text: i18n.tr("You won’t be able to make calls or use text messaging without a SIM.")
83 fontSize: "small"
84 font.weight: Font.Light
85 color: restartDialog.visible ? Theme.palette.normal.backgroundText : textColor
86 }
88 Label {
89 anchors.left: parent.left
90 anchors.right: parent.right
91 wrapMode: Text.Wrap
92 textFormat: Text.RichText
93 text: i18n.tr("To proceed with no SIM tap <em>Skip</em>.")
94 fontSize: "small"
95 font.weight: Font.Light
96 color: restartDialog.visible ? Theme.palette.normal.backgroundText : textColor
97 }
98 }
100 Component {
101 id: forwardButton
102 LocalComponents.StackButton {
103 text: i18n.tr("Skip")
104 onClicked: {
105 seenSIMPage = true;
106 pageStack.next();
107 }
108 }
109 }