projectexplorer.cpp 112 KB
Newer Older
1
/**************************************************************************
con's avatar
con committed
2
3
4
**
** This file is part of Qt Creator
**
con's avatar
con committed
5
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
con's avatar
con committed
6
**
hjk's avatar
hjk committed
7
** Contact: Nokia Corporation (info@qt.nokia.com)
con's avatar
con committed
8
**
9
**
10
** GNU Lesser General Public License Usage
11
**
hjk's avatar
hjk committed
12
13
14
15
16
17
** 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.
18
**
con's avatar
con committed
19
** In addition, as a special exception, Nokia gives you certain additional
hjk's avatar
hjk committed
20
** rights. These rights are described in the Nokia Qt LGPL Exception
con's avatar
con committed
21
22
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
hjk's avatar
hjk committed
23
24
25
26
27
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
con's avatar
con committed
28
** If you have questions regarding the use of this file, please contact
Tobias Hunger's avatar
Tobias Hunger committed
29
** Nokia at info@qt.nokia.com.
con's avatar
con committed
30
**
31
**************************************************************************/
hjk's avatar
hjk committed
32

33
#include "projectexplorer.h"
Tobias Hunger's avatar
Tobias Hunger committed
34

Tobias Hunger's avatar
Tobias Hunger committed
35
36
#include "buildsteplist.h"
#include "deployconfiguration.h"
37
#include "gcctoolchainfactories.h"
38
#include "project.h"
39
#include "projectexplorersettings.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
54
#include "currentprojectfilter.h"
#include "customexecutablerunconfiguration.h"
55
#include "editorsettingspropertiespage.h"
56
#include "codestylesettingspropertiespage.h"
57
#include "dependenciespanel.h"
con's avatar
con committed
58
59
60
61
#include "foldernavigationwidget.h"
#include "iprojectmanager.h"
#include "metatypedeclarations.h"
#include "nodesvisitor.h"
62
#include "appoutputpane.h"
con's avatar
con committed
63
64
65
#include "pluginfilefactory.h"
#include "processstep.h"
#include "projectexplorerconstants.h"
66
#include "customwizard.h"
con's avatar
con committed
67
68
69
70
71
72
#include "projectfilewizardextension.h"
#include "projecttreewidget.h"
#include "projectwindow.h"
#include "removefiledialog.h"
#include "runsettingspropertiespage.h"
#include "session.h"
73
#include "projectnodes.h"
con's avatar
con committed
74
#include "sessiondialog.h"
Tobias Hunger's avatar
Tobias Hunger committed
75
#include "target.h"
76
#include "projectexplorersettingspage.h"
77
#include "projectwelcomepage.h"
78
#include "corelistenercheckingforrunningbuild.h"
79
#include "buildconfiguration.h"
80
#include "miniprojecttargetselector.h"
dt's avatar
dt committed
81
#include "taskhub.h"
82
83
#include "publishing/ipublishingwizardfactory.h"
#include "publishing/publishingwizardselectiondialog.h"
con's avatar
con committed
84

85
#ifdef Q_OS_WIN
86
#    include "windebuginterface.h"
87
88
89
#    include "msvctoolchain.h"
#endif

90
#include <extensionsystem/pluginspec.h>
con's avatar
con committed
91
#include <coreplugin/coreconstants.h>
92
93
#include <coreplugin/filemanager.h>
#include <coreplugin/icore.h>
94
#include <coreplugin/imode.h>
con's avatar
con committed
95
96
#include <coreplugin/mimedatabase.h>
#include <coreplugin/modemanager.h>
97
#include <coreplugin/actionmanager/actionmanager.h>
98
99
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/command.h>
100
#include <coreplugin/id.h>
con's avatar
con committed
101
102
103
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/editormanager/ieditor.h>
#include <coreplugin/editormanager/ieditorfactory.h>
104
#include <coreplugin/editormanager/iexternaleditor.h>
con's avatar
con committed
105
106
107
108
#include <coreplugin/findplaceholder.h>
#include <coreplugin/basefilewizard.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 <extensionsystem/pluginmanager.h>
112
#include <find/searchresultwindow.h>
113
#include <utils/consoleprocess.h>
hjk's avatar
hjk committed
114
#include <utils/qtcassert.h>
115
#include <utils/parameteraction.h>
116
#include <utils/stringutils.h>
Jarek Kobus's avatar
Jarek Kobus committed
117
#include <utils/persistentsettings.h>
con's avatar
con committed
118

119
#include <QtCore/QtPlugin>
hjk's avatar
hjk committed
120
#include <QtCore/QDateTime>
con's avatar
con committed
121
122
#include <QtCore/QDebug>
#include <QtCore/QSettings>
123
#include <QtCore/QAbstractFileEngine>
hjk's avatar
hjk committed
124

con's avatar
con committed
125
126
#include <QtGui/QAction>
#include <QtGui/QApplication>
hjk's avatar
hjk committed
127
128
129
#include <QtGui/QFileDialog>
#include <QtGui/QMenu>
#include <QtGui/QMessageBox>
130
#include <QtGui/QMainWindow>
131
#include <QtGui/QWizard>
con's avatar
con committed
132

133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
/*!
    \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.
*/

151
152
Q_DECLARE_METATYPE(Core::IEditorFactory*)
Q_DECLARE_METATYPE(Core::IExternalEditor*)
con's avatar
con committed
153
154
155
156
157

namespace {
bool debug = false;
}

158
159
static const char kCurrentProjectPath[] = "CurrentProject:Path";
static const char kCurrentProjectFilePath[] = "CurrentProject:FilePath";
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
180
    QAction *m_clearSession;
    QAction *m_buildProjectOnlyAction;
181
    Utils::ParameterAction *m_buildAction;
182
    Utils::ParameterAction *m_buildActionContextMenu;
183
184
    QAction *m_buildSessionAction;
    QAction *m_rebuildProjectOnlyAction;
185
    Utils::ParameterAction *m_rebuildAction;
186
    Utils::ParameterAction *m_rebuildActionContextMenu;
187
188
    QAction *m_rebuildSessionAction;
    QAction *m_cleanProjectOnlyAction;
Tobias Hunger's avatar
Tobias Hunger committed
189
190
191
192
    QAction *m_deployProjectOnlyAction;
    Utils::ParameterAction *m_deployAction;
    Utils::ParameterAction *m_deployActionContextMenu;
    QAction *m_deploySessionAction;
193
    Utils::ParameterAction *m_publishAction;
194
    Utils::ParameterAction *m_cleanAction;
195
    Utils::ParameterAction *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
    QAction *m_setStartupProjectAction;
214
    QAction *m_projectSelectorAction;
215
    QAction *m_projectSelectorActionMenu;
dt's avatar
dt committed
216
    QAction *m_runSubProject;
217
218
219
220
221
222
223
224
225
226
227
228

    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;
229
    Internal::AppOutputPane *m_outputPane;
230
231
232
233
234

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

    QString m_lastOpenDirectory;
235
    RunConfiguration *m_delayedRunConfiguration; // TODO this is not right
236
237
    QString m_runMode;
    QString m_projectFilterString;
238
    Internal::MiniProjectTargetSelector * m_targetSelector;
239
    Internal::ProjectExplorerSettings m_projectExplorerSettings;
240
    Internal::ProjectWelcomePage *m_welcomePage;
241

242
    Core::IMode *m_projectsMode;
243
244

    ToolChainManager *m_toolChainManager;
245
246
247
248
249
250
};

ProjectExplorerPluginPrivate::ProjectExplorerPluginPrivate() :
    m_currentProject(0),
    m_currentNode(0),
    m_delayedRunConfiguration(0),
251
252
    m_projectsMode(0),
    m_toolChainManager(0)
253
254
255
{
}

256
257
258
class ProjectsMode : public Core::IMode
{
public:
259
260
261
262
    ProjectsMode(QWidget *proWindow)
    {
        setWidget(proWindow);
        setContext(Core::Context(Constants::C_PROJECTEXPLORER));
263
264
265
266
267
268
        setDisplayName(QCoreApplication::translate("ProjectExplorer::ProjectsMode", "Projects"));
        setIcon(QIcon(QLatin1String(":/fancyactionbar/images/mode_Project.png")));
        setPriority(Constants::P_MODE_SESSION);
        setId(QLatin1String(Constants::MODE_SESSION));
        setType(QString());
        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;
290
    delete d->m_toolChainManager;
con's avatar
con committed
291
    removeObject(this);
292
    delete d;
con's avatar
con committed
293
294
295
296
297
298
299
}

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

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

306
bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *error)
con's avatar
con committed
307
{
308
309
    if (!parseArguments(arguments, error))
        return false;
dt's avatar
dt committed
310
311
    addObject(this);

312
    // Add ToolChainFactories:
313
#ifdef Q_OS_WIN
314
315
    addAutoReleasedObject(new WinDebugInterface);

316
317
    addAutoReleasedObject(new Internal::MingwToolChainFactory);
    addAutoReleasedObject(new Internal::MsvcToolChainFactory);
318
319
320
#else
    addAutoReleasedObject(new Internal::GccToolChainFactory);
    addAutoReleasedObject(new Internal::LinuxIccToolChainFactory);
321
#endif
Tobias Hunger's avatar
Tobias Hunger committed
322
    addAutoReleasedObject(new Internal::ClangToolChainFactory);
323
324
325
326
327

    d->m_toolChainManager = new ToolChainManager(this);

    addAutoReleasedObject(new Internal::ToolChainOptionsPage);

dt's avatar
dt committed
328
    addAutoReleasedObject(new TaskHub);
329

330
331
    Core::ICore *core = Core::ICore::instance();
    Core::ActionManager *am = core->actionManager();
332
    connect(core, SIGNAL(newItemsDialogRequested()), this, SLOT(loadCustomWizards()));
con's avatar
con committed
333

334
    d->m_welcomePage = new ProjectWelcomePage;
335
    connect(d->m_welcomePage, SIGNAL(manageSessions()), this, SLOT(showSessionManager()));
336
    addObject(d->m_welcomePage);
con's avatar
con committed
337

hjk's avatar
hjk committed
338
339
    connect(core->fileManager(), SIGNAL(currentFileChanged(QString)),
            this, SLOT(setCurrentFile(QString)));
con's avatar
con committed
340

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

343
    connect(d->m_session, SIGNAL(projectAdded(ProjectExplorer::Project *)),
con's avatar
con committed
344
            this, SIGNAL(fileListChanged()));
345
    connect(d->m_session, SIGNAL(aboutToRemoveProject(ProjectExplorer::Project *)),
con's avatar
con committed
346
            this, SLOT(invalidateProject(ProjectExplorer::Project *)));
347
    connect(d->m_session, SIGNAL(projectRemoved(ProjectExplorer::Project *)),
con's avatar
con committed
348
            this, SIGNAL(fileListChanged()));
349
350
351
352
    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*)));
