Merge lp:~bzoltan/qtcreator-plugin-ubuntu/Remove_emulator_installation_stuff into lp:qtcreator-plugin-ubuntu

Proposed by Zoltan Balogh
Status: Rejected
Rejected by: Zoltan Balogh
Proposed branch: lp:~bzoltan/qtcreator-plugin-ubuntu/Remove_emulator_installation_stuff
Merge into: lp:qtcreator-plugin-ubuntu
Diff against target: 384 lines (+4/-197)
9 files modified
share/qtcreator/ubuntu/qml/DevicesPage/DevicePage.qml (+0/-4)
share/qtcreator/ubuntu/qml/DevicesPage/EmulatorNotInstalled.qml (+0/-48)
share/qtcreator/ubuntu/scripts/local_install_emulator (+0/-20)
share/qtcreator/ubuntu/scripts/local_package_installed (+2/-2)
src/ubuntu/ubuntuconstants.h (+1/-6)
src/ubuntu/ubuntudevicesmodel.cpp (+0/-106)
src/ubuntu/ubuntudevicesmodel.h (+0/-9)
src/ubuntu/ubuntupackagingmodel.cpp (+1/-1)
ubuntu.pro (+0/-1)
To merge this branch: bzr merge lp:~bzoltan/qtcreator-plugin-ubuntu/Remove_emulator_installation_stuff
Reviewer Review Type Date Requested Status
ubuntu-sdk-build-bot continuous-integration Approve
Ubuntu SDK team Pending
Review via email: mp+289827@code.launchpad.net

Commit message

Remove emulator installation or package chekcing functions.

Description of the change

Remove emulator installation or package chekcing functions.

To post a comment you must log in.
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)

Unmerged revisions

447. By Zoltan Balogh

