projectexplorer.cpp 123 KB
Newer Older
hjk's avatar
hjk committed
1
/****************************************************************************
con's avatar
con committed
2
**
3
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
hjk's avatar
hjk committed
4
** Contact: http://www.qt-project.org/legal
con's avatar
con committed
5
**
hjk's avatar
hjk committed
6
** This file is part of Qt Creator.
con's avatar
con committed
7
**
hjk's avatar
hjk committed
8
9
10
11
12
13
14
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia.  For licensing terms and
** conditions see http://qt.digia.com/licensing.  For further information
** use the contact form at http://qt.digia.com/contact-us.
15
**
16
** GNU Lesser General Public License Usage
hjk's avatar
hjk committed
17
18
19
20
21
22
23
24
25
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file.  Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights.  These rights are described in the Digia Qt LGPL Exception
con's avatar
con committed
26
27
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
hjk's avatar
hjk committed
28
****************************************************************************/
hjk's avatar
hjk committed
29

30
#include "projectexplorer.h"
Tobias Hunger's avatar
Tobias Hunger committed
31

Tobias Hunger's avatar
Tobias Hunger committed
32
#include "buildsteplist.h"
33
#include "deployablefile.h"
Tobias Hunger's avatar
Tobias Hunger committed
34
#include "deployconfiguration.h"
35
#include "gcctoolchainfactories.h"
36
#include "project.h"
37
#include "projectexplorersettings.h"
38
#include "projectmacroexpander.h"
39
#include "removetaskhandler.h"
Tobias Hunger's avatar
Tobias Hunger committed
40
41
#include "kitmanager.h"
#include "kitoptionspage.h"
Tobias Hunger's avatar
Tobias Hunger committed
42
#include "target.h"
43
44
#include "toolchainmanager.h"
#include "toolchainoptionspage.h"
45
#include "copytaskhandler.h"
46
#include "showineditortaskhandler.h"
47
#include "vcsannotatetaskhandler.h"
48
#include "localapplicationruncontrol.h"
con's avatar
con committed
49
50
51
52
#include "allprojectsfilter.h"
#include "allprojectsfind.h"
#include "buildmanager.h"
#include "buildsettingspropertiespage.h"
53
#include "currentprojectfind.h"
con's avatar
con committed
54
#include "currentprojectfilter.h"
55
#include "editorsettingspropertiespage.h"
56
#include "codestylesettingspropertiespage.h"
57
#include "dependenciespanel.h"
con's avatar
con committed
58
59
60
#include "foldernavigationwidget.h"
#include "iprojectmanager.h"
#include "nodesvisitor.h"
61
#include "appoutputpane.h"
con's avatar
con committed
62
63
#include "pluginfilefactory.h"
#include "processstep.h"
64
#include "customwizard.h"
Tobias Hunger's avatar
Tobias Hunger committed
65
#include "kitinformation.h"
con's avatar
con committed
66
67
68
69
70
#include "projectfilewizardextension.h"
#include "projecttreewidget.h"
#include "projectwindow.h"
#include "runsettingspropertiespage.h"
#include "session.h"
71
#include "projectnodes.h"
con's avatar
con committed
72
#include "sessiondialog.h"
73
#include "projectexplorersettingspage.h"
74
#include "projectwelcomepage.h"
75
#include "corelistenercheckingforrunningbuild.h"
76
#include "buildconfiguration.h"
77
#include "miniprojecttargetselector.h"
dt's avatar
dt committed
78
#include "taskhub.h"
79
#include "customtoolchain.h"
Tobias Hunger's avatar
Tobias Hunger committed
80
81
82
#include "devicesupport/desktopdevice.h"
#include "devicesupport/desktopdevicefactory.h"
#include "devicesupport/devicemanager.h"
83
#include "devicesupport/devicesettingspage.h"
84
85
#include "publishing/ipublishingwizardfactory.h"
#include "publishing/publishingwizardselectiondialog.h"
con's avatar
con committed
86

87
#ifdef Q_OS_WIN
88
#    include "windebuginterface.h"
89
#    include "msvctoolchain.h"
SteveKing's avatar
SteveKing committed
90
#    include "wincetoolchain.h"
91
92
#endif

93
#include <extensionsystem/pluginspec.h>
94
#include <coreplugin/icore.h>
95
#include <coreplugin/editormanager/ieditor.h>
96
#include <coreplugin/id.h>
con's avatar
con committed
97
#include <coreplugin/coreconstants.h>
98
#include <coreplugin/documentmanager.h>
99
#include <coreplugin/imode.h>
con's avatar
con committed
100
101
#include <coreplugin/mimedatabase.h>
#include <coreplugin/modemanager.h>
102
#include <coreplugin/actionmanager/actionmanager.h>
103
#include <coreplugin/actionmanager/actioncontainer.h>
104
#include <coreplugin/infobar.h>
con's avatar
con committed
105
106
107
108
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/findplaceholder.h>
#include <coreplugin/vcsmanager.h>
#include <coreplugin/iversioncontrol.h>
109
#include <coreplugin/variablemanager.h>
Robert Loehning's avatar
Robert Loehning committed
110
#include <coreplugin/fileutils.h>
111
#include <coreplugin/removefiledialog.h>
hjk's avatar
hjk committed
112
#include <utils/qtcassert.h>
113
#include <utils/parameteraction.h>
con's avatar
con committed
114

115
116
#include <QtPlugin>
#include <QDebug>
117
#include <QFileInfo>
118
#include <QSettings>
Morten Johan Sorvig's avatar
Morten Johan Sorvig committed
119

120
121
122
123
124
#include <QAction>
#include <QApplication>
#include <QFileDialog>
#include <QMenu>
#include <QMessageBox>
125
#include <QTimer>
126
#include <QWizard>
con's avatar
con committed
127

128
129
130
131
132
133
134
135
136
137
138
139
140
141
/*!
    \namespace ProjectExplorer
    ProjectExplorer plugin namespace
*/

/*!
    \namespace ProjectExplorer::Internal
    Internal namespace of the ProjectExplorer plugin
    \internal
*/

/*!
    \class ProjectExplorer::ProjectExplorerPlugin

142
143
    \brief The ProjectExplorerPlugin class contains static accessor and utility
    functions to obtain the current project, open projects, and so on.
144
145
*/