353
    connect(d->m_session, SIGNAL(startupProjectChanged(ProjectExplorer::Project *)),
con's avatar
con committed
354
            this, SLOT(startupProjectChanged()));
355
356
    connect(d->m_session, SIGNAL(dependencyChanged(ProjectExplorer::Project*,ProjectExplorer::Project*)),
            this, SLOT(updateActions()));
357
358
    connect(d->m_session, SIGNAL(sessionLoaded()),
            this, SLOT(updateActions()));
359
360
    connect(d->m_session, SIGNAL(sessionLoaded()),
            this, SLOT(updateWelcomePage()));
con's avatar
con committed
361

362
    d->m_proWindow = new ProjectWindow;
con's avatar
con committed
363

364
    Core::Context globalcontext(Core::Constants::C_GLOBAL);
dt's avatar
dt committed
365
    Core::Context projecTreeContext(Constants::C_PROJECT_TREE);
con's avatar
con committed
366

367
    d->m_projectsMode = new ProjectsMode(d->m_proWindow);
368
369
    d->m_projectsMode->setEnabled(session()->startupProject());
    addAutoReleasedObject(d->m_projectsMode);
370
    d->m_proWindow->layout()->addWidget(new Core::FindToolBarPlaceHolder(d->m_proWindow));
con's avatar
con committed
371

372
    addAutoReleasedObject(new CopyTaskHandler);
373
    addAutoReleasedObject(new ShowInEditorTaskHandler);
374
    addAutoReleasedObject(new VcsAnnotateTaskHandler);
375

376
377
    d->m_buildManager = new BuildManager(this);
    connect(d->m_buildManager, SIGNAL(buildStateChanged(ProjectExplorer::Project *)),
con's avatar
con committed
378
            this, SLOT(buildStateChanged(ProjectExplorer::Project *)));
379
    connect(d->m_buildManager, SIGNAL(buildQueueFinished(bool)),
con's avatar
con committed
380
381
            this, SLOT(buildQueueFinished(bool)));

382
    addAutoReleasedObject(new CoreListener);
con's avatar
con committed
383

384
    d->m_outputPane = new AppOutputPane;
385
386
387
    addAutoReleasedObject(d->m_outputPane);
    connect(d->m_session, SIGNAL(projectRemoved(ProjectExplorer::Project *)),
            d->m_outputPane, SLOT(projectRemoved()));
con's avatar
con committed
388

389
390
391
392
393
    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*)));

394
    AllProjectsFilter *allProjectsFilter = new AllProjectsFilter(this);
con's avatar
con committed
395
396
    addAutoReleasedObject(allProjectsFilter);

397
    CurrentProjectFilter *currentProjectFilter = new CurrentProjectFilter(this);
con's avatar
con committed
398
399
400
401
402
    addAutoReleasedObject(currentProjectFilter);

    addAutoReleasedObject(new BuildSettingsPanelFactory);
    addAutoReleasedObject(new RunSettingsPanelFactory);
    addAutoReleasedObject(new EditorSettingsPanelFactory);
403
    addAutoReleasedObject(new CodeStyleSettingsPanelFactory);
404
    addAutoReleasedObject(new DependenciesPanelFactory(d->m_session));
con's avatar
con committed
405
406
407
408

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

409
    AllProjectsFind *allProjectsFind = new AllProjectsFind(this);
con's avatar
con committed
410
411
    addAutoReleasedObject(allProjectsFind);

412
    CurrentProjectFind *currentProjectFind = new CurrentProjectFind(this);
con's avatar
con committed
413
414
    addAutoReleasedObject(currentProjectFind);

415
    addAutoReleasedObject(new LocalApplicationRunControlFactory);
con's avatar
con committed
416
417
    addAutoReleasedObject(new CustomExecutableRunConfigurationFactory);

418
    addAutoReleasedObject(new ProjectFileWizardExtension);
con's avatar
con committed
419

420
421
422
    // Settings page
    addAutoReleasedObject(new ProjectExplorerSettingsPage);

con's avatar
con committed
423
    // context menus
424
    Core::ActionContainer *msessionContextMenu =
con's avatar
con committed
425
        am->createMenu(Constants::M_SESSIONCONTEXT);
dt's avatar
dt committed
426
    Core::ActionContainer *mprojectContextMenu =
con's avatar
con committed
427
        am->createMenu(Constants::M_PROJECTCONTEXT);
dt's avatar
dt committed
428
    Core::ActionContainer *msubProjectContextMenu =
con's avatar
con committed
429
        am->createMenu(Constants::M_SUBPROJECTCONTEXT);
dt's avatar
dt committed
430
    Core::ActionContainer *mfolderContextMenu =
con's avatar
con committed
431
        am->createMenu(Constants::M_FOLDERCONTEXT);
dt's avatar
dt committed
432
    Core::ActionContainer *mfileContextMenu =
con's avatar
con committed
433
434
        am->createMenu(Constants::M_FILECONTEXT);

435
    d->m_sessionContextMenu = msessionContextMenu->menu();
dt's avatar
dt committed
436
437
438
439
    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
440

441
    Core::ActionContainer *mfile =
con's avatar
con committed
442
        am->actionContainer(Core::Constants::M_FILE);
443
    Core::ActionContainer *menubar =
con's avatar
con committed
444
445
446
        am->actionContainer(Core::Constants::MENU_BAR);

    // build menu
447
    Core::ActionContainer *mbuild =
con's avatar
con committed
448
        am->createMenu(Constants::M_BUILDPROJECT);
449
    mbuild->menu()->setTitle(tr("&Build"));
con's avatar
con committed
450
451
452
    menubar->addMenu(mbuild, Core::Constants::G_VIEW);

    // debug menu
453
    Core::ActionContainer *mdebug =
con's avatar
con committed
454
        am->createMenu(Constants::M_DEBUG);
455
    mdebug->menu()->setTitle(tr("&Debug"));
con's avatar
con committed
456
457
    menubar->addMenu(mdebug, Core::Constants::G_VIEW);

458
459
460
461
    Core::ActionContainer *mstartdebugging =
        am->createMenu(Constants::M_DEBUG_STARTDEBUGGING);
    mstartdebugging->menu()->setTitle(tr("&Start Debugging"));
    mdebug->addMenu(mstartdebugging, Core::Constants::G_DEFAULT_ONE);
con's avatar
con committed
462
463
464
465
466
467
468
469
470

    //
    // Groups
    //

    mbuild->appendGroup(Constants::G_BUILD_SESSION);
    mbuild->appendGroup(Constants::G_BUILD_PROJECT);
    mbuild->appendGroup(Constants::G_BUILD_OTHER);
    mbuild->appendGroup(Constants::G_BUILD_CANCEL);
dt's avatar
dt committed
471
    mbuild->appendGroup(Constants::G_BUILD_RUN);
con's avatar
con committed
472
473
474
475
476

    msessionContextMenu->appendGroup(Constants::G_SESSION_BUILD);
    msessionContextMenu->appendGroup(Constants::G_SESSION_FILES);
    msessionContextMenu->appendGroup(Constants::G_SESSION_OTHER);
    msessionContextMenu->appendGroup(Constants::G_SESSION_CONFIG);
477
    msessionContextMenu->appendGroup(Constants::G_PROJECT_TREE);
con's avatar
con committed
478

dt's avatar
dt committed
479
480
481
482
    mprojectContextMenu->appendGroup(Constants::G_PROJECT_FIRST);
    mprojectContextMenu->appendGroup(Constants::G_PROJECT_BUILD);
    mprojectContextMenu->appendGroup(Constants::G_PROJECT_RUN);
    mprojectContextMenu->appendGroup(Constants::G_PROJECT_FILES);
483
    mprojectContextMenu->appendGroup(Constants::G_PROJECT_LAST);
484
    mprojectContextMenu->appendGroup(Constants::G_PROJECT_TREE);
con's avatar
con committed
485

dt's avatar
dt committed
486
487
    msubProjectContextMenu->appendGroup(Constants::G_PROJECT_FIRST);
    msubProjectContextMenu->appendGroup(Constants::G_PROJECT_BUILD);
dt's avatar
dt committed
488
    msubProjectContextMenu->appendGroup(Constants::G_PROJECT_RUN);
dt's avatar
dt committed
489
    msubProjectContextMenu->appendGroup(Constants::G_PROJECT_FILES);
490
    msubProjectContextMenu->appendGroup(Constants::G_PROJECT_LAST);
491
    msubProjectContextMenu->appendGroup(Constants::G_PROJECT_TREE);
con's avatar
con committed
492

dt's avatar
dt committed
493
494
495
496
497
498
499
500
    Core::ActionContainer *runMenu = Core::ICore::instance()->actionManager()->createMenu(Constants::RUNMENUCONTEXTMENU);
    runMenu->setOnAllDisabledBehavior(Core::ActionContainer::Hide);
    QIcon runIcon(Constants::ICON_RUN);
    runIcon.addFile(Constants::ICON_RUN_SMALL);
    runMenu->menu()->setIcon(runIcon);
    runMenu->menu()->setTitle("Run");
    msubProjectContextMenu->addMenu(runMenu, ProjectExplorer::Constants::G_PROJECT_RUN);

dt's avatar
dt committed
501
502
503
    mfolderContextMenu->appendGroup(Constants::G_FOLDER_FILES);
    mfolderContextMenu->appendGroup(Constants::G_FOLDER_OTHER);
    mfolderContextMenu->appendGroup(Constants::G_FOLDER_CONFIG);
504
    mfolderContextMenu->appendGroup(Constants::G_PROJECT_TREE);
con's avatar
con committed
505

dt's avatar
dt committed
506
507
508
    mfileContextMenu->appendGroup(Constants::G_FILE_OPEN);
    mfileContextMenu->appendGroup(Constants::G_FILE_OTHER);
    mfileContextMenu->appendGroup(Constants::G_FILE_CONFIG);
509
    mfileContextMenu->appendGroup(Constants::G_PROJECT_TREE);
con's avatar
con committed
510
    // "open with" submenu
511
    Core::ActionContainer * const openWith =
con's avatar
con committed
512
            am->createMenu(ProjectExplorer::Constants::M_OPENFILEWITHCONTEXT);
