Commit fa05b23a authored by hjk's avatar hjk
Browse files

ProjectExplorer: Remove some explicit namespacing.



Change-Id: Ie70586d709e8dee8eeb85af1b77ba740eb2ed9d4
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 24249090
......@@ -148,6 +148,8 @@ bool debug = false;
const char EXTERNAL_FILE_WARNING[] = "ExternalFile";
}
using namespace Core;
namespace ProjectExplorer {
struct ProjectExplorerPluginPrivate {
......@@ -211,7 +213,7 @@ struct ProjectExplorerPluginPrivate {
QString m_sessionToRestoreAtStartup;
Project *m_currentProject;
Core::Context m_lastProjectContext;
Context m_lastProjectContext;
Node *m_currentNode;
BuildManager *m_buildManager;
......@@ -231,7 +233,7 @@ struct ProjectExplorerPluginPrivate {
Internal::ProjectExplorerSettings m_projectExplorerSettings;
Internal::ProjectWelcomePage *m_welcomePage;
Core::IMode *m_projectsMode;
IMode *m_projectsMode;
TaskHub *m_taskHub;
KitManager *m_kitManager;
......@@ -254,13 +256,13 @@ ProjectExplorerPluginPrivate::ProjectExplorerPluginPrivate() :
{
}
class ProjectsMode : public Core::IMode
class ProjectsMode : public IMode
{
public:
ProjectsMode(QWidget *proWindow)
{
setWidget(proWindow);
setContext(Core::Context(Constants::C_PROJECTEXPLORER));
setContext(Context(Constants::C_PROJECTEXPLORER));
setDisplayName(QCoreApplication::translate("ProjectExplorer::ProjectsMode", "Projects"));
setIcon(QIcon(QLatin1String(":/fancyactionbar/images/mode_Project.png")));
setPriority(Constants::P_MODE_SESSION);
......@@ -347,13 +349,13 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
addAutoReleasedObject(new TaskHub);
connect(Core::ICore::instance(), SIGNAL(newItemsDialogRequested()), this, SLOT(loadCustomWizards()));
connect(ICore::instance(), SIGNAL(newItemsDialogRequested()), this, SLOT(loadCustomWizards()));
d->m_welcomePage = new ProjectWelcomePage;
connect(d->m_welcomePage, SIGNAL(manageSessions()), this, SLOT(showSessionManager()));
addObject(d->m_welcomePage);
connect(Core::DocumentManager::instance(), SIGNAL(currentFileChanged(QString)),
connect(DocumentManager::instance(), SIGNAL(currentFileChanged(QString)),
this, SLOT(setCurrentFile(QString)));
d->m_session = new SessionManager(this);
......@@ -382,13 +384,13 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
d->m_proWindow = new ProjectWindow;
addAutoReleasedObject(d->m_proWindow);
Core::Context globalcontext(Core::Constants::C_GLOBAL);
Core::Context projecTreeContext(Constants::C_PROJECT_TREE);
Context globalcontext(Core::Constants::C_GLOBAL);
Context projecTreeContext(Constants::C_PROJECT_TREE);
d->m_projectsMode = new ProjectsMode(d->m_proWindow);
d->m_projectsMode->setEnabled(false);
addAutoReleasedObject(d->m_projectsMode);
d->m_proWindow->layout()->addWidget(new Core::FindToolBarPlaceHolder(d->m_proWindow));
d->m_proWindow->layout()->addWidget(new FindToolBarPlaceHolder(d->m_proWindow));
addAutoReleasedObject(new CopyTaskHandler);
addAutoReleasedObject(new ShowInEditorTaskHandler);
......@@ -436,16 +438,16 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
addAutoReleasedObject(new DeviceSettingsPage);
// context menus
Core::ActionContainer *msessionContextMenu =
Core::ActionManager::createMenu(Constants::M_SESSIONCONTEXT);
Core::ActionContainer *mprojectContextMenu =
Core::ActionManager::createMenu(Constants::M_PROJECTCONTEXT);
Core::ActionContainer *msubProjectContextMenu =
Core::ActionManager::createMenu(Constants::M_SUBPROJECTCONTEXT);
Core::ActionContainer *mfolderContextMenu =
Core::ActionManager::createMenu(Constants::M_FOLDERCONTEXT);
Core::ActionContainer *mfileContextMenu =
Core::ActionManager::createMenu(Constants::M_FILECONTEXT);
ActionContainer *msessionContextMenu =
ActionManager::createMenu(Constants::M_SESSIONCONTEXT);
ActionContainer *mprojectContextMenu =
ActionManager::createMenu(Constants::M_PROJECTCONTEXT);
ActionContainer *msubProjectContextMenu =
ActionManager::createMenu(Constants::M_SUBPROJECTCONTEXT);
ActionContainer *mfolderContextMenu =
ActionManager::createMenu(Constants::M_FOLDERCONTEXT);
ActionContainer *mfileContextMenu =
ActionManager::createMenu(Constants::M_FILECONTEXT);
d->m_sessionContextMenu = msessionContextMenu->menu();
d->m_projectMenu = mprojectContextMenu->menu();
......@@ -453,25 +455,25 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
d->m_folderMenu = mfolderContextMenu->menu();
d->m_fileMenu = mfileContextMenu->menu();
Core::ActionContainer *mfile =
Core::ActionManager::actionContainer(Core::Constants::M_FILE);
Core::ActionContainer *menubar =
Core::ActionManager::actionContainer(Core::Constants::MENU_BAR);
ActionContainer *mfile =
ActionManager::actionContainer(Core::Constants::M_FILE);
ActionContainer *menubar =
ActionManager::actionContainer(Core::Constants::MENU_BAR);
// build menu
Core::ActionContainer *mbuild =
Core::ActionManager::createMenu(Constants::M_BUILDPROJECT);
ActionContainer *mbuild =
ActionManager::createMenu(Constants::M_BUILDPROJECT);
mbuild->menu()->setTitle(tr("&Build"));
menubar->addMenu(mbuild, Core::Constants::G_VIEW);
// debug menu
Core::ActionContainer *mdebug =
Core::ActionManager::createMenu(Constants::M_DEBUG);
ActionContainer *mdebug =
ActionManager::createMenu(Constants::M_DEBUG);
mdebug->menu()->setTitle(tr("&Debug"));
menubar->addMenu(mdebug, Core::Constants::G_VIEW);
Core::ActionContainer *mstartdebugging =
Core::ActionManager::createMenu(Constants::M_DEBUG_STARTDEBUGGING);
ActionContainer *mstartdebugging =
ActionManager::createMenu(Constants::M_DEBUG_STARTDEBUGGING);
mstartdebugging->menu()->setTitle(tr("&Start Debugging"));
mdebug->addMenu(mstartdebugging, Core::Constants::G_DEFAULT_ONE);
......@@ -507,8 +509,8 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
msubProjectContextMenu->appendGroup(Constants::G_PROJECT_LAST);
msubProjectContextMenu->appendGroup(Constants::G_PROJECT_TREE);
Core::ActionContainer *runMenu = Core::ActionManager::createMenu(Constants::RUNMENUCONTEXTMENU);
runMenu->setOnAllDisabledBehavior(Core::ActionContainer::Hide);
ActionContainer *runMenu = ActionManager::createMenu(Constants::RUNMENUCONTEXTMENU);
runMenu->setOnAllDisabledBehavior(ActionContainer::Hide);
QIcon runIcon = QIcon(QLatin1String(Constants::ICON_RUN));
runIcon.addFile(QLatin1String(Constants::ICON_RUN_SMALL));
runMenu->menu()->setIcon(runIcon);
......@@ -525,20 +527,20 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
mfileContextMenu->appendGroup(Constants::G_FILE_CONFIG);
mfileContextMenu->appendGroup(Constants::G_PROJECT_TREE);
// "open with" submenu
Core::ActionContainer * const openWith =
Core::ActionManager::createMenu(ProjectExplorer::Constants::M_OPENFILEWITHCONTEXT);
openWith->setOnAllDisabledBehavior(Core::ActionContainer::Show);
ActionContainer * const openWith =
ActionManager::createMenu(ProjectExplorer::Constants::M_OPENFILEWITHCONTEXT);
openWith->setOnAllDisabledBehavior(ActionContainer::Show);
d->m_openWithMenu = openWith->menu();
d->m_openWithMenu->setTitle(tr("Open With"));
connect(d->m_openWithMenu, SIGNAL(triggered(QAction*)),
Core::DocumentManager::instance(), SLOT(slotExecuteOpenWithMenuAction(QAction*)));
DocumentManager::instance(), SLOT(slotExecuteOpenWithMenuAction(QAction*)));
//
// Separators
//
Core::Command *cmd;
Command *cmd;
msessionContextMenu->addSeparator(projecTreeContext, Constants::G_SESSION_REBUILD);
......@@ -558,13 +560,13 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
// new action
d->m_newAction = new QAction(tr("New Project..."), this);
cmd = Core::ActionManager::registerAction(d->m_newAction, Constants::NEWPROJECT, globalcontext);
cmd = ActionManager::registerAction(d->m_newAction, Constants::NEWPROJECT, globalcontext);
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+N")));
msessionContextMenu->addAction(cmd, Constants::G_SESSION_FILES);
// open action
d->m_loadAction = new QAction(tr("Load Project..."), this);
cmd = Core::ActionManager::registerAction(d->m_loadAction, Constants::LOAD, globalcontext);
cmd = ActionManager::registerAction(d->m_loadAction, Constants::LOAD, globalcontext);
#ifndef Q_OS_MAC
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+O")));
#endif
......@@ -572,24 +574,24 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
// Default open action
d->m_openFileAction = new QAction(tr("Open File"), this);
cmd = Core::ActionManager::registerAction(d->m_openFileAction, ProjectExplorer::Constants::OPENFILE,
cmd = ActionManager::registerAction(d->m_openFileAction, ProjectExplorer::Constants::OPENFILE,
projecTreeContext);
mfileContextMenu->addAction(cmd, Constants::G_FILE_OPEN);
d->m_searchOnFileSystem = new QAction(FolderNavigationWidget::msgFindOnFileSystem(), this);
cmd = Core::ActionManager::registerAction(d->m_searchOnFileSystem, ProjectExplorer::Constants::SEARCHONFILESYSTEM, projecTreeContext);
cmd = ActionManager::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);
d->m_showInGraphicalShell = new QAction(Core::FileUtils::msgGraphicalShellAction(), this);
cmd = Core::ActionManager::registerAction(d->m_showInGraphicalShell, ProjectExplorer::Constants::SHOWINGRAPHICALSHELL,
d->m_showInGraphicalShell = new QAction(FileUtils::msgGraphicalShellAction(), this);
cmd = ActionManager::registerAction(d->m_showInGraphicalShell, ProjectExplorer::Constants::SHOWINGRAPHICALSHELL,
projecTreeContext);
mfileContextMenu->addAction(cmd, Constants::G_FILE_OPEN);
mfolderContextMenu->addAction(cmd, Constants::G_FOLDER_FILES);
d->m_openTerminalHere = new QAction(Core::FileUtils::msgTerminalAction(), this);
cmd = Core::ActionManager::registerAction(d->m_openTerminalHere, ProjectExplorer::Constants::OPENTERMIANLHERE,
d->m_openTerminalHere = new QAction(FileUtils::msgTerminalAction(), this);
cmd = ActionManager::registerAction(d->m_openTerminalHere, ProjectExplorer::Constants::OPENTERMIANLHERE,
projecTreeContext);
mfileContextMenu->addAction(cmd, Constants::G_FILE_OPEN);
mfolderContextMenu->addAction(cmd, Constants::G_FOLDER_FILES);
......@@ -598,18 +600,18 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
mfileContextMenu->addMenu(openWith, ProjectExplorer::Constants::G_FILE_OPEN);
// recent projects menu
Core::ActionContainer *mrecent =
Core::ActionManager::createMenu(Constants::M_RECENTPROJECTS);
ActionContainer *mrecent =
ActionManager::createMenu(Constants::M_RECENTPROJECTS);
mrecent->menu()->setTitle(tr("Recent P&rojects"));
mrecent->setOnAllDisabledBehavior(Core::ActionContainer::Show);
mrecent->setOnAllDisabledBehavior(ActionContainer::Show);
mfile->addMenu(mrecent, Core::Constants::G_FILE_OPEN);
connect(mfile->menu(), SIGNAL(aboutToShow()),
this, SLOT(updateRecentProjectMenu()));
// session menu
Core::ActionContainer *msession = Core::ActionManager::createMenu(Constants::M_SESSION);
ActionContainer *msession = ActionManager::createMenu(Constants::M_SESSION);
msession->menu()->setTitle(tr("Sessions"));
msession->setOnAllDisabledBehavior(Core::ActionContainer::Show);
msession->setOnAllDisabledBehavior(ActionContainer::Show);
mfile->addMenu(msession, Core::Constants::G_FILE_OPEN);
d->m_sessionMenu = msession->menu();
connect(mfile->menu(), SIGNAL(aboutToShow()),
......@@ -617,7 +619,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
// session manager action
d->m_sessionManagerAction = new QAction(tr("Session Manager..."), this);
cmd = Core::ActionManager::registerAction(d->m_sessionManagerAction, Constants::NEWSESSION, globalcontext);
cmd = ActionManager::registerAction(d->m_sessionManagerAction, Constants::NEWSESSION, globalcontext);
mfile->addAction(cmd, Core::Constants::G_FILE_OPEN);
cmd->setDefaultKeySequence(QKeySequence());
......@@ -626,14 +628,14 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
// unload action
d->m_unloadAction = new Utils::ParameterAction(tr("Close Project"), tr("Close Project \"%1\""),
Utils::ParameterAction::EnabledWithParameter, this);
cmd = Core::ActionManager::registerAction(d->m_unloadAction, Constants::UNLOAD, globalcontext);
cmd->setAttribute(Core::Command::CA_UpdateText);
cmd = ActionManager::registerAction(d->m_unloadAction, Constants::UNLOAD, globalcontext);
cmd->setAttribute(Command::CA_UpdateText);
cmd->setDescription(d->m_unloadAction->text());
mfile->addAction(cmd, Core::Constants::G_FILE_PROJECT);
// unload session action
d->m_closeAllProjects = new QAction(tr("Close All Projects and Editors"), this);
cmd = Core::ActionManager::registerAction(d->m_closeAllProjects, Constants::CLEARSESSION, globalcontext);
cmd = ActionManager::registerAction(d->m_closeAllProjects, Constants::CLEARSESSION, globalcontext);
mfile->addAction(cmd, Core::Constants::G_FILE_PROJECT);
msessionContextMenu->addAction(cmd, Constants::G_SESSION_FILES);
......@@ -641,14 +643,14 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
QIcon buildIcon = QIcon(QLatin1String(Constants::ICON_BUILD));
buildIcon.addFile(QLatin1String(Constants::ICON_BUILD_SMALL));
d->m_buildSessionAction = new QAction(buildIcon, tr("Build All"), this);
cmd = Core::ActionManager::registerAction(d->m_buildSessionAction, Constants::BUILDSESSION, globalcontext);
cmd = ActionManager::registerAction(d->m_buildSessionAction, Constants::BUILDSESSION, globalcontext);
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+B")));
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);
cmd = Core::ActionManager::registerAction(d->m_deploySessionAction, Constants::DEPLOYSESSION, globalcontext);
cmd = ActionManager::registerAction(d->m_deploySessionAction, Constants::DEPLOYSESSION, globalcontext);
mbuild->addAction(cmd, Constants::G_BUILD_DEPLOY);
msessionContextMenu->addAction(cmd, Constants::G_SESSION_BUILD);
......@@ -656,7 +658,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
QIcon rebuildIcon = QIcon(QLatin1String(Constants::ICON_REBUILD));
rebuildIcon.addFile(QLatin1String(Constants::ICON_REBUILD_SMALL));
d->m_rebuildSessionAction = new QAction(rebuildIcon, tr("Rebuild All"), this);
cmd = Core::ActionManager::registerAction(d->m_rebuildSessionAction, Constants::REBUILDSESSION, globalcontext);
cmd = ActionManager::registerAction(d->m_rebuildSessionAction, Constants::REBUILDSESSION, globalcontext);
mbuild->addAction(cmd, Constants::G_BUILD_REBUILD);
msessionContextMenu->addAction(cmd, Constants::G_SESSION_REBUILD);
......@@ -664,7 +666,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
QIcon cleanIcon = QIcon(QLatin1String(Constants::ICON_CLEAN));
cleanIcon.addFile(QLatin1String(Constants::ICON_CLEAN_SMALL));
d->m_cleanSessionAction = new QAction(cleanIcon, tr("Clean All"), this);
cmd = Core::ActionManager::registerAction(d->m_cleanSessionAction, Constants::CLEANSESSION, globalcontext);
cmd = ActionManager::registerAction(d->m_cleanSessionAction, Constants::CLEANSESSION, globalcontext);
mbuild->addAction(cmd, Constants::G_BUILD_CLEAN);
msessionContextMenu->addAction(cmd, Constants::G_SESSION_REBUILD);
......@@ -672,36 +674,36 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
d->m_buildAction = new Utils::ParameterAction(tr("Build Project"), tr("Build Project \"%1\""),
Utils::ParameterAction::AlwaysEnabled, this);
d->m_buildAction->setIcon(buildIcon);
cmd = Core::ActionManager::registerAction(d->m_buildAction, Constants::BUILD, globalcontext);
cmd->setAttribute(Core::Command::CA_UpdateText);
cmd = ActionManager::registerAction(d->m_buildAction, Constants::BUILD, globalcontext);
cmd->setAttribute(Command::CA_UpdateText);
cmd->setDescription(d->m_buildAction->text());
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+B")));
mbuild->addAction(cmd, Constants::G_BUILD_BUILD);
// Add to mode bar
Core::ModeManager::addAction(cmd->action(), Constants::P_ACTION_BUILDPROJECT);
ModeManager::addAction(cmd->action(), Constants::P_ACTION_BUILDPROJECT);
// deploy action
d->m_deployAction = new Utils::ParameterAction(tr("Deploy Project"), tr("Deploy Project \"%1\""),
Utils::ParameterAction::AlwaysEnabled, this);
cmd = Core::ActionManager::registerAction(d->m_deployAction, Constants::DEPLOY, globalcontext);
cmd->setAttribute(Core::Command::CA_UpdateText);
cmd = ActionManager::registerAction(d->m_deployAction, Constants::DEPLOY, globalcontext);
cmd->setAttribute(Command::CA_UpdateText);
cmd->setDescription(d->m_deployAction->text());
mbuild->addAction(cmd, Constants::G_BUILD_DEPLOY);
// rebuild action
d->m_rebuildAction = new Utils::ParameterAction(tr("Rebuild Project"), tr("Rebuild Project \"%1\""),
Utils::ParameterAction::AlwaysEnabled, this);
cmd = Core::ActionManager::registerAction(d->m_rebuildAction, Constants::REBUILD, globalcontext);
cmd->setAttribute(Core::Command::CA_UpdateText);
cmd = ActionManager::registerAction(d->m_rebuildAction, Constants::REBUILD, globalcontext);
cmd->setAttribute(Command::CA_UpdateText);
cmd->setDescription(d->m_rebuildAction->text());
mbuild->addAction(cmd, Constants::G_BUILD_REBUILD);
// clean action
d->m_cleanAction = new Utils::ParameterAction(tr("Clean Project"), tr("Clean Project \"%1\""),
Utils::ParameterAction::AlwaysEnabled, this);
cmd = Core::ActionManager::registerAction(d->m_cleanAction, Constants::CLEAN, globalcontext);
cmd->setAttribute(Core::Command::CA_UpdateText);
cmd = ActionManager::registerAction(d->m_cleanAction, Constants::CLEAN, globalcontext);
cmd->setAttribute(Command::CA_UpdateText);
cmd->setDescription(d->m_cleanAction->text());
mbuild->addAction(cmd, Constants::G_BUILD_CLEAN);
......@@ -709,79 +711,79 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
QIcon stopIcon = QIcon(QLatin1String(Constants::ICON_STOP));
stopIcon.addFile(QLatin1String(Constants::ICON_STOP_SMALL));
d->m_cancelBuildAction = new QAction(stopIcon, tr("Cancel Build"), this);
cmd = Core::ActionManager::registerAction(d->m_cancelBuildAction, Constants::CANCELBUILD, globalcontext);
cmd = ActionManager::registerAction(d->m_cancelBuildAction, Constants::CANCELBUILD, globalcontext);
mbuild->addAction(cmd, Constants::G_BUILD_CANCEL);
// run action
d->m_runAction = new QAction(runIcon, tr("Run"), this);
cmd = Core::ActionManager::registerAction(d->m_runAction, Constants::RUN, globalcontext);
cmd->setAttribute(Core::Command::CA_UpdateText);
cmd = ActionManager::registerAction(d->m_runAction, Constants::RUN, globalcontext);
cmd->setAttribute(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);
ModeManager::addAction(cmd->action(), Constants::P_ACTION_RUN);
// Run without deployment action
d->m_runWithoutDeployAction = new QAction(tr("Run Without Deployment"), this);
cmd = Core::ActionManager::registerAction(d->m_runWithoutDeployAction, Constants::RUNWITHOUTDEPLOY, globalcontext);
cmd = ActionManager::registerAction(d->m_runWithoutDeployAction, Constants::RUNWITHOUTDEPLOY, globalcontext);
mbuild->addAction(cmd, Constants::G_BUILD_RUN);
// Publish action
d->m_publishAction = new Utils::ParameterAction(tr("Publish Project..."), tr("Publish Project \"%1\"..."),
Utils::ParameterAction::AlwaysEnabled, this);
cmd = Core::ActionManager::registerAction(d->m_publishAction, Constants::PUBLISH, globalcontext);
cmd->setAttribute(Core::Command::CA_UpdateText);
cmd = ActionManager::registerAction(d->m_publishAction, Constants::PUBLISH, globalcontext);
cmd->setAttribute(Command::CA_UpdateText);
cmd->setDescription(d->m_publishAction->text());
mbuild->addAction(cmd, Constants::G_BUILD_RUN);
// build action (context menu)
d->m_buildActionContextMenu = new QAction(tr("Build"), this);
cmd = Core::ActionManager::registerAction(d->m_buildActionContextMenu, Constants::BUILDCM, projecTreeContext);
cmd->setAttribute(Core::Command::CA_UpdateText);
cmd = ActionManager::registerAction(d->m_buildActionContextMenu, Constants::BUILDCM, projecTreeContext);
cmd->setAttribute(Command::CA_UpdateText);
mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_BUILD);
// rebuild action (context menu)
d->m_rebuildActionContextMenu = new QAction(tr("Rebuild"), this);
cmd = Core::ActionManager::registerAction(d->m_rebuildActionContextMenu, Constants::REBUILDCM, projecTreeContext);
cmd->setAttribute(Core::Command::CA_UpdateText);
cmd = ActionManager::registerAction(d->m_rebuildActionContextMenu, Constants::REBUILDCM, projecTreeContext);
cmd->setAttribute(Command::CA_UpdateText);
mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_REBUILD);
// clean action (context menu)
d->m_cleanActionContextMenu = new QAction(tr("Clean"), this);
cmd = Core::ActionManager::registerAction(d->m_cleanActionContextMenu, Constants::CLEANCM, projecTreeContext);
cmd->setAttribute(Core::Command::CA_UpdateText);
cmd = ActionManager::registerAction(d->m_cleanActionContextMenu, Constants::CLEANCM, projecTreeContext);
cmd->setAttribute(Command::CA_UpdateText);
mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_REBUILD);
// build without dependencies action
d->m_buildProjectOnlyAction = new QAction(tr("Build Without Dependencies"), this);
cmd = Core::ActionManager::registerAction(d->m_buildProjectOnlyAction, Constants::BUILDPROJECTONLY, globalcontext);
cmd = ActionManager::registerAction(d->m_buildProjectOnlyAction, Constants::BUILDPROJECTONLY, globalcontext);
// rebuild without dependencies action
d->m_rebuildProjectOnlyAction = new QAction(tr("Rebuild Without Dependencies"), this);
cmd = Core::ActionManager::registerAction(d->m_rebuildProjectOnlyAction, Constants::REBUILDPROJECTONLY, globalcontext);
cmd = ActionManager::registerAction(d->m_rebuildProjectOnlyAction, Constants::REBUILDPROJECTONLY, globalcontext);
// deploy without dependencies action
d->m_deployProjectOnlyAction = new QAction(tr("Deploy Without Dependencies"), this);
cmd = Core::ActionManager::registerAction(d->m_deployProjectOnlyAction, Constants::DEPLOYPROJECTONLY, globalcontext);
cmd = ActionManager::registerAction(d->m_deployProjectOnlyAction, Constants::DEPLOYPROJECTONLY, globalcontext);
// clean without dependencies action
d->m_cleanProjectOnlyAction = new QAction(tr("Clean Without Dependencies"), this);
cmd = Core::ActionManager::registerAction(d->m_cleanProjectOnlyAction, Constants::CLEANPROJECTONLY, globalcontext);
cmd = ActionManager::registerAction(d->m_cleanProjectOnlyAction, Constants::CLEANPROJECTONLY, globalcontext);
// deploy action (context menu)
d->m_deployActionContextMenu = new QAction(tr("Deploy"), this);
cmd = Core::ActionManager::registerAction(d->m_deployActionContextMenu, Constants::DEPLOYCM, projecTreeContext);
cmd = ActionManager::registerAction(d->m_deployActionContextMenu, Constants::DEPLOYCM, projecTreeContext);
mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_RUN);
d->m_runActionContextMenu = new QAction(runIcon, tr("Run"), this);
cmd = Core::ActionManager::registerAction(d->m_runActionContextMenu, Constants::RUNCONTEXTMENU, projecTreeContext);
cmd = ActionManager::registerAction(d->m_runActionContextMenu, Constants::RUNCONTEXTMENU, projecTreeContext);
mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_RUN);
msubProjectContextMenu->addAction(cmd, Constants::G_PROJECT_RUN);
// add new file action
d->m_addNewFileAction = new QAction(tr("Add New..."), this);
cmd = Core::ActionManager::registerAction(d->m_addNewFileAction, ProjectExplorer::Constants::ADDNEWFILE,
cmd = ActionManager::registerAction(d->m_addNewFileAction, ProjectExplorer::Constants::ADDNEWFILE,
projecTreeContext);
mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_FILES);
msubProjectContextMenu->addAction(cmd, Constants::G_PROJECT_FILES);
......@@ -789,7 +791,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
// add existing file action
d->m_addExistingFilesAction = new QAction(tr("Add Existing Files..."), this);
cmd = Core::ActionManager::registerAction(d->m_addExistingFilesAction, ProjectExplorer::Constants::ADDEXISTINGFILES,
cmd = ActionManager::registerAction(d->m_addExistingFilesAction, ProjectExplorer::Constants::ADDEXISTINGFILES,
projecTreeContext);
mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_FILES);
msubProjectContextMenu->addAction(cmd, Constants::G_PROJECT_FILES);
......@@ -797,37 +799,37 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
// new subproject action
d->m_addNewSubprojectAction = new QAction(tr("New Subproject..."), this);
cmd = Core::ActionManager::registerAction(d->m_addNewSubprojectAction, ProjectExplorer::Constants::ADDNEWSUBPROJECT,
cmd = ActionManager::registerAction(d->m_addNewSubprojectAction, ProjectExplorer::Constants::ADDNEWSUBPROJECT,
projecTreeContext);
mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_FILES);
msubProjectContextMenu->addAction(cmd, Constants::G_PROJECT_FILES);
// unload project again, in right position
mprojectContextMenu->addAction(Core::ActionManager::command(Constants::UNLOAD), Constants::G_PROJECT_LAST);
mprojectContextMenu->addAction(ActionManager::command(Constants::UNLOAD), Constants::G_PROJECT_LAST);
// remove file action
d->m_removeFileAction = new QAction(tr("Remove File..."), this);
cmd = Core::ActionManager::registerAction(d->m_removeFileAction, ProjectExplorer::Constants::REMOVEFILE,
cmd = ActionManager::registerAction(d->m_removeFileAction, ProjectExplorer::Constants::REMOVEFILE,
projecTreeContext);
cmd->setDefaultKeySequence(QKeySequence::Delete);
mfileContextMenu->addAction(cmd, Constants::G_FILE_OTHER);
//: Remove project from parent profile (Project explorer view); will not physically delete any files.
d->m_removeProjectAction = new QAction(tr("Remove Project..."), this);
cmd = Core::ActionManager::registerAction(d->m_removeProjectAction, ProjectExplorer::Constants::REMOVEPROJECT,
cmd = ActionManager::registerAction(d->m_removeProjectAction, ProjectExplorer::Constants::REMOVEPROJECT,
projecTreeContext);
msubProjectContextMenu->addAction(cmd, Constants::G_PROJECT_FILES);
// delete file action
d->m_deleteFileAction = new QAction(tr("Delete File..."), this);
cmd = Core::ActionManager::registerAction(d->m_deleteFileAction, ProjectExplorer::Constants::DELETEFILE,
cmd = ActionManager::registerAction(d->m_deleteFileAction, ProjectExplorer::Constants::DELETEFILE,
projecTreeContext);
cmd->setDefaultKeySequence(QKeySequence::Delete);
mfileContextMenu->addAction(cmd, Constants::G_FILE_OTHER);
// renamefile action
d->m_renameFileAction = new QAction(tr("Rename..."), this);
cmd = Core::ActionManager::registerAction(d->m_renameFileAction, ProjectExplorer::Constants::RENAMEFILE,
cmd = ActionManager::registerAction(d->m_renameFileAction, ProjectExplorer::Constants::RENAMEFILE,
projecTreeContext);
mfileContextMenu->addAction(cmd, Constants::G_FILE_OTHER);
// Not yet used by anyone, so hide for now
......@@ -839,17 +841,17 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
d->m_setStartupProjectAction = new Utils::ParameterAction(tr("Set as Active Project"),
tr("Set \"%1\" as Active Project"),
Utils::ParameterAction::AlwaysEnabled, this);
cmd = Core::ActionManager::registerAction(d->m_setStartupProjectAction, ProjectExplorer::Constants::SETSTARTUP,
cmd = ActionManager::registerAction(d->m_setStartupProjectAction, ProjectExplorer::Constants::SETSTARTUP,
projecTreeContext);
cmd->setAttribute(Core::Command::CA_UpdateText);
cmd->setAttribute(Command::CA_UpdateText);
cmd->setDescription(d->m_setStartupProjectAction->text());
mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_FIRST);
// Collapse All.
d->m_projectTreeCollapseAllAction = new QAction(tr("Collapse All"), this);
cmd = Core::ActionManager::registerAction(d->m_projectTreeCollapseAllAction, Constants::PROJECTTREE_COLLAPSE_ALL,
cmd = ActionManager::registerAction(d->m_projectTreeCollapseAllAction, Constants::PROJECTTREE_COLLAPSE_ALL,
projecTreeContext);
const Core::Id treeGroup = Constants::G_PROJECT_TREE;
const Id treeGroup = Constants::G_PROJECT_TREE;
mfileContextMenu->addSeparator(globalcontext, treeGroup);
mfileContextMenu->addAction(cmd, treeGroup);
msubProjectContextMenu->addSeparator(globalcontext, treeGroup);
......@@ -865,16 +867,16 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
d->m_projectSelectorAction = new QAction(this);
d->m_projectSelectorAction->setCheckable(true);
d->m_projectSelectorAction->setEnabled(false);
QWidget *mainWindow = Core::ICore::mainWindow();
QWidget *mainWindow = ICore::mainWindow();
d->m_targetSelector = new Internal::MiniProjectTargetSelector(d->m_projectSelectorAction, d->m_session, mainWindow);
connect(d->m_projectSelectorAction, SIGNAL(triggered()), d->m_targetSelector, SLOT(show()));
Core::ModeManager::addProjectSelector(d->m_projectSelectorAction);
ModeManager::addProjectSelector(d->m_projectSelectorAction);
d->m_projectSelectorActionMenu = new QAction(this);
d->m_projectSelectorActionMenu->setEnabled(false);
d->m_projectSelectorActionMenu->setText(tr("Open Build and Run Kit Selector..."));
connect(d->m_projectSelectorActionMenu, SIGNAL(triggered()), d->m_targetSelector, SLOT(toggleVisible()));
cmd = Core::ActionManager::registerAction(d->m_projectSelectorActionMenu, ProjectExplorer::Constants::SELECTTARGET,
cmd = ActionManager::registerAction(d->m_projectSelectorActionMenu, ProjectExplorer::Constants::SELECTTARGET,
globalcontext);
mbuild->addAction(cmd, Constants::G_BUILD_RUN);
......@@ -882,17 +884,17 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
d->m_projectSelectorActionQuick->setEnabled(false);
d->m_projectSelectorActionQuick->setText(tr("Quick Switch Kit Selector"));
connect(d->m_projectSelectorActionQuick, SIGNAL(triggered()), d->m_targetSelector, SLOT(nextOrShow()));
cmd = Core::ActionManager::registerAction(d->m_projectSelectorActionQuick, ProjectExplorer::Constants::SELECTTARGETQUICK, globalcontext);
cmd = ActionManager::registerAction(d->m_projectSelectorActionQuick, ProjectExplorer::Constants::SELECTTARGETQUICK, globalcontext);
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+T")));
connect(Core::ICore::instance(), SIGNAL(saveSettingsRequested()),
connect(ICore::instance(), SIGNAL(saveSettingsRequested()),
this, SLOT(savePersistentSettings()));
addAutoReleasedObject(new ProjectTreeWidgetFactory);
addAutoReleasedObject(new FolderNavigationWidgetFactory);
addAutoReleasedObject(new DeployConfigurationFactory);
QSettings *s = Core::ICore::settings();
QSettings *s = ICore::settings();
const QStringList fileNames =
s->value(QLatin1String("ProjectExplorer/RecentProjects/FileNames")).toStringList();
const QStringList displayNames =
......@@ -985,24 +987,24 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
updateActions();
connect(Core::ICore::instance(), SIGNAL(coreAboutToOpen()),
connect(ICore::instance(), SIGNAL(coreAboutToOpen()),
this, SLOT(determineSessionToRestoreAtStartup()));