Merge lp:~zeller-benjamin/qtcreator-plugin-ubuntu/qtversion into lp:qtcreator-plugin-ubuntu

Proposed by Benjamin Zeller
Status: Merged
Approved by: Zoltan Balogh
Approved revision: 221
Merged at revision: 226
Proposed branch: lp:~zeller-benjamin/qtcreator-plugin-ubuntu/qtversion
Merge into: lp:qtcreator-plugin-ubuntu
Diff against target: 1609 lines (+940/-86)
34 files modified
share/qtcreator/templates/wizards/ubuntu/simple/displayName.desktop (+1/-1)
share/qtcreator/templates/wizards/ubuntu/tabs/displayName.desktop (+1/-1)
share/qtcreator/ubuntu/devicespage/DevicePage.qml (+5/-1)
share/qtcreator/ubuntu/menu.json (+2/-39)
share/qtcreator/ubuntu/scripts/qtc_chroot_qmake (+4/-0)
share/qtcreator/ubuntu/scripts/qtc_device_applaunch.py (+19/-6)
src/ubuntu/ubuntu.pro (+8/-2)
src/ubuntu/ubuntuclickdialog.cpp (+5/-5)
src/ubuntu/ubuntuclickdialog.h (+2/-2)
src/ubuntu/ubuntuconstants.h (+6/-0)
src/ubuntu/ubuntucreatenewchrootdialog.cpp (+5/-2)
src/ubuntu/ubuntucreatenewchrootdialog.h (+1/-1)
src/ubuntu/ubuntudeploystepfactory.cpp (+2/-2)
src/ubuntu/ubuntudevicemode.cpp (+10/-0)
src/ubuntu/ubuntudevicemode.h (+6/-0)
src/ubuntu/ubuntudevicesmodel.cpp (+13/-9)
src/ubuntu/ubuntudevicesmodel.h (+2/-0)
src/ubuntu/ubuntufirstrunwizard.cpp (+221/-0)
src/ubuntu/ubuntufirstrunwizard.h (+86/-0)
src/ubuntu/ubuntukitmanager.cpp (+54/-2)
src/ubuntu/ubuntukitmanager.h (+3/-0)
src/ubuntu/ubuntulocalrunconfigurationfactory.cpp (+3/-3)
src/ubuntu/ubuntupackagestep.cpp (+2/-1)
src/ubuntu/ubuntupackagingwidget.cpp (+6/-3)
src/ubuntu/ubuntuplugin.cpp (+37/-0)
src/ubuntu/ubuntuplugin.h (+1/-0)
src/ubuntu/ubuntuprojectapplicationwizard.cpp (+30/-4)
src/ubuntu/ubuntuprojectapplicationwizard.h (+1/-0)
src/ubuntu/ubuntuqmlbuildconfiguration.cpp (+203/-0)
src/ubuntu/ubuntuqmlbuildconfiguration.h (+71/-0)
src/ubuntu/ubuntuqtversion.cpp (+86/-0)
src/ubuntu/ubuntuqtversion.h (+41/-0)
src/ubuntu/ubunturemotedeployconfiguration.cpp (+2/-1)
src/ubuntu/ubunturemoterunconfiguration.cpp (+1/-1)
To merge this branch: bzr merge lp:~zeller-benjamin/qtcreator-plugin-ubuntu/qtversion
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Zoltan Balogh Approve
Review via email: mp+228612@code.launchpad.net

Commit message

- Adding device runsupport for QML projects
- Create a QtVersion per chroot on the host
- Fix deprecated warnings in the SDK launcher

Description of the change

- Adding device runsupport for QML projects
- Create a QtVersion per chroot on the host

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
215. By Benjamin Zeller

Missing files

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
216. By Benjamin Zeller

- Fix templates to contain correct Exec line in desktop file
- make publish tab work with QML projects again
- Remove obsolete enties in the menu.json

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
217. By Benjamin Zeller

Adding the "first run" wizard

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
218. By Benjamin Zeller

- Add chroot creation to the project wizards
- Lead the user to the device creation page

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
219. By Benjamin Zeller

- Fixes text in the wizard pages
- Make sure parenting is correct
- Add a checkbox if the wizard should be shown again

220. By Benjamin Zeller

Some more text fixes

221. By Benjamin Zeller

- Show list of all devices
- Make sure the device list is up 2 date

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Zoltan Balogh (bzoltan) wrote :

