Merge lp:~juhapekka-piiroinen/ubuntu-qtcreator-plugins/ubuntuprojectmanager into lp:ubuntu-qtcreator-plugins

Proposed by Juhapekka Piiroinen
Status: Merged
Merged at revision: 203
Proposed branch: lp:~juhapekka-piiroinen/ubuntu-qtcreator-plugins/ubuntuprojectmanager
Merge into: lp:ubuntu-qtcreator-plugins
Diff against target: 2106 lines (+1550/-41)
46 files modified
ubuntu-qtcreator-plugins/share/qtcreator/templates/wizards/ubuntu/projectypes.json (+3/-3)
ubuntu-qtcreator-plugins/share/qtcreator/ubuntu/menu.json (+5/-3)
ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/common.h (+19/-2)
ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/constants.h (+17/-0)
ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/cproject.cpp (+17/-0)
ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/cproject.h (+19/-2)
ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/cprojectfile.cpp (+17/-0)
ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/cprojectfile.h (+17/-0)
ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/cprojectmanager.h (+19/-2)
ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/cprojectnode.cpp (+17/-0)
ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/cprojectnode.h (+19/-2)
ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/crunconfiguration.cpp (+17/-0)
ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/crunconfiguration.h (+19/-2)
ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/cruncontrol.cpp (+17/-0)
ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/cruncontrol.h (+19/-2)
ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/global.h (+17/-0)
ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/plugin.cpp (+33/-4)
ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/plugin.h (+19/-0)
ubuntu-qtcreator-plugins/src/plugins/ubuntu/UbuntuProject.mimetypes.xml (+9/-0)
ubuntu-qtcreator-plugins/src/plugins/ubuntu/resources.qrc (+1/-0)
ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntu.pro (+21/-2)
ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuconstants.h (+9/-0)
ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntudevicemode.h (+3/-2)
ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntumenu.cpp (+11/-1)
ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntumenu.h (+4/-2)
ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuplugin.cpp (+11/-0)
ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuplugin.h (+8/-2)
ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuprocess.h (+3/-2)
ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuproject.cpp (+82/-0)
ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuproject.h (+88/-0)
ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuprojectapplicationwizard.cpp (+5/-6)
ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuprojectfile.cpp (+79/-0)
ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuprojectfile.h (+72/-0)
ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuprojectmanager.cpp (+53/-0)
ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuprojectmanager.h (+71/-0)
ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuprojectnode.cpp (+173/-0)
ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuprojectnode.h (+103/-0)
ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubunturunconfiguration.cpp (+9/-0)
ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubunturunconfiguration.h (+56/-0)
ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubunturunconfigurationfactory.cpp (+72/-0)
ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubunturunconfigurationfactory.h (+59/-0)
ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubunturuncontrol.cpp (+82/-0)
ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubunturuncontrol.h (+70/-0)
ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubunturuncontrolfactory.cpp (+35/-0)
ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubunturuncontrolfactory.h (+48/-0)
ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuwelcomemode.h (+3/-2)
To merge this branch: bzr merge lp:~juhapekka-piiroinen/ubuntu-qtcreator-plugins/ubuntuprojectmanager
Reviewer Review Type Date Requested Status
Juhapekka Piiroinen Pending
Review via email: mp+169976@code.launchpad.net

Description of the change

