Merge lp:~tiagosh/dialer-app/dialog-flight-mode into lp:dialer-app

Proposed by Tiago Salem Herrmann on 2015-05-05
Status: Merged
Approved by: Gustavo Pichorim Boiko on 2015-06-22
Approved revision: 403
Merged at revision: 428
Proposed branch: lp:~tiagosh/dialer-app/dialog-flight-mode
Merge into: lp:dialer-app
Diff against target: 119 lines (+75/-1)
2 files modified
src/qml/Dialogs/DisableFlightModeDialog.qml (+59/-0)
src/qml/dialer-app.qml (+16/-1)
To merge this branch: bzr merge lp:~tiagosh/dialer-app/dialog-flight-mode
Reviewer Review Type Date Requested Status
Gustavo Pichorim Boiko (community) 2015-05-05 Approve on 2015-06-22
PS Jenkins bot continuous-integration Needs Fixing on 2015-06-22
Review via email: mp+258274@code.launchpad.net

Commit Message

Ask users to disable flight mode before making calls.

Description of the Change

Ask users to disable flight mode before making calls.

To post a comment you must log in.
400. By Tiago Salem Herrmann on 2015-05-11

Add button to disable flight mode

401. By Tiago Salem Herrmann on 2015-05-11

merge trunk

402. By Tiago Salem Herrmann on 2015-05-11

wait until flight mode is disabled

403. By Tiago Salem Herrmann on 2015-06-09

merge trunk

Gustavo Pichorim Boiko (boiko) wrote :

Looks good and works as expected!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'src/qml/Dialogs/DisableFlightModeDialog.qml'
2--- src/qml/Dialogs/DisableFlightModeDialog.qml 1970-01-01 00:00:00 +0000
3+++ src/qml/Dialogs/DisableFlightModeDialog.qml 2015-06-09 22:02:41 +0000
4@@ -0,0 +1,59 @@
5+/*
6+ * Copyright 2015 Canonical Ltd.
7+ *
8+ * This file is part of dialer-app.
9+ *
10+ * dialer-app is free software; you can redistribute it and/or modify
11+ * it under the terms of the GNU General Public License as published by
12+ * the Free Software Foundation; version 3.
13+ *
14+ * dialer-app is distributed in the hope that it will be useful,
15+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+ * GNU General Public License for more details.
18+ *
19+ * You should have received a copy of the GNU General Public License
20+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
21+ */
22+
23+import QtQuick 2.0
24+import Ubuntu.Components 1.1
25+import Ubuntu.Components.Popups 0.1
26+import Ubuntu.Telephony 0.1
27+
28+Component {
29+ Dialog {
30+ id: dialogue
31+ title: i18n.tr("Flight Mode")
32+ text: i18n.tr("You have to disable flight mode in order to make calls")
33+ Column {
34+ anchors.left: parent.left
35+ anchors.right: parent.right
36+ spacing: units.gu(2)
37+ Row {
38+ anchors.horizontalCenter: parent.horizontalCenter
39+ spacing: units.gu(4)
40+ Button {
41+ objectName: "disableFlightModeDialogCancelButton"
42+ text: i18n.tr("Cancel")
43+ color: UbuntuColors.orange
44+ onClicked: {
45+ PopupUtils.close(dialogue)
46+ Qt.inputMethod.hide()
47+ }
48+ }
49+ Button {
50+ objectName: "disableFlightModeDialogDisableButton"
51+ text: i18n.tr("Disable")
52+ color: UbuntuColors.orange
53+ onClicked: {
54+ telepathyHelper.flightMode = false
55+ PopupUtils.open(flightModeProgressDialog, mainView, {})
56+ PopupUtils.close(dialogue)
57+ Qt.inputMethod.hide()
58+ }
59+ }
60+ }
61+ }
62+ }
63+}
64
65=== modified file 'src/qml/dialer-app.qml'
66--- src/qml/dialer-app.qml 2015-05-15 18:04:30 +0000
67+++ src/qml/dialer-app.qml 2015-06-09 22:02:41 +0000
68@@ -258,7 +258,7 @@
69 if (telepathyHelper.flightMode) {
70 pendingNumberToDial = number;
71 telepathyHelper.flightMode = false;
72- PopupUtils.open(flightModeProgressDialog)
73+ PopupUtils.open(flightModeProgressDialog, mainView, {"emergencyMode": true})
74 return;
75 }
76
77@@ -305,6 +305,11 @@
78 return;
79 }
80
81+ if (telepathyHelper.flightMode) {
82+ PopupUtils.open(Qt.createComponent("Dialogs/DisableFlightModeDialog.qml").createObject(mainView), mainView, {})
83+ return
84+ }
85+
86 // check if at least one account is selected
87 if (multipleAccounts && !mainView.account) {
88 Qt.inputMethod.hide()
89@@ -328,6 +333,11 @@
90 }
91
92 // avoid cleaning the keypadEntry in case there is no signal
93+ if (!mainView.account) {
94+ showNotification(i18n.tr("No network"), i18n.tr("There is currently no network."))
95+ return
96+ }
97+
98 if (!mainView.account.connected) {
99 showNotification(i18n.tr("No network"),
100 telepathyHelper.accountIds.length >= 2 ? i18n.tr("There is currently no network on %1").arg(mainView.account.displayName)
101@@ -436,6 +446,7 @@
102 id: flightModeProgressDialog
103 Dialog {
104 id: flightModeProgressIndicator
105+ property bool emergencyMode: false
106 visible: false
107 title: i18n.tr("Disabling flight mode")
108 ActivityIndicator {
109@@ -444,6 +455,10 @@
110 Connections {
111 target: telepathyHelper
112 onEmergencyCallsAvailableChanged: {
113+ if (!emergencyMode) {
114+ PopupUtils.close(flightModeProgressIndicator)
115+ return
116+ }
117 flightModeTimer.start()
118 }
119 }

Subscribers

People subscribed via source and target branches