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:
Klaus Basan
2016-01-17 00:34:54 +01:00
parent 563f71416e
commit a125b02984
5 changed files with 69 additions and 1 deletions

View File

@@ -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