Introduces Ubuntu Project Manager and Ubuntu Run Control extensions.
Added new project type .ubuntuproject.
Adds missing license headers to CordovaQt plugin.
Disable cordovaqt menu item when a cordovaqt project is not opened.
Added support for ubuntuProjectRequired flag to menu.json.
Fixed issue in application wizard with "compatible platforms: Desktop", now Ubuntu Touch templates identifies as Platform Independent.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntu-qtcreator-plugins/share/qtcreator/templates/wizards/ubuntu/projectypes.json'
2--- ubuntu-qtcreator-plugins/share/qtcreator/templates/wizards/ubuntu/projectypes.json 2013-06-12 07:51:25 +0000
3+++ ubuntu-qtcreator-plugins/share/qtcreator/templates/wizards/ubuntu/projectypes.json 2013-06-18 02:43:28 +0000
4@@ -1,6 +1,6 @@
5 [
6 {
7- "type": "qmlproject",
8+ "type": "ubuntuproject",
9 "folder": "simple",
10 "displayName": "Simple UI",
11 "id": "UbuntuAppSimple",
12@@ -35,7 +35,7 @@
13 ]
14 },
15 {
16- "type": "qmlproject",
17+ "type": "ubuntuproject",
18 "folder": "tabs",
19 "displayName": "Tabbed UI",
20 "id": "UbuntuAppTabs",
21@@ -82,7 +82,7 @@
22 ]
23 },
24 {
25- "type": "htmlproject",
26+ "type": "ubuntuproject",
27 "folder": "html5",
28 "displayName": "HTML5 UI",
29 "id": "UbuntuAppWebView",
30
31=== modified file 'ubuntu-qtcreator-plugins/share/qtcreator/ubuntu/menu.json'
32--- ubuntu-qtcreator-plugins/share/qtcreator/ubuntu/menu.json 2013-06-03 19:05:20 +0000
33+++ ubuntu-qtcreator-plugins/share/qtcreator/ubuntu/menu.json 2013-06-18 02:43:28 +0000
34@@ -12,7 +12,7 @@
35 "projectRequired": true,
36 "keysequence": "Ctrl+F12",
37 "deviceRequired": true,
38- "qmlProjectRequired": true,
39+ "ubuntuProjectRequired": true,
40 "saveRequired": true,
41 "actions": [
42 "%SCRIPTDIRECTORY%/qtc_device_run_app %SERIALNUMBER% %FOLDERNAME% %DISPLAYNAME%.desktop %DISPLAYNAME%.qml /home/phablet/dev_tmp /home/phablet/.local/share/applications"
43@@ -24,7 +24,7 @@
44 "keysequence": "Ctrl+Shift+F12",
45 "projectRequired": true,
46 "deviceRequired": true,
47- "qmlProjectRequired": true,
48+ "ubuntuProjectRequired": true,
49 "actions": [
50 "%SCRIPTDIRECTORY%/qtc_device_close_all_apps %SERIALNUMBER% %DISPLAYNAME%"
51 ]
52@@ -47,7 +47,7 @@
53 "workingDirectory": "%0",
54 "projectRequired": true,
55 "deviceRequired": true,
56- "qmlProjectRequired": true,
57+ "ubuntuProjectRequired": true,
58 "saveRequired": true,
59 "actions": [
60 "%SCRIPTDIRECTORY%/qtc_project_create_package",
61@@ -154,6 +154,7 @@
62 "name": "Export \".pot\" File",
63 "id": "Ubuntu.Menu.i18n.pot",
64 "projectRequired": true,
65+ "ubuntuProjectRequired": true,
66 "saveRequired": true,
67 "actions": [
68 "mkdir -p po",
69@@ -164,6 +165,7 @@
70 "name": "Generate \".mo\" File",
71 "id": "Ubuntu.Menu.i18n.mo",
72 "projectRequired": true,
73+ "ubuntuProjectRequired": true,
74 "saveRequired": true,
75 "actions": [
76 "msgfmt po/*.po"
77
78=== modified file 'ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/common.h'
79--- ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/common.h 2013-04-10 00:20:30 +0000
80+++ ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/common.h 2013-06-18 02:43:28 +0000
81@@ -1,5 +1,22 @@
82-#ifndef COMMON_H_FDSFSDFAF543534534
83-#define COMMON_H_FDSFSDFAF543534534
84+/*
85+ * Copyright 2013 Canonical Ltd.
86+ *
87+ * This program is free software; you can redistribute it and/or modify
88+ * it under the terms of the GNU Lesser General Public License as published by
89+ * the Free Software Foundation; version 2.1.
90+ *
91+ * This program is distributed in the hope that it will be useful,
92+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
93+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
94+ * GNU Lesser General Public License for more details.
95+ *
96+ * You should have received a copy of the GNU Lesser General Public License
97+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
98+ *
99+ */
100+
101+#ifndef COMMON_H
102+#define COMMON_H
103
104 #include <coreplugin/actionmanager/command.h>
105 #include <coreplugin/actionmanager/actioncontainer.h>
106
107=== modified file 'ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/constants.h'
108--- ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/constants.h 2013-04-05 23:49:29 +0000
109+++ ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/constants.h 2013-06-18 02:43:28 +0000
110@@ -1,3 +1,20 @@
111+/*
112+ * Copyright 2013 Canonical Ltd.
113+ *
114+ * This program is free software; you can redistribute it and/or modify
115+ * it under the terms of the GNU Lesser General Public License as published by
116+ * the Free Software Foundation; version 2.1.
117+ *
118+ * This program is distributed in the hope that it will be useful,
119+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
120+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
121+ * GNU Lesser General Public License for more details.
122+ *
123+ * You should have received a copy of the GNU Lesser General Public License
124+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
125+ *
126+ */
127+
128 #ifndef CORDOVAQTPROJECTMANAGERCONSTANTS_H
129 #define CORDOVAQTPROJECTMANAGERCONSTANTS_H
130
131
132=== modified file 'ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/cproject.cpp'
133--- ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/cproject.cpp 2013-04-05 23:49:29 +0000
134+++ ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/cproject.cpp 2013-06-18 02:43:28 +0000
135@@ -1,3 +1,20 @@
136+/*
137+ * Copyright 2013 Canonical Ltd.
138+ *
139+ * This program is free software; you can redistribute it and/or modify
140+ * it under the terms of the GNU Lesser General Public License as published by
141+ * the Free Software Foundation; version 2.1.
142+ *
143+ * This program is distributed in the hope that it will be useful,
144+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
145+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
146+ * GNU Lesser General Public License for more details.
147+ *
148+ * You should have received a copy of the GNU Lesser General Public License
149+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
150+ *
151+ */
152+
153 #include "cproject.h"
154 #include "cprojectmanager.h"
155 #include "cruncontrol.h"
156
157=== modified file 'ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/cproject.h'
158--- ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/cproject.h 2013-04-05 23:49:29 +0000
159+++ ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/cproject.h 2013-06-18 02:43:28 +0000
160@@ -1,5 +1,22 @@
161-#ifndef CPROJECT_H_FFDSA35523523
162-#define CPROJECT_H_FFDSA35523523
163+/*
164+ * Copyright 2013 Canonical Ltd.
165+ *
166+ * This program is free software; you can redistribute it and/or modify
167+ * it under the terms of the GNU Lesser General Public License as published by
168+ * the Free Software Foundation; version 2.1.
169+ *
170+ * This program is distributed in the hope that it will be useful,
171+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
172+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
173+ * GNU Lesser General Public License for more details.
174+ *
175+ * You should have received a copy of the GNU Lesser General Public License
176+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
177+ *
178+ */
179+
180+#ifndef CPROJECT_H
181+#define CPROJECT_H
182
183 #include "global.h"
184 #include "constants.h"
185
186=== modified file 'ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/cprojectfile.cpp'
187--- ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/cprojectfile.cpp 2013-04-05 23:49:29 +0000
188+++ ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/cprojectfile.cpp 2013-06-18 02:43:28 +0000
189@@ -1,3 +1,20 @@
190+/*
191+ * Copyright 2013 Canonical Ltd.
192+ *
193+ * This program is free software; you can redistribute it and/or modify
194+ * it under the terms of the GNU Lesser General Public License as published by
195+ * the Free Software Foundation; version 2.1.
196+ *
197+ * This program is distributed in the hope that it will be useful,
198+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
199+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
200+ * GNU Lesser General Public License for more details.
201+ *
202+ * You should have received a copy of the GNU Lesser General Public License
203+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
204+ *
205+ */
206+
207 #include "cprojectfile.h"
208
209 namespace CordovaqtProjectManager {
210
211=== modified file 'ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/cprojectfile.h'
212--- ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/cprojectfile.h 2013-04-05 23:49:29 +0000
213+++ ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/cprojectfile.h 2013-06-18 02:43:28 +0000
214@@ -1,3 +1,20 @@
215+/*
216+ * Copyright 2013 Canonical Ltd.
217+ *
218+ * This program is free software; you can redistribute it and/or modify
219+ * it under the terms of the GNU Lesser General Public License as published by
220+ * the Free Software Foundation; version 2.1.
221+ *
222+ * This program is distributed in the hope that it will be useful,
223+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
224+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
225+ * GNU Lesser General Public License for more details.
226+ *
227+ * You should have received a copy of the GNU Lesser General Public License
228+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
229+ *
230+ */
231+
232 #ifndef CPROJECTFILE_H
233 #define CPROJECTFILE_H
234
235
236=== modified file 'ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/cprojectmanager.h'
237--- ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/cprojectmanager.h 2013-04-05 23:49:29 +0000
238+++ ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/cprojectmanager.h 2013-06-18 02:43:28 +0000
239@@ -1,5 +1,22 @@
240-#ifndef PROJECTMANAGER_H_FEDEDFDS071421
241-#define PROJECTMANAGER_H_FEDEDFDS071421
242+/*
243+ * Copyright 2013 Canonical Ltd.
244+ *
245+ * This program is free software; you can redistribute it and/or modify
246+ * it under the terms of the GNU Lesser General Public License as published by
247+ * the Free Software Foundation; version 2.1.
248+ *
249+ * This program is distributed in the hope that it will be useful,
250+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
251+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
252+ * GNU Lesser General Public License for more details.
253+ *
254+ * You should have received a copy of the GNU Lesser General Public License
255+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
256+ *
257+ */
258+
259+#ifndef PROJECTMANAGER_H
260+#define PROJECTMANAGER_H
261
262 #include "common.h"
263 #include "cproject.h"
264
265=== modified file 'ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/cprojectnode.cpp'
266--- ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/cprojectnode.cpp 2013-04-05 23:49:29 +0000
267+++ ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/cprojectnode.cpp 2013-06-18 02:43:28 +0000
268@@ -1,3 +1,20 @@
269+/*
270+ * Copyright 2013 Canonical Ltd.
271+ *
272+ * This program is free software; you can redistribute it and/or modify
273+ * it under the terms of the GNU Lesser General Public License as published by
274+ * the Free Software Foundation; version 2.1.
275+ *
276+ * This program is distributed in the hope that it will be useful,
277+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
278+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
279+ * GNU Lesser General Public License for more details.
280+ *
281+ * You should have received a copy of the GNU Lesser General Public License
282+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
283+ *
284+ */
285+
286 #include "cprojectnode.h"
287 #include "cproject.h"
288
289
290=== modified file 'ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/cprojectnode.h'
291--- ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/cprojectnode.h 2013-04-05 23:49:29 +0000
292+++ ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/cprojectnode.h 2013-06-18 02:43:28 +0000
293@@ -1,5 +1,22 @@
294-#ifndef CPROJECTNODE_H_JLMBIHLKKNKLHFVYI
295-#define CPROJECTNODE_H_JLMBIHLKKNKLHFVYI
296+/*
297+ * Copyright 2013 Canonical Ltd.
298+ *
299+ * This program is free software; you can redistribute it and/or modify
300+ * it under the terms of the GNU Lesser General Public License as published by
301+ * the Free Software Foundation; version 2.1.
302+ *
303+ * This program is distributed in the hope that it will be useful,
304+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
305+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
306+ * GNU Lesser General Public License for more details.
307+ *
308+ * You should have received a copy of the GNU Lesser General Public License
309+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
310+ *
311+ */
312+
313+#ifndef CPROJECTNODE_H
314+#define CPROJECTNODE_H
315
316 #include "common.h"
317
318
319=== modified file 'ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/crunconfiguration.cpp'
320--- ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/crunconfiguration.cpp 2013-04-05 23:49:29 +0000
321+++ ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/crunconfiguration.cpp 2013-06-18 02:43:28 +0000
322@@ -1,3 +1,20 @@
323+/*
324+ * Copyright 2013 Canonical Ltd.
325+ *
326+ * This program is free software; you can redistribute it and/or modify
327+ * it under the terms of the GNU Lesser General Public License as published by
328+ * the Free Software Foundation; version 2.1.
329+ *
330+ * This program is distributed in the hope that it will be useful,
331+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
332+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
333+ * GNU Lesser General Public License for more details.
334+ *
335+ * You should have received a copy of the GNU Lesser General Public License
336+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
337+ *
338+ */
339+
340 #include "crunconfiguration.h"
341 #include "constants.h"
342 #include "cproject.h"
343
344=== modified file 'ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/crunconfiguration.h'
345--- ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/crunconfiguration.h 2013-04-05 23:49:29 +0000
346+++ ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/crunconfiguration.h 2013-06-18 02:43:28 +0000
347@@ -1,5 +1,22 @@
348-#ifndef CRUNCONFIGURATION_H_LHJLTGIGJEKLWBFXZM
349-#define CRUNCONFIGURATION_H_LHJLTGIGJEKLWBFXZM
350+/*
351+ * Copyright 2013 Canonical Ltd.
352+ *
353+ * This program is free software; you can redistribute it and/or modify
354+ * it under the terms of the GNU Lesser General Public License as published by
355+ * the Free Software Foundation; version 2.1.
356+ *
357+ * This program is distributed in the hope that it will be useful,
358+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
359+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
360+ * GNU Lesser General Public License for more details.
361+ *
362+ * You should have received a copy of the GNU Lesser General Public License
363+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
364+ *
365+ */
366+
367+#ifndef CRUNCONFIGURATION_H
368+#define CRUNCONFIGURATION_H
369
370 #include "common.h"
371
372
373=== modified file 'ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/cruncontrol.cpp'
374--- ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/cruncontrol.cpp 2013-04-05 23:49:29 +0000
375+++ ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/cruncontrol.cpp 2013-06-18 02:43:28 +0000
376@@ -1,3 +1,20 @@
377+/*
378+ * Copyright 2013 Canonical Ltd.
379+ *
380+ * This program is free software; you can redistribute it and/or modify
381+ * it under the terms of the GNU Lesser General Public License as published by
382+ * the Free Software Foundation; version 2.1.
383+ *
384+ * This program is distributed in the hope that it will be useful,
385+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
386+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
387+ * GNU Lesser General Public License for more details.
388+ *
389+ * You should have received a copy of the GNU Lesser General Public License
390+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
391+ *
392+ */
393+
394 #include "cruncontrol.h"
395 #include "cproject.h"
396
397
398=== modified file 'ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/cruncontrol.h'
399--- ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/cruncontrol.h 2013-04-05 23:49:29 +0000
400+++ ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/cruncontrol.h 2013-06-18 02:43:28 +0000
401@@ -1,5 +1,22 @@
402-#ifndef CRUNCONTROL_H_FDSADASDASDHNUHTYV
403-#define CRUNCONTROL_H_FDSADASDASDHNUHTYV
404+/*
405+ * Copyright 2013 Canonical Ltd.
406+ *
407+ * This program is free software; you can redistribute it and/or modify
408+ * it under the terms of the GNU Lesser General Public License as published by
409+ * the Free Software Foundation; version 2.1.
410+ *
411+ * This program is distributed in the hope that it will be useful,
412+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
413+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
414+ * GNU Lesser General Public License for more details.
415+ *
416+ * You should have received a copy of the GNU Lesser General Public License
417+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
418+ *
419+ */
420+
421+#ifndef CRUNCONTROL_H
422+#define CRUNCONTROL_H
423
424 #include "common.h"
425
426
427=== modified file 'ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/global.h'
428--- ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/global.h 2013-04-05 23:49:29 +0000
429+++ ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/global.h 2013-06-18 02:43:28 +0000
430@@ -1,3 +1,20 @@
431+/*
432+ * Copyright 2013 Canonical Ltd.
433+ *
434+ * This program is free software; you can redistribute it and/or modify
435+ * it under the terms of the GNU Lesser General Public License as published by
436+ * the Free Software Foundation; version 2.1.
437+ *
438+ * This program is distributed in the hope that it will be useful,
439+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
440+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
441+ * GNU Lesser General Public License for more details.
442+ *
443+ * You should have received a copy of the GNU Lesser General Public License
444+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
445+ *
446+ */
447+
448 #ifndef CORDOVAQTPROJECTMANAGER_GLOBAL_H
449 #define CORDOVAQTPROJECTMANAGER_GLOBAL_H
450
451
452=== modified file 'ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/plugin.cpp'
453--- ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/plugin.cpp 2013-04-10 00:20:30 +0000
454+++ ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/plugin.cpp 2013-06-18 02:43:28 +0000
455@@ -1,3 +1,20 @@
456+/*
457+ * Copyright 2013 Canonical Ltd.
458+ *
459+ * This program is free software; you can redistribute it and/or modify
460+ * it under the terms of the GNU Lesser General Public License as published by
461+ * the Free Software Foundation; version 2.1.
462+ *
463+ * This program is distributed in the hope that it will be useful,
464+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
465+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
466+ * GNU Lesser General Public License for more details.
467+ *
468+ * You should have received a copy of the GNU Lesser General Public License
469+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
470+ *
471+ */
472+
473 #include "plugin.h"
474 #include "constants.h"
475 #include "cprojectmanager.h"
476@@ -36,11 +53,12 @@
477 addAutoReleasedObject(new CRunConfigurationFactory);
478 addAutoReleasedObject(new CRunControlFactory);
479
480- QAction *act= new QAction(QLatin1String("Run Cordovaqt app on Ubuntu Phone"), this);
481- Core::Command *cmd = Core::ActionManager::registerAction(act, Core::Id("Cordovaqt.TOTTTT"), Core::Context(Core::Constants::C_GLOBAL));
482- connect(act, SIGNAL(triggered()), this, SLOT(menuItemTriggered()));
483+ m_actionMenu = new QAction(QLatin1String("Run Cordovaqt app on Ubuntu Phone"), this);
484+ Core::Command *cmd = Core::ActionManager::registerAction(m_actionMenu, Core::Id("Cordovaqt.TOTTTT"), Core::Context(Core::Constants::C_GLOBAL));
485+ connect(m_actionMenu, SIGNAL(triggered()), this, SLOT(menuItemTriggered()));
486+ connect(ProjectExplorer::ProjectExplorerPlugin::instance(),SIGNAL(updateRunActions()),this,SLOT(slotUpdateActions()));
487
488- Core::ActionManager::actionContainer(ProjectExplorer::Constants::M_BUILDPROJECT)->addAction(cmd/*,group*/);
489+ Core::ActionManager::actionContainer(ProjectExplorer::Constants::M_BUILDPROJECT)->addAction(cmd,Core::Id(ProjectExplorer::Constants::G_BUILD_RUN));
490
491 connect(&m_ubuntuProcess,SIGNAL(message(QString)),this,SLOT(onMessage(QString)));
492 connect(&m_ubuntuProcess,SIGNAL(finished(QString,int)),this,SLOT(onFinished(QString,int)));
493@@ -50,6 +68,17 @@
494 return true;
495 }
496
497+void CordovaqtProjectManagerPlugin::slotUpdateActions() {
498+ ProjectExplorer::ProjectExplorerPlugin* projectExplorerInstance = ProjectExplorer::ProjectExplorerPlugin::instance();
499+ ProjectExplorer::Project* currentProject = projectExplorerInstance->currentProject();
500+ if (currentProject == NULL || !qobject_cast<CProject *>(currentProject)) {
501+ m_actionMenu->setEnabled(false);
502+ return;
503+ }
504+
505+ m_actionMenu->setEnabled(currentProject->projectManager()->mimeType() == QLatin1String(CORDOVAQTPROJECT_MIMETYPE));
506+}
507+
508 void CordovaqtProjectManagerPlugin::onStarted(QString cmd) {
509 printToOutputPane(QString::fromLatin1("Started %0").arg(cmd));
510 }
511
512=== modified file 'ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/plugin.h'
513--- ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/plugin.h 2013-04-10 00:20:30 +0000
514+++ ubuntu-qtcreator-plugins/src/plugins/cordovaqtprojectmanager/plugin.h 2013-06-18 02:43:28 +0000
515@@ -1,3 +1,20 @@
516+/*
517+ * Copyright 2013 Canonical Ltd.
518+ *
519+ * This program is free software; you can redistribute it and/or modify
520+ * it under the terms of the GNU Lesser General Public License as published by
521+ * the Free Software Foundation; version 2.1.
522+ *
523+ * This program is distributed in the hope that it will be useful,
524+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
525+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
526+ * GNU Lesser General Public License for more details.
527+ *
528+ * You should have received a copy of the GNU Lesser General Public License
529+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
530+ *
531+ */
532+
533 #ifndef CORDOVAQTPROJECTMANAGER_H
534 #define CORDOVAQTPROJECTMANAGER_H
535
536@@ -25,9 +42,11 @@
537 void onMessage(QString);
538 void onError(QString);
539 void onFinished(QString cmd, int code);
540+ void slotUpdateActions();
541
542 private:
543 Ubuntu::Internal::UbuntuProcess m_ubuntuProcess;
544+ QAction* m_actionMenu;
545 };
546
547 }
548
549=== added file 'ubuntu-qtcreator-plugins/src/plugins/ubuntu/UbuntuProject.mimetypes.xml'
550--- ubuntu-qtcreator-plugins/src/plugins/ubuntu/UbuntuProject.mimetypes.xml 1970-01-01 00:00:00 +0000
551+++ ubuntu-qtcreator-plugins/src/plugins/ubuntu/UbuntuProject.mimetypes.xml 2013-06-18 02:43:28 +0000
552@@ -0,0 +1,9 @@
553+<?xml version="1.0"?>
554+
555+<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
556+ <mime-type type="application/x-ubuntuproject">
557+ <sub-class-of type="application/x-qml"/>
558+ <comment>Ubuntu Project file</comment>
559+ <glob pattern="*.ubuntuproject"/>
560+ </mime-type>
561+</mime-info>
562
563=== modified file 'ubuntu-qtcreator-plugins/src/plugins/ubuntu/resources.qrc'
564--- ubuntu-qtcreator-plugins/src/plugins/ubuntu/resources.qrc 2013-02-19 12:16:52 +0000
565+++ ubuntu-qtcreator-plugins/src/plugins/ubuntu/resources.qrc 2013-06-18 02:43:28 +0000
566@@ -5,5 +5,6 @@
567 <file>images/ubuntu-qtcreator.png</file>
568 <file>images/ubuntu-48.png</file>
569 <file>images/device.png</file>
570+ <file>UbuntuProject.mimetypes.xml</file>
571 </qresource>
572 </RCC>
573
574=== modified file 'ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntu.pro'
575--- ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntu.pro 2013-06-13 09:41:23 +0000
576+++ ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntu.pro 2013-06-18 02:43:28 +0000
577@@ -18,7 +18,15 @@
578 SOURCES += ubuntuplugin.cpp \
579 ubuntuwelcomemode.cpp \
580 ubuntuprojectapplicationwizard.cpp \
581- ubuntumenu.cpp
582+ ubuntumenu.cpp \
583+ ubuntuprojectmanager.cpp \
584+ ubuntuproject.cpp \
585+ ubuntuprojectfile.cpp \
586+ ubuntuprojectnode.cpp \
587+ ubunturunconfiguration.cpp \
588+ ubunturunconfigurationfactory.cpp \
589+ ubunturuncontrol.cpp \
590+ ubunturuncontrolfactory.cpp
591
592 HEADERS += ubuntuplugin.h \
593 ubuntu_global.h \
594@@ -26,7 +34,15 @@
595 ubuntuwelcomemode.h \
596 ubuntuprojectapplicationwizard.h \
597 ubuntumenu.h \
598- ubuntushared.h
599+ ubuntushared.h \
600+ ubuntuprojectmanager.h \
601+ ubuntuproject.h \
602+ ubuntuprojectfile.h \
603+ ubuntuprojectnode.h \
604+ ubunturunconfiguration.h \
605+ ubunturunconfigurationfactory.h \
606+ ubunturuncontrol.h \
607+ ubunturuncontrolfactory.h
608
609 RESOURCES += resources.qrc
610
611@@ -54,3 +70,6 @@
612 ###################################
613 # make sure that the required scripts under share/ubuntu/scripts are executable
614 system( chmod +x ../../../share/qtcreator/ubuntu/scripts/* )
615+
616+OTHER_FILES += \
617+ UbuntuProject.mimetypes.xml
618
619=== modified file 'ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuconstants.h'
620--- ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuconstants.h 2013-06-10 18:18:42 +0000
621+++ ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuconstants.h 2013-06-18 02:43:28 +0000
622@@ -25,9 +25,17 @@
623 namespace Ubuntu {
624 namespace Constants {
625
626+const char UBUNTUPROJECT_MIMETYPE[] = "application/x-ubuntuproject";
627+const char UBUNTUPROJECT_ID[] = "UbuntuProjectManager.UbuntuProject";
628+const char UBUNTUPROJECT_PROJECTCONTEXT[] = "UbuntuProject.ProjectContext";
629+const char UBUNTUPROJECT_SUFFIX[] = ".ubuntuproject";
630 const char UBUNTU_PROJECT_WIZARD_CATEGORY[] = "A.UbuntuProjects";
631+const char UBUNTUPROJECT_DISPLAYNAME[] = "Ubuntu Project";
632+const char UBUNTUPROJECT_RUNCONTROL_ID[] = "UbuntuProjectManager.UbuntuRunConfiguration";
633+
634 const char UBUNTU_PROJECT_WIZARD_CATEGORY_DISPLAY[] = QT_TRANSLATE_NOOP("ProjectExplorer", "Ubuntu Touch");
635
636+const char UBUNTU_UBUNTUPROJECT_TYPE[] = "ubuntuproject";
637 const char UBUNTU_HTMLPROJECT_TYPE[] = "htmlproject";
638 const char UBUNTU_AUTOPILOTPROJECT_TYPE[] = "autopilotproject";
639 const char UBUNTU_QMLPROJECT_TYPE[] = "qmlproject";
640@@ -58,6 +66,7 @@
641 const char UBUNTU_MENUJSON_DEVICEREQUIRED[] = "deviceRequired";
642 const char UBUNTU_MENUJSON_QMLPROJECTREQUIRED[] = "qmlProjectRequired";
643 const char UBUNTU_MENUJSON_QMAKEPROJECTREQUIRED[] = "qmakeProjectRequired";
644+const char UBUNTU_MENUJSON_UBUNTUPROJECTREQUIRED[] = "ubuntuProjectRequired";
645 const char UBUNTU_MENUJSON_SAVEREQUIRED[] = "saveRequired";
646 const char UBUNTU_MENUJSON_MESSAGEDIALOG[] = "messageDialog";
647
648
649=== modified file 'ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntudevicemode.h'
650--- ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntudevicemode.h 2013-04-08 13:34:07 +0000
651+++ ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntudevicemode.h 2013-06-18 02:43:28 +0000
652@@ -41,8 +41,9 @@
653 UbuntuDevicesWidget m_ubuntuDevicesWidget;
654 };
655
656-}
657-}
658+
659+} // Internal
660+} // Ubuntu
661
662
663 #endif // UBUNTUDEVICEMODE_H
664
665=== modified file 'ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntumenu.cpp'
666--- ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntumenu.cpp 2013-05-04 21:41:03 +0000
667+++ ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntumenu.cpp 2013-06-18 02:43:28 +0000
668@@ -68,10 +68,12 @@
669 ProjectExplorer::Project* currentProject = projectExplorerInstance->currentProject();
670 bool isQmlProject = false;
671 bool isQmakeProject = false;
672+ bool isUbuntuProject = false;
673
674 if (currentProject) {
675 isQmlProject = (currentProject->projectManager()->mimeType() == QLatin1String("application/x-qmlproject"));
676 isQmakeProject = (currentProject->projectManager()->mimeType() == QLatin1String("application/vnd.nokia.qt.qmakeprofile"));
677+ isUbuntuProject = (currentProject->projectManager()->mimeType() == QLatin1String(Constants::UBUNTUPROJECT_MIMETYPE));
678 }
679
680 //bool canRun = projectExplorerInstance->canRun(currentProject,ProjectExplorer::NormalRunMode);
681@@ -83,7 +85,8 @@
682 bool requiresProject = act->property(Constants::UBUNTU_MENUJSON_PROJECTREQUIRED).toBool();
683 bool requiresQmlProject = act->property(Constants::UBUNTU_MENUJSON_QMLPROJECTREQUIRED).toBool();
684 bool requiresQmakeProject = act->property(Constants::UBUNTU_MENUJSON_QMAKEPROJECTREQUIRED).toBool();
685- bool actionEnabled = ( (requiresQmakeProject ? isQmakeProject : true) && (requiresQmlProject ? isQmlProject : true) && (requiresDevice ? deviceDetected : true) && (requiresProject ? projectOpen : true));
686+ bool requiresUbuntuProject = act->property(Constants::UBUNTU_MENUJSON_UBUNTUPROJECTREQUIRED).toBool();
687+ bool actionEnabled = ( (requiresQmakeProject ? isQmakeProject : true) && (requiresQmlProject ? isQmlProject : true) && (requiresDevice ? deviceDetected : true) && (requiresProject ? projectOpen : true) && (requiresUbuntuProject ? isUbuntuProject : true));
688
689 act->setEnabled( actionEnabled );
690 }
691@@ -160,6 +163,7 @@
692 bool actionDeviceRequired = false;
693 bool actionQmlProjectRequired = false;
694 bool actionQmakeProjectRequired = false;
695+ bool actionUbuntuProjectRequired = false;
696 bool actionSaveRequired = false;
697
698 if (obj.contains(QLatin1String(Constants::UBUNTU_MENUJSON_NAME))) {
699@@ -186,6 +190,11 @@
700 if (obj.contains(QLatin1String(Constants::UBUNTU_MENUJSON_QMAKEPROJECTREQUIRED))) {
701 actionQmakeProjectRequired = obj.value(QLatin1String(Constants::UBUNTU_MENUJSON_QMAKEPROJECTREQUIRED)).toBool();
702 }
703+
704+ if (obj.contains(QLatin1String(Constants::UBUNTU_MENUJSON_UBUNTUPROJECTREQUIRED))) {
705+ actionUbuntuProjectRequired = obj.value(QLatin1String(Constants::UBUNTU_MENUJSON_UBUNTUPROJECTREQUIRED)).toBool();
706+ }
707+
708 if (obj.contains(QLatin1String(Constants::UBUNTU_MENUJSON_SAVEREQUIRED))) {
709 actionSaveRequired = obj.value(QLatin1String(Constants::UBUNTU_MENUJSON_SAVEREQUIRED)).toBool();
710 }
711@@ -217,6 +226,7 @@
712 act->setProperty(Constants::UBUNTU_MENUJSON_DEVICEREQUIRED,actionDeviceRequired);
713 act->setProperty(Constants::UBUNTU_MENUJSON_QMAKEPROJECTREQUIRED,actionQmakeProjectRequired);
714 act->setProperty(Constants::UBUNTU_MENUJSON_QMLPROJECTREQUIRED,actionQmlProjectRequired);
715+ act->setProperty(Constants::UBUNTU_MENUJSON_UBUNTUPROJECTREQUIRED,actionUbuntuProjectRequired);
716 act->setProperty(Constants::UBUNTU_MENUJSON_SAVEREQUIRED,actionSaveRequired);
717
718 connect(act, SIGNAL(triggered()), this, SLOT(menuItemTriggered()));
719
720=== modified file 'ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntumenu.h'
721--- ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntumenu.h 2013-04-24 16:56:03 +0000
722+++ ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntumenu.h 2013-06-18 02:43:28 +0000
723@@ -22,6 +22,7 @@
724 #include <coreplugin/actionmanager/actionmanager.h>
725
726 #include "ubuntuprocess.h"
727+#include "ubuntuconstants.h"
728
729 #include <QObject>
730 #include <QString>
731@@ -66,8 +67,9 @@
732
733 };
734
735-}
736-}
737+
738+} // Internal
739+} // Ubuntu
740
741
742 #endif // UBUNTUMENU_H
743
744=== modified file 'ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuplugin.cpp'
745--- ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuplugin.cpp 2013-06-06 15:56:05 +0000
746+++ ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuplugin.cpp 2013-06-18 02:43:28 +0000
747@@ -44,6 +44,13 @@
748 Q_UNUSED(arguments)
749 Q_UNUSED(errorString)
750
751+ Core::MimeDatabase *mimeDB = Core::ICore::mimeDatabase();
752+
753+ const QLatin1String mimetypesXml(":/ubuntu/UbuntuProject.mimetypes.xml");
754+
755+ if (!mimeDB->addMimeTypes(mimetypesXml, errorString))
756+ return false;
757+
758 QJsonDocument jsonDoc = QJsonDocument::fromJson(Internal::UbuntuProjectApplicationWizard::getProjectTypesJSON());
759 if (jsonDoc.isArray()) {
760 QJsonArray array = jsonDoc.array();
761@@ -65,6 +72,10 @@
762 addAutoReleasedObject(m_ubuntuDeviceMode);
763 addAutoReleasedObject(m_ubuntuMenu);
764
765+ addAutoReleasedObject(new UbuntuProjectManager);
766+ addAutoReleasedObject(new UbuntuRunConfigurationFactory);
767+ addAutoReleasedObject(new UbuntuRunControlFactory);
768+
769 return true;
770 }
771
772
773=== modified file 'ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuplugin.h'
774--- ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuplugin.h 2013-04-08 13:34:07 +0000
775+++ ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuplugin.h 2013-06-18 02:43:28 +0000
776@@ -23,9 +23,14 @@
777 #include "ubuntuwelcomemode.h"
778 #include "ubuntudevicemode.h"
779 #include "ubuntumenu.h"
780+#include "ubuntuprojectmanager.h"
781+#include "ubunturunconfiguration.h"
782+#include "ubunturunconfigurationfactory.h"
783+#include "ubunturuncontrolfactory.h"
784
785 #include <extensionsystem/iplugin.h>
786 #include <QProcess>
787+#include <coreplugin/mimedatabase.h>
788
789 namespace Ubuntu {
790 namespace Internal {
791@@ -48,8 +53,9 @@
792 UbuntuMenu* m_ubuntuMenu;
793 };
794
795-}
796-} // namespace Ubuntu
797+
798+} // Internal
799+} // Ubuntu
800
801 #endif // UBUNTU_H
802
803
804=== modified file 'ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuprocess.h'
805--- ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuprocess.h 2013-04-10 00:20:30 +0000
806+++ ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuprocess.h 2013-06-18 02:43:28 +0000
807@@ -61,7 +61,8 @@
808
809 };
810
811-}
812-}
813+
814+} // Internal
815+} // Ubuntu
816
817 #endif // UBUNTUPROCESS_H
818
819=== added file 'ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuproject.cpp'
820--- ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuproject.cpp 1970-01-01 00:00:00 +0000
821+++ ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuproject.cpp 2013-06-18 02:43:28 +0000
822@@ -0,0 +1,82 @@
823+/*
824+ * Copyright 2013 Canonical Ltd.
825+ *
826+ * This program is free software; you can redistribute it and/or modify
827+ * it under the terms of the GNU Lesser General Public License as published by
828+ * the Free Software Foundation; version 2.1.
829+ *
830+ * This program is distributed in the hope that it will be useful,
831+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
832+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
833+ * GNU Lesser General Public License for more details.
834+ *
835+ * You should have received a copy of the GNU Lesser General Public License
836+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
837+ *
838+ * Author: Juhapekka Piiroinen <juhapekka.piiroinen@canonical.com>
839+ */
840+
841+#include "ubuntuproject.h"
842+
843+using namespace Ubuntu;
844+using namespace Ubuntu::Internal;
845+
846+UbuntuProject::UbuntuProject(UbuntuProjectManager *manager, const QString &fileName)
847+ : m_manager(manager),
848+ m_fileName(fileName) {
849+ setProjectContext(Core::Context(Constants::UBUNTUPROJECT_PROJECTCONTEXT));
850+
851+ QFileInfo fileInfo(m_fileName);
852+ m_projectName = fileInfo.completeBaseName();
853+
854+ m_file = QSharedPointer<UbuntuProjectFile>(new UbuntuProjectFile(this, fileName));
855+
856+ Core::DocumentManager::addDocument(m_file.data(), true);
857+
858+ m_rootNode = QSharedPointer<UbuntuProjectNode>(new UbuntuProjectNode(this, m_file.data()));
859+ m_manager->registerProject(this);
860+
861+ QList<ProjectExplorer::Kit *> kits = ProjectExplorer::KitManager::instance()->kits();
862+ foreach (ProjectExplorer::Kit *kit, kits) {
863+ addTarget(createTarget(kit));
864+ }
865+
866+}
867+
868+QString UbuntuProject::displayName() const {
869+ return m_projectName;
870+}
871+
872+Core::Id UbuntuProject::id() const {
873+ return Core::Id(Constants::UBUNTUPROJECT_ID);
874+}
875+
876+Core::IDocument *UbuntuProject::document() const {
877+ return m_file.data();
878+}
879+
880+ProjectExplorer::IProjectManager *UbuntuProject::projectManager() const {
881+ return m_manager;
882+}
883+
884+ProjectExplorer::ProjectNode *UbuntuProject::rootProjectNode() const {
885+ return m_rootNode.data();
886+}
887+
888+static void enumChild(const QDir &dir, QStringList &res) {
889+ foreach (const QFileInfo &info, dir.entryInfoList(QDir::NoDotAndDotDot|QDir::Dirs|QDir::Files)) {
890+ if (info.fileName().indexOf(QLatin1String(Constants::UBUNTUPROJECT_SUFFIX)) != -1)
891+ continue;
892+ if (info.isFile()) {
893+ res.append(info.absoluteFilePath());
894+ } else if (info.isDir()) {
895+ enumChild(QDir(info.absoluteFilePath()), res);
896+ }
897+ }
898+}
899+
900+QStringList UbuntuProject::files(FilesMode) const {
901+ QStringList files;
902+ enumChild(projectDir(), files);
903+ return files;
904+}
905
906=== added file 'ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuproject.h'
907--- ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuproject.h 1970-01-01 00:00:00 +0000
908+++ ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuproject.h 2013-06-18 02:43:28 +0000
909@@ -0,0 +1,88 @@
910+/*
911+ * Copyright 2013 Canonical Ltd.
912+ *
913+ * This program is free software; you can redistribute it and/or modify
914+ * it under the terms of the GNU Lesser General Public License as published by
915+ * the Free Software Foundation; version 2.1.
916+ *
917+ * This program is distributed in the hope that it will be useful,
918+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
919+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
920+ * GNU Lesser General Public License for more details.
921+ *
922+ * You should have received a copy of the GNU Lesser General Public License
923+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
924+ *
925+ * Author: Juhapekka Piiroinen <juhapekka.piiroinen@canonical.com>
926+ */
927+
928+#ifndef UBUNTUPROJECT_H
929+#define UBUNTUPROJECT_H
930+
931+#include "ubuntuprojectmanager.h"
932+#include "ubuntuprojectfile.h"
933+#include "ubuntuprojectnode.h"
934+#include "ubuntuconstants.h"
935+#include <coreplugin/actionmanager/command.h>
936+#include <coreplugin/actionmanager/actioncontainer.h>
937+#include <coreplugin/actionmanager/actionmanager.h>
938+#include <coreplugin/coreconstants.h>
939+#include <coreplugin/icontext.h>
940+#include <coreplugin/mimedatabase.h>
941+#include <coreplugin/messagemanager.h>
942+#include <coreplugin/icore.h>
943+#include <coreplugin/idocument.h>
944+#include <coreplugin/documentmanager.h>
945+#include <projectexplorer/iprojectmanager.h>
946+#include <projectexplorer/projectexplorerconstants.h>
947+#include <projectexplorer/projectexplorer.h>
948+#include <projectexplorer/projectnodes.h>
949+#include <projectexplorer/project.h>
950+#include <projectexplorer/kitmanager.h>
951+#include <projectexplorer/target.h>
952+#include <projectexplorer/session.h>
953+#include <projectexplorer/runconfiguration.h>
954+#include <projectexplorer/applicationlauncher.h>
955+
956+namespace Ubuntu {
957+namespace Internal {
958+
959+class UbuntuProjectManager;
960+class UbuntuProjectFile;
961+class UbuntuProjectNode;
962+class UbuntuProject : public ProjectExplorer::Project
963+{
964+ Q_OBJECT
965+
966+public:
967+ UbuntuProject(UbuntuProjectManager *manager, const QString &fileName);
968+
969+ QString displayName() const;
970+ Core::Id id() const;
971+ Core::IDocument *document() const;
972+ ProjectExplorer::IProjectManager *projectManager() const;
973+
974+ ProjectExplorer::ProjectNode *rootProjectNode() const;
975+ QStringList files(FilesMode fileMode) const;
976+
977+ QDir projectDir() const {
978+ return QFileInfo(document()->fileName()).dir();
979+ }
980+
981+ QString filesFileName() const {
982+ return m_fileName;
983+ }
984+
985+private:
986+ UbuntuProjectManager *m_manager;
987+ QString m_projectName;
988+ QSharedPointer<UbuntuProjectFile> m_file;
989+
990+ QString m_fileName;
991+ QSharedPointer<UbuntuProjectNode> m_rootNode;
992+
993+};
994+}
995+}
996+
997+#endif // UBUNTUPROJECT_H
998
999=== modified file 'ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuprojectapplicationwizard.cpp'
1000--- ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuprojectapplicationwizard.cpp 2013-06-10 18:37:52 +0000
1001+++ ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuprojectapplicationwizard.cpp 2013-06-18 02:43:28 +0000
1002@@ -37,8 +37,7 @@
1003 #include <QDeclarativeEngine>
1004 #include <QJsonArray>
1005
1006-namespace Ubuntu {
1007-namespace Internal {
1008+using namespace Ubuntu::Internal;
1009
1010 UbuntuProjectApplicationWizardDialog::UbuntuProjectApplicationWizardDialog(QWidget *parent,
1011 const Core::WizardDialogParameters &parameters) :
1012@@ -90,6 +89,7 @@
1013 parameters.setIcon(QIcon(QLatin1String(QtSupport::Constants::QML_WIZARD_ICON)));
1014 parameters.setDisplayName(displayName);
1015 parameters.setId(id);
1016+ parameters.setFlags(Core::IWizard::PlatformIndependent);
1017 parameters.setDescription(description);
1018 parameters.setCategory(QLatin1String(Ubuntu::Constants::UBUNTU_PROJECT_WIZARD_CATEGORY));
1019 parameters.setDisplayCategory(QLatin1String(Ubuntu::Constants::UBUNTU_PROJECT_WIZARD_CATEGORY_DISPLAY));
1020@@ -136,10 +136,11 @@
1021 folder = tmp_folder.toString();
1022 }
1023
1024- if (projectType == QLatin1String(Constants::UBUNTU_QMLPROJECT_TYPE) || projectType == QLatin1String(Constants::UBUNTU_AUTOPILOTPROJECT_TYPE) || projectType == QLatin1String(Constants::UBUNTU_HTMLPROJECT_TYPE)) {
1025+ if (projectType == QLatin1String(Constants::UBUNTU_QMLPROJECT_TYPE) || projectType == QLatin1String(Constants::UBUNTU_AUTOPILOTPROJECT_TYPE) || projectType == QLatin1String(Constants::UBUNTU_HTMLPROJECT_TYPE) || projectType == QLatin1String(Constants::UBUNTU_UBUNTUPROJECT_TYPE)) {
1026+
1027 const QString creatorFileName = Core::BaseFileWizard::buildFileName(projectPath,
1028 projectName,
1029- QLatin1String(Constants::UBUNTU_QMLPROJECT_TYPE));
1030+ projectType);
1031
1032 // load the mainFile
1033 QString mainFileName = Core::BaseFileWizard::buildFileName(projectPath,
1034@@ -334,5 +335,3 @@
1035 return contents;
1036 }
1037
1038-} // Internal
1039-} // Ubuntu
1040
1041=== added file 'ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuprojectfile.cpp'
1042--- ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuprojectfile.cpp 1970-01-01 00:00:00 +0000
1043+++ ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuprojectfile.cpp 2013-06-18 02:43:28 +0000
1044@@ -0,0 +1,79 @@
1045+/*
1046+ * Copyright 2013 Canonical Ltd.
1047+ *
1048+ * This program is free software; you can redistribute it and/or modify
1049+ * it under the terms of the GNU Lesser General Public License as published by
1050+ * the Free Software Foundation; version 2.1.
1051+ *
1052+ * This program is distributed in the hope that it will be useful,
1053+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1054+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1055+ * GNU Lesser General Public License for more details.
1056+ *
1057+ * You should have received a copy of the GNU Lesser General Public License
1058+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1059+ *
1060+ * Author: Juhapekka Piiroinen <juhapekka.piiroinen@canonical.com>
1061+ */
1062+
1063+#include "ubuntuprojectfile.h"
1064+
1065+using namespace Ubuntu::Internal;
1066+
1067+UbuntuProjectFile::UbuntuProjectFile(UbuntuProject *parent, QString fileName)
1068+ : Core::IDocument(parent),
1069+ m_project(parent),
1070+ m_fileName(fileName) {
1071+ QTC_CHECK(m_project);
1072+ QTC_CHECK(!fileName.isEmpty());
1073+}
1074+
1075+bool UbuntuProjectFile::save(QString *, const QString &, bool) {
1076+ return false;
1077+}
1078+
1079+void UbuntuProjectFile::rename(const QString &newName) {
1080+ // Can't happen...
1081+ Q_UNUSED(newName);
1082+ Q_ASSERT(false);
1083+}
1084+
1085+QString UbuntuProjectFile::fileName() const {
1086+ return m_fileName;
1087+}
1088+
1089+QString UbuntuProjectFile::defaultPath() const {
1090+ return QString();
1091+}
1092+
1093+QString UbuntuProjectFile::suggestedFileName() const {
1094+ return QString();
1095+}
1096+
1097+QString UbuntuProjectFile::mimeType() const {
1098+ return QLatin1String(Constants::UBUNTUPROJECT_MIMETYPE);
1099+}
1100+
1101+bool UbuntuProjectFile::isModified() const {
1102+ return false;
1103+}
1104+
1105+bool UbuntuProjectFile::isSaveAsAllowed() const {
1106+ return false;
1107+}
1108+
1109+Core::IDocument::ReloadBehavior UbuntuProjectFile::reloadBehavior(ChangeTrigger state, ChangeType type) const {
1110+ Q_UNUSED(state)
1111+ Q_UNUSED(type)
1112+ return BehaviorSilent;
1113+}
1114+
1115+bool UbuntuProjectFile::reload(QString *errorString, ReloadFlag flag, ChangeType) {
1116+ Q_UNUSED(errorString)
1117+ Q_UNUSED(flag)
1118+
1119+ /*if (type == TypeContents)
1120+ m_project->refreshProjectFile();
1121+*/
1122+ return true;
1123+}
1124
1125=== added file 'ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuprojectfile.h'
1126--- ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuprojectfile.h 1970-01-01 00:00:00 +0000
1127+++ ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuprojectfile.h 2013-06-18 02:43:28 +0000
1128@@ -0,0 +1,72 @@
1129+/*
1130+ * Copyright 2013 Canonical Ltd.
1131+ *
1132+ * This program is free software; you can redistribute it and/or modify
1133+ * it under the terms of the GNU Lesser General Public License as published by
1134+ * the Free Software Foundation; version 2.1.
1135+ *
1136+ * This program is distributed in the hope that it will be useful,
1137+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1138+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1139+ * GNU Lesser General Public License for more details.
1140+ *
1141+ * You should have received a copy of the GNU Lesser General Public License
1142+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1143+ *
1144+ * Author: Juhapekka Piiroinen <juhapekka.piiroinen@canonical.com>
1145+ */
1146+
1147+#ifndef UBUNTUPROJECTFILE_H
1148+#define UBUNTUPROJECTFILE_H
1149+
1150+#include <QObject>
1151+#include "ubuntuconstants.h"
1152+#include "ubuntuproject.h"
1153+#include "ubuntuprojectmanager.h"
1154+
1155+#include <coreplugin/idocument.h>
1156+
1157+#include <utils/qtcassert.h>
1158+#include <coreplugin/actionmanager/command.h>
1159+#include <coreplugin/actionmanager/actioncontainer.h>
1160+#include <coreplugin/actionmanager/actionmanager.h>
1161+#include <coreplugin/coreconstants.h>
1162+#include <coreplugin/icontext.h>
1163+#include <coreplugin/mimedatabase.h>
1164+#include <coreplugin/messagemanager.h>
1165+#include <coreplugin/icore.h>
1166+#include <coreplugin/idocument.h>
1167+#include <coreplugin/documentmanager.h>
1168+namespace Ubuntu {
1169+namespace Internal {
1170+class UbuntuProject;
1171+class UbuntuProjectFile : public Core::IDocument
1172+{
1173+ Q_OBJECT
1174+public:
1175+ UbuntuProjectFile(UbuntuProject *parent, QString fileName);
1176+ ~UbuntuProjectFile() {}
1177+
1178+ bool save(QString *errorString, const QString &fileName, bool autoSave);
1179+ QString fileName() const;
1180+ void rename(const QString &newName);
1181+
1182+ QString defaultPath() const;
1183+ QString suggestedFileName() const;
1184+ QString mimeType() const;
1185+
1186+ bool isModified() const;
1187+ bool isSaveAsAllowed() const;
1188+
1189+ ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const;
1190+ bool reload(QString *errorString, ReloadFlag flag, ChangeType);
1191+
1192+private:
1193+ UbuntuProject *m_project;
1194+ QString m_fileName;
1195+
1196+};
1197+}
1198+}
1199+
1200+#endif // UBUNTUPROJECTFILE_H
1201
1202=== added file 'ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuprojectmanager.cpp'
1203--- ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuprojectmanager.cpp 1970-01-01 00:00:00 +0000
1204+++ ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuprojectmanager.cpp 2013-06-18 02:43:28 +0000
1205@@ -0,0 +1,53 @@
1206+/*
1207+ * Copyright 2013 Canonical Ltd.
1208+ *
1209+ * This program is free software; you can redistribute it and/or modify
1210+ * it under the terms of the GNU Lesser General Public License as published by
1211+ * the Free Software Foundation; version 2.1.
1212+ *
1213+ * This program is distributed in the hope that it will be useful,
1214+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1215+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1216+ * GNU Lesser General Public License for more details.
1217+ *
1218+ * You should have received a copy of the GNU Lesser General Public License
1219+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1220+ *
1221+ * Author: Juhapekka Piiroinen <juhapekka.piiroinen@canonical.com>
1222+ */
1223+
1224+#include "ubuntuprojectmanager.h"
1225+
1226+using namespace Ubuntu::Internal;
1227+
1228+
1229+ProjectExplorer::Project* UbuntuProjectManager::openProject(const QString &fileName, QString *errorString) {
1230+ QFileInfo fileInfo(fileName);
1231+ ProjectExplorer::ProjectExplorerPlugin *projectExplorer = ProjectExplorer::ProjectExplorerPlugin::instance();
1232+
1233+ foreach (ProjectExplorer::Project *pi, projectExplorer->session()->projects()) {
1234+ if (fileName == pi->document()->fileName()) {
1235+ if (errorString)
1236+ *errorString = tr("Failed opening project '%1': Project already open") .arg(QDir::toNativeSeparators(fileName));
1237+ return 0;
1238+ }
1239+ }
1240+
1241+ if (fileInfo.isFile())
1242+ return new UbuntuProject(this, fileName);
1243+
1244+ *errorString = tr("Failed opening project '%1': Project file is not a file").arg(QDir::toNativeSeparators(fileName));
1245+ return 0;
1246+}
1247+
1248+void UbuntuProjectManager::registerProject(UbuntuProject *project) {
1249+ m_projects.append(project);
1250+}
1251+
1252+void UbuntuProjectManager::unregisterProject(UbuntuProject *project) {
1253+ m_projects.removeAll(project);
1254+}
1255+
1256+QString UbuntuProjectManager::mimeType() const {
1257+ return QLatin1String(Constants::UBUNTUPROJECT_MIMETYPE);
1258+}
1259
1260=== added file 'ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuprojectmanager.h'
1261--- ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuprojectmanager.h 1970-01-01 00:00:00 +0000
1262+++ ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuprojectmanager.h 2013-06-18 02:43:28 +0000
1263@@ -0,0 +1,71 @@
1264+/*
1265+ * Copyright 2013 Canonical Ltd.
1266+ *
1267+ * This program is free software; you can redistribute it and/or modify
1268+ * it under the terms of the GNU Lesser General Public License as published by
1269+ * the Free Software Foundation; version 2.1.
1270+ *
1271+ * This program is distributed in the hope that it will be useful,
1272+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1273+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1274+ * GNU Lesser General Public License for more details.
1275+ *
1276+ * You should have received a copy of the GNU Lesser General Public License
1277+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1278+ *
1279+ * Author: Juhapekka Piiroinen <juhapekka.piiroinen@canonical.com>
1280+ */
1281+
1282+#ifndef UBUNTUPROJECTMANAGER_H
1283+#define UBUNTUPROJECTMANAGER_H
1284+
1285+#include <QObject>
1286+#include "ubuntuconstants.h"
1287+#include "ubuntuproject.h"
1288+#include <QFileInfo>
1289+#include <coreplugin/actionmanager/command.h>
1290+#include <coreplugin/actionmanager/actioncontainer.h>
1291+#include <coreplugin/actionmanager/actionmanager.h>
1292+#include <coreplugin/coreconstants.h>
1293+#include <coreplugin/icontext.h>
1294+#include <coreplugin/mimedatabase.h>
1295+#include <coreplugin/messagemanager.h>
1296+#include <coreplugin/icore.h>
1297+#include <coreplugin/idocument.h>
1298+#include <coreplugin/documentmanager.h>
1299+#include <projectexplorer/iprojectmanager.h>
1300+#include <projectexplorer/projectexplorerconstants.h>
1301+#include <projectexplorer/projectexplorer.h>
1302+#include <projectexplorer/projectnodes.h>
1303+#include <projectexplorer/project.h>
1304+#include <projectexplorer/kitmanager.h>
1305+#include <projectexplorer/target.h>
1306+#include <projectexplorer/session.h>
1307+#include <projectexplorer/runconfiguration.h>
1308+#include <projectexplorer/applicationlauncher.h>
1309+
1310+namespace Ubuntu {
1311+namespace Internal {
1312+
1313+class UbuntuProject;
1314+class UbuntuProjectManager : public ProjectExplorer::IProjectManager
1315+{
1316+ Q_OBJECT
1317+public:
1318+ UbuntuProjectManager() {}
1319+ virtual QString mimeType() const;
1320+
1321+ ProjectExplorer::Project* openProject(const QString &fileName, QString *errorString);
1322+ void registerProject(UbuntuProject *project);
1323+ void unregisterProject(UbuntuProject *project);
1324+
1325+private:
1326+ QList<UbuntuProject*> m_projects;
1327+
1328+};
1329+
1330+
1331+} // Internal
1332+} // Ubuntu
1333+
1334+#endif // UBUNTUPROJECTMANAGER_H
1335
1336=== added file 'ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuprojectnode.cpp'
1337--- ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuprojectnode.cpp 1970-01-01 00:00:00 +0000
1338+++ ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuprojectnode.cpp 2013-06-18 02:43:28 +0000
1339@@ -0,0 +1,173 @@
1340+/*
1341+ * Copyright 2013 Canonical Ltd.
1342+ *
1343+ * This program is free software; you can redistribute it and/or modify
1344+ * it under the terms of the GNU Lesser General Public License as published by
1345+ * the Free Software Foundation; version 2.1.
1346+ *
1347+ * This program is distributed in the hope that it will be useful,
1348+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1349+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1350+ * GNU Lesser General Public License for more details.
1351+ *
1352+ * You should have received a copy of the GNU Lesser General Public License
1353+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1354+ *
1355+ * Author: Juhapekka Piiroinen <juhapekka.piiroinen@canonical.com>
1356+ */
1357+
1358+#include "ubuntuprojectnode.h"
1359+
1360+using namespace Ubuntu::Internal;
1361+
1362+UbuntuProjectNode::UbuntuProjectNode(UbuntuProject *project, Core::IDocument *projectFile)
1363+ : ProjectExplorer::ProjectNode(QFileInfo(projectFile->fileName()).absoluteFilePath()),
1364+ m_project(project),
1365+ m_projectFile(projectFile) {
1366+ setDisplayName(QFileInfo(projectFile->fileName()).completeBaseName());
1367+ refresh();
1368+}
1369+
1370+Core::IDocument *UbuntuProjectNode::projectFile() const {
1371+ return m_projectFile;
1372+}
1373+
1374+QString UbuntuProjectNode::projectFilePath() const {
1375+ return m_projectFile->fileName();
1376+}
1377+
1378+void UbuntuProjectNode::refresh() {
1379+ using namespace ProjectExplorer;
1380+
1381+ removeFileNodes(fileNodes(), this);
1382+ removeFolderNodes(subFolderNodes(), this);
1383+
1384+ QStringList files = m_project->files(Project::AllFiles);
1385+ files.removeAll(m_project->filesFileName());
1386+
1387+ QHash<QString, QStringList> filesInDirectory;
1388+
1389+ foreach (const QString &fileName, files) {
1390+ QFileInfo fileInfo(fileName);
1391+
1392+ QString absoluteFilePath;
1393+ QString relativeDirectory;
1394+
1395+ if (fileInfo.isAbsolute()) {
1396+ absoluteFilePath = fileInfo.filePath();
1397+ relativeDirectory = m_project->projectDir().relativeFilePath(fileInfo.path());
1398+ } else {
1399+ absoluteFilePath = m_project->projectDir().absoluteFilePath(fileInfo.filePath());
1400+ relativeDirectory = fileInfo.path();
1401+ if (relativeDirectory == QLatin1String("."))
1402+ relativeDirectory.clear();
1403+ }
1404+
1405+ filesInDirectory[relativeDirectory].append(absoluteFilePath);
1406+ }
1407+
1408+ const QHash<QString, QStringList>::ConstIterator cend = filesInDirectory.constEnd();
1409+ for (QHash<QString, QStringList>::ConstIterator it = filesInDirectory.constBegin(); it != cend; ++it) {
1410+ FolderNode *folder = findOrCreateFolderByName(it.key());
1411+
1412+ QList<FileNode *> fileNodes;
1413+ foreach (const QString &file, it.value()) {
1414+ FileType fileType = SourceType; // ### FIXME
1415+ FileNode *fileNode = new FileNode(file, fileType, false);
1416+ fileNodes.append(fileNode);
1417+ }
1418+
1419+ addFileNodes(fileNodes, folder);
1420+ }
1421+
1422+ m_folderByName.clear();
1423+}
1424+
1425+ProjectExplorer::FolderNode *UbuntuProjectNode::findOrCreateFolderByName(const QStringList &components, int end) {
1426+ if (! end)
1427+ return 0;
1428+
1429+ QString baseDir = QFileInfo(path()).path();
1430+
1431+ QString folderName;
1432+ for (int i = 0; i < end; ++i) {
1433+ folderName.append(components.at(i));
1434+ folderName += QLatin1Char('/');
1435+ }
1436+
1437+ const QString component = components.at(end - 1);
1438+
1439+ if (component.isEmpty())
1440+ return this;
1441+
1442+ else if (FolderNode *folder = m_folderByName.value(folderName))
1443+ return folder;
1444+
1445+ FolderNode *folder = new FolderNode(baseDir + QLatin1Char('/') + folderName);
1446+ folder->setDisplayName(component);
1447+
1448+ m_folderByName.insert(folderName, folder);
1449+
1450+ FolderNode *parent = findOrCreateFolderByName(components, end - 1);
1451+ if (! parent)
1452+ parent = this;
1453+
1454+ addFolderNodes(QList<FolderNode*>() << folder, parent);
1455+
1456+ return folder;
1457+}
1458+
1459+ProjectExplorer::FolderNode *UbuntuProjectNode::findOrCreateFolderByName(const QString &filePath) {
1460+ QStringList components = filePath.split(QLatin1Char('/'));
1461+ return findOrCreateFolderByName(components, components.length());
1462+}
1463+
1464+bool UbuntuProjectNode::hasBuildTargets() const {
1465+ return true;
1466+}
1467+
1468+QList<ProjectExplorer::ProjectNode::ProjectAction> UbuntuProjectNode::supportedActions(Node *node) const {
1469+ Q_UNUSED(node);
1470+ QList<ProjectAction> actions;
1471+ actions.append(AddNewFile);
1472+ actions.append(EraseFile);
1473+ actions.append(Rename);
1474+ return actions;
1475+}
1476+
1477+bool UbuntuProjectNode::canAddSubProject(const QString &proFilePath) const {
1478+ Q_UNUSED(proFilePath)
1479+ return false;
1480+}
1481+
1482+bool UbuntuProjectNode::addSubProjects(const QStringList &proFilePaths) {
1483+ Q_UNUSED(proFilePaths)
1484+ return false;
1485+}
1486+
1487+bool UbuntuProjectNode::removeSubProjects(const QStringList &proFilePaths) {
1488+ Q_UNUSED(proFilePaths)
1489+ return false;
1490+}
1491+
1492+bool UbuntuProjectNode::addFiles(const ProjectExplorer::FileType, const QStringList &, QStringList *) {
1493+ //return m_project->addFiles(filePaths);
1494+ return false;
1495+}
1496+
1497+bool UbuntuProjectNode::removeFiles(const ProjectExplorer::FileType, const QStringList &, QStringList *) {
1498+ return false;
1499+}
1500+
1501+bool UbuntuProjectNode::deleteFiles(const ProjectExplorer::FileType, const QStringList &) {
1502+ return true;
1503+}
1504+
1505+bool UbuntuProjectNode::renameFile(const ProjectExplorer::FileType, const QString &, const QString &) {
1506+ return true;
1507+}
1508+
1509+QList<ProjectExplorer::RunConfiguration *> UbuntuProjectNode::runConfigurationsFor(Node *node) {
1510+ Q_UNUSED(node)
1511+ return QList<ProjectExplorer::RunConfiguration *>();
1512+}
1513
1514=== added file 'ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuprojectnode.h'
1515--- ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuprojectnode.h 1970-01-01 00:00:00 +0000
1516+++ ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuprojectnode.h 2013-06-18 02:43:28 +0000
1517@@ -0,0 +1,103 @@
1518+/*
1519+ * Copyright 2013 Canonical Ltd.
1520+ *
1521+ * This program is free software; you can redistribute it and/or modify
1522+ * it under the terms of the GNU Lesser General Public License as published by
1523+ * the Free Software Foundation; version 2.1.
1524+ *
1525+ * This program is distributed in the hope that it will be useful,
1526+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1527+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1528+ * GNU Lesser General Public License for more details.
1529+ *
1530+ * You should have received a copy of the GNU Lesser General Public License
1531+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1532+ *
1533+ * Author: Juhapekka Piiroinen <juhapekka.piiroinen@canonical.com>
1534+ */
1535+
1536+#ifndef UBUNTUPROJECTNODE_H
1537+#define UBUNTUPROJECTNODE_H
1538+
1539+#include <QObject>
1540+
1541+#include "ubuntuproject.h"
1542+#include "ubuntuprojectmanager.h"
1543+
1544+#include <coreplugin/actionmanager/command.h>
1545+#include <coreplugin/actionmanager/actioncontainer.h>
1546+#include <coreplugin/actionmanager/actionmanager.h>
1547+#include <coreplugin/coreconstants.h>
1548+#include <coreplugin/icontext.h>
1549+#include <coreplugin/mimedatabase.h>
1550+#include <coreplugin/messagemanager.h>
1551+#include <coreplugin/icore.h>
1552+#include <coreplugin/idocument.h>
1553+#include <coreplugin/documentmanager.h>
1554+#include <projectexplorer/iprojectmanager.h>
1555+#include <projectexplorer/projectexplorerconstants.h>
1556+#include <projectexplorer/projectexplorer.h>
1557+#include <projectexplorer/projectnodes.h>
1558+#include <projectexplorer/project.h>
1559+#include <projectexplorer/kitmanager.h>
1560+#include <projectexplorer/target.h>
1561+#include <projectexplorer/session.h>
1562+#include <projectexplorer/runconfiguration.h>
1563+#include <projectexplorer/applicationlauncher.h>
1564+
1565+namespace Ubuntu {
1566+namespace Internal {
1567+
1568+class UbuntuProject;
1569+class UbuntuProjectNode : public ProjectExplorer::ProjectNode
1570+{
1571+ Q_OBJECT
1572+
1573+public:
1574+ UbuntuProjectNode(UbuntuProject *project, Core::IDocument *projectFile);
1575+
1576+ Core::IDocument *projectFile() const;
1577+ QString projectFilePath() const;
1578+
1579+ virtual bool hasBuildTargets() const;
1580+
1581+ virtual QList<ProjectExplorer::ProjectNode::ProjectAction> supportedActions(Node *node) const;
1582+
1583+ virtual bool canAddSubProject(const QString &proFilePath) const;
1584+
1585+ virtual bool addSubProjects(const QStringList &proFilePaths);
1586+ virtual bool removeSubProjects(const QStringList &proFilePaths);
1587+
1588+ virtual bool addFiles(const ProjectExplorer::FileType fileType,
1589+ const QStringList &filePaths,
1590+ QStringList *notAdded = 0);
1591+
1592+ virtual bool removeFiles(const ProjectExplorer::FileType fileType,
1593+ const QStringList &filePaths,
1594+ QStringList *notRemoved = 0);
1595+
1596+ virtual bool deleteFiles(const ProjectExplorer::FileType fileType,
1597+ const QStringList &filePaths);
1598+
1599+ virtual bool renameFile(const ProjectExplorer::FileType fileType,
1600+ const QString &filePath,
1601+ const QString &newFilePath);
1602+ virtual QList<ProjectExplorer::RunConfiguration *> runConfigurationsFor(Node *node);
1603+
1604+
1605+ void refresh();
1606+
1607+private:
1608+ FolderNode *findOrCreateFolderByName(const QString &filePath);
1609+ FolderNode *findOrCreateFolderByName(const QStringList &components, int end);
1610+
1611+private:
1612+ UbuntuProject *m_project;
1613+ Core::IDocument *m_projectFile;
1614+ QHash<QString, FolderNode *> m_folderByName;
1615+
1616+};
1617+}
1618+}
1619+
1620+#endif // UBUNTUPROJECTNODE_H
1621
1622=== added file 'ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubunturunconfiguration.cpp'
1623--- ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubunturunconfiguration.cpp 1970-01-01 00:00:00 +0000
1624+++ ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubunturunconfiguration.cpp 2013-06-18 02:43:28 +0000
1625@@ -0,0 +1,9 @@
1626+#include "ubunturunconfiguration.h"
1627+
1628+using namespace Ubuntu::Internal;
1629+
1630+ProjectExplorer::Abi UbuntuRunConfiguration::Qabi() const {
1631+ ProjectExplorer::Abi hostAbi = ProjectExplorer::Abi::hostAbi();
1632+ return ProjectExplorer::Abi(hostAbi.architecture(), hostAbi.os(), hostAbi.osFlavor(),
1633+ ProjectExplorer::Abi::RuntimeQmlFormat, hostAbi.wordWidth());
1634+}
1635
1636=== added file 'ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubunturunconfiguration.h'
1637--- ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubunturunconfiguration.h 1970-01-01 00:00:00 +0000
1638+++ ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubunturunconfiguration.h 2013-06-18 02:43:28 +0000
1639@@ -0,0 +1,56 @@
1640+#ifndef UBUNTURUNCONFIGURATION_H
1641+#define UBUNTURUNCONFIGURATION_H
1642+
1643+#include <QObject>
1644+#include <coreplugin/actionmanager/command.h>
1645+#include <coreplugin/actionmanager/actioncontainer.h>
1646+#include <coreplugin/actionmanager/actionmanager.h>
1647+#include <coreplugin/coreconstants.h>
1648+#include <coreplugin/icontext.h>
1649+#include <coreplugin/mimedatabase.h>
1650+#include <coreplugin/messagemanager.h>
1651+#include <coreplugin/icore.h>
1652+#include <coreplugin/idocument.h>
1653+#include <coreplugin/documentmanager.h>
1654+#include <debugger/debuggerrunner.h>
1655+#include <debugger/debuggerplugin.h>
1656+#include <debugger/debuggerconstants.h>
1657+#include <debugger/debuggerstartparameters.h>
1658+#include <debugger/debuggerruncontrolfactory.h>
1659+#include <extensionsystem/iplugin.h>
1660+#include <projectexplorer/iprojectmanager.h>
1661+#include <projectexplorer/projectexplorerconstants.h>
1662+#include <projectexplorer/projectexplorer.h>
1663+#include <projectexplorer/projectnodes.h>
1664+#include <projectexplorer/project.h>
1665+#include <projectexplorer/kitmanager.h>
1666+#include <projectexplorer/target.h>
1667+#include <projectexplorer/session.h>
1668+#include <projectexplorer/runconfiguration.h>
1669+#include <projectexplorer/applicationlauncher.h>
1670+
1671+
1672+namespace Ubuntu {
1673+namespace Internal {
1674+
1675+class UbuntuRunConfiguration : public ProjectExplorer::RunConfiguration
1676+{
1677+ Q_OBJECT
1678+public:
1679+ UbuntuRunConfiguration(ProjectExplorer::Target *parent, Core::Id id) : ProjectExplorer::RunConfiguration(parent, id) {}
1680+
1681+ QWidget *createConfigurationWidget() {
1682+ return NULL;
1683+ }
1684+
1685+ bool isEnabled() const {
1686+ return true;
1687+ }
1688+
1689+ ProjectExplorer::Abi Qabi() const;
1690+};
1691+
1692+}
1693+}
1694+
1695+#endif // UBUNTURUNCONFIGURATION_H
1696
1697=== added file 'ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubunturunconfigurationfactory.cpp'
1698--- ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubunturunconfigurationfactory.cpp 1970-01-01 00:00:00 +0000
1699+++ ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubunturunconfigurationfactory.cpp 2013-06-18 02:43:28 +0000
1700@@ -0,0 +1,72 @@
1701+#include "ubunturunconfigurationfactory.h"
1702+
1703+using namespace Ubuntu;
1704+using namespace Ubuntu::Internal;
1705+
1706+QList<Core::Id> UbuntuRunConfigurationFactory::availableCreationIds(ProjectExplorer::Target *parent) const {
1707+ if (!canHandle(parent))
1708+ return QList<Core::Id>();
1709+
1710+ QList<Core::Id> list;
1711+ list << Core::Id(Constants::UBUNTUPROJECT_RUNCONTROL_ID);
1712+
1713+ return list;
1714+}
1715+
1716+QString UbuntuRunConfigurationFactory::displayNameForId(const Core::Id id) const {
1717+ if (id == Constants::UBUNTUPROJECT_RUNCONTROL_ID)
1718+ return tr(Constants::UBUNTUPROJECT_DISPLAYNAME);
1719+ return QString();
1720+}
1721+
1722+bool UbuntuRunConfigurationFactory::canCreate(ProjectExplorer::Target *parent,
1723+ const Core::Id id) const {
1724+ if (!canHandle(parent))
1725+ return false;
1726+
1727+ if (id == Constants::UBUNTUPROJECT_RUNCONTROL_ID)
1728+ return true;
1729+
1730+ return false;
1731+}
1732+
1733+ProjectExplorer::RunConfiguration *UbuntuRunConfigurationFactory::create(ProjectExplorer::Target *parent, const Core::Id id) {
1734+ if (!canCreate(parent, id))
1735+ return NULL;
1736+ return new UbuntuRunConfiguration(parent, id);
1737+}
1738+
1739+bool UbuntuRunConfigurationFactory::canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const {
1740+ return parent && canCreate(parent, ProjectExplorer::idFromMap(map));
1741+}
1742+
1743+ProjectExplorer::RunConfiguration *UbuntuRunConfigurationFactory::restore(ProjectExplorer::Target *parent, const QVariantMap &map) {
1744+ if (!canRestore(parent, map))
1745+ return NULL;
1746+
1747+ /* Core::Id id = ProjectExplorer::idFromMap(map);
1748+ QmlProjectRunConfiguration *rc = new QmlProjectRunConfiguration(parent, id);
1749+ if (rc->fromMap(map))
1750+ return rc;
1751+ delete rc;*/
1752+ return NULL;
1753+}
1754+
1755+bool UbuntuRunConfigurationFactory::canClone(ProjectExplorer::Target *, ProjectExplorer::RunConfiguration *) const {
1756+ return NULL;
1757+ // return canCreate(parent, source->id());
1758+}
1759+
1760+ProjectExplorer::RunConfiguration *UbuntuRunConfigurationFactory::clone(ProjectExplorer::Target *parent,
1761+ ProjectExplorer::RunConfiguration *source) {
1762+ if (!canClone(parent, source))
1763+ return NULL;
1764+ // return new ProjectExplorer::RunConfiguration(parent, qobject_cast<ProjectRunConfiguration *>(source));
1765+ return NULL;
1766+}
1767+
1768+bool UbuntuRunConfigurationFactory::canHandle(ProjectExplorer::Target *parent) const {
1769+ if (!qobject_cast<UbuntuProject *>(parent->project()))
1770+ return false;
1771+ return true;
1772+}
1773
1774=== added file 'ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubunturunconfigurationfactory.h'
1775--- ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubunturunconfigurationfactory.h 1970-01-01 00:00:00 +0000
1776+++ ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubunturunconfigurationfactory.h 2013-06-18 02:43:28 +0000
1777@@ -0,0 +1,59 @@
1778+#ifndef UBUNTURUNCONFIGURATIONFACTORY_H
1779+#define UBUNTURUNCONFIGURATIONFACTORY_H
1780+
1781+#include <QtGlobal>
1782+#include <QObject>
1783+#include "ubuntuproject.h"
1784+#include "ubuntuconstants.h"
1785+#include "ubunturunconfiguration.h"
1786+
1787+#include <coreplugin/actionmanager/command.h>
1788+#include <coreplugin/actionmanager/actioncontainer.h>
1789+#include <coreplugin/actionmanager/actionmanager.h>
1790+#include <coreplugin/coreconstants.h>
1791+#include <coreplugin/icontext.h>
1792+#include <coreplugin/mimedatabase.h>
1793+#include <coreplugin/messagemanager.h>
1794+#include <coreplugin/icore.h>
1795+#include <coreplugin/idocument.h>
1796+#include <coreplugin/documentmanager.h>
1797+#include <projectexplorer/iprojectmanager.h>
1798+#include <projectexplorer/projectexplorerconstants.h>
1799+#include <projectexplorer/projectexplorer.h>
1800+#include <projectexplorer/projectnodes.h>
1801+#include <projectexplorer/project.h>
1802+#include <projectexplorer/kitmanager.h>
1803+#include <projectexplorer/target.h>
1804+#include <projectexplorer/session.h>
1805+#include <projectexplorer/runconfiguration.h>
1806+#include <projectexplorer/applicationlauncher.h>
1807+
1808+namespace Ubuntu {
1809+namespace Internal {
1810+
1811+class UbuntuRunConfigurationFactory : public ProjectExplorer::IRunConfigurationFactory
1812+{
1813+ Q_OBJECT
1814+public:
1815+ explicit UbuntuRunConfigurationFactory() {
1816+ setObjectName(QLatin1String("UbuntuRunConfigurationFactory"));
1817+ }
1818+
1819+ QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent) const;
1820+ QString displayNameForId(const Core::Id id) const;
1821+
1822+ bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const;
1823+ ProjectExplorer::RunConfiguration *create(ProjectExplorer::Target *parent, const Core::Id id);
1824+ bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const;
1825+ ProjectExplorer::RunConfiguration *restore(ProjectExplorer::Target *parent, const QVariantMap &map);
1826+ bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source) const;
1827+ ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source);
1828+
1829+private:
1830+ bool canHandle(ProjectExplorer::Target *parent) const;
1831+
1832+};
1833+
1834+}
1835+}
1836+#endif // UBUNTURUNCONFIGURATIONFACTORY_H
1837
1838=== added file 'ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubunturuncontrol.cpp'
1839--- ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubunturuncontrol.cpp 1970-01-01 00:00:00 +0000
1840+++ ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubunturuncontrol.cpp 2013-06-18 02:43:28 +0000
1841@@ -0,0 +1,82 @@
1842+#include "ubunturuncontrol.h"
1843+
1844+using namespace Ubuntu;
1845+using namespace Ubuntu::Internal;
1846+
1847+
1848+UbuntuRunControl::UbuntuRunControl(ProjectExplorer::RunConfiguration *runConfiguration, ProjectExplorer::RunMode mode, bool debug)
1849+ : RunControl(runConfiguration, mode)
1850+{
1851+ Utils::Environment env = Utils::Environment::systemEnvironment();
1852+ /*if (debug) {
1853+ env.appendOrSet(QLatin1String("QTWEBKIT_INSPECTOR_SERVER"),QLatin1String("9222"));
1854+ }*/
1855+ m_applicationLauncher.setEnvironment(env);
1856+ UbuntuProject* ubuntuProject = qobject_cast<UbuntuProject*>(runConfiguration->target()->project());
1857+
1858+ m_applicationLauncher.setWorkingDirectory(ubuntuProject->projectDir().absolutePath());
1859+
1860+ m_executable = QtSupport::QtKitInformation::qtVersion(runConfiguration->target()->kit())->qmlsceneCommand();
1861+ m_commandLineArguments = QString(QLatin1String("%0.qml")).arg(ubuntuProject->displayName());
1862+
1863+ connect(&m_applicationLauncher, SIGNAL(appendMessage(QString,Utils::OutputFormat)),
1864+ this, SLOT(slotAppendMessage(QString,Utils::OutputFormat)));
1865+ connect(&m_applicationLauncher, SIGNAL(processExited(int)),
1866+ this, SLOT(processExited(int)));
1867+ connect(&m_applicationLauncher, SIGNAL(bringToForegroundRequested(qint64)),
1868+ this, SLOT(slotBringApplicationToForeground(qint64)));
1869+ /*if (debug) {
1870+ const char *command = CHROMIUM_COMMAND;
1871+ if (QFile(QLatin1String(GOOGLE_CHROME_PATH)).exists())
1872+ command = GOOGLE_CHROME_PATH;
1873+ m_browser = QSharedPointer<QProcess>(new QProcess());
1874+ m_browser->start(QLatin1String(command), QStringList() << QLatin1String("http://localhost:9222/"));
1875+ }*/
1876+}
1877+
1878+UbuntuRunControl::~UbuntuRunControl() {
1879+ stop();
1880+}
1881+
1882+void UbuntuRunControl::start() {
1883+ qDebug() << __PRETTY_FUNCTION__;
1884+ m_applicationLauncher.start(ProjectExplorer::ApplicationLauncher::Gui, m_executable,
1885+ m_commandLineArguments);
1886+ setApplicationProcessHandle(ProjectExplorer::ProcessHandle(m_applicationLauncher.applicationPID()));
1887+ emit started();
1888+ QString msg = tr("Starting %1 %2\n")
1889+ .arg(QDir::toNativeSeparators(m_executable), m_commandLineArguments);
1890+ appendMessage(msg, Utils::NormalMessageFormat);
1891+}
1892+
1893+ProjectExplorer::RunControl::StopResult UbuntuRunControl::stop() {
1894+ m_applicationLauncher.stop();
1895+ return StoppedSynchronously;
1896+}
1897+
1898+bool UbuntuRunControl::isRunning() const {
1899+ return m_applicationLauncher.isRunning();
1900+}
1901+
1902+QIcon UbuntuRunControl::icon() const {
1903+ return QIcon(QLatin1String(ProjectExplorer::Constants::ICON_RUN_SMALL));
1904+}
1905+
1906+void UbuntuRunControl::slotBringApplicationToForeground(qint64 pid) {
1907+ bringApplicationToForeground(pid);
1908+}
1909+
1910+void UbuntuRunControl::slotAppendMessage(const QString &line, Utils::OutputFormat format) {
1911+ appendMessage(line, format);
1912+}
1913+
1914+void UbuntuRunControl::processExited(int exitCode) {
1915+ QString msg = tr("%1 exited with code %2\n")
1916+ .arg(QDir::toNativeSeparators(m_executable)).arg(exitCode);
1917+ appendMessage(msg, exitCode ? Utils::ErrorMessageFormat : Utils::NormalMessageFormat);
1918+ emit finished();
1919+}
1920+
1921+
1922+
1923+
1924
1925=== added file 'ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubunturuncontrol.h'
1926--- ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubunturuncontrol.h 1970-01-01 00:00:00 +0000
1927+++ ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubunturuncontrol.h 2013-06-18 02:43:28 +0000
1928@@ -0,0 +1,70 @@
1929+#ifndef UBUNTURUNCONTROL_H
1930+#define UBUNTURUNCONTROL_H
1931+
1932+#include <QProcess>
1933+#include <QObject>
1934+#include <QString>
1935+
1936+#include "ubuntuproject.h"
1937+
1938+#include <utils/environment.h>
1939+#include <coreplugin/actionmanager/command.h>
1940+#include <coreplugin/actionmanager/actioncontainer.h>
1941+#include <coreplugin/actionmanager/actionmanager.h>
1942+#include <coreplugin/coreconstants.h>
1943+#include <coreplugin/icontext.h>
1944+#include <coreplugin/mimedatabase.h>
1945+#include <coreplugin/messagemanager.h>
1946+#include <coreplugin/icore.h>
1947+#include <coreplugin/idocument.h>
1948+#include <coreplugin/documentmanager.h>
1949+#include <projectexplorer/iprojectmanager.h>
1950+#include <projectexplorer/projectexplorerconstants.h>
1951+#include <projectexplorer/projectexplorer.h>
1952+#include <projectexplorer/projectnodes.h>
1953+#include <projectexplorer/project.h>
1954+#include <projectexplorer/kitmanager.h>
1955+#include <projectexplorer/target.h>
1956+#include <projectexplorer/session.h>
1957+#include <projectexplorer/runconfiguration.h>
1958+#include <projectexplorer/applicationlauncher.h>
1959+#include <projectexplorer/target.h>
1960+#include <utils/qtcassert.h>
1961+#include <utils/qtcprocess.h>
1962+#include <qtsupport/qtkitinformation.h>
1963+namespace Ubuntu {
1964+namespace Internal {
1965+
1966+class UbuntuRunControl : public ProjectExplorer::RunControl
1967+{
1968+ Q_OBJECT
1969+public:
1970+
1971+ UbuntuRunControl(ProjectExplorer::RunConfiguration *runConfiguration,
1972+ ProjectExplorer::RunMode mode, bool debug = false);
1973+ virtual ~UbuntuRunControl();
1974+
1975+ void start();
1976+ StopResult stop();
1977+ bool isRunning() const;
1978+ QIcon icon() const;
1979+
1980+private slots:
1981+ void processExited(int exitCode);
1982+ void slotBringApplicationToForeground(qint64 pid);
1983+ void slotAppendMessage(const QString &line, Utils::OutputFormat);
1984+
1985+private:
1986+ ProjectExplorer::ApplicationLauncher m_applicationLauncher;
1987+
1988+ QString m_executable;
1989+ QString m_commandLineArguments;
1990+ QSharedPointer<QProcess> m_browser;
1991+
1992+};
1993+
1994+
1995+}
1996+}
1997+
1998+#endif // UBUNTURUNCONTROL_H
1999
2000=== added file 'ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubunturuncontrolfactory.cpp'
2001--- ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubunturuncontrolfactory.cpp 1970-01-01 00:00:00 +0000
2002+++ ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubunturuncontrolfactory.cpp 2013-06-18 02:43:28 +0000
2003@@ -0,0 +1,35 @@
2004+#include "ubunturuncontrolfactory.h"
2005+
2006+using namespace Ubuntu::Internal;
2007+
2008+bool UbuntuRunControlFactory::canRun(ProjectExplorer::RunConfiguration *runConfiguration,
2009+ ProjectExplorer::RunMode mode) const {
2010+ if (!qobject_cast<UbuntuProject*>(runConfiguration->target()->project()))
2011+ return false;
2012+ if (mode == ProjectExplorer::NormalRunMode || mode == ProjectExplorer::DebugRunMode)
2013+ return true;
2014+ return false;
2015+}
2016+
2017+ProjectExplorer::RunControl *UbuntuRunControlFactory::create(ProjectExplorer::RunConfiguration *runConfiguration,
2018+ ProjectExplorer::RunMode mode, QString *) {
2019+ QList<ProjectExplorer::RunControl *> runcontrols =
2020+ ProjectExplorer::ProjectExplorerPlugin::instance()->runControls();
2021+ foreach (ProjectExplorer::RunControl *rc, runcontrols) {
2022+ if (UbuntuRunControl *qrc = qobject_cast<UbuntuRunControl *>(rc)) {
2023+ //TODO: if (qrc->mainQmlFile() == config->mainScript())
2024+ qrc->stop();
2025+ }
2026+ }
2027+
2028+ ProjectExplorer::RunControl *runControl = 0;
2029+ if (mode == ProjectExplorer::NormalRunMode)
2030+ runControl = new UbuntuRunControl(runConfiguration, mode, false);
2031+ else if (mode == ProjectExplorer::DebugRunMode)
2032+ runControl = new UbuntuRunControl(runConfiguration, mode, true);
2033+ return runControl;
2034+}
2035+
2036+QString UbuntuRunControlFactory::displayName() const {
2037+ return tr("Run on Ubuntu Touch Device");
2038+}
2039
2040=== added file 'ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubunturuncontrolfactory.h'
2041--- ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubunturuncontrolfactory.h 1970-01-01 00:00:00 +0000
2042+++ ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubunturuncontrolfactory.h 2013-06-18 02:43:28 +0000
2043@@ -0,0 +1,48 @@
2044+#ifndef UBUNTURUNCONTROLFACTORY_H
2045+#define UBUNTURUNCONTROLFACTORY_H
2046+
2047+#include <QObject>
2048+#include "ubunturuncontrol.h"
2049+#include "ubuntuproject.h"
2050+
2051+#include <coreplugin/actionmanager/command.h>
2052+#include <coreplugin/actionmanager/actioncontainer.h>
2053+#include <coreplugin/actionmanager/actionmanager.h>
2054+#include <coreplugin/coreconstants.h>
2055+#include <coreplugin/icontext.h>
2056+#include <coreplugin/mimedatabase.h>
2057+#include <coreplugin/messagemanager.h>
2058+#include <coreplugin/icore.h>
2059+#include <coreplugin/idocument.h>
2060+#include <coreplugin/documentmanager.h>
2061+#include <projectexplorer/iprojectmanager.h>
2062+#include <projectexplorer/projectexplorerconstants.h>
2063+#include <projectexplorer/projectexplorer.h>
2064+#include <projectexplorer/projectnodes.h>
2065+#include <projectexplorer/project.h>
2066+#include <projectexplorer/kitmanager.h>
2067+#include <projectexplorer/target.h>
2068+#include <projectexplorer/session.h>
2069+#include <projectexplorer/runconfiguration.h>
2070+#include <projectexplorer/applicationlauncher.h>
2071+
2072+namespace Ubuntu {
2073+namespace Internal {
2074+
2075+class UbuntuRunControlFactory : public ProjectExplorer::IRunControlFactory
2076+{
2077+ Q_OBJECT
2078+public:
2079+ explicit UbuntuRunControlFactory() = default;
2080+ virtual ~UbuntuRunControlFactory() {}
2081+
2082+ bool canRun(ProjectExplorer::RunConfiguration *runConfiguration, ProjectExplorer::RunMode mode) const;
2083+ ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration,
2084+ ProjectExplorer::RunMode mode, QString *);
2085+ QString displayName() const;
2086+
2087+};
2088+
2089+}
2090+}
2091+#endif // UBUNTURUNCONTROLFACTORY_H
2092
2093=== modified file 'ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuwelcomemode.h'
2094--- ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuwelcomemode.h 2013-06-03 18:12:08 +0000
2095+++ ubuntu-qtcreator-plugins/src/plugins/ubuntu/ubuntuwelcomemode.h 2013-06-18 02:43:28 +0000
2096@@ -41,7 +41,8 @@
2097 QWidget* m_modeWidget;
2098 };
2099
2100-}
2101-}
2102+
2103+} // Internal
2104+} // Ubuntu
2105
2106 #endif // UBUNTUWELCOMEMODE_H

Subscribers

People subscribed via source and target branches