con's avatar
con committed
146
147
namespace {
bool debug = false;
148
const char EXTERNAL_FILE_WARNING[] = "ExternalFile";
con's avatar
con committed
149
150
}

151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
namespace ProjectExplorer {

struct ProjectExplorerPluginPrivate {
    ProjectExplorerPluginPrivate();

    QMenu *m_sessionContextMenu;
    QMenu *m_sessionMenu;
    QMenu *m_projectMenu;
    QMenu *m_subProjectMenu;
    QMenu *m_folderMenu;
    QMenu *m_fileMenu;
    QMenu *m_openWithMenu;

    QMultiMap<int, QObject*> m_actionMap;
    QAction *m_sessionManagerAction;
    QAction *m_newAction;
    QAction *m_loadAction;
168
    Utils::ParameterAction *m_unloadAction;
169
    QAction *m_closeAllProjects;
170
    QAction *m_buildProjectOnlyAction;
171
    Utils::ParameterAction *m_buildAction;
172
    QAction *m_buildActionContextMenu;
173
174
    QAction *m_buildSessionAction;
    QAction *m_rebuildProjectOnlyAction;
175
    Utils::ParameterAction *m_rebuildAction;
176
    QAction *m_rebuildActionContextMenu;
177
178
    QAction *m_rebuildSessionAction;
    QAction *m_cleanProjectOnlyAction;
Tobias Hunger's avatar
Tobias Hunger committed
179
180
    QAction *m_deployProjectOnlyAction;
    Utils::ParameterAction *m_deployAction;
181
    QAction *m_deployActionContextMenu;
Tobias Hunger's avatar
Tobias Hunger committed
182
    QAction *m_deploySessionAction;
183
    Utils::ParameterAction *m_publishAction;
184
    Utils::ParameterAction *m_cleanAction;
185
    QAction *m_cleanActionContextMenu;
186
187
188
    QAction *m_cleanSessionAction;
    QAction *m_runAction;
    QAction *m_runActionContextMenu;
189
    QAction *m_runWithoutDeployAction;
190
191
192
    QAction *m_cancelBuildAction;
    QAction *m_addNewFileAction;
    QAction *m_addExistingFilesAction;
193
    QAction *m_addNewSubprojectAction;
194
    QAction *m_removeFileAction;
195
    QAction *m_removeProjectAction;
196
    QAction *m_deleteFileAction;
197
    QAction *m_renameFileAction;
dt's avatar
dt committed
198
    QAction *m_openFileAction;
199
    QAction *m_projectTreeCollapseAllAction;
200
    QAction *m_searchOnFileSystem;
dt's avatar
dt committed
201
202
    QAction *m_showInGraphicalShell;
    QAction *m_openTerminalHere;
203
    Utils::ParameterAction *m_setStartupProjectAction;
204
    QAction *m_projectSelectorAction;
205
    QAction *m_projectSelectorActionMenu;
Daniel Teske's avatar
Daniel Teske committed
206
    QAction *m_projectSelectorActionQuick;
dt's avatar
dt committed
207
    QAction *m_runSubProject;
208
209
210
211
212
213

    Internal::ProjectWindow *m_proWindow;
    SessionManager *m_session;
    QString m_sessionToRestoreAtStartup;

    Project *m_currentProject;
214
    Core::Context m_lastProjectContext;
215
216
217
218
219
220
    Node *m_currentNode;

    BuildManager *m_buildManager;

    QList<Internal::ProjectFileFactory*> m_fileFactories;
    QStringList m_profileMimeTypes;
221
    Internal::AppOutputPane *m_outputPane;
222
223
224
225
226

    QList<QPair<QString, QString> > m_recentProjects; // pair of filename, displayname
    static const int m_maxRecentProjects = 7;

    QString m_lastOpenDirectory;
Daniel Teske's avatar
Daniel Teske committed
227
    RunConfiguration *m_delayedRunConfiguration;
228
    RunMode m_runMode;
229
    QString m_projectFilterString;
230
    Internal::MiniProjectTargetSelector * m_targetSelector;
231
    Internal::ProjectExplorerSettings m_projectExplorerSettings;
232
    Internal::ProjectWelcomePage *m_welcomePage;
233

234
    Core::IMode *m_projectsMode;
235

236
    TaskHub *m_taskHub;
Tobias Hunger's avatar
Tobias Hunger committed
237
    KitManager *m_kitManager;
Tobias Hunger's avatar
Tobias Hunger committed
238
    ToolChainManager *m_toolChainManager;
239
    bool m_shuttingDown;
240
    bool m_ignoreDocumentManagerChangedFile;
241
    QStringList m_arguments;
242
243
244
245
246
247
};

ProjectExplorerPluginPrivate::ProjectExplorerPluginPrivate() :
    m_currentProject(0),
    m_currentNode(0),
    m_delayedRunConfiguration(0),
248
    m_runMode(NoRunMode),
249
    m_projectsMode(0),
Tobias Hunger's avatar
Tobias Hunger committed
250
    m_kitManager(0),
Tobias Hunger's avatar
Tobias Hunger committed
251
    m_toolChainManager(0),
252
253
    m_shuttingDown(false),
    m_ignoreDocumentManagerChangedFile(false)
254
255
256
{
}

257
258
259
class ProjectsMode : public Core::IMode
{
public:
260
261
262
263
    ProjectsMode(QWidget *proWindow)
    {
        setWidget(proWindow);
        setContext(Core::Context(Constants::C_PROJECTEXPLORER));
264
265
266
        setDisplayName(QCoreApplication::translate("ProjectExplorer::ProjectsMode", "Projects"));
        setIcon(QIcon(QLatin1String(":/fancyactionbar/images/mode_Project.png")));
        setPriority(Constants::P_MODE_SESSION);
267
        setId(Constants::MODE_SESSION);
268
        setContextHelpId(QLatin1String("Managing Projects"));
269
    }
270
271
};

272
273
}  // namespace ProjectExplorer

con's avatar
con committed
274
275
276
277
278
279
280
using namespace ProjectExplorer;
using namespace ProjectExplorer::Internal;


ProjectExplorerPlugin *ProjectExplorerPlugin::m_instance = 0;

ProjectExplorerPlugin::ProjectExplorerPlugin()
281
    : d(new ProjectExplorerPluginPrivate)
con's avatar
con committed
282
283
284
285
286
287
{
    m_instance = this;
}