Remove emulator installation or package chekcing functions.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'share/qtcreator/ubuntu/qml/DevicesPage/DevicePage.qml'
2--- share/qtcreator/ubuntu/qml/DevicesPage/DevicePage.qml 2015-11-24 11:14:08 +0000
3+++ share/qtcreator/ubuntu/qml/DevicesPage/DevicePage.qml 2016-03-22 19:37:10 +0000
4@@ -192,10 +192,6 @@
5 width: height
6 anchors.verticalCenter: parent.verticalCenter
7 onClicked: {
8- if(!devicesModel.emulatorInstalled){
9- PopupUtils.open(resourceRoot+"/DevicesPage/EmulatorNotInstalled.qml",devicePage);
10- return;
11- }
12 PopupUtils.open(resourceRoot+"/DevicesPage/NewEmulatorDialog.qml",devicePage);
13 }
14 }
15
16=== removed file 'share/qtcreator/ubuntu/qml/DevicesPage/EmulatorNotInstalled.qml'
17--- share/qtcreator/ubuntu/qml/DevicesPage/EmulatorNotInstalled.qml 2015-11-23 10:34:50 +0000
18+++ share/qtcreator/ubuntu/qml/DevicesPage/EmulatorNotInstalled.qml 1970-01-01 00:00:00 +0000
19@@ -1,48 +0,0 @@
20-import QtQuick 2.4
21-import Ubuntu.Components 1.3
22-import Ubuntu.Components.ListItems 1.3 as ListItem
23-import Ubuntu.Components.Popups 1.0
24-
25-import "../Components"
26-
27-Popover {
28- id: popover
29- height: containerLayout.childrenRect.height
30- Column {
31- id: containerLayout
32- anchors {
33- left: parent.left
34- top: parent.top
35- right: parent.right
36- }
37- ListItem.Header {
38- text: "Ubuntu Emulator is not installed"
39- __foregroundColor: UbuntuColors.orange
40-
41- }
42- ListItem.Empty {
43- showDivider: false
44- Label {
45- anchors.fill: parent
46- anchors.margins: units.gu(2)
47- text: "Install the emulator package \"ubuntu-emulator\" in order to create emulator instances."
48- wrapMode: Text.Wrap
49- }
50- }
51- //add a spacer item
52- Item {
53- height: units.gu(2)
54- width: units.gu(1)
55- }
56- ListItem.SingleControl {
57- highlightWhenPressed: false
58- control: Button {
59- text: "Close"
60- anchors {
61- margins: units.gu(1)
62- }
63- onClicked: PopupUtils.close(popover)
64- }
65- }
66- }
67-}
68
69=== removed file 'share/qtcreator/ubuntu/scripts/local_install_emulator'
70--- share/qtcreator/ubuntu/scripts/local_install_emulator 2013-11-29 12:07:35 +0000
71+++ share/qtcreator/ubuntu/scripts/local_install_emulator 1970-01-01 00:00:00 +0000
72@@ -1,20 +0,0 @@
73-#!/bin/bash
74-# Copyright 2013 Canonical Ltd.
75-#
76-# This program is free software; you can redistribute it and/or modify
77-# it under the terms of the GNU Lesser General Public License as published by
78-# the Free Software Foundation; version 2.1.
79-#
80-# This program is distributed in the hope that it will be useful,
81-# but WITHOUT ANY WARRANTY; without even the implied warranty of
82-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
83-# GNU Lesser General Public License for more details.
84-#
85-# You should have received a copy of the GNU Lesser General Public License
86-# along with this program. If not, see <http://www.gnu.org/licenses/>.
87-#
88-# Author: Zoltán Balogh <zoltan.balogh@canonical.com>
89-
90-set -e
91-EMULATOR_PACKAGE=$1
92-pkexec sh -c "apt-get -y -f install ${EMULATOR_PACKAGE}"
93
94=== modified file 'share/qtcreator/ubuntu/scripts/local_package_installed'
95--- share/qtcreator/ubuntu/scripts/local_package_installed 2014-01-21 11:07:59 +0000
96+++ share/qtcreator/ubuntu/scripts/local_package_installed 2016-03-22 19:37:10 +0000
97@@ -15,6 +15,6 @@
98 #
99 # Author: Zoltán Balogh <zoltan.balogh@canonical.com>
100 set -e
101-EMULATOR_PACKAGE=$1
102+PACKAGE=$1
103
104-dpkg -l ${EMULATOR_PACKAGE} 2>&1 |egrep -v "no packages found matching"| awk '{print $1 " " $2 " " $3}' | grep "ii" || echo "The package is not installed."
105+dpkg -l ${PACKAGE} 2>&1 |egrep -v "no packages found matching"| awk '{print $1 " " $2 " " $3}' | grep "ii" || echo "The package is not installed."
106
107=== modified file 'src/ubuntu/ubuntuconstants.h'
108--- src/ubuntu/ubuntuconstants.h 2015-11-24 15:37:59 +0000
109+++ src/ubuntu/ubuntuconstants.h 2016-03-22 19:37:10 +0000
110@@ -41,7 +41,7 @@
111 const char UBUNTUDEVICESWIDGET_ONERROR[] = "<p style=\"color: red\">%0</p>";
112 const char UBUNTUDEVICESWIDGET_ACTION_BEGIN[] = "<p style=\"color: #888\">%0</p>";
113 const char UBUNTUDEVICESWIDGET_ACTION_END[] = "<p style=\"color: #888\">%0</p>";
114-const char UBUNTUDEVICESWIDGET_ONFINISHED_LOCAL_NO_EMULATOR_INSTALLED[] = "The package is not installed.";
115+const char UBUNTUDEVICESWIDGET_ONFINISHED_LOCAL_NOT_INSTALLED[] = "The package is not installed.";
116 const char UBUNTUDEVICESWIDGET_ONFINISHED_ADB_REGEX[] = "(\\S+)\\s+(.*)";
117 const char UBUNTUDEVICESWIDGET_ONFINISHED_ADB_NOACCESS[] = "???";
118 const char UBUNTUDEVICESWIDGET_ONFINISHED_SSH_WAS_STARTED[] = "..openssh-server was started.";
119@@ -52,7 +52,6 @@
120 const char UBUNTUDEVICESWIDGET_ONFINISHED_UNABLE_TO_FETCH[] = "E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?";
121
122 const char UBUNTUWIDGETS_ONFINISHED_SCRIPT_LOCAL_PACKAGE_INSTALLED[] = "%0/local_package_installed";
123-const char UBUNTUDEVICESWIDGET_ONFINISHED_SCRIPT_LOCAL_INSTALL_EMULATOR[] = "%0/local_install_emulator";
124
125 const char UBUNTUDEVICESWIDGET_ONFINISHED_WRITABLE_ENABLED[] = "..writable image has been enabled, device is rebooting.";
126 const char UBUNTUDEVICESWIDGET_ONFINISHED_WRITABLE_DISABLED[] = "..writable image has been disabled, device is rebooting.";
127@@ -72,13 +71,9 @@
128 const char UBUNTUDEVICESWIDGET_ONFINISHED_PUBLICKEY_AUTH_SET[] = "..public key authentication is now set.";
129 const char UBUNTUDEVICESWIDGET_ONFINISHED_NETWORK_CONF_COPIED[] = "..network configuration copied.";
130
131-const char EMULATOR_PACKAGE_NAME[] = "ubuntu-emulator";
132 const char DEFAULT_EMULATOR_PATH[] = "ubuntu-emulator";
133 const char REVIEWER_PACKAGE_NAME[] = "click-reviewers-tools";
134
135-const char UBUNTUDEVICESWIDGET_LOCAL_EMULATOR_INSTALLED[] = "Checking installed emulator package.";
136-const char UBUNTUDEVICESWIDGET_INSTALL_EMULATOR_PACKAGE[] = "Install the emulator package on the system..";
137-const char UBUNTUDEVICESWIDGET_INSTALL_EMULATOR_PACKAGE_SCRIPT[] = "%0/local_install_emulator %1";
138 const char UBUNTUDEVICESWIDGET_LOCAL_SEARCH_IMAGES_SCRIPT[] = "%0/local_search_images";
139 const char UBUNTUDEVICESWIDGET_LOCAL_SEARCH_IMAGES[] = "Search configured emulator instances.";
140 const char UBUNTUDEVICESWIDGET_LOCAL_CREATE_EMULATOR[] = "Creating new emulator instance.";
141
142=== modified file 'src/ubuntu/ubuntudevicesmodel.cpp'
143--- src/ubuntu/ubuntudevicesmodel.cpp 2015-11-11 14:50:13 +0000
144+++ src/ubuntu/ubuntudevicesmodel.cpp 2016-03-22 19:37:10 +0000
145@@ -361,7 +361,6 @@
146 void UbuntuDevicesModel::refresh()
147 {
148 readDevicesFromSettings();
149- checkEmulatorInstalled();
150 }
151
152 void UbuntuDevicesModel::clear()
153@@ -619,19 +618,6 @@
154 ProjectExplorer::DeviceManager::instance()->addDevice(dev);
155 }
156
157-bool UbuntuDevicesModel::emulatorInstalled() const
158-{
159- return m_emulatorInstalled;
160-}
161-
162-void UbuntuDevicesModel::setEmulatorInstalled(bool arg)
163-{
164- if (m_emulatorInstalled != arg) {
165- m_emulatorInstalled = arg;
166- emit emulatorInstalledChanged(arg);
167- }
168-}
169-
170 bool UbuntuDevicesModel::busy() const
171 {
172 return m_busy;
173@@ -648,14 +634,6 @@
174 QString UbuntuDevicesModel::state() const
175 {
176 switch(m_state) {
177- case CheckEmulatorInstalled: {
178- return tr("Checking if emulator tool is installed");
179- break;
180- }
181- case InstallEmulator: {
182- return tr("Installing emulator tool");
183- break;
184- }
185 case CreateEmulatorImage: {
186 return tr("Creating emulator image");
187 break;
188@@ -713,22 +691,6 @@
189 emit logMessage(QString::fromLatin1(Constants::UBUNTUDEVICESWIDGET_ACTION_END).arg(msg));
190 }
191
192-void UbuntuDevicesModel::checkEmulatorInstalled()
193-{
194- setState(CheckEmulatorInstalled);
195- setCancellable(false);
196- m_emulatorInstalled = false;
197-
198- beginAction(QString::fromLatin1(Constants::UBUNTUDEVICESWIDGET_LOCAL_EMULATOR_INSTALLED));
199- m_process->stop();
200- QString sEmulatorPackageName = QLatin1String(Ubuntu::Constants::EMULATOR_PACKAGE_NAME);
201- m_process->append(QStringList()
202- << QString::fromLatin1(Constants::UBUNTUWIDGETS_LOCAL_PACKAGE_INSTALLED_SCRIPT).arg(Ubuntu::Constants::UBUNTU_SCRIPTPATH).arg(sEmulatorPackageName)
203- << QCoreApplication::applicationDirPath());
204- m_process->start(QString::fromLatin1(Constants::UBUNTUDEVICESWIDGET_LOCAL_EMULATOR_INSTALLED));
205-
206-}
207-
208 void UbuntuDevicesModel::findEmulatorImages()
209 {
210 setState(FindImages);
211@@ -742,23 +704,6 @@
212 m_process->start(QString::fromLatin1(Constants::UBUNTUDEVICESWIDGET_LOCAL_SEARCH_IMAGES));
213 }
214
215-void UbuntuDevicesModel::installEmulator()
216-{
217- if(m_emulatorInstalled)
218- return;
219-
220- setState(InstallEmulator);
221- setCancellable(false);
222-
223- beginAction(QString::fromLatin1(Constants::UBUNTUDEVICESWIDGET_INSTALL_EMULATOR_PACKAGE));
224- QString sEmulatorPackageName = QLatin1String(Ubuntu::Constants::EMULATOR_PACKAGE_NAME);
225- m_process->stop();
226- m_process->append(QStringList()
227- << QString::fromLatin1(Constants::UBUNTUDEVICESWIDGET_INSTALL_EMULATOR_PACKAGE_SCRIPT).arg(Ubuntu::Constants::UBUNTU_SCRIPTPATH).arg(sEmulatorPackageName)
228- << QCoreApplication::applicationDirPath());
229- m_process->start(QString::fromLatin1(Constants::UBUNTUDEVICESWIDGET_INSTALL_EMULATOR_PACKAGE));
230-}
231-
232 void UbuntuDevicesModel::doCreateEmulatorImage(UbuntuProcess *process, const QString &name, const QString &arch, const QString &channel, const QString &passwd)
233 {
234 process->stop();
235@@ -894,9 +839,6 @@
236
237 void UbuntuDevicesModel::onMessage(const QString &msg)
238 {
239- if (msg.startsWith(QLatin1String(Constants::UBUNTUDEVICESWIDGET_ONFINISHED_UNABLE_TO_FETCH))) {
240- setEmulatorInstalled(false);
241- }
242 m_reply.append(msg);
243 }
244
245@@ -911,54 +853,6 @@
246 };
247
248 switch(lastState) {
249- case CheckEmulatorInstalled: {
250- QStringList lines = m_reply.trimmed().split(QLatin1String(Constants::LINEFEED));
251- foreach(QString line, lines) {
252- line = line.trimmed();
253- if (line.isEmpty()) {
254- continue;
255- }
256- if (line.startsWith(QLatin1String(Constants::UBUNTUDEVICESWIDGET_ONFINISHED_LOCAL_NO_EMULATOR_INSTALLED))) {
257- setEmulatorInstalled(false);
258- queryAdb();
259- } else {
260- QStringList lineData = line.split(QLatin1String(Constants::SPACE));
261- QString sEmulatorPackageStatus = lineData.takeFirst();
262- //QString sEmulatorPackageName = lineData.takeFirst();
263- //QString sEmulatorPackageVersion = lineData.takeFirst();
264- if (sEmulatorPackageStatus.startsWith(QLatin1String(Constants::INSTALLED))) {
265- setEmulatorInstalled(true);
266- findEmulatorImages();
267- }
268- }
269- }
270- break;
271- }
272- case InstallEmulator: {
273- QStringList lines = m_reply.trimmed().split(QLatin1String(Constants::LINEFEED));
274- foreach(QString line, lines) {
275- line = line.trimmed();
276- if (line.isEmpty()) {
277- continue;
278- }
279- if (line.startsWith(QLatin1String(Constants::UBUNTUDEVICESWIDGET_ONFINISHED_LOCAL_NO_EMULATOR_INSTALLED))) {
280- setEmulatorInstalled(false);
281- queryAdb();
282- break;
283- } else {
284- QStringList lineData = line.split(QLatin1String(Constants::SPACE));
285- QString sEmulatorPackageStatus = lineData.takeFirst();
286- //QString sEmulatorPackageName = lineData.takeFirst();
287- //QString sEmulatorPackageVersion = lineData.takeFirst();
288- if (sEmulatorPackageStatus.startsWith(QLatin1String(Constants::INSTALLED))) {
289- setEmulatorInstalled(true);
290- findEmulatorImages();
291- break;
292- }
293- }
294- }
295- break;
296- }
297 case CreateEmulatorImage: {
298 findEmulatorImages();
299 break;
300
301=== modified file 'src/ubuntu/ubuntudevicesmodel.h'
302--- src/ubuntu/ubuntudevicesmodel.h 2015-05-05 09:38:13 +0000
303+++ src/ubuntu/ubuntudevicesmodel.h 2016-03-22 19:37:10 +0000
304@@ -69,8 +69,6 @@
305
306 enum State {
307 Initial,
308- CheckEmulatorInstalled,
309- InstallEmulator,
310 CreateEmulatorImage,
311 ReadFromSettings,
312 FindImages,
313@@ -78,7 +76,6 @@
314 Idle
315 };
316
317- Q_PROPERTY(bool emulatorInstalled READ emulatorInstalled WRITE setEmulatorInstalled NOTIFY emulatorInstalledChanged)
318 Q_PROPERTY(bool busy READ busy NOTIFY busyChanged)
319 Q_PROPERTY(bool cancellable READ cancellable NOTIFY cancellableChanged)
320 Q_PROPERTY(QString state READ state NOTIFY stateChanged)
321@@ -101,7 +98,6 @@
322 bool cancellable() const;
323 QString state() const;
324 bool busy() const;
325- bool emulatorInstalled() const;
326
327 static void doCreateEmulatorImage ( UbuntuProcess *process, const QString &name, const QString &arch, const QString &channel, const QString &passwd );
328 signals:
329@@ -110,7 +106,6 @@
330 void stdErrMessage (const QString &str);
331
332 void busyChanged(bool arg);
333- void emulatorInstalledChanged(bool arg);
334 void cancellableChanged(bool arg);
335 void stateChanged(QString arg);
336
337@@ -139,14 +134,11 @@
338
339 void setState(UbuntuDevicesModel::State newState);
340 void setBusy(bool arg);
341- void setEmulatorInstalled(bool arg);
342 void setCancellable(bool arg);
343
344 void beginAction(const QString &msg);
345 void endAction(const QString &msg);
346- void checkEmulatorInstalled();
347 void findEmulatorImages();
348- void installEmulator();
349 void queryAdb();
350
351 protected slots:
352@@ -167,7 +159,6 @@
353 QList<UbuntuDevicesItem*> m_knownDevices;
354 UbuntuDeviceNotifier *m_deviceNotifier;
355 bool m_busy;
356- bool m_emulatorInstalled;
357 bool m_cancellable;
358 State m_state;
359
360
361=== modified file 'src/ubuntu/ubuntupackagingmodel.cpp'
362--- src/ubuntu/ubuntupackagingmodel.cpp 2016-02-09 12:06:50 +0000
363+++ src/ubuntu/ubuntupackagingmodel.cpp 2016-03-22 19:37:10 +0000
364@@ -185,7 +185,7 @@
365 if (line.isEmpty()) {
366 continue;
367 }
368- if (line.startsWith(QLatin1String(Constants::UBUNTUDEVICESWIDGET_ONFINISHED_LOCAL_NO_EMULATOR_INSTALLED))) {
369+ if (line.startsWith(QLatin1String(Constants::UBUNTUDEVICESWIDGET_ONFINISHED_LOCAL_NOT_INSTALLED))) {
370 // There is no click reviewer tool installed
371 m_reviewToolsInstalled = false;
372 setShowValidationUi(false);
373
374=== modified file 'ubuntu.pro'
375--- ubuntu.pro 2015-11-23 10:36:16 +0000
376+++ ubuntu.pro 2016-03-22 19:37:10 +0000
377@@ -16,7 +16,6 @@
378 $$QML_ROOT/qml/DevicesPage/DevicePage.qml \
379 $$QML_ROOT/qml/DevicesPage/NewEmulatorDialog.qml \
380 $$QML_ROOT/qml/DevicesPage/DeleteDeviceDialog.qml \
381- $$QML_ROOT/qml/DevicesPage/EmulatorNotInstalled.qml \
382 $$QML_ROOT/qml/welcome.qml \
383 $$QML_ROOT/qml/publishpage.qml \
384 $$QML_ROOT/qml/devicespage.qml

Subscribers

People subscribed via source and target branches

to all changes: