Browse Source

Attempt to fix module order in manufacturer list

tags/v0.5.0
Andrew Belt 7 years ago
parent
commit
877083e9d9
1 changed files with 10 additions and 18 deletions
  1. +10
    -18
      src/app/RackWidget.cpp

+ 10
- 18
src/app/RackWidget.cpp View File

@@ -398,32 +398,24 @@ struct AddManufacturerMenuItem : MenuItem {
std::string manufacturerName; std::string manufacturerName;
Vec modulePos; Vec modulePos;
Menu *createChildMenu() override { Menu *createChildMenu() override {
Menu *menu = new Menu();

// Collect models which have this manufacturer name // Collect models which have this manufacturer name
std::set<Model*> models;
for (Plugin *plugin : gPlugins) { for (Plugin *plugin : gPlugins) {
for (Model *model : plugin->models) { for (Model *model : plugin->models) {
if (model->manufacturerName == manufacturerName) { if (model->manufacturerName == manufacturerName) {
models.insert(model);
AddModuleMenuItem *item = new AddModuleMenuItem();
item->text = model->name;
// item->rightText = model->plugin->slug;
// if (!model->plugin->version.empty())
// item->rightText += " v" + model->plugin->version;
item->model = model;
item->modulePos = modulePos;
menu->pushChild(item);
} }
} }
} }


if (models.empty())
return NULL;

// Model items
Menu *menu = new Menu();
for (Model *model : models) {
AddModuleMenuItem *item = new AddModuleMenuItem();
item->text = model->name;
// item->rightText = model->plugin->slug;
// if (!model->plugin->version.empty())
// item->rightText += " v" + model->plugin->version;
item->model = model;
item->modulePos = modulePos;
menu->pushChild(item);
}

// Metadata items // Metadata items
/* /*
{ {


Loading…
Cancel
Save