Skip to content

Allow search bar name to be set in code #686

@EmmanuelMess

Description

@EmmanuelMess

The search bar name currently is not editable from code:

gz-gui/src/MainWindow.cc

Lines 125 to 152 in 72a1346

QStringList pluginNames;
auto plugins = App()->PluginList();
for (auto const &path : plugins)
{
for (auto const &plugin : path.second)
{
// TODO(anyone): Move this into gz-plugin to be reusable
// Remove shared library prefix and shared library suffix
auto pluginName = plugin.substr(
strlen(SHARED_LIBRARY_PREFIX),
plugin.length() - strlen(SHARED_LIBRARY_PREFIX) -
strlen(SHARED_LIBRARY_SUFFIX));
// Split WWWCamelCase3D -> WWW Camel Case 3D
std::regex reg("(\\B[A-Z][a-z])|(\\B[0-9])");
pluginName = std::regex_replace(pluginName, reg, " $&");
// Show?
if (this->dataPtr->windowConfig.pluginsFromPaths ||
std::find(this->dataPtr->windowConfig.showPlugins.begin(),
this->dataPtr->windowConfig.showPlugins.end(),
pluginName) !=
this->dataPtr->windowConfig.showPlugins.end())
{
pluginNames.append(QString::fromStdString(pluginName));
}
}

The search bar name should be both translatable and not related to the file name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Inbox

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions