refs #525, stash view

* allow to stash and unstash models from vPilot and own models
* removed stash main area and moved it into mapping component
* own stash component
* use the new functions for modles/views from the prevuous steps
This commit is contained in:
Klaus Basan
2015-12-02 01:31:54 +01:00
parent 8e852b19ae
commit f7cb21c78c
9 changed files with 450 additions and 153 deletions

View File

@@ -13,6 +13,8 @@
#define BLACKGUI_COMPONENTS_DBSTASHCOMPONENT_H
#include "blackgui/components/enablefordockwidgetinfoarea.h"
#include "blackgui/menudelegate.h"
#include "blackgui/views/aircraftmodelview.h"
#include "blackmisc/network/webdataservicesprovider.h"
#include <QFrame>
#include <QScopedPointer>
@@ -46,10 +48,43 @@ namespace BlackGui
//! Graceful shutdown
void gracefulShutdown();
//! Test the given model if it can be stashed
BlackMisc::CStatusMessage validateStashModel(const BlackMisc::Simulation::CAircraftModel &model) const;
//! Stash given model
BlackMisc::CStatusMessage stashModel(const BlackMisc::Simulation::CAircraftModel &model);
//! Stash given models
BlackMisc::CStatusMessageList stashModels(const BlackMisc::Simulation::CAircraftModelList &models);
//! The embedded view
const BlackGui::Views::CAircraftModelView *getView() const;
signals:
//! Unstash
void unstashed(BlackMisc::Simulation::CAircraftModel &model);
private slots:
//! Unstash pressed
void ps_onUnstashPressed();
//! Validate pressed
void ps_onValidatePressed();
private:
QScopedPointer<Ui::CDbStashComponent> ui;
};
//! Custom menu for the stashed models
class CStashModelsMenu : public BlackGui::IMenuDelegate
{
public:
//! Constructor
CStashModelsMenu(CDbStashComponent *parent, bool separatorAtEnd) : IMenuDelegate(parent, separatorAtEnd) {}
//! \copydoc IMenuDelegate::customMenu
virtual void customMenu(QMenu &menu) const override;
};
};
} // ns
} // ns