projectexplorer.cpp 118 KB
Newer Older
hjk's avatar
hjk committed
1
/****************************************************************************
con's avatar
con committed
2
**
hjk's avatar
hjk committed
3
4
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** 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"
Tobias Hunger's avatar
Tobias Hunger committed
38
39
#include "kitmanager.h"
#include "kitoptionspage.h"
Tobias Hunger's avatar
Tobias Hunger committed
40
41
#include "target.h"
#include "targetsettingspanel.h"
42
43
#include "toolchainmanager.h"
#include "toolchainoptionspage.h"
44
#include "copytaskhandler.h"
45
#include "showineditortaskhandler.h"
46
#include "vcsannotatetaskhandler.h"
47
#include "localapplicationruncontrol.h"
con's avatar
con committed
48
49
50
51
#include "allprojectsfilter.h"
#include "allprojectsfind.h"
#include "buildmanager.h"
#include "buildsettingspropertiespage.h"
52
#include "currentprojectfind.h"
con's avatar
con committed
53
#include "currentprojectfilter.h"
54
#include "editorsettingspropertiespage.h"
55
#include "codestylesettingspropertiespage.h"
56
#include "dependenciespanel.h"
con's avatar
con committed
57
58
59
60
#include "foldernavigationwidget.h"
#include "iprojectmanager.h"
#include "metatypedeclarations.h"
#include "nodesvisitor.h"
61
#include "appoutputpane.h"
con's avatar
con committed
62
63
64
#include "pluginfilefactory.h"
#include "processstep.h"
#include "projectexplorerconstants.h"
65
#include "customwizard.h"
Tobias Hunger's avatar
Tobias Hunger committed
66
#include "kitinformation.h"
con's avatar
con committed
67
68
69
70
71
#include "projectfilewizardextension.h"
#include "projecttreewidget.h"
#include "projectwindow.h"
#include "runsettingspropertiespage.h"
#include "session.h"
72
#include "projectnodes.h"
con's avatar
con committed
73
#include "sessiondialog.h"
Tobias Hunger's avatar
Tobias Hunger committed
74
#include "target.h"
75
#include "projectexplorersettingspage.h"
76
#include "projectwelcomepage.h"
77
#include "corelistenercheckingforrunningbuild.h"
78
#include "buildconfiguration.h"
79
#include "miniprojecttargetselector.h"
dt's avatar
dt committed
80
#include "taskhub.h"
Tobias Hunger's avatar
Tobias Hunger committed
81
82
83
#include "devicesupport/desktopdevice.h"
#include "devicesupport/desktopdevicefactory.h"
#include "devicesupport/devicemanager.h"
84
#include "devicesupport/devicesettingspage.h"
85
86
#include "publishing/ipublishingwizardfactory.h"
#include "publishing/publishingwizardselectiondialog.h"
con's avatar
con committed
87

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

94
#include <extensionsystem/pluginspec.h>
con's avatar
con committed
95
#include <coreplugin/coreconstants.h>
96
#include <coreplugin/documentmanager.h>
97
#include <coreplugin/icore.h>
98
#include <coreplugin/imode.h>
con's avatar
con committed
99
100
#include <coreplugin/mimedatabase.h>
#include <coreplugin/modemanager.h>
101
#include <coreplugin/actionmanager/actionmanager.h>
102
103
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/command.h>
104
#include <coreplugin/id.h>
con's avatar
con committed
105
106
107
108
109
110
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/editormanager/ieditor.h>
#include <coreplugin/findplaceholder.h>
#include <coreplugin/basefilewizard.h>
#include <coreplugin/vcsmanager.h>
#include <coreplugin/iversioncontrol.h>
111
#include <coreplugin/variablemanager.h>
Robert Loehning's avatar
Robert Loehning committed
112
#include <coreplugin/fileutils.h>
113
#include <coreplugin/removefiledialog.h>
114
#include <extensionsystem/pluginmanager.h>
115
#include <find/searchresultwindow.h>
116
#include <utils/consoleprocess.h>
hjk's avatar
hjk committed
117
#include <utils/qtcassert.h>
118
#include <utils/parameteraction.h>
119
#include <utils/stringutils.h>
Jarek Kobus's avatar
Jarek Kobus committed
120
#include <utils/persistentsettings.h>
con's avatar
con committed
121

122
123
124
#include <QtPlugin>
#include <QDateTime>
#include <QDebug>
125
#include <QFileInfo>
126
#include <QSettings>
Morten Johan Sorvig's avatar
Morten Johan Sorvig committed
127

128
129
130
131
132
133
#include <QAction>
#include <QApplication>
#include <QFileDialog>
#include <QMenu>
#include <QMessageBox>
#include <QWizard>
con's avatar
con committed
134

135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
/*!
    \namespace ProjectExplorer
    ProjectExplorer plugin namespace
*/

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