513
    openWith->setOnAllDisabledBehavior(Core::ActionContainer::Show);
514
515
    d->m_openWithMenu = openWith->menu();
    d->m_openWithMenu->setTitle(tr("Open With"));
con's avatar
con committed
516

517
    connect(d->m_openWithMenu, SIGNAL(triggered(QAction *)),
con's avatar
con committed
518
519
520
521
522
523
            this, SLOT(openWithMenuTriggered(QAction *)));

    //
    // Separators
    //

con's avatar
con committed
524
    Core::Command *cmd;
con's avatar
con committed
525
526
527
528
    QAction *sep;

    sep = new QAction(this);
    sep->setSeparator(true);
hjk's avatar
hjk committed
529
    cmd = am->registerAction(sep, Core::Id("ProjectExplorer.Build.Sep"), globalcontext);
con's avatar
con committed
530
531
532
533
    mbuild->addAction(cmd, Constants::G_BUILD_PROJECT);

    sep = new QAction(this);
    sep->setSeparator(true);
dt's avatar
dt committed
534
    cmd = am->registerAction(sep, Core::Id("ProjectExplorer.Files.Sep"), projecTreeContext);
con's avatar
con committed
535
    msessionContextMenu->addAction(cmd, Constants::G_SESSION_FILES);
dt's avatar
dt committed
536
537
    mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_FILES);
    msubProjectContextMenu->addAction(cmd, Constants::G_PROJECT_FILES);
con's avatar
con committed
538
539
540

    sep = new QAction(this);
    sep->setSeparator(true);
dt's avatar
dt committed
541
    cmd = am->registerAction(sep, Core::Id("ProjectExplorer.Config.Sep"), projecTreeContext);
con's avatar
con committed
542
543
544
545
    msessionContextMenu->addAction(cmd, Constants::G_SESSION_CONFIG);

    sep = new QAction(this);
    sep->setSeparator(true);
hjk's avatar
hjk committed
546
    cmd = am->registerAction(sep, Core::Id("ProjectExplorer.Projects.Sep"), globalcontext);
con's avatar
con committed
547
548
549
550
    mfile->addAction(cmd, Core::Constants::G_FILE_PROJECT);

    sep = new QAction(this);
    sep->setSeparator(true);
hjk's avatar
hjk committed
551
    cmd = am->registerAction(sep, Core::Id("ProjectExplorer.Other.Sep"), globalcontext);
con's avatar
con committed
552
553
554
555
556
    mbuild->addAction(cmd, Constants::G_BUILD_OTHER);
    msessionContextMenu->addAction(cmd, Constants::G_SESSION_OTHER);

    sep = new QAction(this);
    sep->setSeparator(true);
hjk's avatar
hjk committed
557
    cmd = am->registerAction(sep, Core::Id("ProjectExplorer.Run.Sep"), globalcontext);
con's avatar
con committed
558
    mbuild->addAction(cmd, Constants::G_BUILD_RUN);
dt's avatar
dt committed
559
    mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_RUN);
con's avatar
con committed
560
561
562

    sep = new QAction(this);
    sep->setSeparator(true);
hjk's avatar
hjk committed
563
    cmd = am->registerAction(sep, Core::Id("ProjectExplorer.CancelBuild.Sep"), globalcontext);
con's avatar
con committed
564
565
566
567
568
569
570
    mbuild->addAction(cmd, Constants::G_BUILD_CANCEL);

    //
    // Actions
    //

    // new action
571
572
    d->m_newAction = new QAction(tr("New Project..."), this);
    cmd = am->registerAction(d->m_newAction, Constants::NEWPROJECT, globalcontext);
con's avatar
con committed
573
574
575
576
    cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+N")));
    msessionContextMenu->addAction(cmd, Constants::G_SESSION_FILES);

    // open action
577
578
    d->m_loadAction = new QAction(tr("Load Project..."), this);
    cmd = am->registerAction(d->m_loadAction, Constants::LOAD, globalcontext);
579
#ifndef Q_WS_MAC
con's avatar
con committed
580
    cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+O")));
581
#endif
con's avatar
con committed
582
583
584
    msessionContextMenu->addAction(cmd, Constants::G_SESSION_FILES);

    // Default open action
585
586
    d->m_openFileAction = new QAction(tr("Open File"), this);
    cmd = am->registerAction(d->m_openFileAction, ProjectExplorer::Constants::OPENFILE,
dt's avatar
dt committed
587
588
                       projecTreeContext);
    mfileContextMenu->addAction(cmd, Constants::G_FILE_OPEN);
con's avatar
con committed
589

590
591
592
593
594
595
    d->m_searchOnFileSystem = new QAction(FolderNavigationWidget::msgFindOnFileSystem(), this);
    cmd = am->registerAction(d->m_searchOnFileSystem, ProjectExplorer::Constants::SEARCHONFILESYSTEM, projecTreeContext);
    mfolderContextMenu->addAction(cmd, Constants::G_FOLDER_CONFIG);
    msubProjectContextMenu->addAction(cmd, Constants::G_PROJECT_LAST);
    mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_LAST);

596
    d->m_showInGraphicalShell = new QAction(Core::FileUtils::msgGraphicalShellAction(), this);
597
    cmd = am->registerAction(d->m_showInGraphicalShell, ProjectExplorer::Constants::SHOWINGRAPHICALSHELL,
dt's avatar
dt committed
598
599
600
                       projecTreeContext);
    mfileContextMenu->addAction(cmd, Constants::G_FILE_OPEN);
    mfolderContextMenu->addAction(cmd, Constants::G_FOLDER_FILES);
con's avatar
con committed
601

602
    d->m_openTerminalHere = new QAction(Core::FileUtils::msgTerminalAction(), this);
603
    cmd = am->registerAction(d->m_openTerminalHere, ProjectExplorer::Constants::OPENTERMIANLHERE,
dt's avatar
dt committed
604
605
606
                       projecTreeContext);
    mfileContextMenu->addAction(cmd, Constants::G_FILE_OPEN);
    mfolderContextMenu->addAction(cmd, Constants::G_FOLDER_FILES);
607

con's avatar
con committed
608
    // Open With menu
dt's avatar
dt committed
609
    mfileContextMenu->addMenu(openWith, ProjectExplorer::Constants::G_FILE_OPEN);
con's avatar
con committed
610

mae's avatar
mae committed
611
    // recent projects menu
612
    Core::ActionContainer *mrecent =
mae's avatar
mae committed
613
        am->createMenu(Constants::M_RECENTPROJECTS);
614
    mrecent->menu()->setTitle(tr("Recent P&rojects"));
615
    mrecent->setOnAllDisabledBehavior(Core::ActionContainer::Show);
mae's avatar
mae committed
616
617
618
619
    mfile->addMenu(mrecent, Core::Constants::G_FILE_OPEN);
    connect(mfile->menu(), SIGNAL(aboutToShow()),
        this, SLOT(updateRecentProjectMenu()));

620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
    // recent session menu
    Core::ActionContainer *msession = am->createMenu(Constants::M_SESSION);
    msession->menu()->setTitle(tr("Recent Sessions"));
    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);
    cmd = am->registerAction(d->m_sessionManagerAction, Constants::NEWSESSION, globalcontext);
    mfile->addAction(cmd, Core::Constants::G_FILE_OPEN);
    cmd->setDefaultKeySequence(QKeySequence());


dt's avatar
dt committed
636
    // XXX same action?
con's avatar
con committed
637
    // unload action
638
639
    d->m_unloadAction = new Utils::ParameterAction(tr("Close Project"), tr("Close Project \"%1\""),
                                                      Utils::ParameterAction::EnabledWithParameter, this);
640
    cmd = am->registerAction(d->m_unloadAction, Constants::UNLOAD, globalcontext);
con's avatar
con committed
641
    cmd->setAttribute(Core::Command::CA_UpdateText);
642
    cmd->setDefaultText(d->m_unloadAction->text());
con's avatar
con committed
643
644
645
    mfile->addAction(cmd, Core::Constants::G_FILE_PROJECT);

    // unload session action
646
647
    d->m_clearSession = new QAction(tr("Close All Projects"), this);
    cmd = am->registerAction(d->m_clearSession, Constants::CLEARSESSION, globalcontext);
con's avatar
con committed
648
649
650
651
652
653
    mfile->addAction(cmd, Core::Constants::G_FILE_PROJECT);
    msessionContextMenu->addAction(cmd, Constants::G_SESSION_FILES);

    // build session action
    QIcon buildIcon(Constants::ICON_BUILD);
    buildIcon.addFile(Constants::ICON_BUILD_SMALL);
654
655
    d->m_buildSessionAction = new QAction(buildIcon, tr("Build All"), this);
    cmd = am->registerAction(d->m_buildSessionAction, Constants::BUILDSESSION, globalcontext);
con's avatar
con committed
656
657
658
659
660
661
662
    cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+B")));
    mbuild->addAction(cmd, Constants::G_BUILD_SESSION);
    msessionContextMenu->addAction(cmd, Constants::G_SESSION_BUILD);

    // rebuild session action
    QIcon rebuildIcon(Constants::ICON_REBUILD);
    rebuildIcon.addFile(Constants::ICON_REBUILD_SMALL);
663
664
    d->m_rebuildSessionAction = new QAction(rebuildIcon, tr("Rebuild All"), this);
    cmd = am->registerAction(d->m_rebuildSessionAction, Constants::REBUILDSESSION, globalcontext);
con's avatar
con committed
665
666
667
    mbuild->addAction(cmd, Constants::G_BUILD_SESSION);
    msessionContextMenu->addAction(cmd, Constants::G_SESSION_BUILD);

Tobias Hunger's avatar
Tobias Hunger committed
668
669
670
671
672
673
    // deploy session
    d->m_deploySessionAction = new QAction(tr("Deploy All"), this);
    cmd = am->registerAction(d->m_deploySessionAction, Constants::DEPLOYSESSION, globalcontext);
    mbuild->addAction(cmd, Constants::G_BUILD_SESSION);
    msessionContextMenu->addAction(cmd, Constants::G_SESSION_BUILD);

con's avatar
con committed
674
675
676
    // clean session
    QIcon cleanIcon(Constants::ICON_CLEAN);
    cleanIcon.addFile(Constants::ICON_CLEAN_SMALL);
677
678
    d->m_cleanSessionAction = new QAction(cleanIcon, tr("Clean All"), this);
    cmd = am->registerAction(d->m_cleanSessionAction, Constants::CLEANSESSION, globalcontext);
con's avatar
con committed
679
680
681
682
    mbuild->addAction(cmd, Constants::G_BUILD_SESSION);
    msessionContextMenu->addAction(cmd, Constants::G_SESSION_BUILD);

    // build action
683
    d->m_buildAction = new Utils::ParameterAction(tr("Build Project"), tr("Build Project \"%1\""),
684
                                                     Utils::ParameterAction::AlwaysEnabled, this);
dt's avatar
dt committed
685
    d->m_buildAction->setIcon(buildIcon);
686
    cmd = am->registerAction(d->m_buildAction, Constants::BUILD, globalcontext);
687
    cmd->setAttribute(Core::Command::CA_UpdateText);
688
    cmd->setDefaultText(d->m_buildAction->text());
con's avatar
con committed
689
690
691
    cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+B")));
    mbuild->addAction(cmd, Constants::G_BUILD_PROJECT);

692
    // Add to mode bar
693
    Core::ModeManager::instance()->addAction(cmd->action(), Constants::P_ACTION_BUILDPROJECT);
694

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

Tobias Hunger's avatar
Tobias Hunger committed
703
704
705
706
707
708
709
710
    // deploy action
    d->m_deployAction = new Utils::ParameterAction(tr("Deploy Project"), tr("Deploy Project \"%1\""),
                                                     Utils::ParameterAction::AlwaysEnabled, this);
    cmd = am->registerAction(d->m_deployAction, Constants::DEPLOY, globalcontext);
    cmd->setAttribute(Core::Command::CA_UpdateText);
    cmd->setDefaultText(d->m_deployAction->text());
    mbuild->addAction(cmd, Constants::G_BUILD_PROJECT);

711
712
713
714
715
716
717
718
    // Publish action
    d->m_publishAction = new Utils::ParameterAction(tr("Publish Project..."), tr("Publish Project \"%1\"..."),
                                                    Utils::ParameterAction::AlwaysEnabled, this);
    cmd = am->registerAction(d->m_publishAction, Constants::PUBLISH, globalcontext);
    cmd->setAttribute(Core::Command::CA_UpdateText);
    cmd->setDefaultText(d->m_publishAction->text());
    mbuild->addAction(cmd, Constants::G_BUILD_PROJECT);

con's avatar
con committed
719
    // clean action
720
    d->m_cleanAction = new Utils::ParameterAction(tr("Clean Project"), tr("Clean Project \"%1\""),
721
                                                     Utils::ParameterAction::AlwaysEnabled, this);
722
    cmd = am->registerAction(d->m_cleanAction, Constants::CLEAN, globalcontext);
723
    cmd->setAttribute(Core::Command::CA_UpdateText);
724
    cmd->setDefaultText(d->m_cleanAction->text());
con's avatar
con committed
725
    mbuild->addAction(cmd, Constants::G_BUILD_PROJECT);
726
727
728
729

    // build action (context menu)
    d->m_buildActionContextMenu = new Utils::ParameterAction(tr("Build Project"), tr("Build Project \"%1\""),
                                                             Utils::ParameterAction::AlwaysEnabled, this);
dt's avatar
dt committed
730
    cmd = am->registerAction(d->m_buildActionContextMenu, Constants::BUILDCM, projecTreeContext);
731
732
    cmd->setAttribute(Core::Command::CA_UpdateText);
    cmd->setDefaultText(d->m_buildActionContextMenu->text());
dt's avatar
dt committed
733
    mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_BUILD);
734
735
736
737

    // rebuild action (context menu)
    d->m_rebuildActionContextMenu = new Utils::ParameterAction(tr("Rebuild Project"), tr("Rebuild Project \"%1\""),
                                                               Utils::ParameterAction::AlwaysEnabled, this);
dt's avatar
dt committed
738
    cmd = am->registerAction(d->m_rebuildActionContextMenu, Constants::REBUILDCM, projecTreeContext);
739
740
    cmd->setAttribute(Core::Command::CA_UpdateText);
    cmd->setDefaultText(d->m_rebuildActionContextMenu->text());
dt's avatar
dt committed
741
    mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_BUILD);
742

Tobias Hunger's avatar
Tobias Hunger committed
743
744
745
    // deploy action (context menu)
    d->m_deployActionContextMenu = new Utils::ParameterAction(tr("Deploy Project"), tr("Deploy Project \"%1\""),
                                                              Utils::ParameterAction::AlwaysEnabled, this);
dt's avatar
dt committed
746
    cmd = am->registerAction(d->m_deployActionContextMenu, Constants::DEPLOYCM, projecTreeContext);
Tobias Hunger's avatar
Tobias Hunger committed
747
748
    cmd->setAttribute(Core::Command::CA_UpdateText);
    cmd->setDefaultText(d->m_deployActionContextMenu->text());
dt's avatar
dt committed
749
    mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_BUILD);
Tobias Hunger's avatar
Tobias Hunger committed
750

751
752
753
    // clean action (context menu)
    d->m_cleanActionContextMenu = new Utils::ParameterAction(tr("Clean Project"), tr("Clean Project \"%1\""),
                                                             Utils::ParameterAction::AlwaysEnabled, this);
dt's avatar
dt committed
754
    cmd = am->registerAction(d->m_cleanActionContextMenu, Constants::CLEANCM, projecTreeContext);
755
756
    cmd->setAttribute(Core::Command::CA_UpdateText);
    cmd->setDefaultText(d->m_cleanActionContextMenu->text());
dt's avatar
dt committed
757
    mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_BUILD);
con's avatar
con committed
758

759
    // build without dependencies action
760
761
    d->m_buildProjectOnlyAction = new QAction(tr("Build Without Dependencies"), this);
    cmd = am->registerAction(d->m_buildProjectOnlyAction, Constants::BUILDPROJECTONLY, globalcontext);
762

763
    // rebuild without dependencies action
764
765
    d->m_rebuildProjectOnlyAction = new QAction(tr("Rebuild Without Dependencies"), this);
    cmd = am->registerAction(d->m_rebuildProjectOnlyAction, Constants::REBUILDPROJECTONLY, globalcontext);
766

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

771
    // clean without dependencies action
772
773
    d->m_cleanProjectOnlyAction = new QAction(tr("Clean Without Dependencies"), this);
    cmd = am->registerAction(d->m_cleanProjectOnlyAction, Constants::CLEANPROJECTONLY, globalcontext);
774

con's avatar
con committed
775
    // run action
776
777
    d->m_runAction = new QAction(runIcon, tr("Run"), this);
    cmd = am->registerAction(d->m_runAction, Constants::RUN, globalcontext);
778
779
    cmd->setAttribute(Core::Command::CA_UpdateText);

con's avatar
con committed
780
781
    cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+R")));
    mbuild->addAction(cmd, Constants::G_BUILD_RUN);
782

783
    Core::ModeManager::instance()->addAction(cmd->action(), Constants::P_ACTION_RUN);
con's avatar
con committed
784

785
    d->m_runActionContextMenu = new QAction(runIcon, tr("Run"), this);
dt's avatar
dt committed
786
787
    cmd = am->registerAction(d->m_runActionContextMenu, Constants::RUNCONTEXTMENU, projecTreeContext);
    mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_RUN);
dt's avatar
dt committed
788
    msubProjectContextMenu->addAction(cmd, Constants::G_PROJECT_RUN);
789

790
791
792
793
794
    // run without deployment action
    d->m_runWithoutDeployAction = new QAction(tr("Run Without Deployment"), this);
    cmd = am->registerAction(d->m_runWithoutDeployAction, Constants::RUNWITHOUTDEPLOY, globalcontext);
    mbuild->addAction(cmd, Constants::G_BUILD_RUN);

con's avatar
con committed
795
    // cancel build action
796
797
    d->m_cancelBuildAction = new QAction(tr("Cancel Build"), this);
    cmd = am->registerAction(d->m_cancelBuildAction, Constants::CANCELBUILD, globalcontext);
con's avatar
con committed
798
799
800
    mbuild->addAction(cmd, Constants::G_BUILD_CANCEL);

    // add new file action
801
802
    d->m_addNewFileAction = new QAction(tr("Add New..."), this);
    cmd = am->registerAction(d->m_addNewFileAction, ProjectExplorer::Constants::ADDNEWFILE,
dt's avatar
dt committed
803
804
805
806
                       projecTreeContext);
    mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_FILES);
    msubProjectContextMenu->addAction(cmd, Constants::G_PROJECT_FILES);
    mfolderContextMenu->addAction(cmd, Constants::G_FOLDER_FILES);
con's avatar
con committed
807
808

    // add existing file action
809
810
    d->m_addExistingFilesAction = new QAction(tr("Add Existing Files..."), this);
    cmd = am->registerAction(d->m_addExistingFilesAction, ProjectExplorer::Constants::ADDEXISTINGFILES,
dt's avatar
dt committed
811
812
813
814
                       projecTreeContext);
    mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_FILES);
    msubProjectContextMenu->addAction(cmd, Constants::G_PROJECT_FILES);
    mfolderContextMenu->addAction(cmd, Constants::G_FOLDER_FILES);
con's avatar
con committed
815

816
817
818
    // new subproject action
    d->m_addNewSubprojectAction = new QAction(tr("New Subproject..."), this);
    cmd = am->registerAction(d->m_addNewSubprojectAction, ProjectExplorer::Constants::ADDNEWSUBPROJECT,
dt's avatar
dt committed
819
820
821
                       projecTreeContext);
    mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_FILES);
    msubProjectContextMenu->addAction(cmd, Constants::G_PROJECT_FILES);
822
823

    // unload project again, in right position
824
    mprojectContextMenu->addAction(am->command(Constants::UNLOAD), Constants::G_PROJECT_LAST);
825

con's avatar
con committed
826
    // remove file action
827
828
    d->m_removeFileAction = new QAction(tr("Remove File..."), this);
    cmd = am->registerAction(d->m_removeFileAction, ProjectExplorer::Constants::REMOVEFILE,
dt's avatar
dt committed
829
                       projecTreeContext);
830
    cmd->setDefaultKeySequence(QKeySequence::Delete);
dt's avatar
dt committed
831
    mfileContextMenu->addAction(cmd, Constants::G_FILE_OTHER);
con's avatar
con committed
832

Friedemann Kleint's avatar
Friedemann Kleint committed
833
834
    //: Remove project from parent profile (Project explorer view); will not physically delete any files.
    d->m_removeProjectAction = new QAction(tr("Remove Project..."), this);