mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 00:16:51 +08:00
refs #573, added exclude/include combo box in UI
* access to user, only admin may edit include/exclude * updated UI
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include "ui_modelmappingform.h"
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Network;
|
||||
using namespace BlackMisc::Simulation;
|
||||
|
||||
namespace BlackGui
|
||||
@@ -26,6 +27,8 @@ namespace BlackGui
|
||||
ui->le_Id->setReadOnly(true);
|
||||
ui->lai_Id->set(CIcons::appMappings16(), "Id:");
|
||||
connect(ui->pb_Stash, &QPushButton::clicked, this, &CModelMappingForm::requestStash);
|
||||
|
||||
this->ps_userChanged();
|
||||
}
|
||||
|
||||
CModelMappingForm::~CModelMappingForm()
|
||||
@@ -38,6 +41,7 @@ namespace BlackGui
|
||||
model.setDescription(this->ui->le_Description->text());
|
||||
model.setModelString(this->ui->le_ModelKey->text());
|
||||
model.setName(this->ui->le_Name->text());
|
||||
model.setModelModeAsString(this->ui->cb_Include->currentText());
|
||||
return model;
|
||||
}
|
||||
|
||||
@@ -68,8 +72,24 @@ namespace BlackGui
|
||||
ui->le_Id->setText(model.getDbKeyAsString());
|
||||
ui->le_Description->setText(model.getDescription());
|
||||
ui->le_Name->setText(model.getName());
|
||||
ui->cb_Include->setCurrentText(model.getModelModeAsString());
|
||||
ui->selector_Simulator->setValue(model.getSimulatorInfo());
|
||||
m_originalModel = model;
|
||||
}
|
||||
|
||||
void CModelMappingForm::ps_userChanged()
|
||||
{
|
||||
const CAuthenticatedUser user(this->getUser());
|
||||
if (user.isAdmin())
|
||||
{
|
||||
ui->cb_Include->setEnabled(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->cb_Include->setEnabled(false);
|
||||
}
|
||||
|
||||
CForm::ps_userChanged();
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
Reference in New Issue
Block a user