ProjectExplorerPlugin::~ProjectExplorerPlugin()
{
288
289
    removeObject(d->m_welcomePage);
    delete d->m_welcomePage;
con's avatar
con committed
290
    removeObject(this);
Tobias Hunger's avatar
Tobias Hunger committed
291
    // Force sequence of deletion:
Tobias Hunger's avatar
Tobias Hunger committed
292
    delete d->m_kitManager; // remove all the profile informations
Tobias Hunger's avatar
Tobias Hunger committed
293
294
    delete d->m_toolChainManager;

295
    delete d;
con's avatar
con committed
296
297
298
299
300
301
302
}

ProjectExplorerPlugin *ProjectExplorerPlugin::instance()
{
    return m_instance;
}

303
304
305
306
307
308
bool ProjectExplorerPlugin::parseArguments(const QStringList &arguments, QString * /* error */)
{
    CustomWizard::setVerbose(arguments.count(QLatin1String("-customwizard-verbose")));
    return true;
}

309
bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *error)
con's avatar
con committed
310
{
Friedemann Kleint's avatar
Friedemann Kleint committed
311
    qRegisterMetaType<ProjectExplorer::RunControl *>();
312
    qRegisterMetaType<ProjectExplorer::DeployableFile>("ProjectExplorer::DeployableFile");
Friedemann Kleint's avatar
Friedemann Kleint committed
313

314
315
    if (!parseArguments(arguments, error))
        return false;
dt's avatar
dt committed
316
317
    addObject(this);

318
    // Add ToolChainFactories:
319
#ifdef Q_OS_WIN
320
321
    addAutoReleasedObject(new WinDebugInterface);

322
    addAutoReleasedObject(new Internal::MsvcToolChainFactory);
SteveKing's avatar
SteveKing committed
323
    addAutoReleasedObject(new Internal::WinCEToolChainFactory);
324
325
#else
    addAutoReleasedObject(new Internal::LinuxIccToolChainFactory);
Tobias Hunger's avatar
Tobias Hunger committed
326
327
328
#endif
#ifndef Q_OS_MAC
    addAutoReleasedObject(new Internal::MingwToolChainFactory); // Mingw offers cross-compiling to windows
329
#endif
330
    addAutoReleasedObject(new Internal::GccToolChainFactory);
Tobias Hunger's avatar
Tobias Hunger committed
331
    addAutoReleasedObject(new Internal::ClangToolChainFactory);
332
    addAutoReleasedObject(new Internal::CustomToolChainFactory);
333

Tobias Hunger's avatar
Tobias Hunger committed
334
335
    addAutoReleasedObject(new Internal::DesktopDeviceFactory);

Tobias Hunger's avatar
Tobias Hunger committed
336
    d->m_kitManager = new KitManager; // register before ToolChainManager
Tobias Hunger's avatar
Tobias Hunger committed
337
    d->m_toolChainManager = new ToolChainManager;
338
339
340
341

    // Register KitInformation:
    KitManager::instance()->registerKitInformation(new DeviceTypeKitInformation);
    KitManager::instance()->registerKitInformation(new DeviceKitInformation);
342
    KitManager::instance()->registerKitInformation(new ToolChainKitInformation);
343
344
    KitManager::instance()->registerKitInformation(new SysRootKitInformation);

345
    addAutoReleasedObject(new Internal::ToolChainOptionsPage);
Tobias Hunger's avatar
Tobias Hunger committed
346
    addAutoReleasedObject(new KitOptionsPage);
347

348
349
    d->m_taskHub = new TaskHub;
    addAutoReleasedObject(d->m_taskHub);
350

hjk's avatar
hjk committed
351
    connect(Core::ICore::instance(), SIGNAL(newItemsDialogRequested()), this, SLOT(loadCustomWizards()));
con's avatar
con committed
352

353
    d->m_welcomePage = new ProjectWelcomePage;
354
    connect(d->m_welcomePage, SIGNAL(manageSessions()), this, SLOT(showSessionManager()));
355
    addObject(d->m_welcomePage);
con's avatar
con committed
356

357
    connect(Core::DocumentManager::instance(), SIGNAL(currentFileChanged(QString)),
hjk's avatar
hjk committed
358
            this, SLOT(setCurrentFile(QString)));
con's avatar
con committed
359

360
    d->m_session = new SessionManager(this);
con's avatar
con committed
361

Robert Loehning's avatar
Robert Loehning committed
362
    connect(d->m_session, SIGNAL(projectAdded(ProjectExplorer::Project*)),
con's avatar
con committed
363
            this, SIGNAL(fileListChanged()));
Robert Loehning's avatar
Robert Loehning committed
364
365
366
    connect(d->m_session, SIGNAL(aboutToRemoveProject(ProjectExplorer::Project*)),
            this, SLOT(invalidateProject(ProjectExplorer::Project*)));
    connect(d->m_session, SIGNAL(projectRemoved(ProjectExplorer::Project*)),
con's avatar
con committed
367
            this, SIGNAL(fileListChanged()));
368
369
370
371
    connect(d->m_session, SIGNAL(projectAdded(ProjectExplorer::Project*)),
            this, SLOT(projectAdded(ProjectExplorer::Project*)));
    connect(d->m_session, SIGNAL(projectRemoved(ProjectExplorer::Project*)),
            this, SLOT(projectRemoved(ProjectExplorer::Project*)));
Robert Loehning's avatar
Robert Loehning committed
372
    connect(d->m_session, SIGNAL(startupProjectChanged(ProjectExplorer::Project*)),
con's avatar
con committed
373
            this, SLOT(startupProjectChanged()));
374
375
    connect(d->m_session, SIGNAL(projectDisplayNameChanged(ProjectExplorer::Project*)),
            this, SLOT(projectDisplayNameChanged(ProjectExplorer::Project*)));
376
377
    connect(d->m_session, SIGNAL(dependencyChanged(ProjectExplorer::Project*,ProjectExplorer::Project*)),
            this, SLOT(updateActions()));
378
    connect(d->m_session, SIGNAL(sessionLoaded(QString)),
379
            this, SLOT(updateActions()));
380
    connect(d->m_session, SIGNAL(sessionLoaded(QString)),
381
            this, SLOT(updateWelcomePage()));
con's avatar
con committed
382

383
    d->m_proWindow = new ProjectWindow;
Orgad Shaneh's avatar
Orgad Shaneh committed
384
    addAutoReleasedObject(d->m_proWindow);
con's avatar
con committed
385

386
    Core::Context globalcontext(Core::Constants::C_GLOBAL);
dt's avatar
dt committed
387
    Core::Context projecTreeContext(Constants::C_PROJECT_TREE);
con's avatar
con committed
388

389
    d->m_projectsMode = new ProjectsMode(d->m_proWindow);
390
    d->m_projectsMode->setEnabled(false);
391
    addAutoReleasedObject(d->m_projectsMode);
392
    d->m_proWindow->layout()->addWidget(new Core::FindToolBarPlaceHolder(d->m_proWindow));
con's avatar
con committed
393

394
    addAutoReleasedObject(new CopyTaskHandler);
395
    addAutoReleasedObject(new ShowInEditorTaskHandler);
396
    addAutoReleasedObject(new VcsAnnotateTaskHandler);
397
    addAutoReleasedObject(new RemoveTaskHandler);
398
    addAutoReleasedObject(new CoreListener);
con's avatar
con committed
399

400
    d->m_outputPane = new AppOutputPane;
401
    addAutoReleasedObject(d->m_outputPane);
Robert Loehning's avatar
Robert Loehning committed
402
    connect(d->m_session, SIGNAL(projectRemoved(ProjectExplorer::Project*)),
403
            d->m_outputPane, SLOT(projectRemoved()));
con's avatar
con committed
404

405
406
407
408
409
    connect(d->m_outputPane, SIGNAL(runControlStarted(ProjectExplorer::RunControl*)),
            this, SIGNAL(runControlStarted(ProjectExplorer::RunControl*)));
    connect(d->m_outputPane, SIGNAL(runControlFinished(ProjectExplorer::RunControl*)),
            this, SIGNAL(runControlFinished(ProjectExplorer::RunControl*)));

410
    AllProjectsFilter *allProjectsFilter = new AllProjectsFilter(this);
con's avatar
con committed
411
412
    addAutoReleasedObject(allProjectsFilter);

413
    CurrentProjectFilter *currentProjectFilter = new CurrentProjectFilter(this);
con's avatar
con committed
414
415
416
417
418
    addAutoReleasedObject(currentProjectFilter);

    addAutoReleasedObject(new BuildSettingsPanelFactory);
    addAutoReleasedObject(new RunSettingsPanelFactory);
    addAutoReleasedObject(new EditorSettingsPanelFactory);
419
    addAutoReleasedObject(new CodeStyleSettingsPanelFactory);
420
    addAutoReleasedObject(new DependenciesPanelFactory(d->m_session));
con's avatar
con committed
421
422
423
424

    ProcessStepFactory *processStepFactory = new ProcessStepFactory;
    addAutoReleasedObject(processStepFactory);

425
    AllProjectsFind *allProjectsFind = new AllProjectsFind(this);
con's avatar
con committed
426
427
    addAutoReleasedObject(allProjectsFind);

428
    CurrentProjectFind *currentProjectFind = new CurrentProjectFind(this);
con's avatar
con committed
429
430
    addAutoReleasedObject(currentProjectFind);

431
    addAutoReleasedObject(new LocalApplicationRunControlFactory);
con's avatar
con committed
432

433
    addAutoReleasedObject(new ProjectFileWizardExtension);
con's avatar
con committed
434

435
    // Settings pages
436
    addAutoReleasedObject(new ProjectExplorerSettingsPage);
437
    addAutoReleasedObject(new DeviceSettingsPage);
438

con's avatar
con committed
439
    // context menus
440
    Core::ActionContainer *msessionContextMenu =
Eike Ziller's avatar
Eike Ziller committed
441
        Core::ActionManager::createMenu(Constants::M_SESSIONCONTEXT);
dt's avatar
dt committed
442
    Core::ActionContainer *mprojectContextMenu =
Eike Ziller's avatar
Eike Ziller committed
443
        Core::ActionManager::createMenu(Constants::M_PROJECTCONTEXT);
dt's avatar
dt committed
444
    Core::ActionContainer *msubProjectContextMenu =
Eike Ziller's avatar
Eike Ziller committed
445
        Core::ActionManager::createMenu(Constants::M_SUBPROJECTCONTEXT);
dt's avatar
dt committed
446
    Core::ActionContainer *mfolderContextMenu =
Eike Ziller's avatar
Eike Ziller committed
447
        Core::ActionManager::createMenu(Constants::M_FOLDERCONTEXT);
dt's avatar
dt committed
448
    Core::ActionContainer *mfileContextMenu =
Eike Ziller's avatar
Eike Ziller committed
449
        Core::ActionManager::createMenu(Constants::M_FILECONTEXT);
con's avatar
con committed
450

451
    d->m_sessionContextMenu = msessionContextMenu->menu();
dt's avatar
dt committed
452
453
454
455
    d->m_projectMenu = mprojectContextMenu->menu();
    d->m_subProjectMenu = msubProjectContextMenu->menu();
    d->m_folderMenu = mfolderContextMenu->menu();
    d->m_fileMenu = mfileContextMenu->menu();
con's avatar
con committed
456

457
    Core::ActionContainer *mfile =
Eike Ziller's avatar
Eike Ziller committed
458
        Core::ActionManager::actionContainer(Core::Constants::M_FILE);
459
    Core::ActionContainer *menubar =
Eike Ziller's avatar
Eike Ziller committed
460
        Core::ActionManager::actionContainer(Core::Constants::MENU_BAR);
con's avatar
con committed
461
462

    // build menu
463
    Core::ActionContainer *mbuild =
Eike Ziller's avatar
Eike Ziller committed
464
        Core::ActionManager::createMenu(Constants::M_BUILDPROJECT);
465
    mbuild->menu()->setTitle(tr("&Build"));
con's avatar
con committed
466
467
468
    menubar->addMenu(mbuild, Core::Constants::G_VIEW);

    // debug menu
469
    Core::ActionContainer *mdebug =
Eike Ziller's avatar
Eike Ziller committed
470
        Core::ActionManager::createMenu(Constants::M_DEBUG);
471
    mdebug->menu()->setTitle(tr("&Debug"));
con's avatar
con committed
472
473
    menubar->addMenu(mdebug, Core::Constants::G_VIEW);

474
    Core::ActionContainer *mstartdebugging =
Eike Ziller's avatar
Eike Ziller committed
475
        Core::ActionManager::createMenu(Constants::M_DEBUG_STARTDEBUGGING);
476
477
    mstartdebugging->menu()->setTitle(tr("&Start Debugging"));
    mdebug->addMenu(mstartdebugging, Core::Constants::G_DEFAULT_ONE);
con's avatar
con committed
478
479
480
481
482

    //
    // Groups
    //

483
484
485
486
    mbuild->appendGroup(Constants::G_BUILD_BUILD);
    mbuild->appendGroup(Constants::G_BUILD_DEPLOY);
    mbuild->appendGroup(Constants::G_BUILD_REBUILD);
    mbuild->appendGroup(Constants::G_BUILD_CLEAN);
con's avatar
con committed
487
    mbuild->appendGroup(Constants::G_BUILD_CANCEL);
dt's avatar
dt committed
488
    mbuild->appendGroup(Constants::G_BUILD_RUN);
con's avatar
con committed
489
490

    msessionContextMenu->appendGroup(Constants::G_SESSION_BUILD);
491
    msessionContextMenu->appendGroup(Constants::G_SESSION_REBUILD);
con's avatar
con committed
492
493
    msessionContextMenu->appendGroup(Constants::G_SESSION_FILES);
    msessionContextMenu->appendGroup(Constants::G_SESSION_OTHER);
494
    msessionContextMenu->appendGroup(Constants::G_PROJECT_TREE);
con's avatar
con committed
495

dt's avatar
dt committed
496
497
498
    mprojectContextMenu->appendGroup(Constants::G_PROJECT_FIRST);
    mprojectContextMenu->appendGroup(Constants::G_PROJECT_BUILD);
    mprojectContextMenu->appendGroup(Constants::G_PROJECT_RUN);
499
    mprojectContextMenu->appendGroup(Constants::G_PROJECT_REBUILD);
dt's avatar
dt committed
500
    mprojectContextMenu->appendGroup(Constants::G_PROJECT_FILES);
501
    mprojectContextMenu->appendGroup(Constants::G_PROJECT_LAST);
502
    mprojectContextMenu->appendGroup(Constants::G_PROJECT_TREE);
con's avatar
con committed
503

dt's avatar
dt committed
504
505
    msubProjectContextMenu->appendGroup(Constants::G_PROJECT_FIRST);
    msubProjectContextMenu->appendGroup(Constants::G_PROJECT_BUILD);
dt's avatar
dt committed
506
    msubProjectContextMenu->appendGroup(Constants::G_PROJECT_RUN);
dt's avatar
dt committed
507
    msubProjectContextMenu->appendGroup(Constants::G_PROJECT_FILES);
508
    msubProjectContextMenu->appendGroup(Constants::G_PROJECT_LAST);
509
    msubProjectContextMenu->appendGroup(Constants::G_PROJECT_TREE);
con's avatar
con committed
510

Eike Ziller's avatar
Eike Ziller committed
511
    Core::ActionContainer *runMenu = Core::ActionManager::createMenu(Constants::RUNMENUCONTEXTMENU);
dt's avatar
dt committed
512
    runMenu->setOnAllDisabledBehavior(Core::ActionContainer::Hide);
Friedemann Kleint's avatar
Friedemann Kleint committed
513
    QIcon runIcon = QIcon(QLatin1String(Constants::ICON_RUN));
514
    runIcon.addFile(QLatin1String(Constants::ICON_RUN_SMALL));
dt's avatar
dt committed
515
    runMenu->menu()->setIcon(runIcon);
516
    runMenu->menu()->setTitle(tr("Run"));
dt's avatar
dt committed
517
518
    msubProjectContextMenu->addMenu(runMenu, ProjectExplorer::Constants::G_PROJECT_RUN);

dt's avatar
dt committed
519
520
521
    mfolderContextMenu->appendGroup(Constants::G_FOLDER_FILES);
    mfolderContextMenu->appendGroup(Constants::G_FOLDER_OTHER);
    mfolderContextMenu->appendGroup(Constants::G_FOLDER_CONFIG);
522
    mfolderContextMenu->appendGroup(Constants::G_PROJECT_TREE);
con's avatar
con committed
523

dt's avatar
dt committed
524
525
526
    mfileContextMenu->appendGroup(Constants::G_FILE_OPEN);
    mfileContextMenu->appendGroup(Constants::G_FILE_OTHER);
    mfileContextMenu->appendGroup(Constants::G_FILE_CONFIG);
527
    mfileContextMenu->appendGroup(Constants::G_PROJECT_TREE);
con's avatar
con committed
528
    // "open with" submenu
529
    Core::ActionContainer * const openWith =
Eike Ziller's avatar
Eike Ziller committed
530
            Core::ActionManager::createMenu(ProjectExplorer::Constants::M_OPENFILEWITHCONTEXT);
531
    openWith->setOnAllDisabledBehavior(Core::ActionContainer::Show);
532
533
    d->m_openWithMenu = openWith->menu();
    d->m_openWithMenu->setTitle(tr("Open With"));
con's avatar
con committed
534

Robert Loehning's avatar
Robert Loehning committed
535
    connect(d->m_openWithMenu, SIGNAL(triggered(QAction*)),
536
            Core::DocumentManager::instance(), SLOT(slotExecuteOpenWithMenuAction(QAction*)));
con's avatar
con committed
537
538
539
540
541

    //
    // Separators
    //

con's avatar
con committed
542
    Core::Command *cmd;
con's avatar
con committed
543

544
    msessionContextMenu->addSeparator(projecTreeContext, Constants::G_SESSION_REBUILD);
con's avatar
con committed
545

546
547
548
549
550
551
552
553
554
    msessionContextMenu->addSeparator(projecTreeContext, Constants::G_SESSION_FILES);
    mprojectContextMenu->addSeparator(projecTreeContext, Constants::G_PROJECT_FILES);
    msubProjectContextMenu->addSeparator(projecTreeContext, Constants::G_PROJECT_FILES);
    mfile->addSeparator(globalcontext, Core::Constants::G_FILE_PROJECT);
    mbuild->addSeparator(globalcontext, Constants::G_BUILD_REBUILD);
    msessionContextMenu->addSeparator(globalcontext, Constants::G_SESSION_OTHER);
    mbuild->addSeparator(globalcontext, Constants::G_BUILD_CANCEL);
    mbuild->addSeparator(globalcontext, Constants::G_BUILD_RUN);
    mprojectContextMenu->addSeparator(globalcontext, Constants::G_PROJECT_REBUILD);
con's avatar
con committed
555
556
557
558
559
560

    //
    // Actions
    //

    // new action
561
    d->m_newAction = new QAction(tr("New Project..."), this);
Eike Ziller's avatar
Eike Ziller committed
562
    cmd = Core::ActionManager::registerAction(d->m_newAction, Constants::NEWPROJECT, globalcontext);
con's avatar
con committed
563
564
565
566
    cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+N")));
    msessionContextMenu->addAction(cmd, Constants::G_SESSION_FILES);

    // open action
567
    d->m_loadAction = new QAction(tr("Load Project..."), this);
Eike Ziller's avatar
Eike Ziller committed
568
    cmd = Core::ActionManager::registerAction(d->m_loadAction, Constants::LOAD, globalcontext);
569
#ifndef Q_OS_MAC
con's avatar
con committed
570
    cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+O")));
571
#endif
con's avatar
con committed
572
573
574
    msessionContextMenu->addAction(cmd, Constants::G_SESSION_FILES);

    // Default open action
575
    d->m_openFileAction = new QAction(tr("Open File"), this);
Eike Ziller's avatar
Eike Ziller committed
576
    cmd = Core::ActionManager::registerAction(d->m_openFileAction, ProjectExplorer::Constants::OPENFILE,
dt's avatar
dt committed
577
578
                       projecTreeContext);
    mfileContextMenu->addAction(cmd, Constants::G_FILE_OPEN);
con's avatar
con committed
579

580
    d->m_searchOnFileSystem = new QAction(FolderNavigationWidget::msgFindOnFileSystem(), this);
Eike Ziller's avatar
Eike Ziller committed
581
    cmd = Core::ActionManager::registerAction(d->m_searchOnFileSystem, ProjectExplorer::Constants::SEARCHONFILESYSTEM, projecTreeContext);
582
583
584
585
    mfolderContextMenu->addAction(cmd, Constants::G_FOLDER_CONFIG);
    msubProjectContextMenu->addAction(cmd, Constants::G_PROJECT_LAST);
    mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_LAST);

