mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
refs #475, added a utility class so the load indicator of a view can be triggered from the framing component
This commit is contained in:
committed by
Mathew Sutcliffe
parent
2507ce6715
commit
6fda875e8f
@@ -13,6 +13,7 @@
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "blackmisc/project.h"
|
||||
#include "blackgui/guiutility.h"
|
||||
#include "blackgui/roles.h"
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Aviation;
|
||||
@@ -54,10 +55,11 @@ namespace BlackGui
|
||||
|
||||
void CDbMappingComponent::initVPilotLoading()
|
||||
{
|
||||
if (CProject::isRunningOnWindowsNtPlatform() && CProject::isCompiledWithMsFlightSimulatorSupport())
|
||||
if (CRoles::roles().isAdmin() &&
|
||||
CProject::isRunningOnWindowsNtPlatform() &&
|
||||
CProject::isCompiledWithMsFlightSimulatorSupport())
|
||||
{
|
||||
this->m_withVPilot = true;
|
||||
this->ui->tab_VPilot->setEnabled(true);
|
||||
this->ui->tvp_AircraftModelsForVPilot->setCustomMenu(new CMappingVPilotMenu(this));
|
||||
this->ui->tvp_AircraftModelsForVPilot->setDisplayAutomatically(true);
|
||||
connect(ui->tvp_AircraftModelsForVPilot, &CAircraftModelView::doubleClicked, this, &CDbMappingComponent::ps_onModelRowSelected);
|
||||
@@ -67,8 +69,10 @@ namespace BlackGui
|
||||
else
|
||||
{
|
||||
this->m_withVPilot = false;
|
||||
this->ui->tab_VPilot->setEnabled(false);
|
||||
}
|
||||
this->ui->tab_VPilot->setEnabled(m_withVPilot);
|
||||
this->ui->tab_VPilot->setVisible(m_withVPilot);
|
||||
this->ui->tw_ModelsToBeMapped->removeTab(1);
|
||||
}
|
||||
|
||||
bool CDbMappingComponent::initModelLoader(const CSimulatorInfo &simInfo)
|
||||
@@ -365,8 +369,11 @@ namespace BlackGui
|
||||
CDbMappingComponent *mapComp = qobject_cast<CDbMappingComponent *>(this->parent());
|
||||
Q_ASSERT_X(mapComp, Q_FUNC_INFO, "Cannot access parent");
|
||||
|
||||
menu.addAction(CIcons::appMappings16(), "Load vPilot Rules", mapComp, SLOT(ps_loadVPilotData()));
|
||||
menu.addSeparator();
|
||||
if (CRoles::roles().isAdmin())
|
||||
{
|
||||
menu.addAction(CIcons::appMappings16(), "Load vPilot Rules", mapComp, SLOT(ps_loadVPilotData()));
|
||||
menu.addSeparator();
|
||||
}
|
||||
}
|
||||
|
||||
} // ns
|
||||
|
||||
Reference in New Issue
Block a user