refs #568, allow to stash from DB data view (model view)

* added required signal slots
* moved models for stashing into aircraft model view
* allow to unselect when stashed
* fixed DB object highlighting and resize row height automatically
This commit is contained in:
Klaus Basan
2016-01-09 03:37:07 +01:00
parent 0326356f43
commit 11ee49a382
12 changed files with 209 additions and 106 deletions

View File

@@ -16,6 +16,7 @@
#include "blackgui/enableforviewbasedindicator.h"
#include "blackgui/components/enablefordockwidgetinfoarea.h"
#include "blackgui/components/dbmappingcomponentaware.h"
#include "blackgui/menudelegate.h"
#include "blackmisc/network/webdataservicesprovider.h"
#include <QFrame>
#include <QScopedPointer>
@@ -51,6 +52,13 @@ namespace BlackGui
//! Get latest model if any
BlackMisc::Simulation::CAircraftModel getLatestModel() const;
//! Models loaded?
bool hasModels() const;
signals:
//! Request to stash the selected models
void requestStash(const BlackMisc::Simulation::CAircraftModelList &models);
public slots:
//! Load new data
void requestUpdatedData();
@@ -65,8 +73,29 @@ namespace BlackGui
//! Style sheet changed
void ps_onStyleSheetChanged();
//! Stash the selected models
void ps_stashSelectedModels();
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