586
    d->m_showInGraphicalShell = new QAction(Core::FileUtils::msgGraphicalShellAction(), this);
Eike Ziller's avatar
Eike Ziller committed
587
    cmd = Core::ActionManager::registerAction(d->m_showInGraphicalShell, ProjectExplorer::Constants::SHOWINGRAPHICALSHELL,
dt's avatar
dt committed
588
589
590
                       projecTreeContext);
    mfileContextMenu->addAction(cmd, Constants::G_FILE_OPEN);
    mfolderContextMenu->addAction(cmd, Constants::G_FOLDER_FILES);
con's avatar
con committed
591

592
    d->m_openTerminalHere = new QAction(Core::FileUtils::msgTerminalAction(), this);
Eike Ziller's avatar
Eike Ziller committed
593
    cmd = Core::ActionManager::registerAction(d->m_openTerminalHere, ProjectExplorer::Constants::OPENTERMIANLHERE,
dt's avatar
dt committed
594
595
596
                       projecTreeContext);
    mfileContextMenu->addAction(cmd, Constants::G_FILE_OPEN);
    mfolderContextMenu->addAction(cmd, Constants::G_FOLDER_FILES);
597

con's avatar
con committed
598
    // Open With menu
dt's avatar
dt committed
599
    mfileContextMenu->addMenu(openWith, ProjectExplorer::Constants::G_FILE_OPEN);
con's avatar
con committed
600

mae's avatar
mae committed
601
    // recent projects menu
602
    Core::ActionContainer *mrecent =
Eike Ziller's avatar
Eike Ziller committed
603
        Core::ActionManager::createMenu(Constants::M_RECENTPROJECTS);
604
    mrecent->menu()->setTitle(tr("Recent P&rojects"));
605
    mrecent->setOnAllDisabledBehavior(Core::ActionContainer::Show);
mae's avatar
mae committed
606
607
608
609
    mfile->addMenu(mrecent, Core::Constants::G_FILE_OPEN);
    connect(mfile->menu(), SIGNAL(aboutToShow()),
        this, SLOT(updateRecentProjectMenu()));

610
    // session menu
Eike Ziller's avatar
Eike Ziller committed
611
    Core::ActionContainer *msession = Core::ActionManager::createMenu(Constants::M_SESSION);
612
    msession->menu()->setTitle(tr("Sessions"));
613
614
615
616
617
618
619
620
    msession->setOnAllDisabledBehavior(Core::ActionContainer::Show);
    mfile->addMenu(msession, Core::Constants::G_FILE_OPEN);
    d->m_sessionMenu = msession->menu();
    connect(mfile->menu(), SIGNAL(aboutToShow()),
            this, SLOT(updateSessionMenu()));

    // session manager action
    d->m_sessionManagerAction = new QAction(tr("Session Manager..."), this);
