diff --git a/src/blackgui/components/dbmappingcomponent.cpp b/src/blackgui/components/dbmappingcomponent.cpp index 4298cca60..5d065dcb7 100644 --- a/src/blackgui/components/dbmappingcomponent.cpp +++ b/src/blackgui/components/dbmappingcomponent.cpp @@ -853,9 +853,6 @@ namespace BlackGui { CDbMappingComponent *mapComp = mappingComponent(); Q_ASSERT_X(mapComp, Q_FUNC_INFO, "no mapping component"); - const bool canConnectDb = sGui->getWebDataServices()->canConnectSwiftDb(); - if (!canConnectDb) { this->nestedCustomMenu(menuActions); return; } - if (!mapComp->currentModelView()->isEmpty() && mapComp->currentModelView()->getMenu().testFlag(CViewBaseNonTemplate::MenuCanStashModels)) { menuActions.addMenuStash(); diff --git a/src/blackgui/components/dbownmodelsetcomponent.cpp b/src/blackgui/components/dbownmodelsetcomponent.cpp index 8b7e438be..4f465e03b 100644 --- a/src/blackgui/components/dbownmodelsetcomponent.cpp +++ b/src/blackgui/components/dbownmodelsetcomponent.cpp @@ -58,7 +58,7 @@ namespace BlackGui ui->tvp_OwnModelSet->addFilterDialog(); ui->tvp_OwnModelSet->setJsonLoad(CAircraftModelView::AllowOnlySingleSimulator | CAircraftModelView::ReduceToOneSimulator); ui->tvp_OwnModelSet->setCustomMenu(new CLoadModelsMenu(this)); - ui->tvp_OwnModelSet->setCustomMenu(new CMergeWithDbDataMenu(ui->tvp_OwnModelSet, this, true)); + ui->tvp_OwnModelSet->setCustomMenu(new CConsolidateWithDbDataMenu(ui->tvp_OwnModelSet, this, true)); ui->tvp_OwnModelSet->menuAddItems(CAircraftModelView::MenuOrderable); ui->tvp_OwnModelSet->setSorting(CAircraftModel::IndexOrderString); ui->tvp_OwnModelSet->initAsOrderable(); @@ -332,7 +332,8 @@ namespace BlackGui void CDbOwnModelSetComponent::CLoadModelsMenu::customMenu(CMenuActions &menuActions) { - const CSimulatorInfo sims = CSimulatorInfo::getLocallyInstalledSimulators(); + // for the moment I use all sims, I could restrict to CSimulatorInfo::getLocallyInstalledSimulators(); + const CSimulatorInfo sims = CSimulatorInfo::allSimulators(); const bool noSims = sims.isNoSimulator() || sims.isUnspecified(); if (!noSims) { diff --git a/src/blackgui/views/aircraftmodelview.cpp b/src/blackgui/views/aircraftmodelview.cpp index 3ca2ef02f..da1ad7ac3 100644 --- a/src/blackgui/views/aircraftmodelview.cpp +++ b/src/blackgui/views/aircraftmodelview.cpp @@ -155,7 +155,7 @@ namespace BlackGui int CAircraftModelView::removeModelsWithModelString(const CAircraftModelList &models, Qt::CaseSensitivity sensitivity) { - return this->removeModelsWithModelString(models.getModelStrings(), sensitivity); + return this->removeModelsWithModelString(models.getModelStringList(), sensitivity); } int CAircraftModelView::replaceOrAddModelsWithString(const CAircraftModelList &models, Qt::CaseSensitivity sensitivity) @@ -294,12 +294,19 @@ namespace BlackGui if (!this->m_menuFlagActions.contains(MenuCanStashModels)) { CMenuActions ma; - ma.addAction(CIcons::appDbStash16(), "Stash selectied", CMenuAction::pathStash(), { this, &CAircraftModelView::ps_requestStash }); + ma.addAction(CIcons::appDbStash16(), "Stash selected", CMenuAction::pathStash(), { this, &CAircraftModelView::ps_requestStash }); QAction *added = ma.addAction(CIcons::appDbStash16(), "Stashing clears selection (on/off)", CMenuAction::pathStash(), { this, &CAircraftModelView::ps_stashingClearsSelection }); added->setCheckable(true); this->m_menuFlagActions.insert(MenuCanStashModels, ma); } - QAction *a = menuActions.addActions(initMenuActions(MenuCanStashModels)).last(); + + // modify menu items + const int selected = this->selectedRowCount(); + const bool tooMany = selected > 500; + const bool canStash = selected > 0 && !tooMany; + QAction *a = menuActions.addActions(initMenuActions(MenuCanStashModels)).first(); + a->setEnabled(canStash); + a = menuActions.addActions(initMenuActions(MenuCanStashModels)).last(); a->setChecked(m_stashingClearsSelection); used = true; } @@ -409,7 +416,7 @@ namespace BlackGui { this->clearSelection(); } - sGui->displayInStatusBar(CStatusMessage(CStatusMessage::SeverityInfo, "Stashed " + models.getModelStrings(true).join(" "))); + sGui->displayInStatusBar(CStatusMessage(CStatusMessage::SeverityInfo, "Stashed " + models.getModelStringList(true).join(" "))); } } // namespace } // namespace