forked from qt-creator/qt-creator
readd "Recent Projects" menu.
This commit is contained in:
@@ -406,16 +406,6 @@ bool ProjectExplorerPlugin::initialize(const QStringList & /*arguments*/, QStrin
|
|||||||
msessionContextMenu->addAction(cmd, Constants::G_SESSION_FILES);
|
msessionContextMenu->addAction(cmd, Constants::G_SESSION_FILES);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0
|
|
||||||
// recent projects menu
|
|
||||||
Core::IActionContainer *mrecent =
|
|
||||||
am->createMenu(Constants::M_RECENTPROJECTS);
|
|
||||||
mrecent->menu()->setTitle("Recent Projects");
|
|
||||||
mfile->addMenu(mrecent, Core::Constants::G_FILE_PROJECT);
|
|
||||||
connect(mfile->menu(), SIGNAL(aboutToShow()),
|
|
||||||
this, SLOT(updateRecentProjectMenu()));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Default open action
|
// Default open action
|
||||||
m_openFileAction = new QAction(tr("Open File"), this);
|
m_openFileAction = new QAction(tr("Open File"), this);
|
||||||
cmd = am->registerAction(m_openFileAction, ProjectExplorer::Constants::OPENFILE,
|
cmd = am->registerAction(m_openFileAction, ProjectExplorer::Constants::OPENFILE,
|
||||||
@@ -425,6 +415,14 @@ bool ProjectExplorerPlugin::initialize(const QStringList & /*arguments*/, QStrin
|
|||||||
// Open With menu
|
// Open With menu
|
||||||
mfilec->addMenu(openWith, ProjectExplorer::Constants::G_FILE_OPEN);
|
mfilec->addMenu(openWith, ProjectExplorer::Constants::G_FILE_OPEN);
|
||||||
|
|
||||||
|
// recent projects menu
|
||||||
|
Core::IActionContainer *mrecent =
|
||||||
|
am->createMenu(Constants::M_RECENTPROJECTS);
|
||||||
|
mrecent->menu()->setTitle("Recent Projects");
|
||||||
|
mfile->addMenu(mrecent, Core::Constants::G_FILE_OPEN);
|
||||||
|
connect(mfile->menu(), SIGNAL(aboutToShow()),
|
||||||
|
this, SLOT(updateRecentProjectMenu()));
|
||||||
|
|
||||||
// unload action
|
// unload action
|
||||||
m_unloadAction = new QAction(tr("Unload Project"), this);
|
m_unloadAction = new QAction(tr("Unload Project"), this);
|
||||||
cmd = am->registerAction(m_unloadAction, Constants::UNLOAD, globalcontext);
|
cmd = am->registerAction(m_unloadAction, Constants::UNLOAD, globalcontext);
|
||||||
@@ -1498,8 +1496,7 @@ void ProjectExplorerPlugin::openRecentProject()
|
|||||||
QAction *a = qobject_cast<QAction*>(sender());
|
QAction *a = qobject_cast<QAction*>(sender());
|
||||||
if (m_recentProjectsActions.contains(a)) {
|
if (m_recentProjectsActions.contains(a)) {
|
||||||
const QString fileName = m_recentProjectsActions.value(a);
|
const QString fileName = m_recentProjectsActions.value(a);
|
||||||
if (ProjectFileFactory *pf = findProjectFileFactory(fileName))
|
openProject(fileName);
|
||||||
pf->open(fileName);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user