mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-18 19:35:33 +08:00
refs #525, specialized model class for DB entities and improved funtions in view base class
* will allow to highlight entities * nested custom menus * moved displayAutomatically() menus in view base class * fixed which menus are displayed for aircraft models * also changed to QStandardItem model to see if this is causing any trouble (the real bigger changes will follow in #530)
This commit is contained in:
@@ -34,29 +34,39 @@ namespace BlackGui
|
||||
//! Set display mode
|
||||
void setAircraftModelMode(Models::CAircraftModelListModel::AircraftModelMode mode);
|
||||
|
||||
//! Display automatically (when models are loaded)
|
||||
bool displayAutomatically() const;
|
||||
|
||||
//! Display automatically (when models are loaded)
|
||||
void setDisplayAutomatically(bool automatically) { m_displayAutomatically = automatically; }
|
||||
|
||||
signals:
|
||||
//! Request to load VPilot data
|
||||
void requestVPilotRules();
|
||||
|
||||
protected:
|
||||
//! \copydoc CViewBase::customMenu
|
||||
virtual void customMenu(QMenu &menu) const override;
|
||||
|
||||
private slots:
|
||||
//! Toggle auto display
|
||||
void ps_toggleAutoDisplay();
|
||||
|
||||
//! Highlight DB models
|
||||
void ps_toggleHighlightDbModels();
|
||||
|
||||
//! Highlight stashed models
|
||||
void ps_toggleHighlightStashedModels();
|
||||
|
||||
private:
|
||||
bool m_displayAutomatically = false; //!< display automatically (when models are loaded)
|
||||
//! Custom menu for the models which have been loaded
|
||||
class CHighlightDbModelsMenu : public BlackGui::IMenuDelegate
|
||||
{
|
||||
public:
|
||||
//! Constructor
|
||||
CHighlightDbModelsMenu(CAircraftModelView *parent, bool separatorAtEnd) : IMenuDelegate(parent, separatorAtEnd) {}
|
||||
|
||||
//! \copydoc IMenuDelegate::customMenu
|
||||
virtual void customMenu(QMenu &menu) const override;
|
||||
};
|
||||
|
||||
//! Custom menu for the models which have been loaded
|
||||
class CHighlightStashedModelsMenu : public BlackGui::IMenuDelegate
|
||||
{
|
||||
public:
|
||||
//! Constructor
|
||||
CHighlightStashedModelsMenu(CAircraftModelView *parent, bool separatorAtEnd) : IMenuDelegate(parent, separatorAtEnd) {}
|
||||
|
||||
//! \copydoc IMenuDelegate::customMenu
|
||||
virtual void customMenu(QMenu &menu) const override;
|
||||
};
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
Reference in New Issue
Block a user