Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
@@ -0,0 +1,95 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#include "saab_map_party.h"
|
||||
#include "ui_saab_map_party.h"
|
||||
|
||||
#include "saab_map_type.h"
|
||||
|
||||
namespace saab
|
||||
{
|
||||
|
||||
MapParty::MapParty(const QString &partyName,
|
||||
const QMap<QString, QString> &forces, const QMap<QString, SaabEchelon> &echelons, const QMap<QString, SaabSymbol> &symbols,
|
||||
QWidget *parent)
|
||||
: LtsFramelessDialog(parent, LtsWidgets::Behaviour::Modal)
|
||||
, m_skipped(false)
|
||||
, m_ui(new Ui_MapParty)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
m_ui->lblText->setText(tr("Party <b>%1</b> needs to be mapped:").arg(partyName));
|
||||
|
||||
QList<QString> forcesList = forces.keys();
|
||||
|
||||
std::sort(forcesList.begin(), forcesList.end());
|
||||
|
||||
for (const QString ¤t : qAsConst(forcesList))
|
||||
m_ui->cbForce->addItem(current);
|
||||
|
||||
QList<SaabEchelon> echelonList = echelons.values();
|
||||
|
||||
sortList(echelonList);
|
||||
|
||||
for (const SaabEchelon ¤t : qAsConst(echelonList))
|
||||
m_ui->cbEchelon->addItem(current.text, current.code);
|
||||
|
||||
QList<SaabSymbol> symbolList = symbols.values();
|
||||
|
||||
sortList(symbolList);
|
||||
|
||||
for (const SaabSymbol ¤t : qAsConst(symbolList))
|
||||
m_ui->cbSymbol->addItem(current.text, current.code);
|
||||
|
||||
connect(m_ui->pbApply, &QPushButton::clicked,
|
||||
this, &MapParty::close);
|
||||
connect(m_ui->pbSkip, &QPushButton::clicked,
|
||||
this, [this]()
|
||||
{
|
||||
m_skipped = true;
|
||||
close();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
MapParty::~MapParty()
|
||||
{
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
QString MapParty::force() const
|
||||
{
|
||||
if (!m_ui->cbForce->count())
|
||||
return QString();
|
||||
|
||||
return m_ui->cbForce->currentText();
|
||||
}
|
||||
|
||||
QString MapParty::echelonCode() const
|
||||
{
|
||||
if (!m_ui->cbEchelon->count())
|
||||
return QString();
|
||||
|
||||
return m_ui->cbEchelon->currentData().toString();
|
||||
}
|
||||
|
||||
QString MapParty::symbolCode() const
|
||||
{
|
||||
if (!m_ui->cbSymbol->count())
|
||||
return QString();
|
||||
|
||||
return m_ui->cbSymbol->currentData().toString();
|
||||
}
|
||||
|
||||
bool saab::MapParty::isSkipped() const
|
||||
{
|
||||
return m_skipped;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user