OK

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'share/qtcreator/templates/wizards/ubuntu/simple/displayName.desktop'
2--- share/qtcreator/templates/wizards/ubuntu/simple/displayName.desktop 2014-07-10 15:35:32 +0000
3+++ share/qtcreator/templates/wizards/ubuntu/simple/displayName.desktop 2014-07-31 10:11:55 +0000
4@@ -1,6 +1,6 @@
5 [Desktop Entry]
6 Name=%ClickHookName%
7-Exec=/usr/bin/qmlscene $@ /usr/share/%ProjectName%/%ProjectName%.qml
8+Exec=qmlscene $@ main.qml
9 Icon=%ProjectName%.png
10 Terminal=false
11 Type=Application
12
13=== modified file 'share/qtcreator/templates/wizards/ubuntu/tabs/displayName.desktop'
14--- share/qtcreator/templates/wizards/ubuntu/tabs/displayName.desktop 2014-07-10 15:35:32 +0000
15+++ share/qtcreator/templates/wizards/ubuntu/tabs/displayName.desktop 2014-07-31 10:11:55 +0000
16@@ -1,6 +1,6 @@
17 [Desktop Entry]
18 Name=%ClickHookName%
19-Exec=/usr/bin/qmlscene $@ /usr/share/%ProjectName%/%ProjectName%.qml
20+Exec=qmlscene $@ main.qml
21 Icon=%ProjectName%.png
22 Terminal=false
23 Type=Application
24
25=== modified file 'share/qtcreator/ubuntu/devicespage/DevicePage.qml'
26--- share/qtcreator/ubuntu/devicespage/DevicePage.qml 2014-07-28 09:25:34 +0000
27+++ share/qtcreator/ubuntu/devicespage/DevicePage.qml 2014-07-31 10:11:55 +0000
28@@ -11,7 +11,6 @@
29 id: devicePage
30 flickable: null
31
32-
33 Item {
34 anchors.fill: parent
35 visible: devicesModel.busy
36@@ -146,6 +145,11 @@
37 iconSource: "qrc:/ubuntu/images/list-add.png"
38 onClicked: PopupUtils.open(resourceRoot+"/NewEmulatorDialog.qml",devicePage);
39 }
40+
41+ Connections{
42+ target: deviceMode
43+ onOpenAddEmulatorDialog: PopupUtils.open(resourceRoot+"/NewEmulatorDialog.qml",devicePage);
44+ }
45 }
46 }
47 }
48
49=== modified file 'share/qtcreator/ubuntu/menu.json'
50--- share/qtcreator/ubuntu/menu.json 2014-07-15 13:20:19 +0000
51+++ share/qtcreator/ubuntu/menu.json 2014-07-31 10:11:55 +0000
52@@ -48,20 +48,6 @@
53 "submenu": [
54 {
55 "name": "Run Application on Device",
56- "id": "Ubuntu.Build.Run",
57- "workingDirectory": "%0/..",
58- "projectRequired": true,
59- "keysequence": "Ctrl+F12",
60- "deviceRequired": true,
61- "qmlProjectRequired": true,
62- "saveRequired": true,
63- "context" : ["QmlProject.ProjectContext"],
64- "actions": [
65- "%SCRIPTDIRECTORY%/qtc_device_run_app_click %SERIALNUMBER% %FOLDERNAME% %USERNAME%@%IP% %PORT% /home/%USERNAME%/dev_tmp"
66- ]
67- },
68- {
69- "name": "Run Application on Device",
70 "id": "Ubuntu.Build.Run.Go",
71 "workingDirectory": "%0/..",
72 "projectRequired": true,
73@@ -80,41 +66,18 @@
74 "projectRequired": true,
75 "deviceRequired": true,
76 "qmlProjectRequired": true,
77+ "context": ["GoProject.ProjectContext"],
78 "actions": [
79 "%SCRIPTDIRECTORY%/qtc_device_close_all_apps %SERIALNUMBER% %DISPLAYNAME%"
80 ]
81 },
82 {
83- "name": "Create Application Package",
84- "id": "Ubuntu.Build.Package",
85- "workingDirectory": "%0/..",
86- "projectRequired": true,
87- "context": "QmlProject.ProjectContext",
88- "ubuntuProjectRequired": true,
89- "saveRequired": true,
90- "actions": [
91- "%SCRIPTDIRECTORY%/qtc_project_click_create %FOLDERNAME% %BUILDDIR%"
92- ]
93- },
94- {
95- "name": "Install Application on Device",
96- "id": "Ubuntu.Build.PackageInstall",
97- "workingDirectory": "%0/..",
98- "projectRequired": true,
99- "deviceRequired": true,
100- "context": ["QmlProject.ProjectContext"],
101- "saveRequired": true,
102- "actions": [
103- "%SCRIPTDIRECTORY%/qtc_project_click_createanddeploy %SERIALNUMBER% %FOLDERNAME% %USERNAME%@%IP% %PORT% /home/%USERNAME%/dev_tmp %USERNAME%"
104- ]
105- },
106- {
107 "name": "Install Application on Device",
108 "id": "Ubuntu.Build.PackageInstall.Html",
109 "workingDirectory": "%0/..",
110 "projectRequired": true,
111 "deviceRequired": true,
112- "context": ["UbuntuProject.ProjectContext"],
113+ "context": ["UbuntuProject.ProjectContext","QmlProject.ProjectContext"],
114 "saveRequired": true,
115 "actions": [
116 {
117
118=== modified file 'share/qtcreator/ubuntu/scripts/qtc_chroot_qmake' (properties changed: +x to -x)
119--- share/qtcreator/ubuntu/scripts/qtc_chroot_qmake 2014-07-22 09:57:33 +0000
120+++ share/qtcreator/ubuntu/scripts/qtc_chroot_qmake 2014-07-31 10:11:55 +0000
121@@ -15,6 +15,10 @@
122 #
123 # Author: Zoltán Balogh <zoltan.balogh@canonical.com>
124
125+
126+CLICK_CHROOT_ARCH="%1"
127+CLICK_CHROOT_FW="%2"
128+
129 if [ -z "$CLICK_CHROOT_ARCH" ]; then
130 echo "Need to set CLICK_CHROOT_ARCH"
131 exit 1
132
133=== modified file 'share/qtcreator/ubuntu/scripts/qtc_device_applaunch.py'
134--- share/qtcreator/ubuntu/scripts/qtc_device_applaunch.py 2014-07-03 13:03:47 +0000
135+++ share/qtcreator/ubuntu/scripts/qtc_device_applaunch.py 2014-07-31 10:11:55 +0000
136@@ -79,8 +79,11 @@
137 sys.stdout.flush()
138
139 def on_log_io(file, condition):
140- print (file.read().decode())
141- sys.stdout.flush()
142+ output = file.read().decode()
143+ if len(output) > 0:
144+ print (output)
145+ sys.stdout.flush()
146+
147 return True
148
149
150@@ -212,7 +215,11 @@
151 file_flags = fcntl.fcntl(logFileFd, fcntl.F_GETFL)
152 fcntl.fcntl(logFileFd, fcntl.F_SETFL, file_flags | os.O_NDELAY)
153
154-GObject.io_add_watch(logTailProc.stdout,GObject.IO_IN | GObject.IO_HUP,on_log_io)
155+#since pygobject version 3.8 the old way of calling io_add_watch is deprecated
156+if (GObject.pygobject_version[0] > 3 or (GObject.pygobject_version[0] == 3 and GObject.pygobject_version[1] >= 8)):
157+ GLib.io_add_watch(logTailProc.stdout,GLib.PRIORITY_DEFAULT,GObject.IO_IN | GObject.IO_HUP,on_log_io)
158+else:
159+ GObject.io_add_watch(logTailProc.stdout,GObject.IO_IN | GObject.IO_HUP,on_log_io)
160
161 state = {}
162 state['loop'] = GLib.MainLoop()
163@@ -222,9 +229,15 @@
164
165 print ("Registering hooks")
166 sys.stdout.flush()
167-GLib.unix_signal_add_full(GLib.PRIORITY_HIGH, signal.SIGTERM, on_sigterm, state)
168-GLib.unix_signal_add_full(GLib.PRIORITY_HIGH, signal.SIGINT, on_sigterm, state)
169-GLib.unix_signal_add_full(GLib.PRIORITY_HIGH, signal.SIGHUP, on_sigterm, state)
170+
171+if "unix_signal_add" in dir(GLib):
172+ GLib.unix_signal_add(GLib.PRIORITY_HIGH, signal.SIGTERM, on_sigterm, state)
173+ GLib.unix_signal_add(GLib.PRIORITY_HIGH, signal.SIGINT, on_sigterm, state)
174+ GLib.unix_signal_add(GLib.PRIORITY_HIGH, signal.SIGHUP, on_sigterm, state)
175+else:
176+ GLib.unix_signal_add_full(GLib.PRIORITY_HIGH, signal.SIGTERM, on_sigterm, state)
177+ GLib.unix_signal_add_full(GLib.PRIORITY_HIGH, signal.SIGINT, on_sigterm, state)
178+ GLib.unix_signal_add_full(GLib.PRIORITY_HIGH, signal.SIGHUP, on_sigterm, state)
179
180 UAL.observer_add_app_failed(on_failed, state)
181 UAL.observer_add_app_started(on_started, state)
182
183=== modified file 'src/ubuntu/ubuntu.pro'
184--- src/ubuntu/ubuntu.pro 2014-07-15 09:55:12 +0000
185+++ src/ubuntu/ubuntu.pro 2014-07-31 10:11:55 +0000
186@@ -117,9 +117,12 @@
187 abstractremoterunsupport.cpp\
188 ubuntushared.cpp \
189 ubuntupackagestep.cpp \
190+ ubuntuqtversion.cpp \
191 ubuntudeploystepfactory.cpp \
192 ubuntudirectuploadstep.cpp \
193- ubuntuhtmlbuildconfiguration.cpp
194+ ubuntuhtmlbuildconfiguration.cpp \
195+ ubuntuqmlbuildconfiguration.cpp \
196+ ubuntufirstrunwizard.cpp
197
198 HEADERS += \
199 ubuntuplugin.h \
200@@ -186,7 +189,10 @@
201 ubunturemoterunner.h \
202 abstractremoterunsupport.h \
203 ubuntupackagestep.h \
204+ ubuntuqtversion.h \
205 ubuntudeploystepfactory.h \
206 ubuntudirectuploadstep.h \
207- ubuntuhtmlbuildconfiguration.h
208+ ubuntuhtmlbuildconfiguration.h \
209+ ubuntuqmlbuildconfiguration.h \
210+ ubuntufirstrunwizard.h
211
212
213=== modified file 'src/ubuntu/ubuntuclickdialog.cpp'
214--- src/ubuntu/ubuntuclickdialog.cpp 2014-07-22 07:33:23 +0000
215+++ src/ubuntu/ubuntuclickdialog.cpp 2014-07-31 10:11:55 +0000
216@@ -81,9 +81,9 @@
217 m_process->start();
218 }
219
220-int UbuntuClickDialog::runClickModal(ProjectExplorer::ProcessParameters *params)
221+int UbuntuClickDialog::runClickModal(ProjectExplorer::ProcessParameters *params, QWidget *parent)
222 {
223- UbuntuClickDialog dlg(Core::ICore::mainWindow());
224+ UbuntuClickDialog dlg( parent ? parent : Core::ICore::mainWindow());
225 dlg.setParameters(params);
226 QMetaObject::invokeMethod(&dlg,"runClick",Qt::QueuedConnection);
227 dlg.exec();
228@@ -91,17 +91,17 @@
229 return dlg.m_exitCode;
230 }
231
232-bool UbuntuClickDialog::createClickChrootModal(bool redetectKits, const QString &arch)
233+bool UbuntuClickDialog::createClickChrootModal(bool redetectKits, const QString &arch, QWidget *parent)
234 {
235
236 UbuntuClickTool::Target t;
237- if(!UbuntuCreateNewChrootDialog::getNewChrootTarget(&t,arch))
238+ if(!UbuntuCreateNewChrootDialog::getNewChrootTarget(&t,arch,parent))
239 return false;
240
241 ProjectExplorer::ProcessParameters params;
242 UbuntuClickTool::parametersForCreateChroot(t,&params);
243
244- bool success = (runClickModal(&params) == 0);
245+ bool success = (runClickModal(&params,parent) == 0);
246
247 if(success) {
248 ClickToolChain* tc = new ClickToolChain(t, ProjectExplorer::ToolChain::AutoDetection);
249
250=== modified file 'src/ubuntu/ubuntuclickdialog.h'
251--- src/ubuntu/ubuntuclickdialog.h 2014-06-16 15:40:12 +0000
252+++ src/ubuntu/ubuntuclickdialog.h 2014-07-31 10:11:55 +0000
253@@ -49,8 +49,8 @@
254 public slots:
255 void runClick ();
256
257- static int runClickModal (ProjectExplorer::ProcessParameters* params);
258- static bool createClickChrootModal (bool redetectKits = true , const QString &arch = QString());
259+ static int runClickModal (ProjectExplorer::ProcessParameters* params, QWidget *parent = 0);
260+ static bool createClickChrootModal (bool redetectKits = true , const QString &arch = QString(),QWidget *parent = 0);
261 static int maintainClickModal (const UbuntuClickTool::Target &target, const UbuntuClickTool::MaintainMode &mode);
262
263 // QDialog interface
264
265=== modified file 'src/ubuntu/ubuntuconstants.h'
266--- src/ubuntu/ubuntuconstants.h 2014-07-28 07:58:53 +0000
267+++ src/ubuntu/ubuntuconstants.h 2014-07-31 10:11:55 +0000
268@@ -510,6 +510,7 @@
269 const char UBUNTU_CLICK_MAKE_WRAPPER[] = "%0/qtc_chroot_make2";
270 const char UBUNTU_CLICK_GCC_WRAPPER[] = "%0/qtc_chroot_gcc";
271 const char UBUNTU_CLICK_HTML_BC_ID[] = "UbuntuProjectManager.UbuntuHTML5.BuildConfiguration";
272+const char UBUNTU_CLICK_QML_BC_ID[] = "UbuntuProjectManager.UbuntuQml.BuildConfiguration";
273 //Devicesupport
274 const char UBUNTU_DEVICE_TYPE_ID[] = "UbuntuProjectManager.DeviceTypeId";
275 const char UBUNTU_DEVICE_SSHIDENTITY[] = "%0/.config/ubuntu-sdk/ubuntudevice_id_rsa";
276@@ -551,6 +552,11 @@
277
278 const char UBUNTU_GO_BUILD_TARGETS[] = "%GOBUILDTARGETS%";
279
280+//Qtversion support
281+const char UBUNTU_QTVERSION_TYPE[] = "UbuntuProjectManager.QtVersion";
282+const char UBUNTU_PLATFORM_NAME[] = "Ubuntu Phone";
283+const char UBUNTU_PLATFORM_NAME_TR[] = QT_TRANSLATE_NOOP("UbuntuProjectManager", "Ubuntu Phone");
284+
285 } // namespace Ubuntu
286 } // namespace Constants
287
288
289=== modified file 'src/ubuntu/ubuntucreatenewchrootdialog.cpp'
290--- src/ubuntu/ubuntucreatenewchrootdialog.cpp 2014-06-16 15:40:12 +0000
291+++ src/ubuntu/ubuntucreatenewchrootdialog.cpp 2014-07-31 10:11:55 +0000
292@@ -19,6 +19,9 @@
293 #include "ui_ubuntucreatenewchrootdialog.h"
294
295 #include "ubuntuconstants.h"
296+
297+#include <coreplugin/icore.h>
298+
299 namespace Ubuntu {
300
301 namespace Constants {
302@@ -66,9 +69,9 @@
303 * Opens a dialog that lets the user select a new chroot, returns false
304 * if the user pressed cancel
305 */
306-bool UbuntuCreateNewChrootDialog::getNewChrootTarget(UbuntuClickTool::Target *target, const QString &arch)
307+bool UbuntuCreateNewChrootDialog::getNewChrootTarget(UbuntuClickTool::Target *target, const QString &arch, QWidget *parent)
308 {
309- UbuntuCreateNewChrootDialog dlg(arch);
310+ UbuntuCreateNewChrootDialog dlg(arch, parent ? parent : Core::ICore::mainWindow());
311 if( dlg.exec() == QDialog::Accepted) {
312 bool ok = false;
313
314
315=== modified file 'src/ubuntu/ubuntucreatenewchrootdialog.h'
316--- src/ubuntu/ubuntucreatenewchrootdialog.h 2014-06-16 15:40:12 +0000
317+++ src/ubuntu/ubuntucreatenewchrootdialog.h 2014-07-31 10:11:55 +0000
318@@ -38,7 +38,7 @@
319 explicit UbuntuCreateNewChrootDialog(const QString &arch = QString(), QWidget *parent = 0);
320 ~UbuntuCreateNewChrootDialog();
321
322- static bool getNewChrootTarget(UbuntuClickTool::Target *target, const QString &arch);
323+ static bool getNewChrootTarget(UbuntuClickTool::Target *target, const QString &arch, QWidget *parent = 0);
324
325 private:
326 Ui::UbuntuCreateNewChrootDialog *ui;
327
328=== modified file 'src/ubuntu/ubuntudeploystepfactory.cpp'
329--- src/ubuntu/ubuntudeploystepfactory.cpp 2014-07-15 09:55:12 +0000
330+++ src/ubuntu/ubuntudeploystepfactory.cpp 2014-07-31 10:11:55 +0000
331@@ -35,7 +35,7 @@
332 bool isRemote = targetDevice == Ubuntu::Constants::UBUNTU_DEVICE_TYPE_ID;
333 bool isCMake = parent->target()->project()->id() == CMakeProjectManager::Constants::CMAKEPROJECT_ID;
334 bool isHTML = parent->target()->project()->id() == Ubuntu::Constants::UBUNTUPROJECT_ID;
335- //bool isQML = parent->target()->project()->id() == "QmlProjectManager.QmlProject";
336+ bool isQML = parent->target()->project()->id() == "QmlProjectManager.QmlProject";
337
338 if (isRemote) {
339 //IF we have a remote device we just support a ubuntu toolchain
340@@ -47,7 +47,7 @@
341 if(isRemote && isCMake && !UbuntuProjectGuesser::isScopesProject(parent->target()->project()))
342 types << Constants::UBUNTU_DEPLOY_UPLOADSTEP_ID
343 << Constants::UBUNTU_CLICK_PACKAGESTEP_ID;
344- else if(isRemote && isHTML)
345+ else if(isRemote && ( isHTML || isQML ) )
346 types << Constants::UBUNTU_DEPLOY_UPLOADSTEP_ID
347 << Constants::UBUNTU_CLICK_PACKAGESTEP_ID;
348
349
350=== modified file 'src/ubuntu/ubuntudevicemode.cpp'
351--- src/ubuntu/ubuntudevicemode.cpp 2014-05-15 13:48:54 +0000
352+++ src/ubuntu/ubuntudevicemode.cpp 2014-07-31 10:11:55 +0000
353@@ -103,6 +103,11 @@
354 emit updateDeviceActions ();
355 }
356
357+void UbuntuDeviceMode::showAddEmulatorDialog()
358+{
359+ m_qmlControl->showAddEmulatorDialog();
360+}
361+
362 void UbuntuDeviceMode::modeChanged(Core::IMode *mode)
363 {
364 Q_UNUSED(mode);
365@@ -125,6 +130,11 @@
366
367 }
368
369+void UbuntuQMLDeviceMode::showAddEmulatorDialog()
370+{
371+ emit openAddEmulatorDialog();
372+}
373+
374 void UbuntuQMLDeviceMode::deviceSelected(const QVariant index)
375 {
376 m_mode->deviceSelected(index);
377
378=== modified file 'src/ubuntu/ubuntudevicemode.h'
379--- src/ubuntu/ubuntudevicemode.h 2014-05-14 14:18:55 +0000
380+++ src/ubuntu/ubuntudevicemode.h 2014-07-31 10:11:55 +0000
381@@ -37,6 +37,8 @@
382 public:
383 UbuntuQMLDeviceMode( UbuntuDeviceMode *parent );
384
385+ void showAddEmulatorDialog ();
386+
387 public slots:
388 void deviceSelected ( const QVariant index );
389 void addText (const QString &arg);
390@@ -45,6 +47,7 @@
391 signals:
392 void logChanged(const QString &arg);
393 void appendText(const QString &newText);
394+ void openAddEmulatorDialog ();
395
396 private:
397 UbuntuDeviceMode* m_mode;
398@@ -64,6 +67,9 @@
399
400 void deviceSelected ( const QVariant index );
401
402+public slots:
403+ void showAddEmulatorDialog ();
404+
405 signals:
406 void updateDeviceActions ();
407
408
409=== modified file 'src/ubuntu/ubuntudevicesmodel.cpp'
410--- src/ubuntu/ubuntudevicesmodel.cpp 2014-07-28 09:38:41 +0000
411+++ src/ubuntu/ubuntudevicesmodel.cpp 2014-07-31 10:11:55 +0000
412@@ -726,23 +726,27 @@
413 m_process->start(QString::fromLatin1(Constants::UBUNTUDEVICESWIDGET_INSTALL_EMULATOR_PACKAGE));
414 }
415
416-void UbuntuDevicesModel::createEmulatorImage(const QString &name, const QString &arch, const QString &channel)
417+void UbuntuDevicesModel::doCreateEmulatorImage(UbuntuProcess *process, const QString &name, const QString &arch, const QString &channel)
418 {
419- setState(CreateEmulatorImage);
420- setCancellable(true);
421-
422- beginAction(QString::fromLatin1(Constants::UBUNTUDEVICESWIDGET_LOCAL_CREATE_EMULATOR));
423- m_process->stop();
424+ process->stop();
425 QString strEmulatorName = name;
426 QString strEmulatorPath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation);
427 strEmulatorPath += QDir::separator();
428 strEmulatorPath += QLatin1String(Constants::DEFAULT_EMULATOR_PATH);
429 strEmulatorPath += QDir::separator();
430- m_process->append(QStringList()
431+ process->append(QStringList()
432 << QString::fromLatin1(Constants::UBUNTUDEVICESWIDGET_LOCAL_CREATE_EMULATOR_SCRIPT)
433 .arg(Ubuntu::Constants::UBUNTU_SCRIPTPATH).arg(strEmulatorPath).arg(strEmulatorName).arg(arch).arg(channel)
434 << QCoreApplication::applicationDirPath());
435- m_process->start(QString::fromLatin1(Constants::UBUNTUDEVICESWIDGET_LOCAL_CREATE_EMULATOR));
436+ process->start(QString::fromLatin1(Constants::UBUNTUDEVICESWIDGET_LOCAL_CREATE_EMULATOR));
437+}
438+
439+void UbuntuDevicesModel::createEmulatorImage(const QString &name, const QString &arch, const QString &channel)
440+{
441+ setState(CreateEmulatorImage);
442+ setCancellable(true);
443+ beginAction(QString::fromLatin1(Constants::UBUNTUDEVICESWIDGET_LOCAL_CREATE_EMULATOR));
444+ doCreateEmulatorImage(m_process,name,arch,channel);
445 }
446
447 void UbuntuDevicesModel::queryAdb()
448@@ -1024,7 +1028,7 @@
449
450 if (lineData.count() == 2) {
451 QString sSerialNumber = lineData.takeFirst();
452- QString sDeviceInfo = lineData.takeFirst();
453+ //QString sDeviceInfo = lineData.takeFirst();
454
455 //sometimes the adb server is not started when adb devices is
456 //executed, we just skip those lines
457
458=== modified file 'src/ubuntu/ubuntudevicesmodel.h'
459--- src/ubuntu/ubuntudevicesmodel.h 2014-07-28 07:28:56 +0000
460+++ src/ubuntu/ubuntudevicesmodel.h 2014-07-31 10:11:55 +0000
461@@ -81,6 +81,8 @@
462 QString state() const;
463 bool busy() const;
464 bool emulatorInstalled() const;
465+
466+ static void doCreateEmulatorImage ( UbuntuProcess *process, const QString &name, const QString &arch, const QString &channel );
467 signals:
468 void logMessage (const QString &str);
469 void stdOutMessage (const QString &str);
470
471=== added file 'src/ubuntu/ubuntufirstrunwizard.cpp'
472--- src/ubuntu/ubuntufirstrunwizard.cpp 1970-01-01 00:00:00 +0000
473+++ src/ubuntu/ubuntufirstrunwizard.cpp 2014-07-31 10:11:55 +0000
474@@ -0,0 +1,221 @@
475+#include "ubuntufirstrunwizard.h"
476+#include "ubuntuconstants.h"
477+#include "ubuntukitmanager.h"
478+#include "ubuntuclickdialog.h"
479+#include "clicktoolchain.h"
480+#include "ubuntudevicesmodel.h"
481+#include "ubuntuprocess.h"
482+#include "ubuntudevice.h"
483+
484+#include <projectexplorer/kitmanager.h>
485+#include <projectexplorer/kitinformation.h>
486+#include <projectexplorer/devicesupport/devicemanager.h>
487+
488+#include <QLabel>
489+#include <QPushButton>
490+#include <QVBoxLayout>
491+#include <QTreeWidget>
492+#include <QTreeWidgetItem>
493+#include <QCheckBox>
494+#include <QDebug>
495+#include <QVariant>
496+#include <QHeaderView>
497+#include <QSpacerItem>
498+
499+namespace Ubuntu {
500+namespace Internal {
501+
502+enum {
503+ debug = 1
504+};
505+
506+UbuntuFirstRunWizard::UbuntuFirstRunWizard(QWidget *parent) :
507+ QWizard(parent)
508+{
509+ addPage(new UbuntuIntroductionWizardPage);
510+ addPage(new UbuntuSetupChrootWizardPage);
511+ addPage(new UbuntuSetupEmulatorWizardPage);
512+
513+ setMinimumSize(800,600);
514+}
515+
516+
517+
518+UbuntuIntroductionWizardPage::UbuntuIntroductionWizardPage(QWidget *parent) :
519+ QWizardPage(parent)
520+{
521+ QLabel *label = new QLabel(tr("<h1 style=\"text-align: center;\">Welcome to the Ubuntu-SDK</h1>"
522+ "<p>This Wizard will help to setup a development environment to create Applications for the Ubuntu platform.</p>"
523+ "<p>At any time later it is possible to create:"
524+ "<ul><li>new targets in the &quot;Tools -&gt; Options -&gt; Ubuntu&quot; Settings Page,</li>"
525+ "<li>new emulators on the Devices pages by clicking on the &quot;+&quot; button</li></ul>"
526+ "</p>"
527+ "<p>Have a lot of fun!</p>"));
528+ label->setWordWrap(true);
529+
530+ QCheckBox *check = new QCheckBox(tr("Do not show this Wizard the next time."));
531+ check->setChecked(true);
532+
533+
534+ registerField(QStringLiteral("disableWizard"),check);
535+
536+ QVBoxLayout *layout = new QVBoxLayout;
537+ layout->addWidget(label);
538+ layout->addStretch();
539+ layout->addWidget(check);
540+ setLayout(layout);
541+}
542+
543+void UbuntuIntroductionWizardPage::initializePage()
544+{
545+
546+}
547+
548+bool UbuntuIntroductionWizardPage::isComplete() const
549+{
550+ return true;
551+}
552+
553+UbuntuSetupChrootWizardPage::UbuntuSetupChrootWizardPage(QWidget *parent)
554+ : QWizardPage(parent) ,
555+ m_complete(false)
556+{
557+
558+ setTitle(tr("Build targets"));
559+
560+ QLabel *label = new QLabel(tr("<p>In order to create Apps for the Ubuntu platform, it is required to create Kits. Kits enable cross-platform and cross-configuration development. Kits consist of a set of values that define one environment, such as a target device, sysroot to build against, toolchain to build with, platform specific API set, and some metadata.</p>"
561+ "<p><strong>Note: </strong>It is recommended to create Kits for each possible traget architecture (i386, armhf). When developing with the emulator, the best experience is provided by using a i386 emulator and Kit</p>"));
562+ label->setWordWrap(true);
563+
564+ m_kitExistsLabel = new QLabel(tr("These Kits are already available on the machine, but it is also possible to create new ones."));
565+ m_kitExistsLabel->setWordWrap(true);
566+ m_kitExistsLabel->setVisible(false);
567+
568+ m_kitList = new QTreeWidget;
569+ m_kitList->setEditTriggers(QAbstractItemView::NoEditTriggers);
570+ m_kitList->setSelectionMode(QAbstractItemView::NoSelection);
571+ m_kitList->setItemsExpandable(false);
572+ m_kitList->header()->setStretchLastSection(true);
573+ m_kitList->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
574+ m_kitList->setColumnCount(1);
575+
576+ QStringList headers;
577+ headers << tr("Kit Name");
578+ m_kitList->setHeaderLabels(headers);
579+
580+
581+ m_createKitButton = new QPushButton(tr("Create new Kit"));
582+ connect(m_createKitButton,SIGNAL(clicked()),this,SLOT(onCreateKitButtonClicked()));
583+
584+ QVBoxLayout *layout = new QVBoxLayout;
585+ layout->addWidget(label);
586+ layout->addWidget(m_kitExistsLabel);
587+ layout->addWidget(m_kitList);
588+ layout->addWidget(m_createKitButton);
589+ setLayout(layout);
590+}
591+
592+void UbuntuSetupChrootWizardPage::initializePage()
593+{
594+ QList<ProjectExplorer::Kit *> allKits = ProjectExplorer::KitManager::kits();
595+ m_kitList->clear();
596+
597+ bool found = false;
598+ foreach(ProjectExplorer::Kit *curr, allKits) {
599+ ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(curr);
600+ if (tc->type() == QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID)) {
601+ found = true;
602+
603+ QTreeWidgetItem* kitItem = new QTreeWidgetItem;
604+ kitItem->setText(0,curr->displayName());
605+ kitItem->setData(0,Qt::UserRole,curr->id().uniqueIdentifier());
606+ m_kitList->addTopLevelItem(kitItem);
607+ }
608+ }
609+
610+ m_kitExistsLabel->setVisible(found);
611+ if(m_complete != found) {
612+ m_complete = found;
613+ emit completeChanged();
614+ }
615+}
616+
617+bool UbuntuSetupChrootWizardPage::isComplete() const
618+{
619+ return m_complete;
620+}
621+
622+void UbuntuSetupChrootWizardPage::onCreateKitButtonClicked()
623+{
624+ UbuntuClickDialog::createClickChrootModal(true,QString(),this);
625+ initializePage();
626+}
627+
628+UbuntuSetupEmulatorWizardPage::UbuntuSetupEmulatorWizardPage(QWidget *parent)
629+ : QWizardPage(parent)
630+{
631+
632+ QLabel *label = new QLabel(tr("<p>To be able to run applications either a physical device or a Ubuntu Emulator can be used.<br />"
633+ "Please enable the checkbox below if a emulator should be created right away and after pressing the &quot;Finish&quot; button the device page will be opened.</p>"
634+ "<p>Skip that step if only physical devices are used.</p>"
635+ "<p><strong>Note: </strong>Currently we suggest to use only the i386 emulator, because it provides the best experience</p>"));
636+ label->setWordWrap(true);
637+
638+ m_createEmulatorCheckBox = new QCheckBox(tr("Create emulator"));
639+ registerField(QStringLiteral("createEmulator"),m_createEmulatorCheckBox);
640+
641+ m_devicesList =new QTreeWidget;
642+ m_devicesList->setEditTriggers(QAbstractItemView::NoEditTriggers);
643+ m_devicesList->setSelectionMode(QAbstractItemView::NoSelection);
644+ m_devicesList->setItemsExpandable(false);
645+ m_devicesList->header()->setStretchLastSection(true);
646+ m_devicesList->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
647+ m_devicesList->setColumnCount(1);
648+
649+ QStringList headers;
650+ headers << tr("Device Name");
651+ m_devicesList->setHeaderLabels(headers);
652+
653+ QVBoxLayout *layout = new QVBoxLayout;
654+ layout->addWidget(label);
655+ layout->addSpacing(10);
656+ layout->addWidget(new QLabel(tr("List of available devices")));
657+ layout->addWidget(m_devicesList);
658+ layout->addWidget(m_createEmulatorCheckBox);
659+ setLayout(layout);
660+
661+ connect(ProjectExplorer::DeviceManager::instance(),SIGNAL(deviceAdded(Core::Id)),this,SLOT(updateDevicesList()));
662+ connect(ProjectExplorer::DeviceManager::instance(),SIGNAL(deviceRemoved(Core::Id)),this,SLOT(updateDevicesList()));
663+ connect(ProjectExplorer::DeviceManager::instance(),SIGNAL(deviceListReplaced()),this,SLOT(updateDevicesList()));
664+}
665+
666+void UbuntuSetupEmulatorWizardPage::updateDevicesList()
667+{
668+ m_devicesList->clear();
669+ ProjectExplorer::DeviceManager *devMgr = ProjectExplorer::DeviceManager::instance();
670+ for(int i = 0; i < devMgr->deviceCount(); i++) {
671+ ProjectExplorer::IDevice::ConstPtr dev = devMgr->deviceAt(i);
672+ if(!dev)
673+ continue;
674+
675+ if(dev->type() != Constants::UBUNTU_DEVICE_TYPE_ID)
676+ continue;
677+
678+ QTreeWidgetItem* devItem = new QTreeWidgetItem;
679+ devItem->setText(0,dev->displayName());
680+ m_devicesList->addTopLevelItem(devItem);
681+ }
682+}
683+
684+void UbuntuSetupEmulatorWizardPage::initializePage()
685+{
686+ updateDevicesList();
687+}
688+
689+bool UbuntuSetupEmulatorWizardPage::isComplete() const
690+{
691+ return true;
692+}
693+
694+} // namespace Internal
695+} // namespace Ubuntu
696
697=== added file 'src/ubuntu/ubuntufirstrunwizard.h'
698--- src/ubuntu/ubuntufirstrunwizard.h 1970-01-01 00:00:00 +0000
699+++ src/ubuntu/ubuntufirstrunwizard.h 2014-07-31 10:11:55 +0000
700@@ -0,0 +1,86 @@
701+#ifndef UBUNTU_INTERNAL_UBUNTUFIRSTRUNWIZARD_H
702+#define UBUNTU_INTERNAL_UBUNTUFIRSTRUNWIZARD_H
703+
704+#include <QWizard>
705+#include <QList>
706+
707+class QLabel;
708+class QPushButton;
709+class QTreeWidget;
710+class QCheckBox;
711+
712+namespace ProjectExplorer {
713+ class Kit;
714+}
715+
716+namespace Ubuntu {
717+namespace Internal {
718+
719+class UbuntuProcess;
720+
721+class UbuntuFirstRunWizard : public QWizard
722+{
723+ Q_OBJECT
724+public:
725+ explicit UbuntuFirstRunWizard(QWidget *parent = 0);
726+
727+signals:
728+
729+public slots:
730+
731+};
732+
733+class UbuntuIntroductionWizardPage : public QWizardPage
734+{
735+ Q_OBJECT
736+public:
737+ UbuntuIntroductionWizardPage (QWidget *parent = 0);
738+
739+ // QWizardPage interface
740+ virtual void initializePage();
741+ virtual bool isComplete() const;
742+};
743+
744+
745+class UbuntuSetupChrootWizardPage : public QWizardPage
746+{
747+ Q_OBJECT
748+public:
749+ UbuntuSetupChrootWizardPage (QWidget *parent = 0);
750+
751+ // QWizardPage interface
752+ virtual void initializePage();
753+ virtual bool isComplete() const;
754+
755+protected slots:
756+ void onCreateKitButtonClicked ();
757+
758+private:
759+ QLabel *m_kitExistsLabel;
760+ QTreeWidget *m_kitList;
761+ QPushButton *m_createKitButton;
762+ bool m_complete;
763+};
764+
765+class UbuntuSetupEmulatorWizardPage : public QWizardPage
766+{
767+ Q_OBJECT
768+public:
769+ UbuntuSetupEmulatorWizardPage (QWidget *parent = 0);
770+
771+ // QWizardPage interface
772+ virtual void initializePage();
773+ virtual bool isComplete() const;
774+
775+protected slots:
776+ void updateDevicesList ();
777+
778+private:
779+ QCheckBox *m_createEmulatorCheckBox;
780+ QTreeWidget *m_devicesList;
781+};
782+
783+} // namespace Internal
784+} // namespace Ubuntu
785+
786+#endif // UBUNTU_INTERNAL_UBUNTUFIRSTRUNWIZARD_H
787
788=== modified file 'src/ubuntu/ubuntukitmanager.cpp'
789--- src/ubuntu/ubuntukitmanager.cpp 2014-07-22 07:33:23 +0000
790+++ src/ubuntu/ubuntukitmanager.cpp 2014-07-31 10:11:55 +0000
791@@ -4,6 +4,7 @@
792 #include "ubuntucmaketool.h"
793 #include "ubuntudevice.h"
794 #include "ubuntuclickdialog.h"
795+#include "ubuntuqtversion.h"
796
797 #include <projectexplorer/kitmanager.h>
798 #include <projectexplorer/kit.h>
799@@ -15,8 +16,10 @@
800 #include <qtsupport/qtkitinformation.h>
801 #include <cmakeprojectmanager/cmakekitinformation.h>
802 #include <cmakeprojectmanager/cmaketoolmanager.h>
803+#include <qtsupport/qtversionmanager.h>
804
805 #include <QMessageBox>
806+#include <QTextStream>
807
808 namespace Ubuntu {
809 namespace Internal {
810@@ -64,6 +67,53 @@
811 return toolchains;
812 }
813
814+UbuntuQtVersion *UbuntuKitManager::createOrFindQtVersion(ClickToolChain *tc)
815+{
816+
817+ QString qmakePath = QStringLiteral("%1/.config/ubuntu-sdk/qmake-%2-%3")
818+ .arg(QDir::homePath())
819+ .arg(tc->clickTarget().framework)
820+ .arg(tc->clickTarget().architecture);
821+
822+ if(!QFile::exists(qmakePath)) {
823+ QFile qmakeTemplate(Constants::UBUNTU_RESOURCE_PATH+QStringLiteral("/ubuntu/scripts/qtc_chroot_qmake"));
824+ if(qmakeTemplate.open(QIODevice::ReadOnly)) {
825+
826+ QTextStream in(&qmakeTemplate);
827+ QString templ = in.readAll();
828+
829+ templ = templ
830+ .arg(tc->clickTarget().architecture)
831+ .arg(tc->clickTarget().framework);
832+
833+
834+ QFile qmakeScript(qmakePath);
835+
836+ qmakeScript.open(QIODevice::WriteOnly);
837+ qmakeScript.setPermissions(QFile::ExeUser | QFile::ReadUser | QFile::ReadGroup);
838+
839+ {
840+ QTextStream out(&qmakeScript);
841+ out << templ;
842+ }
843+
844+ qmakeScript.close();
845+ }
846+ } else {
847+ //try to find a already existing Qt Version for this chroot
848+ foreach (QtSupport::BaseQtVersion *qtVersion, QtSupport::QtVersionManager::versions()) {
849+ if (qtVersion->type() != QLatin1String(Constants::UBUNTU_QTVERSION_TYPE))
850+ continue;
851+ if (qtVersion->qmakeCommand().toFileInfo() == QFileInfo(qmakePath))
852+ return static_cast<UbuntuQtVersion*> (qtVersion);
853+ }
854+ }
855+
856+ UbuntuQtVersion *qtVersion = new UbuntuQtVersion(Utils::FileName::fromString(qmakePath),false);
857+ QtSupport::QtVersionManager::addVersion(qtVersion);
858+ return qtVersion;
859+}
860+
861 void UbuntuKitManager::autoCreateKit(UbuntuDevice::Ptr device)
862 {
863 ProjectExplorer::Abi requiredAbi = ClickToolChain::architectureNameToAbi(device->architecture());
864@@ -265,8 +315,7 @@
865 ProjectExplorer::SysRootKitInformation::setSysRoot(newKit,Utils::FileName::fromString(UbuntuClickTool::targetBasePath(tc->clickTarget())));
866
867 //@TODO add gdbserver support
868- //@TODO add real qt version
869- QtSupport::QtKitInformation::setQtVersion(newKit, 0);
870+ QtSupport::QtKitInformation::setQtVersion(newKit, createOrFindQtVersion(tc));
871 return newKit;
872 }
873
874@@ -342,6 +391,9 @@
875 k->setSticky(ProjectExplorer::SysRootKitInformation::id(),true);
876 k->setMutable(ProjectExplorer::SysRootKitInformation::id(),false);
877
878+ //make sure we use a ubuntu Qt version
879+ QtSupport::QtKitInformation::setQtVersion(k, createOrFindQtVersion(tc));
880+
881 }
882
883 } // namespace Internal
884
885=== modified file 'src/ubuntu/ubuntukitmanager.h'
886--- src/ubuntu/ubuntukitmanager.h 2014-04-17 14:38:15 +0000
887+++ src/ubuntu/ubuntukitmanager.h 2014-07-31 10:11:55 +0000
888@@ -29,6 +29,8 @@
889 namespace Ubuntu {
890 namespace Internal {
891
892+class UbuntuQtVersion;
893+
894 class UbuntuKitManager : public QObject
895 {
896 Q_OBJECT
897@@ -41,6 +43,7 @@
898 static QVariant createOrFindDebugger(const Utils::FileName &path);
899 static void fixKit (ProjectExplorer::Kit* k);
900 static QList<ClickToolChain *> clickToolChains();
901+ static UbuntuQtVersion *createOrFindQtVersion(ClickToolChain* tc);
902 };
903
904 } // namespace Internal
905
906=== modified file 'src/ubuntu/ubuntulocalrunconfigurationfactory.cpp'
907--- src/ubuntu/ubuntulocalrunconfigurationfactory.cpp 2014-07-14 15:39:54 +0000
908+++ src/ubuntu/ubuntulocalrunconfigurationfactory.cpp 2014-07-31 10:11:55 +0000
909@@ -51,9 +51,9 @@
910 bool isCMake = parent->project()->id() == CMakeProjectManager::Constants::CMAKEPROJECT_ID;
911 bool isHTML = parent->project()->id() == Ubuntu::Constants::UBUNTUPROJECT_ID;
912 bool isApp = UbuntuProjectGuesser::isClickAppProject(parent->project());
913- //bool isQML = parent->target()->project()->id() == "QmlProjectManager.QmlProject";
914+ bool isQML = parent->project()->id() == "QmlProjectManager.QmlProject";
915
916- if (!isCMake && !isHTML)
917+ if (!isCMake && !isHTML &&!isQML)
918 return types;
919
920 if (isRemote) {
921@@ -78,7 +78,7 @@
922 }
923 else if (isRemote) {
924 //when CMake we only support App projects, scopes have no way to be controlled on the device atm
925- if ((isCMake && isApp) || isHTML) {
926+ if ((isCMake && isApp) || isHTML || isQML) {
927 foreach (const UbuntuClickManifest::Hook &hook, hooks) {
928 types << UbuntuRemoteRunConfiguration::typeId().withSuffix(hook.appId);
929 }
930
931=== modified file 'src/ubuntu/ubuntupackagestep.cpp'
932--- src/ubuntu/ubuntupackagestep.cpp 2014-07-15 09:55:12 +0000
933+++ src/ubuntu/ubuntupackagestep.cpp 2014-07-31 10:11:55 +0000
934@@ -457,7 +457,8 @@
935
936 bool ubuntuDevice = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(bc->target()->kit()) == Constants::UBUNTU_DEVICE_TYPE_ID;
937 bool injectDebugScript = (m_packageMode == EnableDebugScript) ||
938- (m_packageMode == AutoEnableDebugScript && bc->buildType() == ProjectExplorer::BuildConfiguration::Debug);
939+ (m_packageMode == AutoEnableDebugScript && bc->buildType() == ProjectExplorer::BuildConfiguration::Debug)
940+ || (m_packageMode == AutoEnableDebugScript && bc->target()->project()->id() == "QmlProjectManager.QmlProject");
941
942 //debughelper script name, source and destination path
943 const QString debScript = QStringLiteral("qtc_device_debughelper.py");
944
945=== modified file 'src/ubuntu/ubuntupackagingwidget.cpp'
946--- src/ubuntu/ubuntupackagingwidget.cpp 2014-07-23 09:46:36 +0000
947+++ src/ubuntu/ubuntupackagingwidget.cpp 2014-07-31 10:11:55 +0000
948@@ -42,6 +42,7 @@
949 #include <coreplugin/actionmanager/actioncontainer.h>
950 #include <cmakeprojectmanager/cmakeprojectconstants.h>
951 #include <ssh/sshconnection.h>
952+#include <qmlprojectmanager/qmlprojectconstants.h>
953
954
955 #include <QFileDialog>
956@@ -187,7 +188,7 @@
957
958 void UbuntuPackagingWidget::onMessage(QString msg)
959 {
960- if(debug) printToOutputPane(msg);
961+ printToOutputPane(msg);
962 m_reply.append(msg);
963 m_inputParser->addRecievedData(msg);
964 }
965@@ -700,7 +701,8 @@
966
967 QString mimeType = project->projectManager()->mimeType();
968 if(mimeType == QLatin1String(CMakeProjectManager::Constants::CMAKEMIMETYPE)
969- || mimeType == QLatin1String(Ubuntu::Constants::UBUNTUPROJECT_MIMETYPE) ) {
970+ || mimeType == QLatin1String(Ubuntu::Constants::UBUNTUPROJECT_MIMETYPE)
971+ || mimeType == QLatin1String(QmlProjectManager::Constants::QMLPROJECT_MIMETYPE)) {
972 if(m_reviewToolsInstalled)
973 m_postPackageTask = Verify;
974 else
975@@ -804,8 +806,9 @@
976 QString mimeType = project->projectManager()->mimeType();
977 bool isCMake = mimeType == QLatin1String(CMakeProjectManager::Constants::CMAKEMIMETYPE);
978 bool isHtml = mimeType == QLatin1String(Ubuntu::Constants::UBUNTUPROJECT_MIMETYPE);
979+ bool isQml = mimeType == QLatin1String(QmlProjectManager::Constants::QMLPROJECT_MIMETYPE);
980
981- if(isCMake || isHtml) {
982+ if(isCMake || isHtml || isQml) {
983 ProjectExplorer::Target* target = project->activeTarget();
984 if(!target)
985 return;
986
987=== modified file 'src/ubuntu/ubuntuplugin.cpp'
988--- src/ubuntu/ubuntuplugin.cpp 2014-07-15 09:55:12 +0000
989+++ src/ubuntu/ubuntuplugin.cpp 2014-07-31 10:11:55 +0000
990@@ -35,7 +35,11 @@
991 #include "ubuntudevicesmodel.h"
992 #include "localportsmanager.h"
993 #include "ubuntubzr.h"
994+#include "ubuntuqtversion.h"
995 #include "ubuntudeploystepfactory.h"
996+#include "ubuntuqmlbuildconfiguration.h"
997+#include "ubuntufirstrunwizard.h"
998+
999 #include <coreplugin/modemanager.h>
1000 #include <projectexplorer/kitmanager.h>
1001 #include <coreplugin/featureprovider.h>
1002@@ -47,6 +51,7 @@
1003 #include <QFileInfo>
1004 #include <QGuiApplication>
1005 #include <QtQml>
1006+#include <QFile>
1007 #include <coreplugin/icore.h>
1008
1009 using namespace Ubuntu;
1010@@ -136,6 +141,7 @@
1011 addAutoReleasedObject(new UbuntuCMakeMakeStepFactory);
1012 addAutoReleasedObject(new UbuntuCMakeBuildConfigurationFactory);
1013 addAutoReleasedObject(new UbuntuHtmlBuildConfigurationFactory);
1014+ addAutoReleasedObject(new UbuntuQmlBuildConfigurationFactory);
1015
1016 //ubuntu device support
1017 addAutoReleasedObject(new UbuntuDeviceFactory);
1018@@ -162,6 +168,9 @@
1019 QStringLiteral("ubuntu-project-go"),
1020 Core::IWizard::ProjectWizard));
1021
1022+ //register Qt version
1023+ addAutoReleasedObject(new Ubuntu::Internal::UbuntuQtVersionFactory);
1024+
1025 //disabled for now, keeping the code because we might need a deploy method
1026 //for local applications in the future
1027 //addAutoReleasedObject(new UbuntuLocalDeployConfigurationFactory);
1028@@ -190,6 +199,34 @@
1029 UbuntuKitManager::autoDetectKits();
1030 disconnect(ProjectExplorer::KitManager::instance(),SIGNAL(kitsLoaded())
1031 ,this,SLOT(onKitsLoaded()));
1032+
1033+ showFirstStartWizard();
1034+}
1035+
1036+void UbuntuPlugin::showFirstStartWizard()
1037+{
1038+ QString file = QStringLiteral("%1/.config/ubuntu-sdk/firstrun")
1039+ .arg(QDir::homePath());
1040+
1041+ if(!QFile::exists(file)) {
1042+ UbuntuFirstRunWizard wiz(Core::ICore::mainWindow());
1043+ if( wiz.exec() == QDialog::Accepted ) {
1044+ if (wiz.field(QStringLiteral("createEmulator")).toBool()) {
1045+ Core::ModeManager::activateMode(Ubuntu::Constants::UBUNTU_MODE_DEVICES);
1046+
1047+ //invoke the method the next time the event loop starts
1048+ QMetaObject::invokeMethod(m_ubuntuDeviceMode,"showAddEmulatorDialog",Qt::QueuedConnection);
1049+ }
1050+
1051+ if(wiz.field(QStringLiteral("disableWizard")).toBool()) {
1052+ QFile f(file);
1053+ if(f.open(QIODevice::WriteOnly)) {
1054+ f.write("1");
1055+ f.close();
1056+ }
1057+ }
1058+ }
1059+ }
1060 }
1061
1062 Q_EXPORT_PLUGIN2(Ubuntu, UbuntuPlugin)
1063
1064=== modified file 'src/ubuntu/ubuntuplugin.h'
1065--- src/ubuntu/ubuntuplugin.h 2014-06-04 15:35:40 +0000
1066+++ src/ubuntu/ubuntuplugin.h 2014-07-31 10:11:55 +0000
1067@@ -57,6 +57,7 @@
1068
1069 private slots:
1070 void onKitsLoaded ();
1071+ void showFirstStartWizard ();
1072
1073 protected:
1074 UbuntuDeviceMode* m_ubuntuDeviceMode;
1075
1076=== modified file 'src/ubuntu/ubuntuprojectapplicationwizard.cpp'
1077--- src/ubuntu/ubuntuprojectapplicationwizard.cpp 2014-07-15 09:55:12 +0000
1078+++ src/ubuntu/ubuntuprojectapplicationwizard.cpp 2014-07-31 10:11:55 +0000
1079@@ -21,6 +21,7 @@
1080 #include "ubuntuconstants.h"
1081 #include "ubuntuproject.h"
1082 #include "ubuntubzr.h"
1083+#include "ubuntufirstrunwizard.h"
1084
1085 #include <coreplugin/mimedatabase.h>
1086
1087@@ -57,6 +58,7 @@
1088 UbuntuProjectApplicationWizardDialog *projectDialog = new UbuntuProjectApplicationWizardDialog(parent,
1089 m_type ,
1090 wizardDialogParameters);
1091+ projectDialog->addChrootSetupPage(12);
1092 projectDialog->addTargetSetupPage(13);
1093
1094 initProjectWizardDialog(projectDialog,
1095@@ -168,12 +170,30 @@
1096 this, SLOT(generateProfileName(QString,QString)));
1097 }
1098
1099+void UbuntuProjectApplicationWizardDialog::addChrootSetupPage(int id)
1100+{
1101+ QList<ProjectExplorer::Kit *> allKits = ProjectExplorer::KitManager::kits();
1102+
1103+ bool found = false;
1104+ foreach(ProjectExplorer::Kit *curr, allKits) {
1105+ ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(curr);
1106+ if (tc->type() == QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID)) {
1107+ found = true;
1108+ break;
1109+ }
1110+ }
1111+
1112+ if(found)
1113+ return;
1114+
1115+ if (id >= 0)
1116+ setPage(id, new UbuntuSetupChrootWizardPage);
1117+ else
1118+ id = addPage(new UbuntuSetupChrootWizardPage);
1119+}
1120+
1121 void UbuntuProjectApplicationWizardDialog::addTargetSetupPage(int id)
1122 {
1123- //no target setup page required for basic projects
1124- if(m_type == UbuntuProjectApplicationWizard::UbuntuQMLProject)
1125- return;
1126-
1127 m_targetSetupPage = new ProjectExplorer::TargetSetupPage;
1128 const QString platform = selectedPlatform();
1129
1130@@ -211,6 +231,7 @@
1131 m_targetSetupPage->setRequiredKitMatcher(new QtSupport::QtVersionKitMatcher(features));
1132 break;
1133 }
1134+ case UbuntuProjectApplicationWizard::UbuntuQMLProject:
1135 case UbuntuProjectApplicationWizard::UbuntuHTMLProject: {
1136 m_targetSetupPage->setRequiredKitMatcher(new UbuntuKitMatcher());
1137 break;
1138@@ -250,6 +271,11 @@
1139 +projectName
1140 +QDir::separator()
1141 +QString::fromLatin1("%1.ubuntuhtmlproject").arg(projectName));
1142+ } else if (m_type == UbuntuProjectApplicationWizard::UbuntuQMLProject) {
1143+ m_targetSetupPage->setProjectPath(path+QDir::separator()
1144+ +projectName
1145+ +QDir::separator()
1146+ +QString::fromLatin1("%1.qmlproject").arg(projectName));
1147 } else {
1148 m_targetSetupPage->setProjectPath(path+QDir::separator()+projectName+QDir::separator()+QLatin1String("CMakeLists.txt"));
1149 }
1150
1151=== modified file 'src/ubuntu/ubuntuprojectapplicationwizard.h'
1152--- src/ubuntu/ubuntuprojectapplicationwizard.h 2014-07-15 09:55:12 +0000
1153+++ src/ubuntu/ubuntuprojectapplicationwizard.h 2014-07-31 10:11:55 +0000
1154@@ -68,6 +68,7 @@
1155 const Core::WizardDialogParameters &parameters);
1156 virtual ~UbuntuProjectApplicationWizardDialog();
1157
1158+ void addChrootSetupPage(int id = -1);
1159 void addTargetSetupPage(int id = -1);
1160
1161 QList<Core::Id> selectedKits() const;
1162
1163=== added file 'src/ubuntu/ubuntuqmlbuildconfiguration.cpp'
1164--- src/ubuntu/ubuntuqmlbuildconfiguration.cpp 1970-01-01 00:00:00 +0000
1165+++ src/ubuntu/ubuntuqmlbuildconfiguration.cpp 2014-07-31 10:11:55 +0000
1166@@ -0,0 +1,203 @@
1167+#include "ubuntuqmlbuildconfiguration.h"
1168+#include "ubuntuconstants.h"
1169+#include "ubuntuproject.h"
1170+
1171+#include <coreplugin/mimedatabase.h>
1172+
1173+#include <projectexplorer/target.h>
1174+#include <projectexplorer/project.h>
1175+#include <projectexplorer/buildinfo.h>
1176+#include <projectexplorer/kit.h>
1177+#include <utils/fancylineedit.h>
1178+#include <qmlprojectmanager/qmlprojectconstants.h>
1179+
1180+#include <QFormLayout>
1181+
1182+namespace Ubuntu {
1183+namespace Internal {
1184+
1185+/*!
1186+ * \class UbuntuQmlBuildConfiguration
1187+ *
1188+ * Even though QML projects don't need to be built, we need
1189+ * that BuildConfiguration to store the Builddirectory (where the click
1190+ * package goes) and to enable the Target page to show us some actual
1191+ * targets
1192+ */
1193+
1194+UbuntuQmlBuildConfiguration::UbuntuQmlBuildConfiguration(ProjectExplorer::Target *target)
1195+ : BuildConfiguration(target,Constants::UBUNTU_CLICK_QML_BC_ID)
1196+{
1197+}
1198+
1199+UbuntuQmlBuildConfiguration::UbuntuQmlBuildConfiguration(ProjectExplorer::Target *target, UbuntuQmlBuildConfiguration *source)
1200+ : BuildConfiguration(target,source)
1201+{
1202+
1203+}
1204+
1205+bool UbuntuQmlBuildConfiguration::fromMap(const QVariantMap &map)
1206+{
1207+ return BuildConfiguration::fromMap(map);
1208+}
1209+
1210+QVariantMap UbuntuQmlBuildConfiguration::toMap() const
1211+{
1212+ return BuildConfiguration::toMap();
1213+}
1214+
1215+ProjectExplorer::NamedWidget *UbuntuQmlBuildConfiguration::createConfigWidget()
1216+{
1217+ return new UbuntuQmlBuildSettingsWidget(this);
1218+}
1219+
1220+ProjectExplorer::BuildConfiguration::BuildType UbuntuQmlBuildConfiguration::buildType() const
1221+{
1222+ return Release;
1223+}
1224+
1225+UbuntuQmlBuildConfigurationFactory::UbuntuQmlBuildConfigurationFactory(QObject *parent)
1226+ : IBuildConfigurationFactory(parent)
1227+{
1228+
1229+}
1230+
1231+UbuntuQmlBuildConfigurationFactory::~UbuntuQmlBuildConfigurationFactory()
1232+{
1233+
1234+}
1235+
1236+int UbuntuQmlBuildConfigurationFactory::priority(const ProjectExplorer::Target *parent) const
1237+{
1238+ if (canHandle(parent))
1239+ return 100;
1240+ return -1;
1241+}
1242+
1243+QList<ProjectExplorer::BuildInfo *> UbuntuQmlBuildConfigurationFactory::availableBuilds(const ProjectExplorer::Target *parent) const
1244+{
1245+ if(!canHandle(parent))
1246+ return QList<ProjectExplorer::BuildInfo *>();
1247+ return createBuildInfos(parent->kit(),parent->project()->projectFilePath());
1248+}
1249+
1250+int UbuntuQmlBuildConfigurationFactory::priority(const ProjectExplorer::Kit *k, const QString &projectPath) const
1251+{
1252+ return (k && Core::MimeDatabase::findByFile(QFileInfo(projectPath))
1253+ .matchesType(QLatin1String(QmlProjectManager::Constants::QMLPROJECT_MIMETYPE))) ? 100 : -1;
1254+}
1255+
1256+QList<ProjectExplorer::BuildInfo *> UbuntuQmlBuildConfigurationFactory::availableSetups(const ProjectExplorer::Kit *k, const QString &projectPath) const
1257+{
1258+ UbuntuKitMatcher m;
1259+ if(priority(k,projectPath) < 0 || !m.matches(k))
1260+ return QList<ProjectExplorer::BuildInfo *>();
1261+
1262+ return createBuildInfos(k,projectPath);
1263+}
1264+
1265+UbuntuQmlBuildConfiguration *UbuntuQmlBuildConfigurationFactory::create(ProjectExplorer::Target *parent, const ProjectExplorer::BuildInfo *info) const
1266+{
1267+ QTC_ASSERT(info->factory() == this, return 0);
1268+ QTC_ASSERT(info->kitId == parent->kit()->id(), return 0);
1269+ QTC_ASSERT(!info->displayName.isEmpty(), return 0);
1270+
1271+ UbuntuQmlBuildConfiguration *conf = new UbuntuQmlBuildConfiguration(parent);
1272+ conf->setBuildDirectory(info->buildDirectory);
1273+ conf->setDefaultDisplayName(info->displayName);
1274+ conf->setDisplayName(info->displayName);
1275+
1276+ return conf;
1277+}
1278+
1279+bool UbuntuQmlBuildConfigurationFactory::canRestore(const ProjectExplorer::Target *parent, const QVariantMap &map) const
1280+{
1281+ if (!canHandle(parent))
1282+ return false;
1283+ return ProjectExplorer::idFromMap(map) == Constants::UBUNTU_CLICK_QML_BC_ID;
1284+}
1285+
1286+UbuntuQmlBuildConfiguration *UbuntuQmlBuildConfigurationFactory::restore(ProjectExplorer::Target *parent, const QVariantMap &map)
1287+{
1288+ if (!canRestore(parent,map) )
1289+ return 0;
1290+
1291+ UbuntuQmlBuildConfiguration *conf = new UbuntuQmlBuildConfiguration(parent);
1292+ if (conf->fromMap(map))
1293+ return conf;
1294+
1295+ delete conf;
1296+ return 0;
1297+}
1298+
1299+bool UbuntuQmlBuildConfigurationFactory::canClone(const ProjectExplorer::Target *parent, ProjectExplorer::BuildConfiguration *product) const
1300+{
1301+ if (!canHandle(parent))
1302+ return false;
1303+ if (product->id() != Constants::UBUNTU_CLICK_QML_BC_ID )
1304+ return false;
1305+
1306+ return true;
1307+}
1308+
1309+UbuntuQmlBuildConfiguration *UbuntuQmlBuildConfigurationFactory::clone(ProjectExplorer::Target *parent, ProjectExplorer::BuildConfiguration *product)
1310+{
1311+ if (!canClone(parent,product))
1312+ return 0;
1313+ return new UbuntuQmlBuildConfiguration(parent,static_cast<UbuntuQmlBuildConfiguration*>(product));
1314+}
1315+
1316+bool UbuntuQmlBuildConfigurationFactory::canHandle(const ProjectExplorer::Target *t) const
1317+{
1318+ UbuntuKitMatcher m;
1319+ if(!m.matches(t->kit()))
1320+ return false;
1321+
1322+ if (t->project()->id() != "QmlProjectManager.QmlProject")
1323+ return false;
1324+
1325+ return true;
1326+}
1327+
1328+QList<ProjectExplorer::BuildInfo *> UbuntuQmlBuildConfigurationFactory::createBuildInfos(const ProjectExplorer::Kit *k, const QString &projectDir) const
1329+{
1330+ QList<ProjectExplorer::BuildInfo *> builds;
1331+
1332+ ProjectExplorer::BuildInfo *info = new ProjectExplorer::BuildInfo(this);
1333+ info->buildDirectory = Utils::FileName::fromString(UbuntuProject::shadowBuildDirectory(projectDir,k,QStringLiteral("default")));
1334+ info->typeName = tr("Qml");
1335+ info->kitId = k->id();
1336+ info->supportsShadowBuild = true;
1337+ info->displayName = tr("Default");
1338+
1339+ builds << info;
1340+ return builds;
1341+}
1342+
1343+UbuntuQmlBuildSettingsWidget::UbuntuQmlBuildSettingsWidget(UbuntuQmlBuildConfiguration *conf, QWidget *parent)
1344+ : NamedWidget(parent) ,
1345+ m_buildConfiguration(conf)
1346+{
1347+ QFormLayout *fl = new QFormLayout(this);
1348+ fl->setContentsMargins(20, -1, 0, -1);
1349+ fl->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
1350+ setLayout(fl);
1351+
1352+ m_pathChooser = new Utils::PathChooser(this);
1353+ m_pathChooser->setPath(m_buildConfiguration->rawBuildDirectory().toString());
1354+ fl->addRow(tr("Build directory:"), m_pathChooser);
1355+
1356+ connect(m_pathChooser->lineEdit(),SIGNAL(editingFinished()),this,SLOT(onBuilddirChanged()));
1357+ connect(m_buildConfiguration,SIGNAL(buildDirectoryChanged()),this,SLOT(updateBuildDirectory()));
1358+}
1359+
1360+void UbuntuQmlBuildSettingsWidget::updateBuildDirectory() const
1361+{
1362+ m_pathChooser->blockSignals(true);
1363+ m_pathChooser->setPath(m_buildConfiguration->rawBuildDirectory().toString());
1364+ m_pathChooser->blockSignals(false);
1365+}
1366+
1367+
1368+} // namespace Internal
1369+} // namespace Ubuntu
1370
1371=== added file 'src/ubuntu/ubuntuqmlbuildconfiguration.h'
1372--- src/ubuntu/ubuntuqmlbuildconfiguration.h 1970-01-01 00:00:00 +0000
1373+++ src/ubuntu/ubuntuqmlbuildconfiguration.h 2014-07-31 10:11:55 +0000
1374@@ -0,0 +1,71 @@
1375+#ifndef UBUNTU_INTERNAL_UBUNTUQMLBUILDCONFIGURATION_H
1376+#define UBUNTU_INTERNAL_UBUNTUQMLBUILDCONFIGURATION_H
1377+
1378+#include <projectexplorer/buildconfiguration.h>
1379+#include <utils/pathchooser.h>
1380+#include <projectexplorer/namedwidget.h>
1381+
1382+namespace Ubuntu {
1383+namespace Internal {
1384+
1385+class UbuntuQmlBuildConfiguration : public ProjectExplorer::BuildConfiguration
1386+{
1387+ Q_OBJECT
1388+
1389+public:
1390+ UbuntuQmlBuildConfiguration(ProjectExplorer::Target *target);
1391+ UbuntuQmlBuildConfiguration(ProjectExplorer::Target *target, UbuntuQmlBuildConfiguration *source);
1392+
1393+ // ProjectConfiguration interface
1394+ virtual bool fromMap(const QVariantMap &map) override;
1395+ virtual QVariantMap toMap() const override;
1396+
1397+ // BuildConfiguration interface
1398+ virtual ProjectExplorer::NamedWidget *createConfigWidget() override;
1399+ virtual BuildType buildType() const override;
1400+
1401+private:
1402+ friend class UbuntuQmlBuildConfigurationFactory;
1403+};
1404+
1405+class UbuntuQmlBuildSettingsWidget : public ProjectExplorer::NamedWidget
1406+{
1407+ Q_OBJECT
1408+
1409+public:
1410+ explicit UbuntuQmlBuildSettingsWidget(UbuntuQmlBuildConfiguration *conf, QWidget *parent = 0);
1411+
1412+private slots:
1413+ void updateBuildDirectory () const;
1414+
1415+private:
1416+ Utils::PathChooser *m_pathChooser;
1417+ UbuntuQmlBuildConfiguration *m_buildConfiguration;
1418+};
1419+
1420+class UbuntuQmlBuildConfigurationFactory : public ProjectExplorer::IBuildConfigurationFactory
1421+{
1422+ Q_OBJECT
1423+public:
1424+ UbuntuQmlBuildConfigurationFactory(QObject *parent = 0);
1425+ ~UbuntuQmlBuildConfigurationFactory();
1426+
1427+ // IBuildConfigurationFactory interface
1428+ virtual int priority(const ProjectExplorer::Target *parent) const override;
1429+ virtual QList<ProjectExplorer::BuildInfo *> availableBuilds(const ProjectExplorer::Target *parent) const override;
1430+ virtual int priority(const ProjectExplorer::Kit *k, const QString &projectPath) const override;
1431+ virtual QList<ProjectExplorer::BuildInfo *> availableSetups(const ProjectExplorer::Kit *k, const QString &projectPath) const override;
1432+ virtual UbuntuQmlBuildConfiguration *create(ProjectExplorer::Target *parent, const ProjectExplorer::BuildInfo *info) const override;
1433+ virtual bool canRestore(const ProjectExplorer::Target *parent, const QVariantMap &map) const override;
1434+ virtual UbuntuQmlBuildConfiguration *restore(ProjectExplorer::Target *parent, const QVariantMap &map) override;
1435+ virtual bool canClone(const ProjectExplorer::Target *parent, ProjectExplorer::BuildConfiguration *product) const override;
1436+ virtual UbuntuQmlBuildConfiguration*clone(ProjectExplorer::Target *parent, ProjectExplorer::BuildConfiguration *product) override;
1437+private:
1438+ bool canHandle(const ProjectExplorer::Target *t) const;
1439+ QList<ProjectExplorer::BuildInfo *> createBuildInfos (const ProjectExplorer::Kit *k, const QString &projectDir) const;
1440+};
1441+
1442+} // namespace Internal
1443+} // namespace Ubuntu
1444+
1445+#endif // UBUNTU_INTERNAL_UBUNTUQMLBUILDCONFIGURATION_H
1446
1447=== added file 'src/ubuntu/ubuntuqtversion.cpp'
1448--- src/ubuntu/ubuntuqtversion.cpp 1970-01-01 00:00:00 +0000
1449+++ src/ubuntu/ubuntuqtversion.cpp 2014-07-31 10:11:55 +0000
1450@@ -0,0 +1,86 @@
1451+#include "ubuntuqtversion.h"
1452+#include "ubuntuconstants.h"
1453+
1454+#include <qtsupport/qtsupportconstants.h>
1455+
1456+#include <QCoreApplication>
1457+#include <QFileInfo>
1458+
1459+namespace Ubuntu {
1460+namespace Internal {
1461+
1462+UbuntuQtVersion::UbuntuQtVersion()
1463+ : BaseQtVersion()
1464+{ }
1465+
1466+UbuntuQtVersion::UbuntuQtVersion(const Utils::FileName &path, bool isAutodetected, const QString &autodetectionSource)
1467+ : BaseQtVersion(path, isAutodetected, autodetectionSource)
1468+{
1469+ setDisplayName(defaultDisplayName(qtVersionString(), path, false));
1470+}
1471+
1472+UbuntuQtVersion::~UbuntuQtVersion()
1473+{ }
1474+
1475+UbuntuQtVersion *UbuntuQtVersion::clone() const
1476+{
1477+ return new UbuntuQtVersion(*this);
1478+}
1479+
1480+QString UbuntuQtVersion::type() const
1481+{
1482+ return QLatin1String(Constants::UBUNTU_QTVERSION_TYPE);
1483+}
1484+
1485+QList<ProjectExplorer::Abi> UbuntuQtVersion::detectQtAbis() const
1486+{
1487+ return qtAbisFromLibrary(qtCorePaths(versionInfo(), qtVersionString()));
1488+}
1489+
1490+QString UbuntuQtVersion::description() const
1491+{
1492+ return QCoreApplication::translate("QtVersion", "Ubuntu Phone", "Qt Version is used for Ubuntu Phone development");
1493+}
1494+
1495+QString UbuntuQtVersion::platformName() const
1496+{
1497+ return QLatin1String(Constants::UBUNTU_PLATFORM_NAME);
1498+}
1499+
1500+QString UbuntuQtVersion::platformDisplayName() const
1501+{
1502+ return QLatin1String(Constants::UBUNTU_PLATFORM_NAME_TR);
1503+}
1504+
1505+bool UbuntuQtVersionFactory::canRestore(const QString &type)
1506+{
1507+ return type == QLatin1String(Constants::UBUNTU_QTVERSION_TYPE);
1508+}
1509+
1510+QtSupport::BaseQtVersion *UbuntuQtVersionFactory::restore(const QString &type, const QVariantMap &data)
1511+{
1512+ if(!canRestore(type))
1513+ return 0;
1514+
1515+ UbuntuQtVersion *v = new UbuntuQtVersion();
1516+ v->fromMap(data);
1517+ return v;
1518+}
1519+
1520+int UbuntuQtVersionFactory::priority() const
1521+{
1522+ return 100;
1523+}
1524+
1525+QtSupport::BaseQtVersion *UbuntuQtVersionFactory::create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected, const QString &autoDetectionSource)
1526+{
1527+ Q_UNUSED(evaluator);
1528+ //we only care about our qmakes
1529+ if(!qmakePath.toFileInfo().absolutePath().endsWith(QStringLiteral(".config/ubuntu-sdk")))
1530+ return 0;
1531+
1532+ return new UbuntuQtVersion(qmakePath,isAutoDetected,autoDetectionSource);
1533+}
1534+
1535+} // namespace Internal
1536+} // namespace Ubuntu
1537
1538=== added file 'src/ubuntu/ubuntuqtversion.h'
1539--- src/ubuntu/ubuntuqtversion.h 1970-01-01 00:00:00 +0000
1540+++ src/ubuntu/ubuntuqtversion.h 2014-07-31 10:11:55 +0000
1541@@ -0,0 +1,41 @@
1542+#ifndef UBUNTU_INTERNAL_UBUNTUQTVERSION_H
1543+#define UBUNTU_INTERNAL_UBUNTUQTVERSION_H
1544+
1545+#include <qtsupport/baseqtversion.h>
1546+#include <qtsupport/qtversionfactory.h>
1547+
1548+namespace Ubuntu {
1549+namespace Internal {
1550+
1551+class UbuntuQtVersion : public QtSupport::BaseQtVersion
1552+{
1553+public:
1554+ UbuntuQtVersion();
1555+ UbuntuQtVersion(const Utils::FileName &path, bool isAutodetected = false, const QString &autodetectionSource = QString());
1556+ ~UbuntuQtVersion() override;
1557+ UbuntuQtVersion *clone() const override;
1558+
1559+ QString type() const override;
1560+
1561+ QList<ProjectExplorer::Abi> detectQtAbis() const override;
1562+
1563+ QString description() const override;
1564+
1565+ QString platformName() const override;
1566+ QString platformDisplayName() const override;
1567+};
1568+
1569+class UbuntuQtVersionFactory : public QtSupport::QtVersionFactory
1570+{
1571+public:
1572+ // QtVersionFactory interface
1573+ virtual bool canRestore(const QString &type) override;
1574+ virtual QtSupport::BaseQtVersion *restore(const QString &type, const QVariantMap &data) override;
1575+ virtual int priority() const override;
1576+ virtual QtSupport::BaseQtVersion *create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected, const QString &autoDetectionSource) override;
1577+};
1578+
1579+} // namespace Internal
1580+} // namespace Ubuntu
1581+
1582+#endif // UBUNTU_INTERNAL_UBUNTUQTVERSION_H
1583
1584=== modified file 'src/ubuntu/ubunturemotedeployconfiguration.cpp'
1585--- src/ubuntu/ubunturemotedeployconfiguration.cpp 2014-07-14 15:39:54 +0000
1586+++ src/ubuntu/ubunturemotedeployconfiguration.cpp 2014-07-31 10:11:55 +0000
1587@@ -85,7 +85,8 @@
1588
1589 //for now only support cmake and ubuntu projects
1590 if(projectTypeId != CMakeProjectManager::Constants::CMAKEPROJECT_ID
1591- && projectTypeId != Ubuntu::Constants::UBUNTUPROJECT_ID)
1592+ && projectTypeId != Ubuntu::Constants::UBUNTUPROJECT_ID
1593+ && projectTypeId != "QmlProjectManager.QmlProject")
1594 return ids;
1595
1596 const Core::Id devType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(parent->kit());
1597
1598=== modified file 'src/ubuntu/ubunturemoterunconfiguration.cpp'
1599--- src/ubuntu/ubunturemoterunconfiguration.cpp 2014-07-15 09:55:12 +0000
1600+++ src/ubuntu/ubunturemoterunconfiguration.cpp 2014-07-31 10:11:55 +0000
1601@@ -268,7 +268,7 @@
1602 ProjectExplorer::Project *p = target()->project();
1603 if (p->id() == CMakeProjectManager::Constants::CMAKEPROJECT_ID)
1604 return target()->activeBuildConfiguration()->buildDirectory().toString()+QDir::separator()+QLatin1String(Constants::UBUNTU_DEPLOY_DESTDIR);
1605- else if (p->id() == Ubuntu::Constants::UBUNTUPROJECT_ID) {
1606+ else if (p->id() == Ubuntu::Constants::UBUNTUPROJECT_ID || p->id() == "QmlProjectManager.QmlProject") {
1607 if (!target()->activeBuildConfiguration()) {
1608 //backwards compatibility, try to not crash QtC for old projects
1609 //they did not create a buildconfiguration back then

Subscribers

People subscribed via source and target branches