42 lines
1015 B
C++
Executable File
42 lines
1015 B
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* Declaration/Definition
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
*/
|
|
#include "jump_point_namer.h"
|
|
#include "ui_jump_point_namer.h"
|
|
|
|
namespace SituationMap
|
|
{
|
|
|
|
JumpPointNamer::JumpPointNamer(int count, const QPointF &coordGeo, QWidget *parent)
|
|
: LtsWidgets::LtsFramelessDialog(parent, LtsWidgets::Behaviour::Modal)
|
|
, m_ui(new Ui::JumpPointNamer)
|
|
, m_coord(coordGeo)
|
|
{
|
|
m_ui->setupUi(this);
|
|
m_ui->leName->setText(QStringLiteral("JP_%1").arg(count));
|
|
#ifdef TABLET_MODE
|
|
m_ui->leName->setFocusPolicy(Qt::ClickFocus);
|
|
#endif
|
|
connect(m_ui->ltsDialogButtonBox->getButton(LtsWidgets::DialogButton::Close), &QPushButton::clicked, this, &JumpPointNamer::close);
|
|
connect(m_ui->ltsDialogButtonBox->getButton(LtsWidgets::DialogButton::Ok), &QPushButton::clicked, this, &JumpPointNamer::onOk);
|
|
}
|
|
|
|
JumpPointNamer::~JumpPointNamer()
|
|
{
|
|
delete m_ui;
|
|
}
|
|
|
|
void JumpPointNamer::onOk()
|
|
{
|
|
if (m_ui->leName->text().size() > 0)
|
|
{
|
|
emit newName(m_ui->leName->text(), m_coord);
|
|
close();
|
|
}
|
|
}
|
|
}
|