From 5adb65655028fe41ce2f0d9d1990a01d01dc33f4 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 31 Mar 2023 15:49:51 +0200 Subject: [PATCH] Show locator filter descriptions more prominently - Sort items in the menu. - Disable items for disabled filters. - Show a tool tip when hovering over the magnifying glass menu. - Add descriptions to all filters and make them more consistent. Change-Id: Ic03e303c50422f9de5dd3c512fe32bbdc958d2ba Reviewed-by: David Schulz Reviewed-by: Qt CI Bot --- src/plugins/bookmarks/bookmarkfilter.cpp | 4 ++-- .../clangcodemodel/clangdlocatorfilters.cpp | 11 +++++++++++ .../cmakeprojectmanager/cmakelocatorfilter.cpp | 6 +++--- .../coreplugin/locator/directoryfilter.cpp | 2 +- .../coreplugin/locator/ilocatorfilter.cpp | 3 +++ src/plugins/coreplugin/locator/ilocatorfilter.h | 3 +++ src/plugins/coreplugin/locator/locator.cpp | 2 ++ .../coreplugin/locator/locatorsettingspage.cpp | 6 ++++-- .../coreplugin/locator/locatorwidget.cpp | 17 +++++++++++++++-- .../coreplugin/locator/opendocumentsfilter.cpp | 1 + .../locator/spotlightlocatorfilter.cpp | 8 ++++---- .../cppeditor/cppcurrentdocumentfilter.cpp | 1 + src/plugins/cppeditor/cppeditorconstants.h | 8 ++++++++ src/plugins/cppeditor/cppincludesfilter.cpp | 2 +- src/plugins/cppeditor/cpplocatorfilter.cpp | 3 +++ src/plugins/fossil/fossilplugin.cpp | 1 + src/plugins/help/helpindexfilter.cpp | 1 + .../languageclient/languageclient_global.h | 11 +++++++++++ src/plugins/languageclient/locatorfilter.cpp | 6 ++++-- .../projectexplorer/allprojectsfilter.cpp | 6 +++--- .../projectexplorer/currentprojectfilter.cpp | 6 +++--- src/plugins/projectexplorer/projectexplorer.cpp | 15 +++++++-------- src/plugins/qmljstools/qmljsfunctionfilter.cpp | 1 + 23 files changed, 93 insertions(+), 31 deletions(-) diff --git a/src/plugins/bookmarks/bookmarkfilter.cpp b/src/plugins/bookmarks/bookmarkfilter.cpp index 2fad930d37e..28a03ce0074 100644 --- a/src/plugins/bookmarks/bookmarkfilter.cpp +++ b/src/plugins/bookmarks/bookmarkfilter.cpp @@ -19,8 +19,8 @@ BookmarkFilter::BookmarkFilter(BookmarkManager *manager) { setId("Bookmarks"); setDisplayName(Tr::tr("Bookmarks")); - setDescription(Tr::tr("Matches all bookmarks. Filter by file name, by the text on the line of the " - "bookmark, or by the bookmark's note text.")); + setDescription(Tr::tr("Locates bookmarks. Filter by file name, by the text on the line of the " + "bookmark, or by the bookmark's note text.")); setPriority(Medium); setDefaultShortcutString("b"); } diff --git a/src/plugins/clangcodemodel/clangdlocatorfilters.cpp b/src/plugins/clangcodemodel/clangdlocatorfilters.cpp index 0f37e4fb554..58166fd499c 100644 --- a/src/plugins/clangcodemodel/clangdlocatorfilters.cpp +++ b/src/plugins/clangcodemodel/clangdlocatorfilters.cpp @@ -50,6 +50,7 @@ public: { setId({}); setDisplayName({}); + setDescription({}); setDefaultShortcutString({}); setEnabled(false); setHidden(true); @@ -63,6 +64,7 @@ public: { setId({}); setDisplayName({}); + setDescription({}); setDefaultShortcutString({}); setEnabled(false); setHidden(true); @@ -82,6 +84,7 @@ public: { setId({}); setDisplayName({}); + setDescription({}); setDefaultShortcutString({}); setEnabled(false); setHidden(true); @@ -94,6 +97,7 @@ public: LspClassesFilter() { setId({}); setDisplayName({}); + setDescription({}); setDefaultShortcutString({}); setEnabled(false); setHidden(true); @@ -112,6 +116,7 @@ public: { setId({}); setDisplayName({}); + setDescription({}); setDefaultShortcutString({}); setEnabled(false); setHidden(true); @@ -125,6 +130,7 @@ public: { setId({}); setDisplayName({}); + setDescription({}); setDefaultShortcutString({}); setEnabled(false); setHidden(true); @@ -148,6 +154,7 @@ ClangGlobalSymbolFilter::ClangGlobalSymbolFilter(ILocatorFilter *cppFilter, { setId(CppEditor::Constants::LOCATOR_FILTER_ID); setDisplayName(::CppEditor::Tr::tr(CppEditor::Constants::LOCATOR_FILTER_DISPLAY_NAME)); + setDescription(::CppEditor::Tr::tr(CppEditor::Constants::LOCATOR_FILTER_DESCRIPTION)); setDefaultShortcutString(":"); setDefaultIncludedByDefault(false); } @@ -175,6 +182,7 @@ ClangClassesFilter::ClangClassesFilter() { setId(CppEditor::Constants::CLASSES_FILTER_ID); setDisplayName(::CppEditor::Tr::tr(CppEditor::Constants::CLASSES_FILTER_DISPLAY_NAME)); + setDescription(::CppEditor::Tr::tr(CppEditor::Constants::CLASSES_FILTER_DESCRIPTION)); setDefaultShortcutString("c"); setDefaultIncludedByDefault(false); } @@ -184,6 +192,7 @@ ClangFunctionsFilter::ClangFunctionsFilter() { setId(CppEditor::Constants::FUNCTIONS_FILTER_ID); setDisplayName(::CppEditor::Tr::tr(CppEditor::Constants::FUNCTIONS_FILTER_DISPLAY_NAME)); + setDescription(::CppEditor::Tr::tr(CppEditor::Constants::FUNCTIONS_FILTER_DESCRIPTION)); setDefaultShortcutString("m"); setDefaultIncludedByDefault(false); } @@ -195,6 +204,7 @@ public: { setId({}); setDisplayName({}); + setDescription({}); setDefaultShortcutString({}); setEnabled(false); setHidden(true); @@ -309,6 +319,7 @@ ClangdCurrentDocumentFilter::ClangdCurrentDocumentFilter() : d(new Private) { setId(CppEditor::Constants::CURRENT_DOCUMENT_FILTER_ID); setDisplayName(::CppEditor::Tr::tr(CppEditor::Constants::CURRENT_DOCUMENT_FILTER_DISPLAY_NAME)); + setDescription(::CppEditor::Tr::tr(CppEditor::Constants::CURRENT_DOCUMENT_FILTER_DESCRIPTION)); setDefaultShortcutString("."); setPriority(High); setDefaultIncludedByDefault(false); diff --git a/src/plugins/cmakeprojectmanager/cmakelocatorfilter.cpp b/src/plugins/cmakeprojectmanager/cmakelocatorfilter.cpp index 7141fb276cb..dfee13d0911 100644 --- a/src/plugins/cmakeprojectmanager/cmakelocatorfilter.cpp +++ b/src/plugins/cmakeprojectmanager/cmakelocatorfilter.cpp @@ -92,7 +92,7 @@ void CMakeTargetLocatorFilter::projectListUpdated() BuildCMakeTargetLocatorFilter::BuildCMakeTargetLocatorFilter() { setId("Build CMake target"); - setDisplayName(Tr::tr("Build CMake target")); + setDisplayName(Tr::tr("Build CMake Target")); setDescription(Tr::tr("Builds a target of any open CMake project.")); setDefaultShortcutString("cm"); setPriority(High); @@ -139,8 +139,8 @@ void BuildCMakeTargetLocatorFilter::accept(const LocatorFilterEntry &selection, OpenCMakeTargetLocatorFilter::OpenCMakeTargetLocatorFilter() { setId("Open CMake target definition"); - setDisplayName(Tr::tr("Open CMake target")); - setDescription(Tr::tr("Jumps to the definition of a target of any open CMake project.")); + setDisplayName(Tr::tr("Open CMake Target")); + setDescription(Tr::tr("Locates the definition of a target of any open CMake project.")); setDefaultShortcutString("cmo"); setPriority(Medium); } diff --git a/src/plugins/coreplugin/locator/directoryfilter.cpp b/src/plugins/coreplugin/locator/directoryfilter.cpp index 88e17bad358..59043051368 100644 --- a/src/plugins/coreplugin/locator/directoryfilter.cpp +++ b/src/plugins/coreplugin/locator/directoryfilter.cpp @@ -75,7 +75,7 @@ DirectoryFilter::DirectoryFilter(Id id) setId(id); setDefaultIncludedByDefault(true); setDisplayName(defaultDisplayName()); - setDescription(Tr::tr("Matches all files from a custom set of directories. Append \"+\" " + setDescription(Tr::tr("Locates files from a custom set of directories. Append \"+\" " "or \":\" to jump to the given line number. Append another " "\"+\" or \":\" to jump to the column number as well.")); diff --git a/src/plugins/coreplugin/locator/ilocatorfilter.cpp b/src/plugins/coreplugin/locator/ilocatorfilter.cpp index 35c934fbc49..e2b1fed4823 100644 --- a/src/plugins/coreplugin/locator/ilocatorfilter.cpp +++ b/src/plugins/coreplugin/locator/ilocatorfilter.cpp @@ -844,7 +844,10 @@ ILocatorFilter::Priority ILocatorFilter::priority() const */ void ILocatorFilter::setEnabled(bool enabled) { + if (enabled == m_enabled) + return; m_enabled = enabled; + emit enabledChanged(m_enabled); } /*! diff --git a/src/plugins/coreplugin/locator/ilocatorfilter.h b/src/plugins/coreplugin/locator/ilocatorfilter.h index 3babe87516c..7d41eba9e13 100644 --- a/src/plugins/coreplugin/locator/ilocatorfilter.h +++ b/src/plugins/coreplugin/locator/ilocatorfilter.h @@ -251,6 +251,9 @@ public: public slots: void setEnabled(bool enabled); +signals: + void enabledChanged(bool enabled); + protected: void setHidden(bool hidden); void setId(Utils::Id id); diff --git a/src/plugins/coreplugin/locator/locator.cpp b/src/plugins/coreplugin/locator/locator.cpp index d43b77e7508..dab6cf364cf 100644 --- a/src/plugins/coreplugin/locator/locator.cpp +++ b/src/plugins/coreplugin/locator/locator.cpp @@ -66,6 +66,7 @@ public: LocatorData::LocatorData() { + m_urlFilter.setDescription(Tr::tr("Triggers a web search with the selected search engine.")); m_urlFilter.setDefaultShortcutString("r"); m_urlFilter.addDefaultUrl("https://www.bing.com/search?q=%1"); m_urlFilter.addDefaultUrl("https://www.google.com/search?q=%1"); @@ -75,6 +76,7 @@ LocatorData::LocatorData() "http://en.cppreference.com/mwiki/index.php?title=Special%3ASearch&search=%1"); m_urlFilter.addDefaultUrl("https://en.wikipedia.org/w/index.php?search=%1"); + m_bugFilter.setDescription(Tr::tr("Triggers a search in the Qt bug tracker.")); m_bugFilter.setDefaultShortcutString("bug"); m_bugFilter.addDefaultUrl("https://bugreports.qt.io/secure/QuickSearch.jspa?searchString=%1"); } diff --git a/src/plugins/coreplugin/locator/locatorsettingspage.cpp b/src/plugins/coreplugin/locator/locatorsettingspage.cpp index 99116eea9c1..bd5a9f63aa7 100644 --- a/src/plugins/coreplugin/locator/locatorsettingspage.cpp +++ b/src/plugins/coreplugin/locator/locatorsettingspage.cpp @@ -101,8 +101,10 @@ QVariant FilterItem::data(int column, int role) const break; } - if (role == Qt::ToolTipRole) - return m_filter->description(); + if (role == Qt::ToolTipRole) { + const QString description = m_filter->description(); + return description.isEmpty() ? QString() : ("" + description.toHtmlEscaped()); + } return QVariant(); } diff --git a/src/plugins/coreplugin/locator/locatorwidget.cpp b/src/plugins/coreplugin/locator/locatorwidget.cpp index bd31b69fe13..889223e440a 100644 --- a/src/plugins/coreplugin/locator/locatorwidget.cpp +++ b/src/plugins/coreplugin/locator/locatorwidget.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -599,6 +600,10 @@ LocatorWidget::LocatorWidget(Locator *locator) connect(m_filterMenu, &QMenu::aboutToShow, this, [this] { m_centeredPopupAction->setChecked(Locator::useCenteredPopupForShortcut()); }); + connect(m_filterMenu, &QMenu::hovered, this, [this](QAction *action) { + ToolTip::show(m_filterMenu->mapToGlobal(m_filterMenu->actionGeometry(action).topRight()), + action->toolTip()); + }); connect(m_centeredPopupAction, &QAction::toggled, locator, [locator](bool toggled) { if (toggled != Locator::useCenteredPopupForShortcut()) { Locator::setUseCenteredPopupForShortcut(toggled); @@ -672,12 +677,20 @@ void LocatorWidget::updatePlaceholderText(Command *command) void LocatorWidget::updateFilterList() { m_filterMenu->clear(); - const QList filters = Locator::filters(); + const QList filters = Utils::sorted(Locator::filters(), + [](ILocatorFilter *a, ILocatorFilter *b) { + return a->displayName() + < b->displayName(); + }); for (ILocatorFilter *filter : filters) { if (filter->shortcutString().isEmpty() || filter->isHidden()) continue; QAction *action = m_filterMenu->addAction(filter->displayName()); - action->setToolTip(filter->description()); + action->setEnabled(filter->isEnabled()); + const QString description = filter->description(); + action->setToolTip(description.isEmpty() ? QString() + : ("" + description.toHtmlEscaped())); + connect(filter, &ILocatorFilter::enabledChanged, action, &QAction::setEnabled); connect(action, &QAction::triggered, this, [this, filter] { Locator::showFilter(filter, this); }); diff --git a/src/plugins/coreplugin/locator/opendocumentsfilter.cpp b/src/plugins/coreplugin/locator/opendocumentsfilter.cpp index 2ec6aca0531..b68142bbb3f 100644 --- a/src/plugins/coreplugin/locator/opendocumentsfilter.cpp +++ b/src/plugins/coreplugin/locator/opendocumentsfilter.cpp @@ -21,6 +21,7 @@ OpenDocumentsFilter::OpenDocumentsFilter() { setId("Open documents"); setDisplayName(Tr::tr("Open Documents")); + setDescription(Tr::tr("Switches to an open document.")); setDefaultShortcutString("o"); setPriority(High); setDefaultIncludedByDefault(true); diff --git a/src/plugins/coreplugin/locator/spotlightlocatorfilter.cpp b/src/plugins/coreplugin/locator/spotlightlocatorfilter.cpp index cc62ec91c06..e266e707680 100644 --- a/src/plugins/coreplugin/locator/spotlightlocatorfilter.cpp +++ b/src/plugins/coreplugin/locator/spotlightlocatorfilter.cpp @@ -225,10 +225,10 @@ SpotlightLocatorFilter::SpotlightLocatorFilter() setDefaultShortcutString("md"); setDefaultIncludedByDefault(false); setDisplayName(Tr::tr("File Name Index")); - setDescription( - Tr::tr("Matches files from a global file system index (Spotlight, Locate, Everything). Append " - "\"+\" or \":\" to jump to the given line number. Append another " - "\"+\" or \":\" to jump to the column number as well.")); + setDescription(Tr::tr( + "Locates files from a global file system index (Spotlight, Locate, Everything). Append " + "\"+\" or \":\" to jump to the given line number. Append another " + "\"+\" or \":\" to jump to the column number as well.")); setConfigurable(true); reset(); } diff --git a/src/plugins/cppeditor/cppcurrentdocumentfilter.cpp b/src/plugins/cppeditor/cppcurrentdocumentfilter.cpp index 838160e918a..e148525b3b3 100644 --- a/src/plugins/cppeditor/cppcurrentdocumentfilter.cpp +++ b/src/plugins/cppeditor/cppcurrentdocumentfilter.cpp @@ -24,6 +24,7 @@ CppCurrentDocumentFilter::CppCurrentDocumentFilter(CppModelManager *manager) { setId(Constants::CURRENT_DOCUMENT_FILTER_ID); setDisplayName(Tr::tr(Constants::CURRENT_DOCUMENT_FILTER_DISPLAY_NAME)); + setDescription(Tr::tr(Constants::CURRENT_DOCUMENT_FILTER_DESCRIPTION)); setDefaultShortcutString("."); setPriority(High); setDefaultIncludedByDefault(false); diff --git a/src/plugins/cppeditor/cppeditorconstants.h b/src/plugins/cppeditor/cppeditorconstants.h index 3c87aa6d63b..179c3b3b9b0 100644 --- a/src/plugins/cppeditor/cppeditorconstants.h +++ b/src/plugins/cppeditor/cppeditorconstants.h @@ -110,12 +110,18 @@ const char CPP_SETTINGS_NAME[] = QT_TRANSLATE_NOOP("QtC::CppEditor", "C++"); const char CURRENT_DOCUMENT_FILTER_ID[] = "Methods in current Document"; const char CURRENT_DOCUMENT_FILTER_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("QtC::CppEditor", "C++ Symbols in Current Document"); +const char CURRENT_DOCUMENT_FILTER_DESCRIPTION[] + = QT_TRANSLATE_NOOP("QtC::CppEditor", "Locates C++ symbols in the current document."); const char CLASSES_FILTER_ID[] = "Classes"; const char CLASSES_FILTER_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("QtC::CppEditor", "C++ Classes"); +const char CLASSES_FILTER_DESCRIPTION[] + = QT_TRANSLATE_NOOP("QtC::CppEditor", "Locates C++ classes in any open project."); const char FUNCTIONS_FILTER_ID[] = "Methods"; const char FUNCTIONS_FILTER_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("QtC::CppEditor", "C++ Functions"); +const char FUNCTIONS_FILTER_DESCRIPTION[] + = QT_TRANSLATE_NOOP("QtC::CppEditor", "Locates C++ functions in any open project."); const char INCLUDES_FILTER_ID[] = "All Included C/C++ Files"; const char INCLUDES_FILTER_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("QtC::CppEditor", @@ -124,6 +130,8 @@ const char INCLUDES_FILTER_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("QtC::CppEditor", const char LOCATOR_FILTER_ID[] = "Classes and Methods"; const char LOCATOR_FILTER_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("QtC::CppEditor", "C++ Classes, Enums, Functions and Type Aliases"); +const char LOCATOR_FILTER_DESCRIPTION[] = QT_TRANSLATE_NOOP( + "QtC::CppEditor", "Locates C++ classes, enums, functions and type aliases in any open project."); const char SYMBOLS_FIND_FILTER_ID[] = "Symbols"; const char SYMBOLS_FIND_FILTER_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("QtC::CppEditor", "C++ Symbols"); diff --git a/src/plugins/cppeditor/cppincludesfilter.cpp b/src/plugins/cppeditor/cppincludesfilter.cpp index 44f21045d24..1c9cb298d4b 100644 --- a/src/plugins/cppeditor/cppincludesfilter.cpp +++ b/src/plugins/cppeditor/cppincludesfilter.cpp @@ -102,7 +102,7 @@ CppIncludesFilter::CppIncludesFilter() setId(Constants::INCLUDES_FILTER_ID); setDisplayName(Tr::tr(Constants::INCLUDES_FILTER_DISPLAY_NAME)); setDescription( - Tr::tr("Matches all files that are included by all C++ files in all projects. Append " + Tr::tr("Locates files that are included by C++ files of any open project. Append " "\"+\" or \":\" to jump to the given line number. Append another " "\"+\" or \":\" to jump to the column number as well.")); setDefaultShortcutString("ai"); diff --git a/src/plugins/cppeditor/cpplocatorfilter.cpp b/src/plugins/cppeditor/cpplocatorfilter.cpp index 671c2d205e6..6a9f50a9c83 100644 --- a/src/plugins/cppeditor/cpplocatorfilter.cpp +++ b/src/plugins/cppeditor/cpplocatorfilter.cpp @@ -167,6 +167,7 @@ CppLocatorFilter::CppLocatorFilter() { setId(Constants::LOCATOR_FILTER_ID); setDisplayName(Tr::tr(Constants::LOCATOR_FILTER_DISPLAY_NAME)); + setDescription(Tr::tr(Constants::LOCATOR_FILTER_DESCRIPTION)); setDefaultShortcutString(":"); setDefaultIncludedByDefault(false); } @@ -263,6 +264,7 @@ CppClassesFilter::CppClassesFilter() { setId(Constants::CLASSES_FILTER_ID); setDisplayName(Tr::tr(Constants::CLASSES_FILTER_DISPLAY_NAME)); + setDescription(Tr::tr(Constants::CLASSES_FILTER_DESCRIPTION)); setDefaultShortcutString("c"); setDefaultIncludedByDefault(false); } @@ -283,6 +285,7 @@ CppFunctionsFilter::CppFunctionsFilter() { setId(Constants::FUNCTIONS_FILTER_ID); setDisplayName(Tr::tr(Constants::FUNCTIONS_FILTER_DISPLAY_NAME)); + setDescription(Tr::tr(Constants::FUNCTIONS_FILTER_DESCRIPTION)); setDefaultShortcutString("m"); setDefaultIncludedByDefault(false); } diff --git a/src/plugins/fossil/fossilplugin.cpp b/src/plugins/fossil/fossilplugin.cpp index 94f800e1ea6..0840841416b 100644 --- a/src/plugins/fossil/fossilplugin.cpp +++ b/src/plugins/fossil/fossilplugin.cpp @@ -293,6 +293,7 @@ FossilPluginPrivate::FossilPluginPrivate() connect(&m_client, &VcsBase::VcsBaseClient::changed, this, &FossilPluginPrivate::changed); m_commandLocator = new Core::CommandLocator("Fossil", "fossil", "fossil", this); + m_commandLocator->setDescription(Tr::tr("Triggers a Fossil version control operation.")); ProjectExplorer::JsonWizardFactory::addWizardPath(Utils::FilePath::fromString(Constants::WIZARD_PATH)); Core::JsExpander::registerGlobalObject("Fossil", [this] { diff --git a/src/plugins/help/helpindexfilter.cpp b/src/plugins/help/helpindexfilter.cpp index 9c2c7ada44c..8146b0aa2df 100644 --- a/src/plugins/help/helpindexfilter.cpp +++ b/src/plugins/help/helpindexfilter.cpp @@ -25,6 +25,7 @@ HelpIndexFilter::HelpIndexFilter() { setId("HelpIndexFilter"); setDisplayName(Tr::tr("Help Index")); + setDescription(Tr::tr("Locates help topics, for example in the Qt documentation.")); setDefaultIncludedByDefault(false); setDefaultShortcutString("?"); setRefreshRecipe(Utils::Tasking::Sync([this] { invalidateCache(); return true; })); diff --git a/src/plugins/languageclient/languageclient_global.h b/src/plugins/languageclient/languageclient_global.h index d115d10a252..2abb395d86e 100644 --- a/src/plugins/languageclient/languageclient_global.h +++ b/src/plugins/languageclient/languageclient_global.h @@ -22,12 +22,23 @@ const char LANGUAGECLIENT_STDIO_SETTINGS_ID[] = "LanguageClient::StdIOSettingsID const char LANGUAGECLIENT_SETTINGS_TR[] = QT_TRANSLATE_NOOP("QtC::LanguageClient", "Language Client"); const char LANGUAGECLIENT_DOCUMENT_FILTER_ID[] = "Current Document Symbols"; const char LANGUAGECLIENT_DOCUMENT_FILTER_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("QtC::LanguageClient", "Symbols in Current Document"); +const char LANGUAGECLIENT_DOCUMENT_FILTER_DESCRIPTION[] + = QT_TRANSLATE_NOOP("QtC::LanguageClient", + "Locates symbols in the current document, based on a language server."); const char LANGUAGECLIENT_WORKSPACE_FILTER_ID[] = "Workspace Symbols"; const char LANGUAGECLIENT_WORKSPACE_FILTER_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("QtC::LanguageClient", "Symbols in Workspace"); +const char LANGUAGECLIENT_WORKSPACE_FILTER_DESCRIPTION[] + = QT_TRANSLATE_NOOP("QtC::LanguageClient", "Locates symbols in the language server workspace."); const char LANGUAGECLIENT_WORKSPACE_CLASS_FILTER_ID[] = "Workspace Classes and Structs"; const char LANGUAGECLIENT_WORKSPACE_CLASS_FILTER_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("QtC::LanguageClient", "Classes and Structs in Workspace"); +const char LANGUAGECLIENT_WORKSPACE_CLASS_FILTER_DESCRIPTION[] + = QT_TRANSLATE_NOOP("QtC::LanguageClient", + "Locates classes and structs in the language server workspace."); const char LANGUAGECLIENT_WORKSPACE_METHOD_FILTER_ID[] = "Workspace Functions and Methods"; const char LANGUAGECLIENT_WORKSPACE_METHOD_FILTER_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("QtC::LanguageClient", "Functions and Methods in Workspace"); +const char LANGUAGECLIENT_WORKSPACE_METHOD_FILTER_DESCRIPTION[] + = QT_TRANSLATE_NOOP("QtC::LanguageClient", + "Locates functions and methods in the language server workspace."); const char CALL_HIERARCHY_FACTORY_ID[] = "LanguageClient.CallHierarchy"; diff --git a/src/plugins/languageclient/locatorfilter.cpp b/src/plugins/languageclient/locatorfilter.cpp index fb883c7603d..563f418e2a7 100644 --- a/src/plugins/languageclient/locatorfilter.cpp +++ b/src/plugins/languageclient/locatorfilter.cpp @@ -114,8 +114,7 @@ DocumentLocatorFilter::DocumentLocatorFilter() { setId(Constants::LANGUAGECLIENT_DOCUMENT_FILTER_ID); setDisplayName(Tr::tr(Constants::LANGUAGECLIENT_DOCUMENT_FILTER_DISPLAY_NAME)); - setDescription( - Tr::tr("Matches all symbols from the current document, based on a language server.")); + setDescription(Tr::tr(Constants::LANGUAGECLIENT_DOCUMENT_FILTER_DESCRIPTION)); setDefaultShortcutString("."); setDefaultIncludedByDefault(false); setPriority(ILocatorFilter::Low); @@ -292,6 +291,7 @@ WorkspaceLocatorFilter::WorkspaceLocatorFilter(const QVector &filter { setId(Constants::LANGUAGECLIENT_WORKSPACE_FILTER_ID); setDisplayName(Tr::tr(Constants::LANGUAGECLIENT_WORKSPACE_FILTER_DISPLAY_NAME)); + setDescription(Tr::tr(Constants::LANGUAGECLIENT_WORKSPACE_FILTER_DESCRIPTION)); setDefaultShortcutString(":"); setDefaultIncludedByDefault(false); setPriority(ILocatorFilter::Low); @@ -388,6 +388,7 @@ WorkspaceClassLocatorFilter::WorkspaceClassLocatorFilter() { setId(Constants::LANGUAGECLIENT_WORKSPACE_CLASS_FILTER_ID); setDisplayName(Tr::tr(Constants::LANGUAGECLIENT_WORKSPACE_CLASS_FILTER_DISPLAY_NAME)); + setDescription(Tr::tr(Constants::LANGUAGECLIENT_WORKSPACE_CLASS_FILTER_DESCRIPTION)); setDefaultShortcutString("c"); } @@ -396,6 +397,7 @@ WorkspaceMethodLocatorFilter::WorkspaceMethodLocatorFilter() { setId(Constants::LANGUAGECLIENT_WORKSPACE_METHOD_FILTER_ID); setDisplayName(Tr::tr(Constants::LANGUAGECLIENT_WORKSPACE_METHOD_FILTER_DISPLAY_NAME)); + setDescription(Tr::tr(Constants::LANGUAGECLIENT_WORKSPACE_METHOD_FILTER_DESCRIPTION)); setDefaultShortcutString("m"); } diff --git a/src/plugins/projectexplorer/allprojectsfilter.cpp b/src/plugins/projectexplorer/allprojectsfilter.cpp index 3a9b8e7a45a..d89e111150d 100644 --- a/src/plugins/projectexplorer/allprojectsfilter.cpp +++ b/src/plugins/projectexplorer/allprojectsfilter.cpp @@ -20,9 +20,9 @@ AllProjectsFilter::AllProjectsFilter() { setId("Files in any project"); setDisplayName(Tr::tr("Files in Any Project")); - setDescription(Tr::tr("Matches all files of all open projects. Append \"+\" or " - "\":\" to jump to the given line number. Append another " - "\"+\" or \":\" to jump to the column number as well.")); + setDescription(Tr::tr("Locates files of all open projects. Append \"+\" or " + "\":\" to jump to the given line number. Append another " + "\"+\" or \":\" to jump to the column number as well.")); setDefaultShortcutString("a"); setDefaultIncludedByDefault(true); setRefreshRecipe(Tasking::Sync([this] { invalidateCache(); return true; })); diff --git a/src/plugins/projectexplorer/currentprojectfilter.cpp b/src/plugins/projectexplorer/currentprojectfilter.cpp index 8d7d699a693..c8d39d5403d 100644 --- a/src/plugins/projectexplorer/currentprojectfilter.cpp +++ b/src/plugins/projectexplorer/currentprojectfilter.cpp @@ -20,9 +20,9 @@ CurrentProjectFilter::CurrentProjectFilter() { setId("Files in current project"); setDisplayName(Tr::tr("Files in Current Project")); - setDescription(Tr::tr("Matches all files from the current document's project. Append \"+\" " - "or \":\" to jump to the given line number. Append another " - "\"+\" or \":\" to jump to the column number as well.")); + setDescription(Tr::tr("Locates files from the current document's project. Append \"+\" " + "or \":\" to jump to the given line number. Append another " + "\"+\" or \":\" to jump to the column number as well.")); setDefaultShortcutString("p"); setDefaultIncludedByDefault(false); setRefreshRecipe(Tasking::Sync([this] { invalidateCache(); return true; })); diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 7e4938a2042..57fe61080e1 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -4357,10 +4357,9 @@ AllProjectFilesFilter::AllProjectFilesFilter() setDefaultIncludedByDefault(false); // but not included in default setFilters({}); setIsCustomFilter(false); - setDescription(Tr::tr( - "Matches all files from all project directories. Append \"+\" or " - "\":\" to jump to the given line number. Append another " - "\"+\" or \":\" to jump to the column number as well.")); + setDescription(Tr::tr("Locates files from all project directories. Append \"+\" or " + "\":\" to jump to the given line number. Append another " + "\"+\" or \":\" to jump to the column number as well.")); ProjectManager *projectManager = ProjectManager::instance(); QTC_ASSERT(projectManager, return); @@ -4440,8 +4439,8 @@ static RunConfiguration *runConfigurationForDisplayName(const QString &displayNa RunRunConfigurationLocatorFilter::RunRunConfigurationLocatorFilter() { setId("Run run configuration"); - setDisplayName(Tr::tr("Run run configuration")); - setDescription(Tr::tr("Run a run configuration of the current active project")); + setDisplayName(Tr::tr("Run Run Configuration")); + setDescription(Tr::tr("Runs a run configuration of the active project.")); setDefaultShortcutString("rr"); setPriority(Medium); } @@ -4463,8 +4462,8 @@ void RunRunConfigurationLocatorFilter::accept(const LocatorFilterEntry &selectio SwitchToRunConfigurationLocatorFilter::SwitchToRunConfigurationLocatorFilter() { setId("Switch run configuration"); - setDisplayName(Tr::tr("Switch run configuration")); - setDescription(Tr::tr("Switch active run configuration")); + setDisplayName(Tr::tr("Switch Run Configuration")); + setDescription(Tr::tr("Switches the active run configuration of the active project.")); setDefaultShortcutString("sr"); setPriority(Medium); } diff --git a/src/plugins/qmljstools/qmljsfunctionfilter.cpp b/src/plugins/qmljstools/qmljsfunctionfilter.cpp index 8d6206d0c9f..22050f7a9c7 100644 --- a/src/plugins/qmljstools/qmljsfunctionfilter.cpp +++ b/src/plugins/qmljstools/qmljsfunctionfilter.cpp @@ -20,6 +20,7 @@ FunctionFilter::FunctionFilter(LocatorData *data, QObject *parent) { setId("Functions"); setDisplayName(Tr::tr("QML Functions")); + setDescription(Tr::tr("Locates QML functions in any open project.")); setDefaultShortcutString("m"); setDefaultIncludedByDefault(false); }