Eike Ziller's avatar
Eike Ziller committed
621
    cmd = Core::ActionManager::registerAction(d->m_sessionManagerAction, Constants::NEWSESSION, globalcontext);
622
623
624
625
    mfile->addAction(cmd, Core::Constants::G_FILE_OPEN);
    cmd->setDefaultKeySequence(QKeySequence());


dt's avatar
dt committed
626
    // XXX same action?
con's avatar
con committed
627
    // unload action
628
629
    d->m_unloadAction = new Utils::ParameterAction(tr("Close Project"), tr("Close Project \"%1\""),
                                                      Utils::ParameterAction::EnabledWithParameter, this);
Eike Ziller's avatar
Eike Ziller committed
630
    cmd = Core::ActionManager::registerAction(d->m_unloadAction, Constants::UNLOAD, globalcontext);
con's avatar
con committed
631
    cmd->setAttribute(Core::Command::CA_UpdateText);
632
    cmd->setDescription(d->m_unloadAction->text());
con's avatar
con committed
633
634
635
    mfile->addAction(cmd, Core::Constants::G_FILE_PROJECT);

    // unload session action
636
    d->m_closeAllProjects = new QAction(tr("Close All Projects and Editors"), this);
Eike Ziller's avatar
Eike Ziller committed
637
    cmd = Core::ActionManager::registerAction(d->m_closeAllProjects, Constants::CLEARSESSION, globalcontext);
