From 3eb71d95f83301d4c2cac94aed6e62327fb2d989 Mon Sep 17 00:00:00 2001 From: Nikita Baryshnikov Date: Thu, 8 Mar 2018 09:34:17 +0300 Subject: [PATCH] ProjectExplorer: return back actions text for Add New, Rename and Remove File actions. FolderNavigationWidgetFactory::registerActions with empty action text is called before ProjectExplorerPlugin::initialize with proper action registration Change-Id: I719f58735d672ad0831162a5f0cccebf73354976 Reviewed-by: Eike Ziller --- src/plugins/projectexplorer/foldernavigationwidget.cpp | 6 +++--- src/plugins/projectexplorer/projectexplorer.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/projectexplorer/foldernavigationwidget.cpp b/src/plugins/projectexplorer/foldernavigationwidget.cpp index 7af34b24c2a..43dbf18aa07 100644 --- a/src/plugins/projectexplorer/foldernavigationwidget.cpp +++ b/src/plugins/projectexplorer/foldernavigationwidget.cpp @@ -850,21 +850,21 @@ void FolderNavigationWidgetFactory::registerActions() { Core::Context context(C_FOLDERNAVIGATIONWIDGET); - auto add = new QAction(this); + auto add = new QAction(tr("Add New..."), this); Core::ActionManager::registerAction(add, Constants::ADDNEWFILE, context); connect(add, &QAction::triggered, Core::ICore::instance(), [] { if (auto navWidget = currentFolderNavigationWidget()) navWidget->addNewItem(); }); - auto rename = new QAction(this); + auto rename = new QAction(tr("Rename..."), this); Core::ActionManager::registerAction(rename, Constants::RENAMEFILE, context); connect(rename, &QAction::triggered, Core::ICore::instance(), [] { if (auto navWidget = currentFolderNavigationWidget()) navWidget->editCurrentItem(); }); - auto remove = new QAction(this); + auto remove = new QAction(tr("Remove..."), this); Core::ActionManager::registerAction(remove, Constants::REMOVEFILE, context); connect(remove, &QAction::triggered, Core::ICore::instance(), [] { if (auto navWidget = currentFolderNavigationWidget()) diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 154a6a862db..b4fab761f57 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -1035,7 +1035,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er msubProjectContextMenu->addAction(cmd, Constants::G_PROJECT_RUN); // add new file action - dd->m_addNewFileAction = new QAction(tr("Add New..."), this); + dd->m_addNewFileAction = new QAction(this); cmd = ActionManager::registerAction(dd->m_addNewFileAction, Constants::ADDNEWFILE, projecTreeContext); mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_FILES); @@ -1081,7 +1081,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er mfileContextMenu->addAction(cmd, Constants::G_FILE_OTHER); // remove file action - dd->m_removeFileAction = new QAction(tr("Remove File..."), this); + dd->m_removeFileAction = new QAction(this); cmd = ActionManager::registerAction(dd->m_removeFileAction, Constants::REMOVEFILE, projecTreeContext); cmd->setDefaultKeySequence(QKeySequence::Delete); @@ -1107,7 +1107,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er mfileContextMenu->addAction(cmd, Constants::G_FILE_OTHER); // renamefile action - dd->m_renameFileAction = new QAction(tr("Rename..."), this); + dd->m_renameFileAction = new QAction(this); cmd = ActionManager::registerAction(dd->m_renameFileAction, Constants::RENAMEFILE, projecTreeContext); mfileContextMenu->addAction(cmd, Constants::G_FILE_OTHER);