mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 15:25:35 +08:00
Fixed some minor issues in mapping tool (triggered by slack discussion)
* slot menu connect * stashing from model view * removed unused menu
This commit is contained in:
committed by
Mathew Sutcliffe
parent
79f95845b2
commit
76814b43be
@@ -31,7 +31,7 @@ namespace BlackGui
|
||||
ui(new Ui::CDataInfoAreaComponent)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
initInfoArea(); // init base class
|
||||
this->initInfoArea(); // init base class
|
||||
this->setWindowIcon(CIcons::swiftDatabase24());
|
||||
this->ps_setTabBarPosition(QTabWidget::North);
|
||||
}
|
||||
|
||||
@@ -863,7 +863,7 @@ namespace BlackGui
|
||||
if (mapComp->currentTabIndex() == CDbMappingComponent::TabOwnModels && mapComp->currentModelView()->hasSelection())
|
||||
{
|
||||
this->addSeparator(menu);
|
||||
menu.addAction(CIcons::text16(), "Open simulator file", this, SLOT(ps_showSimulatorFile()));
|
||||
menu.addAction(CIcons::text16(), "Open simulator file", mapComp, SLOT(ps_showSimulatorFile()));
|
||||
}
|
||||
|
||||
this->nestedCustomMenu(menu);
|
||||
|
||||
@@ -36,6 +36,8 @@ namespace BlackGui
|
||||
ui->setupUi(this);
|
||||
this->setViewWithIndicator(this->ui->tvp_AircraftModel);
|
||||
this->ui->tvp_AircraftModel->setAircraftModelMode(CAircraftModelListModel::Database);
|
||||
this->ui->tvp_AircraftModel->menuAddItems(CAircraftModelView::MenuStashing);
|
||||
this->ui->tvp_AircraftModel->menuRemoveItems(CAircraftModelView::MenuHighlightStashed); // not supported here
|
||||
connect(this->ui->tvp_AircraftModel, &CAircraftModelView::requestNewBackendData, this, &CDbModelComponent::ps_reload);
|
||||
connect(this->ui->tvp_AircraftModel, &CAircraftModelView::requestStash, this, &CDbModelComponent::requestStash);
|
||||
connect(&CStyleSheetUtility::instance(), &CStyleSheetUtility::styleSheetsChanged, this, &CDbModelComponent::ps_onStyleSheetChanged);
|
||||
@@ -101,22 +103,5 @@ namespace BlackGui
|
||||
emit requestStash(models);
|
||||
}
|
||||
}
|
||||
|
||||
void CDbModelComponent::CStashMenu::customMenu(QMenu &menu) const
|
||||
{
|
||||
CDbModelComponent *modelComponent = qobject_cast<CDbModelComponent *>(this->parent());
|
||||
Q_ASSERT_X(modelComponent, Q_FUNC_INFO, "Cannot access model component");
|
||||
if (modelComponent->hasModels())
|
||||
{
|
||||
menu.addAction(CIcons::appMappings16(), "Stash", modelComponent, SLOT(ps_stashSelectedModels()), CShortcut::keyStash());
|
||||
}
|
||||
this->nestedCustomMenu(menu);
|
||||
}
|
||||
|
||||
CDbModelComponent *CDbModelComponent::CStashMenu::modelComponent() const
|
||||
{
|
||||
return qobject_cast<CDbModelComponent *>(this->parent());
|
||||
}
|
||||
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -74,24 +74,6 @@ namespace BlackGui
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::CDbModelComponent> ui;
|
||||
|
||||
//! The menu for stashing models
|
||||
//! \note This is a specific menu for that very component
|
||||
class CStashMenu : public BlackGui::IMenuDelegate
|
||||
{
|
||||
public:
|
||||
//! Constructor
|
||||
CStashMenu(CDbModelComponent *modelComponent, bool separatorAtEnd) :
|
||||
BlackGui::IMenuDelegate(modelComponent, separatorAtEnd)
|
||||
{}
|
||||
|
||||
//! \copydoc IMenuDelegate::customMenu
|
||||
virtual void customMenu(QMenu &menu) const override;
|
||||
|
||||
private:
|
||||
//! Mapping component
|
||||
CDbModelComponent *modelComponent() const;
|
||||
};
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace BlackGui
|
||||
CStatusMessageList msgs;
|
||||
for (const CAircraftModel &model : models)
|
||||
{
|
||||
CStatusMessage m(stashModel(model));
|
||||
const CStatusMessage m(stashModel(model));
|
||||
if (m.isWarningOrAbove()) { msgs.push_back(m); }
|
||||
}
|
||||
return msgs;
|
||||
|
||||
@@ -183,7 +183,7 @@ namespace BlackGui
|
||||
void menuRemoveItems(Menu menusToRemove);
|
||||
|
||||
//! Add given menu items
|
||||
void menuAddItems(Menu menusToRemove);
|
||||
void menuAddItems(Menu menusToAdd);
|
||||
|
||||
//! Set menu items
|
||||
void setMenu(Menu menuItems) { this->m_menus = menuItems; }
|
||||
|
||||
Reference in New Issue
Block a user