mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 19:05:31 +08:00
Use normal private member functions instead of slots
This commit is contained in:
committed by
Mathew Sutcliffe
parent
6d61935bc7
commit
6a17465633
@@ -90,11 +90,11 @@ namespace BlackGui
|
|||||||
if (model.hasFileName())
|
if (model.hasFileName())
|
||||||
{
|
{
|
||||||
menuActions.addMenuSimulator();
|
menuActions.addMenuSimulator();
|
||||||
this->m_fileAction = menuActions.addAction(this->m_fileAction, CIcons::text16(), "Open simulator file", CMenuAction::pathSimulator(), { this, &CShowSimulatorFileMenu::ps_showSimulatorFile });
|
this->m_fileAction = menuActions.addAction(this->m_fileAction, CIcons::text16(), "Open simulator file", CMenuAction::pathSimulator(), { this, &CShowSimulatorFileMenu::showSimulatorFile });
|
||||||
added = true;
|
added = true;
|
||||||
if (CModelConverterX::supportsModelConverterX())
|
if (CModelConverterX::supportsModelConverterX())
|
||||||
{
|
{
|
||||||
this->m_modelConverterX = menuActions.addAction(this->m_modelConverterX, CIcons::modelConverterX(), "ModelConverterX", CMenuAction::pathSimulator(), { this, &CShowSimulatorFileMenu::ps_startModelConverterX });
|
this->m_modelConverterX = menuActions.addAction(this->m_modelConverterX, CIcons::modelConverterX(), "ModelConverterX", CMenuAction::pathSimulator(), { this, &CShowSimulatorFileMenu::startModelConverterX });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
added = true;
|
added = true;
|
||||||
menuActions.addMenuSimulator();
|
menuActions.addMenuSimulator();
|
||||||
this->m_iconAction = menuActions.addAction(this->m_iconAction, CIcons::appAircraft16(), "Display icon", CMenuAction::pathSimulator(), { this, &CShowSimulatorFileMenu::ps_displayIcon });
|
this->m_iconAction = menuActions.addAction(this->m_iconAction, CIcons::appAircraft16(), "Display icon", CMenuAction::pathSimulator(), { this, &CShowSimulatorFileMenu::displayIcon });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (added)
|
if (added)
|
||||||
@@ -113,7 +113,7 @@ namespace BlackGui
|
|||||||
this->nestedCustomMenu(menuActions);
|
this->nestedCustomMenu(menuActions);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CShowSimulatorFileMenu::ps_showSimulatorFile()
|
void CShowSimulatorFileMenu::showSimulatorFile()
|
||||||
{
|
{
|
||||||
const CAircraftModelView *mv = modelView();
|
const CAircraftModelView *mv = modelView();
|
||||||
if (!mv->hasSingleSelectedRow()) { return; }
|
if (!mv->hasSingleSelectedRow()) { return; }
|
||||||
@@ -126,7 +126,7 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CShowSimulatorFileMenu::ps_displayIcon()
|
void CShowSimulatorFileMenu::displayIcon()
|
||||||
{
|
{
|
||||||
const CAircraftModelView *mv = modelView();
|
const CAircraftModelView *mv = modelView();
|
||||||
if (!mv->hasSingleSelectedRow()) { return; }
|
if (!mv->hasSingleSelectedRow()) { return; }
|
||||||
@@ -144,7 +144,7 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CShowSimulatorFileMenu::ps_startModelConverterX()
|
void CShowSimulatorFileMenu::startModelConverterX()
|
||||||
{
|
{
|
||||||
if (!CModelConverterX::supportsModelConverterX()) { return; }
|
if (!CModelConverterX::supportsModelConverterX()) { return; }
|
||||||
const CAircraftModelView *mv = modelView();
|
const CAircraftModelView *mv = modelView();
|
||||||
@@ -161,7 +161,7 @@ namespace BlackGui
|
|||||||
// it can be the target is not yet known
|
// it can be the target is not yet known
|
||||||
if (modelsTarget)
|
if (modelsTarget)
|
||||||
{
|
{
|
||||||
bool ok = modelsTargetSetable() || modelsTargetUpdatable();
|
const bool ok = modelsTargetSetable() || modelsTargetUpdatable();
|
||||||
Q_ASSERT_X(ok, Q_FUNC_INFO, "Neither setable nor updatable");
|
Q_ASSERT_X(ok, Q_FUNC_INFO, "Neither setable nor updatable");
|
||||||
Q_UNUSED(ok);
|
Q_UNUSED(ok);
|
||||||
}
|
}
|
||||||
@@ -181,15 +181,15 @@ namespace BlackGui
|
|||||||
|
|
||||||
menuActions.addMenuConsolidateModels();
|
menuActions.addMenuConsolidateModels();
|
||||||
|
|
||||||
this->m_consolidateAll = menuActions.addAction(this->m_consolidateAll, CIcons::databaseEdit16(), "All with DB data", CMenuAction::pathViewModelsConsolidate(), { this, &CConsolidateWithDbDataMenu::ps_consolidateData });
|
this->m_consolidateAll = menuActions.addAction(this->m_consolidateAll, CIcons::databaseEdit16(), "All with DB data", CMenuAction::pathViewModelsConsolidate(), { this, &CConsolidateWithDbDataMenu::consolidateData });
|
||||||
if (mv->hasSelection())
|
if (mv->hasSelection())
|
||||||
{
|
{
|
||||||
this->m_consolidateSelected = menuActions.addAction(this->m_consolidateSelected, CIcons::databaseEdit16(), "Selected with DB data", CMenuAction::pathViewModelsConsolidate(), { this, &CConsolidateWithDbDataMenu::ps_consolidateSelectedData });
|
this->m_consolidateSelected = menuActions.addAction(this->m_consolidateSelected, CIcons::databaseEdit16(), "Selected with DB data", CMenuAction::pathViewModelsConsolidate(), { this, &CConsolidateWithDbDataMenu::consolidateSelectedData });
|
||||||
}
|
}
|
||||||
this->nestedCustomMenu(menuActions);
|
this->nestedCustomMenu(menuActions);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CConsolidateWithDbDataMenu::ps_consolidateData()
|
void CConsolidateWithDbDataMenu::consolidateData()
|
||||||
{
|
{
|
||||||
BLACK_VERIFY_X(sGui, Q_FUNC_INFO, "Missing sGui");
|
BLACK_VERIFY_X(sGui, Q_FUNC_INFO, "Missing sGui");
|
||||||
if (!sGui->hasWebDataServices()) { return; }
|
if (!sGui->hasWebDataServices()) { return; }
|
||||||
@@ -231,7 +231,7 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CConsolidateWithDbDataMenu::ps_consolidateSelectedData()
|
void CConsolidateWithDbDataMenu::consolidateSelectedData()
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(sGui, Q_FUNC_INFO, "Missing sGui");
|
Q_ASSERT_X(sGui, Q_FUNC_INFO, "Missing sGui");
|
||||||
if (!sGui->hasWebDataServices()) { return; }
|
if (!sGui->hasWebDataServices()) { return; }
|
||||||
@@ -243,7 +243,7 @@ namespace BlackGui
|
|||||||
CLogMessage(this).warning("No updatable target");
|
CLogMessage(this).warning("No updatable target");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int c = CDatabaseUtils::consolidateModelsWithDbDataAllowsGuiRefresh(models, true, true);
|
const int c = CDatabaseUtils::consolidateModelsWithDbDataAllowsGuiRefresh(models, true, true);
|
||||||
if (c > 0 && this->modelsTargetUpdatable())
|
if (c > 0 && this->modelsTargetUpdatable())
|
||||||
{
|
{
|
||||||
this->modelsTargetUpdatable()->updateModels(models);
|
this->modelsTargetUpdatable()->updateModels(models);
|
||||||
@@ -268,7 +268,7 @@ namespace BlackGui
|
|||||||
// it can be the target is not yet known
|
// it can be the target is not yet known
|
||||||
if (modelsTarget)
|
if (modelsTarget)
|
||||||
{
|
{
|
||||||
bool ok = modelsTargetSetable() || modelsTargetUpdatable();
|
const bool ok = modelsTargetSetable() || modelsTargetUpdatable();
|
||||||
Q_ASSERT_X(ok, Q_FUNC_INFO, "Neither setable nor updatable");
|
Q_ASSERT_X(ok, Q_FUNC_INFO, "Neither setable nor updatable");
|
||||||
Q_UNUSED(ok);
|
Q_UNUSED(ok);
|
||||||
}
|
}
|
||||||
@@ -288,15 +288,15 @@ namespace BlackGui
|
|||||||
|
|
||||||
menuActions.addMenuConsolidateModels();
|
menuActions.addMenuConsolidateModels();
|
||||||
|
|
||||||
this->m_consolidateAll = menuActions.addAction(this->m_consolidateAll, CIcons::appModels16(), "All with simulator models", CMenuAction::pathViewModelsConsolidate(), { this, &CConsolidateWithSimulatorModels::ps_consolidateData });
|
this->m_consolidateAll = menuActions.addAction(this->m_consolidateAll, CIcons::appModels16(), "All with simulator models", CMenuAction::pathViewModelsConsolidate(), { this, &CConsolidateWithSimulatorModels::consolidateData });
|
||||||
if (mv->hasSelection())
|
if (mv->hasSelection())
|
||||||
{
|
{
|
||||||
this->m_consolidateSelected = menuActions.addAction(this->m_consolidateSelected, CIcons::appModels16(), "Selected with simulator models", CMenuAction::pathViewModelsConsolidate(), { this, &CConsolidateWithSimulatorModels::ps_consolidateSelectedData });
|
this->m_consolidateSelected = menuActions.addAction(this->m_consolidateSelected, CIcons::appModels16(), "Selected with simulator models", CMenuAction::pathViewModelsConsolidate(), { this, &CConsolidateWithSimulatorModels::consolidateSelectedData });
|
||||||
}
|
}
|
||||||
this->nestedCustomMenu(menuActions);
|
this->nestedCustomMenu(menuActions);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CConsolidateWithSimulatorModels::ps_consolidateData()
|
void CConsolidateWithSimulatorModels::consolidateData()
|
||||||
{
|
{
|
||||||
bool filtered = false;
|
bool filtered = false;
|
||||||
const CAircraftModelList models(this->getAllOrAllFilteredAircraftModels(&filtered));
|
const CAircraftModelList models(this->getAllOrAllFilteredAircraftModels(&filtered));
|
||||||
@@ -323,7 +323,7 @@ namespace BlackGui
|
|||||||
this->modelView()->hideLoadIndicator(i);
|
this->modelView()->hideLoadIndicator(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CConsolidateWithSimulatorModels::ps_consolidateSelectedData()
|
void CConsolidateWithSimulatorModels::consolidateSelectedData()
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(sGui, Q_FUNC_INFO, "Missing sGui");
|
Q_ASSERT_X(sGui, Q_FUNC_INFO, "Missing sGui");
|
||||||
const CAircraftModelList models(this->getSelectedAircraftModels());
|
const CAircraftModelList models(this->getSelectedAircraftModels());
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace BlackGui
|
|||||||
namespace Components { class CDbMappingComponent; }
|
namespace Components { class CDbMappingComponent; }
|
||||||
namespace Menus
|
namespace Menus
|
||||||
{
|
{
|
||||||
//! Menu base for aircraft model view menus
|
//! Menu base class for aircraft model view menus
|
||||||
class IAircraftModelViewMenu : public IMenuDelegate
|
class IAircraftModelViewMenu : public IMenuDelegate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -66,12 +66,11 @@ namespace BlackGui
|
|||||||
//! \copydoc IMenuDelegate::customMenu
|
//! \copydoc IMenuDelegate::customMenu
|
||||||
virtual void customMenu(CMenuActions &menuActions) override;
|
virtual void customMenu(CMenuActions &menuActions) override;
|
||||||
|
|
||||||
private slots:
|
|
||||||
void ps_showSimulatorFile(); //!< simulator file
|
|
||||||
void ps_displayIcon(); //!< aircraft icon if any
|
|
||||||
void ps_startModelConverterX(); //!< show in model converter X
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void showSimulatorFile(); //!< simulator file
|
||||||
|
void displayIcon(); //!< aircraft icon if any
|
||||||
|
void startModelConverterX(); //!< show in model converter X
|
||||||
|
|
||||||
BlackGui::COverlayMessagesFrame *m_messageFrame = nullptr;
|
BlackGui::COverlayMessagesFrame *m_messageFrame = nullptr;
|
||||||
QAction *m_fileAction = nullptr;
|
QAction *m_fileAction = nullptr;
|
||||||
QAction *m_iconAction = nullptr;
|
QAction *m_iconAction = nullptr;
|
||||||
@@ -99,11 +98,10 @@ namespace BlackGui
|
|||||||
//! Change target
|
//! Change target
|
||||||
void setModelsTarget(QObject *target) { this->m_modelsTarget = target; }
|
void setModelsTarget(QObject *target) { this->m_modelsTarget = target; }
|
||||||
|
|
||||||
private slots:
|
|
||||||
void ps_consolidateData();
|
|
||||||
void ps_consolidateSelectedData();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void consolidateData();
|
||||||
|
void consolidateSelectedData();
|
||||||
|
|
||||||
BlackMisc::Simulation::IModelsSetable *modelsTargetSetable() const;
|
BlackMisc::Simulation::IModelsSetable *modelsTargetSetable() const;
|
||||||
BlackMisc::Simulation::IModelsUpdatable *modelsTargetUpdatable() const;
|
BlackMisc::Simulation::IModelsUpdatable *modelsTargetUpdatable() const;
|
||||||
QObject *m_modelsTarget = nullptr; //!< optional target for setting/updating the models
|
QObject *m_modelsTarget = nullptr; //!< optional target for setting/updating the models
|
||||||
@@ -132,11 +130,10 @@ namespace BlackGui
|
|||||||
//! Change target
|
//! Change target
|
||||||
void setModelsTarget(QObject *target) { this->m_modelsTarget = target; }
|
void setModelsTarget(QObject *target) { this->m_modelsTarget = target; }
|
||||||
|
|
||||||
private slots:
|
|
||||||
void ps_consolidateData();
|
|
||||||
void ps_consolidateSelectedData();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void consolidateData();
|
||||||
|
void consolidateSelectedData();
|
||||||
|
|
||||||
//! Get models
|
//! Get models
|
||||||
BlackMisc::Simulation::CAircraftModelList getSimulatorModels() const;
|
BlackMisc::Simulation::CAircraftModelList getSimulatorModels() const;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user