Merge lp:~boiko/dialer-app/rtm-fullscreen_emergency_mode into lp:dialer-app/rtm-14.09

Proposed by Gustavo Pichorim Boiko
Status: Merged
Approved by: Bill Filler
Approved revision: 235
Merged at revision: 233
Proposed branch: lp:~boiko/dialer-app/rtm-fullscreen_emergency_mode
Merge into: lp:dialer-app/rtm-14.09
Diff against target: 210 lines (+96/-4)
6 files modified
debian/control (+2/-0)
src/dialerapplication.cpp (+15/-4)
src/dialerapplication.h (+7/-0)
src/qml/dialer-app.qml (+6/-0)
tests/qml/CMakeLists.txt (+1/-0)
tests/qml/tst_MainView.qml (+65/-0)
To merge this branch: bzr merge lp:~boiko/dialer-app/rtm-fullscreen_emergency_mode
Reviewer Review Type Date Requested Status
Bill Filler (community) Approve
Review via email: mp+240484@code.launchpad.net

Commit message

Switch dialer-app to fullscreen mode when running on top of the greeter.

Description of the change

Switch dialer-app to fullscreen mode when running on top of the greeter.

== Checklist ==
Are there any related MPs required for this MP to build/function as expected? Please list.
https://code.launchpad.net/~boiko/telephony-service/rtm-dont_crash_no_dbus/+merge/240717

Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)
Yes

Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator?
Yes

Did you successfully run all tests found in your component's Test Plan (https://wiki.ubuntu.com/Process/Merges/TestPlan/<package-name>) on device or emulator?
Yes

If you changed the UI, was the change specified/approved by design?
Yes

If you changed UI labels, did you update the pot file?
N/A

If you changed the packaging (debian), did you add a core-dev as a reviewer to this MP?
N/A

To post a comment you must log in.
234. By Gustavo Pichorim Boiko

Add a qml test for the fullscreen emergency mode feature.

235. By Gustavo Pichorim Boiko

Add some extra build time dependencies so that the QML test succeed.

Revision history for this message
Bill Filler (bfiller) wrote :

approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2014-09-05 19:54:09 +0000
3+++ debian/control 2014-11-05 12:53:46 +0000
4@@ -9,10 +9,12 @@
5 python3-all:any,
6 dh-python,
7 qml-module-qttest,
8+ qml-module-qt-labs-settings,
9 qt5-default,
10 qtbase5-dev (>= 5.0),
11 qtdeclarative5-dev (>= 5.0),
12 qtdeclarative5-dev-tools,
13+ qtdeclarative5-ubuntu-telephony0.1 | qtdeclarative5-ubuntu-telephony-plugin,
14 qtdeclarative5-ubuntu-ui-toolkit-plugin,
15 xvfb,
16 Standards-Version: 3.9.4
17
18=== modified file 'src/dialerapplication.cpp'
19--- src/dialerapplication.cpp 2014-08-22 14:51:14 +0000
20+++ src/dialerapplication.cpp 2014-11-05 12:53:46 +0000
21@@ -60,7 +60,7 @@
22
23
24 DialerApplication::DialerApplication(int &argc, char **argv)
25- : QGuiApplication(argc, argv), m_view(0), m_applicationIsReady(false)
26+ : QGuiApplication(argc, argv), m_view(0), m_applicationIsReady(false), m_fullScreen(false)
27 {
28 setApplicationName("DialerApp");
29 setOrganizationName("com.ubuntu.dialer-app");
30@@ -70,7 +70,6 @@
31 {
32 installIconPath();
33 static QList<QString> validSchemes;
34- bool fullScreen = false;
35
36 if (validSchemes.isEmpty()) {
37 validSchemes << "tel" << "dialer";
38@@ -85,7 +84,7 @@
39
40 if (arguments.contains("--fullscreen")) {
41 arguments.removeAll("--fullscreen");
42- fullScreen = true;
43+ m_fullScreen = true;
44 }
45
46 // The testability driver is only loaded by QApplication but not by QGuiApplication.
47@@ -150,7 +149,7 @@
48 }
49
50 m_view->setSource(QUrl::fromLocalFile("dialer-app.qml"));
51- if (fullScreen) {
52+ if (m_fullScreen) {
53 m_view->showFullScreen();
54 } else {
55 m_view->show();
56@@ -159,6 +158,18 @@
57 return true;
58 }
59
60+bool DialerApplication::fullScreen() const
61+{
62+ return m_fullScreen;
63+}
64+
65+void DialerApplication::setFullScreen(bool value)
66+{
67+ m_fullScreen = value;
68+ m_view->setWindowState(m_fullScreen ? Qt::WindowFullScreen : Qt::WindowNoState);
69+ Q_EMIT fullScreenChanged();
70+}
71+
72 DialerApplication::~DialerApplication()
73 {
74 if (m_view) {
75
76=== modified file 'src/dialerapplication.h'
77--- src/dialerapplication.h 2014-08-22 14:51:14 +0000
78+++ src/dialerapplication.h 2014-11-05 12:53:46 +0000
79@@ -26,18 +26,24 @@
80 class DialerApplication : public QGuiApplication
81 {
82 Q_OBJECT
83+ Q_PROPERTY(bool fullScreen READ fullScreen WRITE setFullScreen NOTIFY fullScreenChanged)
84
85 public:
86 DialerApplication(int &argc, char **argv);
87 virtual ~DialerApplication();
88
89 bool setup();
90+ bool fullScreen() const;
91+ void setFullScreen(bool value);
92
93 public Q_SLOTS:
94 void activateWindow();
95 void parseArgument(const QString &arg);
96 QStringList mmiPluginList();
97
98+Q_SIGNALS:
99+ void fullScreenChanged();
100+
101 private Q_SLOTS:
102 void onViewStatusChanged(QQuickView::Status status);
103 void onApplicationReady();
104@@ -46,6 +52,7 @@
105 QQuickView *m_view;
106 QString m_arg;
107 bool m_applicationIsReady;
108+ bool m_fullScreen;
109 };
110
111 #endif // DIALERAPPLICATION_H
112
113=== modified file 'src/qml/dialer-app.qml'
114--- src/qml/dialer-app.qml 2014-10-06 19:59:17 +0000
115+++ src/qml/dialer-app.qml 2014-11-05 12:53:46 +0000
116@@ -99,6 +99,12 @@
117 id: phoneUtils
118 }
119
120+ Binding {
121+ target: application
122+ property: "fullScreen"
123+ value: greeter.greeterActive
124+ }
125+
126 states: [
127 State {
128 name: "greeterMode"
129
130=== modified file 'tests/qml/CMakeLists.txt'
131--- tests/qml/CMakeLists.txt 2014-09-05 19:53:38 +0000
132+++ tests/qml/CMakeLists.txt 2014-11-05 12:53:46 +0000
133@@ -17,6 +17,7 @@
134
135 if(QMLTESTRUNNER_BIN AND XVFB_RUN_BIN)
136 declare_qml_test("keypad_button" tst_KeypadButton.qml)
137+ declare_qml_test("main_view" tst_MainView.qml)
138 else()
139 if (NOT QMLTESTRUNNER_BIN)
140 message(WARNING "Qml tests disabled: qmltestrunner not found")
141
142=== added file 'tests/qml/tst_MainView.qml'
143--- tests/qml/tst_MainView.qml 1970-01-01 00:00:00 +0000
144+++ tests/qml/tst_MainView.qml 2014-11-05 12:53:46 +0000
145@@ -0,0 +1,65 @@
146+/*
147+ * Copyright 2014 Canonical Ltd.
148+ *
149+ * This file is part of dialer-app.
150+ *
151+ * dialer-app is free software; you can redistribute it and/or modify
152+ * it under the terms of the GNU General Public License as published by
153+ * the Free Software Foundation; version 3.
154+ *
155+ * dialer-app is distributed in the hope that it will be useful,
156+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
157+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
158+ * GNU General Public License for more details.
159+ *
160+ * You should have received a copy of the GNU General Public License
161+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
162+ */
163+
164+import QtQuick 2.2
165+import QtTest 1.0
166+import Ubuntu.Test 0.1
167+
168+Item {
169+ id: root
170+
171+ width: units.gu(40)
172+ height: units.gu(60)
173+
174+ Item {
175+ id: application
176+ property bool fullScreen: false
177+ }
178+
179+ Item {
180+ id: greeter
181+ property bool greeterActive: false
182+ }
183+
184+ Loader {
185+ source: '../../src/qml/dialer-app.qml'
186+ }
187+
188+ UbuntuTestCase {
189+ id: mainViewTestCase
190+ name: 'mainViewTestCase'
191+
192+ when: windowShown
193+
194+ function init() {
195+ }
196+
197+ function cleanup() {
198+ }
199+
200+ function test_mainViewSwitchesToFullScreenWhenGreeterActive() {
201+ // set the greeter as active
202+ greeter.greeterActive = true;
203+ tryCompare(application, 'fullScreen', true);
204+
205+ // and make sure it comes back as false when leaving greeter mode
206+ greeter.greeterActive = false;
207+ tryCompare(application, 'fullScreen', false);
208+ }
209+ }
210+}

Subscribers

People subscribed via source and target branches