con's avatar
con committed
638
639
640
641
    mfile->addAction(cmd, Core::Constants::G_FILE_PROJECT);
    msessionContextMenu->addAction(cmd, Constants::G_SESSION_FILES);

    // build session action
Friedemann Kleint's avatar
Friedemann Kleint committed
642
    QIcon buildIcon = QIcon(QLatin1String(Constants::ICON_BUILD));
643
    buildIcon.addFile(QLatin1String(Constants::ICON_BUILD_SMALL));
644
    d->m_buildSessionAction = new QAction(buildIcon, tr("Build All"), this);
Eike Ziller's avatar
Eike Ziller committed
645
    cmd = Core::ActionManager::registerAction(d->m_buildSessionAction, Constants::BUILDSESSION, globalcontext);
con's avatar
con committed
646
    cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+B")));
647
648
649
650
651
    mbuild->addAction(cmd, Constants::G_BUILD_BUILD);
    msessionContextMenu->addAction(cmd, Constants::G_SESSION_BUILD);

    // deploy session
    d->m_deploySessionAction = new QAction(tr("Deploy All"), this);
Eike Ziller's avatar
Eike Ziller committed
652
    cmd = Core::ActionManager::registerAction(d->m_deploySessionAction, Constants::DEPLOYSESSION, globalcontext);
653
    mbuild->addAction(cmd, Constants::G_BUILD_DEPLOY);
con's avatar
con committed
654
655
656
    msessionContextMenu->addAction(cmd, Constants::G_SESSION_BUILD);

    // rebuild session action
Friedemann Kleint's avatar
Friedemann Kleint committed
657
    QIcon rebuildIcon = QIcon(QLatin1String(Constants::ICON_REBUILD));
658
    rebuildIcon.addFile(QLatin1String(Constants::ICON_REBUILD_SMALL));
659
    d->m_rebuildSessionAction = new QAction(rebuildIcon, tr("Rebuild All"), this);
Eike Ziller's avatar
Eike Ziller committed
660
    cmd = Core::ActionManager::registerAction(d->m_rebuildSessionAction, Constants::REBUILDSESSION, globalcontext);
661
662
    mbuild->addAction(cmd, Constants::G_BUILD_REBUILD);
    msessionContextMenu->addAction(cmd, Constants::G_SESSION_REBUILD);
Tobias Hunger's avatar
Tobias Hunger committed
663

con's avatar
con committed
664
    // clean session
Friedemann Kleint's avatar
Friedemann Kleint committed
665
    QIcon cleanIcon = QIcon(QLatin1String(Constants::ICON_CLEAN));
666
    cleanIcon.addFile(QLatin1String(Constants::ICON_CLEAN_SMALL));
667
    d->m_cleanSessionAction = new QAction(cleanIcon, tr("Clean All"), this);
Eike Ziller's avatar
Eike Ziller committed
668
    cmd = Core::ActionManager::registerAction(d->m_cleanSessionAction, Constants::CLEANSESSION, globalcontext);
669
670
    mbuild->addAction(cmd, Constants::G_BUILD_CLEAN);
    msessionContextMenu->addAction(cmd, Constants::G_SESSION_REBUILD);
con's avatar
con committed
671
672

    // build action
673
    d->m_buildAction = new Utils::ParameterAction(tr("Build Project"), tr("Build Project \"%1\""),
674
                                                     Utils::ParameterAction::AlwaysEnabled, this);
dt's avatar
dt committed
675
    d->m_buildAction->setIcon(buildIcon);
Eike Ziller's avatar
Eike Ziller committed
676
    cmd = Core::ActionManager::registerAction(d->m_buildAction, Constants::BUILD, globalcontext);
677
    cmd->setAttribute(Core::Command::CA_UpdateText);
678
    cmd->setDescription(d->m_buildAction->text());
con's avatar
con committed
679
    cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+B")));
680
    mbuild->addAction(cmd, Constants::G_BUILD_BUILD);
con's avatar
con committed
681

682
    // Add to mode bar
683
    Core::ModeManager::addAction(cmd->action(), Constants::P_ACTION_BUILDPROJECT);
684

685
686
687
    // deploy action
    d->m_deployAction = new Utils::ParameterAction(tr("Deploy Project"), tr("Deploy Project \"%1\""),
                                                     Utils::ParameterAction::AlwaysEnabled, this);
Eike Ziller's avatar
Eike Ziller committed
688
    cmd = Core::ActionManager::registerAction(d->m_deployAction, Constants::DEPLOY, globalcontext);
689
690
691
692
    cmd->setAttribute(Core::Command::CA_UpdateText);
    cmd->setDescription(d->m_deployAction->text());
    mbuild->addAction(cmd, Constants::G_BUILD_DEPLOY);

con's avatar
con committed
693
    // rebuild action
694
    d->m_rebuildAction = new Utils::ParameterAction(tr("Rebuild Project"), tr("Rebuild Project \"%1\""),
695
                                                       Utils::ParameterAction::AlwaysEnabled, this);
Eike Ziller's avatar
Eike Ziller committed
696
    cmd = Core::ActionManager::registerAction(d->m_rebuildAction, Constants::REBUILD, globalcontext);
697
    cmd->setAttribute(Core::Command::CA_UpdateText);
698
    cmd->setDescription(d->m_rebuildAction->text());
699
    mbuild->addAction(cmd, Constants::G_BUILD_REBUILD);
con's avatar
con committed
700

701
702
    // clean action
    d->m_cleanAction = new Utils::ParameterAction(tr("Clean Project"), tr("Clean Project \"%1\""),
Tobias Hunger's avatar
Tobias Hunger committed
703
                                                     Utils::ParameterAction::AlwaysEnabled, this);
Eike Ziller's avatar
Eike Ziller committed
704
    cmd = Core::ActionManager::registerAction(d->m_cleanAction, Constants::CLEAN, globalcontext);
Tobias Hunger's avatar
Tobias Hunger committed
705
    cmd->setAttribute(Core::Command::CA_UpdateText);
706
707
708
709
710
711
712
    cmd->setDescription(d->m_cleanAction->text());
    mbuild->addAction(cmd, Constants::G_BUILD_CLEAN);

    // cancel build action
    QIcon stopIcon = QIcon(QLatin1String(Constants::ICON_STOP));
    stopIcon.addFile(QLatin1String(Constants::ICON_STOP_SMALL));
    d->m_cancelBuildAction = new QAction(stopIcon, tr("Cancel Build"), this);
Eike Ziller's avatar
Eike Ziller committed
713
    cmd = Core::ActionManager::registerAction(d->m_cancelBuildAction, Constants::CANCELBUILD, globalcontext);
714
715
716
717
    mbuild->addAction(cmd, Constants::G_BUILD_CANCEL);

    // run action
    d->m_runAction = new QAction(runIcon, tr("Run"), this);
Eike Ziller's avatar
Eike Ziller committed
718
    cmd = Core::ActionManager::registerAction(d->m_runAction, Constants::RUN, globalcontext);
719
720
721
722
723
724
725
726
727
    cmd->setAttribute(Core::Command::CA_UpdateText);

    cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+R")));
    mbuild->addAction(cmd, Constants::G_BUILD_RUN);

    Core::ModeManager::addAction(cmd->action(), Constants::P_ACTION_RUN);

    // Run without deployment action
    d->m_runWithoutDeployAction = new QAction(tr("Run Without Deployment"), this);
Eike Ziller's avatar
Eike Ziller committed
728
    cmd = Core::ActionManager::registerAction(d->m_runWithoutDeployAction, Constants::RUNWITHOUTDEPLOY, globalcontext);
729
    mbuild->addAction(cmd, Constants::G_BUILD_RUN);
Tobias Hunger's avatar
Tobias Hunger committed
730

731
732
733
    // Publish action
    d->m_publishAction = new Utils::ParameterAction(tr("Publish Project..."), tr("Publish Project \"%1\"..."),
                                                    Utils::ParameterAction::AlwaysEnabled, this);
Eike Ziller's avatar
Eike Ziller committed
734
    cmd = Core::ActionManager::registerAction(d->m_publishAction, Constants::PUBLISH, globalcontext);
735
    cmd->setAttribute(Core::Command::CA_UpdateText);
736
    cmd->setDescription(d->m_publishAction->text());
737
    mbuild->addAction(cmd, Constants::G_BUILD_RUN);
738
739

    // build action (context menu)
740
    d->m_buildActionContextMenu = new QAction(tr("Build"), this);
Eike Ziller's avatar
Eike Ziller committed
741
    cmd = Core::ActionManager::registerAction(d->m_buildActionContextMenu, Constants::BUILDCM, projecTreeContext);
742
    cmd->setAttribute(Core::Command::CA_UpdateText);
dt's avatar
dt committed
743
    mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_BUILD);
744
745

    // rebuild action (context menu)
746
    d->m_rebuildActionContextMenu = new QAction(tr("Rebuild"), this);
Eike Ziller's avatar
Eike Ziller committed
747
    cmd = Core::ActionManager::registerAction(d->m_rebuildActionContextMenu, Constants::REBUILDCM, projecTreeContext);
748
    cmd->setAttribute(Core::Command::CA_UpdateText);
749
    mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_REBUILD);
Tobias Hunger's avatar
Tobias Hunger committed
750

751
    // clean action (context menu)
752
    d->m_cleanActionContextMenu = new QAction(tr("Clean"), this);
Eike Ziller's avatar
Eike Ziller committed
753
    cmd = Core::ActionManager::registerAction(d->m_cleanActionContextMenu, Constants::CLEANCM, projecTreeContext);
754
    cmd->setAttribute(Core::Command::CA_UpdateText);
755
    mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_REBUILD);
con's avatar
con committed
756

757
    // build without dependencies action
758
    d->m_buildProjectOnlyAction = new QAction(tr("Build Without Dependencies"), this);
Eike Ziller's avatar
Eike Ziller committed
759
    cmd = Core::ActionManager::registerAction(d->m_buildProjectOnlyAction, Constants::BUILDPROJECTONLY, globalcontext);
760

761
    // rebuild without dependencies action
762
    d->m_rebuildProjectOnlyAction = new QAction(tr("Rebuild Without Dependencies"), this);
Eike Ziller's avatar
Eike Ziller committed
763
    cmd = Core::ActionManager::registerAction(d->m_rebuildProjectOnlyAction, Constants::REBUILDPROJECTONLY, globalcontext);
764

Tobias Hunger's avatar
Tobias Hunger committed
765
766
    // deploy without dependencies action
    d->m_deployProjectOnlyAction = new QAction(tr("Deploy Without Dependencies"), this);
Eike Ziller's avatar
Eike Ziller committed
767
    cmd = Core::ActionManager::registerAction(d->m_deployProjectOnlyAction, Constants::DEPLOYPROJECTONLY, globalcontext);
Tobias Hunger's avatar
Tobias Hunger committed
768

769
    // clean without dependencies action
770
    d->m_cleanProjectOnlyAction = new QAction(tr("Clean Without Dependencies"), this);
Eike Ziller's avatar
Eike Ziller committed
771
    cmd = Core::ActionManager::registerAction(d->m_cleanProjectOnlyAction, Constants::CLEANPROJECTONLY, globalcontext);
772

773
774
    // deploy action (context menu)
    d->m_deployActionContextMenu = new QAction(tr("Deploy"), this);
Eike Ziller's avatar
Eike Ziller committed
775
    cmd = Core::ActionManager::registerAction(d->m_deployActionContextMenu, Constants::DEPLOYCM, projecTreeContext);
776
    mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_RUN);
con's avatar
con committed
777

778
    d->m_runActionContextMenu = new QAction(runIcon, tr("Run"), this);
Eike Ziller's avatar
Eike Ziller committed
779
    cmd = Core::ActionManager::registerAction(d->m_runActionContextMenu, Constants::RUNCONTEXTMENU, projecTreeContext);
dt's avatar
dt committed
780
    mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_RUN);
dt's avatar
dt committed
781
    msubProjectContextMenu->addAction(cmd, Constants::G_PROJECT_RUN);
782

con's avatar
con committed
783
    // add new file action
784
    d->m_addNewFileAction = new QAction(tr("Add New..."), this);
Eike Ziller's avatar
Eike Ziller committed
785
    cmd = Core::ActionManager::registerAction(d->m_addNewFileAction, ProjectExplorer::Constants::ADDNEWFILE,
dt's avatar
dt committed
786
787
788