/*!
    \class ProjectExplorer::ProjectExplorerPlugin

    \brief ProjectExplorerPlugin with static accessor and utility functions to obtain
    current project, open projects, etc.
*/

con's avatar
con committed
153
154
155
156
namespace {
bool debug = false;
}

157
158
static const char kCurrentProjectPath[] = "CurrentProject:Path";
static const char kCurrentProjectFilePath[] = "CurrentProject:FilePath";
159
static const char kCurrentProjectBuildPath[] = "CurrentProject:BuildPath";
con's avatar
con committed
160

161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
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;
178
    Utils::ParameterAction *m_unloadAction;
179
    QAction *m_closeAllProjects;
180
    QAction *m_buildProjectOnlyAction;
181
    Utils::ParameterAction *m_buildAction;
182
    QAction *m_buildActionContextMenu;
183
184
    QAction *m_buildSessionAction;
    QAction *m_rebuildProjectOnlyAction;
185
    Utils::ParameterAction *m_rebuildAction;
186
    QAction *m_rebuildActionContextMenu;
187
188
    QAction *m_rebuildSessionAction;
    QAction *m_cleanProjectOnlyAction;
Tobias Hunger's avatar
Tobias Hunger committed
189
190
    QAction *m_deployProjectOnlyAction;
    Utils::ParameterAction *m_deployAction;
191
    QAction *m_deployActionContextMenu;
Tobias Hunger's avatar
Tobias Hunger committed
192
    QAction *m_deploySessionAction;
193
    Utils::ParameterAction *m_publishAction;
194
    Utils::ParameterAction *m_cleanAction;
195
    QAction *m_cleanActionContextMenu;
196
197
198
    QAction *m_cleanSessionAction;
    QAction *m_runAction;
    QAction *m_runActionContextMenu;
199
    QAction *m_runWithoutDeployAction;
200
201
202
    QAction *m_cancelBuildAction;
    QAction *m_addNewFileAction;
    QAction *m_addExistingFilesAction;
203
    QAction *m_addNewSubprojectAction;
204
    QAction *m_removeFileAction;
205
    QAction *m_removeProjectAction;
206
    QAction *m_deleteFileAction;
207
    QAction *m_renameFileAction;
dt's avatar
dt committed
208
    QAction *m_openFileAction;
209
    QAction *m_projectTreeCollapseAllAction;
210
    QAction *m_searchOnFileSystem;
dt's avatar
dt committed
211
212
    QAction *m_showInGraphicalShell;
    QAction *m_openTerminalHere;
213
    Utils::ParameterAction *m_setStartupProjectAction;
214
    QAction *m_projectSelectorAction;
215
    QAction *m_projectSelectorActionMenu;
Daniel Teske's avatar
Daniel Teske committed
216
    QAction *m_projectSelectorActionQuick;
dt's avatar
dt committed
217
    QAction *m_runSubProject;
218
219
220
221
222
223
224
225
226
227
228
229

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

    Project *m_currentProject;
    Node *m_currentNode;

    BuildManager *m_buildManager;

    QList<Internal::ProjectFileFactory*> m_fileFactories;
    QStringList m_profileMimeTypes;
230
    Internal::AppOutputPane *m_outputPane;
231
232
233
234
235

    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
236
    RunConfiguration *m_delayedRunConfiguration;
237
    RunMode m_runMode;
238
    QString m_projectFilterString;
239
    Internal::MiniProjectTargetSelector * m_targetSelector;
240
    Internal::ProjectExplorerSettings m_projectExplorerSettings;
241
    Internal::ProjectWelcomePage *m_welcomePage;
242

243
    Core::IMode *m_projectsMode;
244

245
    TaskHub *m_taskHub;
Tobias Hunger's avatar
Tobias Hunger committed
246
    KitManager *m_kitManager;
Tobias Hunger's avatar
Tobias Hunger committed
247
    ToolChainManager *m_toolChainManager;
248
    bool m_shuttingDown;
249
250
251
252
253
254
};

ProjectExplorerPluginPrivate::ProjectExplorerPluginPrivate() :
    m_currentProject(0),
    m_currentNode(0),
    m_delayedRunConfiguration(0),
255
    m_runMode(NoRunMode),
256
    m_projectsMode(0),
Tobias Hunger's avatar
Tobias Hunger committed
257
    m_kitManager(0),
Tobias Hunger's avatar
Tobias Hunger committed
258
    m_toolChainManager(0),
259
    m_shuttingDown(false)
260
261
262
{
}

263
264
265
class ProjectsMode : public Core::IMode
{
public:
266
267
268
269
    ProjectsMode(QWidget *proWindow)
    {
        setWidget(proWindow);
        setContext(Core::Context(Constants::C_PROJECTEXPLORER));
270
271
272
        setDisplayName(QCoreApplication::translate("ProjectExplorer::ProjectsMode", "Projects"));
        setIcon(QIcon(QLatin1String(":/fancyactionbar/images/mode_Project.png")));
        setPriority(Constants::P_MODE_SESSION);
273
274
        setId(Constants::MODE_SESSION);
        setType(Core::Id());
275
        setContextHelpId(QLatin1String("Managing Projects"));
276
    }
277
278
};

279
280
}  // namespace ProjectExplorer

con's avatar
con committed
281
282
283
284
285
286
287
using namespace ProjectExplorer;
using namespace ProjectExplorer::Internal;


ProjectExplorerPlugin *ProjectExplorerPlugin::m_instance = 0;

ProjectExplorerPlugin::ProjectExplorerPlugin()
288
    : d(new ProjectExplorerPluginPrivate)
con's avatar
con committed
289
290
291
292
293
294
{
    m_instance = this;
}

ProjectExplorerPlugin::~ProjectExplorerPlugin()
{
295
296
    removeObject(d->m_welcomePage);
    delete d->m_welcomePage;
con's avatar
con committed
297
    removeObject(this);
Tobias Hunger's avatar
Tobias Hunger committed
298
    // Force sequence of deletion:
Tobias Hunger's avatar
Tobias Hunger committed
299
    delete d->m_kitManager; // remove all the profile informations
Tobias Hunger's avatar
Tobias Hunger committed
300
301
    delete d->m_toolChainManager;

302
    delete d;
con's avatar
con committed
303
304
305
306
307
308
309
}

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

310
311
312
313
314
315
bool ProjectExplorerPlugin::parseArguments(const QStringList &arguments, QString * /* error */)
{
    CustomWizard::setVerbose(arguments.count(QLatin1String("-customwizard-verbose")));
    return true;
}

316
bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *error)
con's avatar
con committed
317
{
Friedemann Kleint's avatar
Friedemann Kleint committed
318
    qRegisterMetaType<ProjectExplorer::RunControl *>();
319
    qRegisterMetaType<ProjectExplorer::DeployableFile>("ProjectExplorer::DeployableFile");
Friedemann Kleint's avatar
Friedemann Kleint committed
320

321
322
    if (!parseArguments(arguments, error))
        return false;
dt's avatar
dt committed
323
324
    addObject(this);

325
    // Add ToolChainFactories:
326
#ifdef Q_OS_WIN
327
328
    addAutoReleasedObject(new WinDebugInterface);

329
    addAutoReleasedObject(new Internal::MsvcToolChainFactory);
SteveKing's avatar
SteveKing committed
330
    addAutoReleasedObject(new Internal::WinCEToolChainFactory);
331
332
#else
    addAutoReleasedObject(new Internal::LinuxIccToolChainFactory);
Tobias Hunger's avatar
Tobias Hunger committed
333
334
335
#endif
#ifndef Q_OS_MAC
    addAutoReleasedObject(new Internal::MingwToolChainFactory); // Mingw offers cross-compiling to windows
336
#endif
337
    addAutoReleasedObject(new Internal::GccToolChainFactory);
Tobias Hunger's avatar
Tobias Hunger committed
338
    addAutoReleasedObject(new Internal::ClangToolChainFactory);
339

Tobias Hunger's avatar
Tobias Hunger committed
340
341
    addAutoReleasedObject(new Internal::DesktopDeviceFactory);

Tobias Hunger's avatar
Tobias Hunger committed
342
    d->m_kitManager = new KitManager; // register before ToolChainManager
Tobias Hunger's avatar
Tobias Hunger committed
343
    d->m_toolChainManager = new ToolChainManager;
344
    addAutoReleasedObject(new Internal::ToolChainOptionsPage);
Tobias Hunger's avatar
Tobias Hunger committed
345
    addAutoReleasedObject(new KitOptionsPage);
346

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

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

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

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

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

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

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

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

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

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

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

403
404
405
406
407
    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*)));

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

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

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

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

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

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

429
    addAutoReleasedObject(new LocalApplicationRunControlFactory);
con's avatar
con committed
430

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

433
    // Settings pages
434
    addAutoReleasedObject(new ProjectExplorerSettingsPage);
435
    addAutoReleasedObject(new DeviceSettingsPage);
436

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

449
    d->m_sessionContextMenu = msessionContextMenu->menu();
dt's avatar
dt committed
450
451
452
453
    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
454

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

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

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

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

    //
    // Groups
    //

481
482
483
484
    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
485
    mbuild->appendGroup(Constants::G_BUILD_CANCEL);
dt's avatar
dt committed
486
    mbuild->appendGroup(Constants::G_BUILD_RUN);
con's avatar
con committed
487
488

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

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

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

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

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

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

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

    //
    // Separators
    //

con's avatar
con committed
540
    Core::Command *cmd;
con's avatar
con committed
541

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

544
545
546
547
548
549
550
551
552
    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
553
554
555
556
557
558

    //
    // Actions
    //

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

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

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

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

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

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

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

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

608
    // session menu
Eike Ziller's avatar
Eike Ziller committed
609
    Core::ActionContainer *msession = Core::ActionManager::createMenu(Constants::M_SESSION);
610
    msession->menu()->setTitle(tr("Sessions"));
611
612
613
614
615
616
617
618
    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
619
    cmd = Core::ActionManager::registerAction(d->m_sessionManagerAction, Constants::NEWSESSION, globalcontext);
620
621
622
623
    mfile->addAction(cmd, Core::Constants::G_FILE_OPEN);
    cmd->setDefaultKeySequence(QKeySequence());


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

    // unload session action
634
    d->m_closeAllProjects = new QAction(tr("Close All Projects and Editors"), this);
Eike Ziller's avatar
Eike Ziller committed
635
    cmd = Core::ActionManager::registerAction(d->m_closeAllProjects, Constants::CLEARSESSION, globalcontext);
con's avatar
con committed
636
637
638
639
    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
640
    QIcon buildIcon = QIcon(QLatin1String(Constants::ICON_BUILD));
641
    buildIcon.addFile(QLatin1String(Constants::ICON_BUILD_SMALL));
642
    d->m_buildSessionAction = new QAction(buildIcon, tr("Build All"), this);
Eike Ziller's avatar
Eike Ziller committed
643
    cmd = Core::ActionManager::registerAction(d->m_buildSessionAction, Constants::BUILDSESSION, globalcontext);
con's avatar
con committed
644
    cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+B")));
645
646
647
648
649
    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
650
    cmd = Core::ActionManager::registerAction(d->m_deploySessionAction, Constants::DEPLOYSESSION, globalcontext);
651
    mbuild->addAction(cmd, Constants::G_BUILD_DEPLOY);
con's avatar
con committed
652
653
654
    msessionContextMenu->addAction(cmd, Constants::G_SESSION_BUILD);

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

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

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

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

683
684
685
    // 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
686
    cmd = Core::ActionManager::registerAction(d->m_deployAction, Constants::DEPLOY, globalcontext);
687
688
689
690
    cmd->setAttribute(Core::Command::CA_UpdateText);
    cmd->setDescription(d->m_deployAction->text());
    mbuild->addAction(cmd, Constants::G_BUILD_DEPLOY);

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

699
700
    // clean action
    d->m_cleanAction = new Utils::ParameterAction(tr("Clean Project"), tr("Clean Project \"%1\""),
Tobias Hunger's avatar
Tobias Hunger committed
701
                                                     Utils::ParameterAction::AlwaysEnabled, this);
Eike Ziller's avatar
Eike Ziller committed
702
    cmd = Core::ActionManager::registerAction(d->m_cleanAction, Constants::CLEAN, globalcontext);
Tobias Hunger's avatar
Tobias Hunger committed
703
    cmd->setAttribute(Core::Command::CA_UpdateText);
704
705
706
707
708
709
710
    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
711
    cmd = Core::ActionManager::registerAction(d->m_cancelBuildAction, Constants::CANCELBUILD, globalcontext);
712
713
714
715
    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
716
    cmd = Core::ActionManager::registerAction(d->m_runAction, Constants::RUN, globalcontext);
717
718
719
720
721
722
723
724
725
    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
726
    cmd = Core::ActionManager::registerAction(d->m_runWithoutDeployAction, Constants::RUNWITHOUTDEPLOY, globalcontext);
727
    mbuild->addAction(cmd, Constants::G_BUILD_RUN);
Tobias Hunger's avatar
Tobias Hunger committed
728

729
730
731
    // 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
732
    cmd = Core::ActionManager::registerAction(d->m_publishAction, Constants::PUBLISH, globalcontext);
733
    cmd->setAttribute(Core::Command::CA_UpdateText);
734
    cmd->setDescription(d->m_publishAction->text());
735
    mbuild->addAction(cmd, Constants::G_BUILD_RUN);
736
737

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

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

747
    // clean action (context menu)
748
    d->m_cleanActionContextMenu = new QAction(tr("Clean"), this);
Eike Ziller's avatar
Eike Ziller committed
749
    cmd = Core::ActionManager::registerAction(d->m_cleanActionContextMenu, Constants::CLEANCM, projecTreeContext);
750
    mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_REBUILD);
con's avatar
con committed
751

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

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

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

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

768
769
    // deploy action (context menu)
    d->m_deployActionContextMenu = new QAction(tr("Deploy"), this);
Eike Ziller's avatar
Eike Ziller committed
770
    cmd = Core::ActionManager::registerAction(d->m_deployActionContextMenu, Constants::DEPLOYCM, projecTreeContext);
771
    mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_RUN);
con's avatar
con committed
772

773
    d->m_runActionContextMenu = new QAction(runIcon, tr("Run"), this);
Eike Ziller's avatar
Eike Ziller committed
774
    cmd = Core::ActionManager::registerAction(d->m_runActionContextMenu, Constants::RUNCONTEXTMENU, projecTreeContext);
dt's avatar
dt committed
775
    mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_RUN);
dt's avatar
dt committed
776
    msubProjectContextMenu->addAction(cmd, Constants::G_PROJECT_RUN);
777

con's avatar
con committed
778
    // add new file action
779
    d->m_addNewFileAction = new QAction(tr("Add New..."), this);
Eike Ziller's avatar
Eike Ziller committed
780
    cmd = Core::ActionManager::registerAction(d->m_addNewFileAction, ProjectExplorer::Constants::ADDNEWFILE,
dt's avatar
dt committed
781
782