mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-12 15:25:34 +08:00
refs #568, specialized view class for DB objects
* CViewWithDbObjects * new menu for views (delete key, remove) * adjusted derived classes
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
#include "blackgui/blackguiexport.h"
|
||||
#include "blackgui/filters/aircraftmodelfilterdialog.h"
|
||||
#include "blackgui/models/aircraftmodellistmodel.h"
|
||||
#include "viewbase.h"
|
||||
#include "viewdbobjects.h"
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
@@ -23,7 +23,7 @@ namespace BlackGui
|
||||
{
|
||||
//! Aircraft view
|
||||
class BLACKGUI_EXPORT CAircraftModelView :
|
||||
public CViewBase<Models::CAircraftModelListModel, BlackMisc::Simulation::CAircraftModelList, BlackMisc::Simulation::CAircraftModel>
|
||||
public CViewWithDbObjects<Models::CAircraftModelListModel, BlackMisc::Simulation::CAircraftModelList, BlackMisc::Simulation::CAircraftModel, int>
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -46,15 +46,18 @@ namespace BlackGui
|
||||
//! Allow to stash
|
||||
void setAllowStash(bool stash) { m_allowStash = stash; }
|
||||
|
||||
//! Has any models to stash amd is allowed to stash
|
||||
bool hasModelsToStash() const;
|
||||
//! Has any models to stash and it is allowed to stash
|
||||
bool hasSelectedModelsToStash() const;
|
||||
|
||||
//! Add the technically supported metatypes as allows
|
||||
//! Add the technically supported metatypes allowed for drag and drop
|
||||
void setImplementedMetaTypeIds();
|
||||
|
||||
//! Add my own filter dialog
|
||||
void addFilterDialog();
|
||||
|
||||
//! Remove models with model strings
|
||||
int removeModelsWithModelString(const QStringList &modelStrings, Qt::CaseSensitivity sensitivity = Qt::CaseInsensitive);
|
||||
|
||||
signals:
|
||||
//! Request to stash if applicable
|
||||
void requestStash();
|
||||
@@ -67,9 +70,6 @@ namespace BlackGui
|
||||
virtual void dropEvent(QDropEvent *event) override;
|
||||
|
||||
private slots:
|
||||
//! Highlight DB models
|
||||
void ps_toggleHighlightDbModels();
|
||||
|
||||
//! Highlight stashed models
|
||||
void ps_toggleHighlightStashedModels();
|
||||
|
||||
@@ -79,17 +79,6 @@ namespace BlackGui
|
||||
private:
|
||||
bool m_allowStash = false; //!< allow to stash
|
||||
|
||||
//! 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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user