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:
Klaus Basan
2015-12-02 01:29:20 +01:00
parent 88f14f150d
commit 8e852b19ae
11 changed files with 362 additions and 108 deletions

View File

@@ -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