mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 21:15:33 +08:00
Ref T246, added distributor selection to 1st model set
This commit is contained in:
@@ -7,13 +7,14 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "blackcore/webdataservices.h"
|
||||
#include "dbdistributorcomponent.h"
|
||||
#include "ui_dbdistributorcomponent.h"
|
||||
#include "blackgui/components/dbdistributorcomponent.h"
|
||||
#include "blackgui/guiapplication.h"
|
||||
#include "blackgui/views/distributorview.h"
|
||||
#include "blackgui/views/viewbase.h"
|
||||
#include "dbdistributorcomponent.h"
|
||||
#include "ui_dbdistributorcomponent.h"
|
||||
#include "blackcore/webdataservices.h"
|
||||
#include "blackmisc/simulation/simulatorinfo.h"
|
||||
|
||||
#include <QFrame>
|
||||
#include <QScopedPointer>
|
||||
@@ -21,6 +22,7 @@
|
||||
|
||||
using namespace BlackCore;
|
||||
using namespace BlackMisc::Network;
|
||||
using namespace BlackMisc::Simulation;
|
||||
using namespace BlackGui::Views;
|
||||
|
||||
namespace BlackGui
|
||||
@@ -35,9 +37,11 @@ namespace BlackGui
|
||||
this->setViewWithIndicator(ui->tvp_Distributors);
|
||||
ui->tvp_Distributors->setResizeMode(CViewBaseNonTemplate::ResizingAuto);
|
||||
ui->tvp_Distributors->allowDragDrop(true, false);
|
||||
connect(ui->tvp_Distributors, &CDistributorView::requestNewBackendData, this, &CDbDistributorComponent::ps_reload);
|
||||
connect(sGui->getWebDataServices(), &CWebDataServices::dataRead, this, &CDbDistributorComponent::ps_distributorsRead);
|
||||
this->ps_distributorsRead(CEntityFlags::DistributorEntity, CEntityFlags::ReadFinished, sGui->getWebDataServices()->getDistributorsCount());
|
||||
ui->tvp_Distributors->setFilterWidget(ui->filter_Distributor);
|
||||
|
||||
connect(ui->tvp_Distributors, &CDistributorView::requestNewBackendData, this, &CDbDistributorComponent::reload);
|
||||
connect(sGui->getWebDataServices(), &CWebDataServices::dataRead, this, &CDbDistributorComponent::distributorsRead);
|
||||
this->distributorsRead(CEntityFlags::DistributorEntity, CEntityFlags::ReadFinished, sGui->getWebDataServices()->getDistributorsCount());
|
||||
}
|
||||
|
||||
CDbDistributorComponent::~CDbDistributorComponent()
|
||||
@@ -48,7 +52,12 @@ namespace BlackGui
|
||||
return ui->tvp_Distributors;
|
||||
}
|
||||
|
||||
void CDbDistributorComponent::ps_distributorsRead(CEntityFlags::Entity entity, CEntityFlags::ReadState readState, int count)
|
||||
void CDbDistributorComponent::filterBySimulator(const CSimulatorInfo &simulator)
|
||||
{
|
||||
ui->filter_Distributor->setSimulator(simulator);
|
||||
}
|
||||
|
||||
void CDbDistributorComponent::distributorsRead(CEntityFlags::Entity entity, CEntityFlags::ReadState readState, int count)
|
||||
{
|
||||
Q_UNUSED(count);
|
||||
if (entity.testFlag(CEntityFlags::DistributorEntity) && readState == CEntityFlags::ReadFinished)
|
||||
@@ -57,7 +66,7 @@ namespace BlackGui
|
||||
}
|
||||
}
|
||||
|
||||
void CDbDistributorComponent::ps_reload()
|
||||
void CDbDistributorComponent::reload()
|
||||
{
|
||||
if (!sGui) { return; }
|
||||
sGui->getWebDataServices()->triggerLoadingDirectlyFromDb(CEntityFlags::DistributorEntity);
|
||||
|
||||
Reference in New Issue
Block a user