106 lines
3.1 KiB
C++
Executable File
106 lines
3.1 KiB
C++
Executable File
/**
|
|
**
|
|
** @RDE_HEADER@
|
|
** Dialog of aggregation of participant layer
|
|
** $Id$
|
|
** $HeadURL$
|
|
** $Author$
|
|
**
|
|
** -----------------------------------------------------------------------------------------------
|
|
**
|
|
** Hardware-Environment: Intel-PC
|
|
** Software-Environment: Windows 7, Qt 5.4. ArcGIS 10.2.5
|
|
**
|
|
** Language ........: C++ 11
|
|
**
|
|
** -----------------------------------------------------------------------------------------------
|
|
**
|
|
** Author ...........: Jörg Turla, SPD G, Tel. 3132
|
|
**
|
|
** -----------------------------------------------------------------------------------------------
|
|
**
|
|
** Notes .........:
|
|
**
|
|
** 18.08.2017, JT : first edition
|
|
**
|
|
** -----------------------------------------------------------------------------------------------
|
|
*/
|
|
|
|
#include "participant_aggregation_dialog.h"
|
|
#include "layer_aggregation_widget.h"
|
|
|
|
#include <Map/map.h>
|
|
|
|
#include <QtWidgets/QVBoxLayout>
|
|
|
|
|
|
using namespace SituationMap;
|
|
|
|
|
|
ParticipantAggregationDialog::ParticipantAggregationDialog(Map *map, QWidget *parent)
|
|
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::OkApplyCancel)
|
|
{
|
|
m_law = new LayerAggregationWidget(map, LayerType::Operational, QRegularExpression(QStringLiteral("^Participant.+"), QRegularExpression::CaseInsensitiveOption), this);
|
|
|
|
if (map)
|
|
connect(map, &Map::beginDestroy, this, &ParticipantAggregationDialog::onMapDestroyed, Qt::UniqueConnection);
|
|
|
|
QVBoxLayout *layout = new QVBoxLayout(this);
|
|
|
|
layout->addWidget(m_law);
|
|
layout->addStretch(2);
|
|
|
|
LtsWidgets::DialogButton btnSetDefault = LtsWidgets::DialogButton::Print;
|
|
|
|
m_buttonBox->connectButton(btnSetDefault, m_law, &LayerAggregationWidget::onSetDefaultScales);
|
|
|
|
m_buttonBox->setButtonEnabled(btnSetDefault, true);
|
|
m_buttonBox->setButtonVisible(btnSetDefault, true);
|
|
|
|
connect(this, &ParticipantAggregationDialog::canceled, m_law, &LayerAggregationWidget::onResetAll);
|
|
connect(this, &ParticipantAggregationDialog::applied, m_law, &LayerAggregationWidget::onApplyAll);
|
|
|
|
connect(m_law, &LayerAggregationWidget::changesMade, this, &ParticipantAggregationDialog::slotChangesMade);
|
|
|
|
retranslate();
|
|
|
|
setOnlineHelpFilename(QStringLiteral("Situation-Participant_Aggregation"));
|
|
|
|
} // ParticipantAggregationDialog::ParticipantAggregationDialog( Map * map, QWidget * parent )
|
|
|
|
|
|
void ParticipantAggregationDialog::retranslate()
|
|
{
|
|
// lupdate doesn't like translate(tr("foo")) ...
|
|
const QString txt(tr("Participant Aggregation"));
|
|
translate(txt);
|
|
|
|
LtsWidgets::DialogButton btnSetDefault = LtsWidgets::DialogButton::Print;
|
|
|
|
m_buttonBox->setText( btnSetDefault, tr("Set Scale Defaults"));
|
|
m_buttonBox->setToolTip( btnSetDefault, tr("Calculate scale values for each aggregation from map scale range"));
|
|
|
|
m_law->retranslate();
|
|
|
|
} // void ParticipantAggregationDialog::retranslate()
|
|
|
|
|
|
void ParticipantAggregationDialog::dialogCanceled()
|
|
{
|
|
emit canceled();
|
|
} // void ParticipantAggregationDialog::dialogCanceled()
|
|
|
|
|
|
bool ParticipantAggregationDialog::apply()
|
|
{
|
|
emit applied();
|
|
return true;
|
|
}
|
|
|
|
void ParticipantAggregationDialog::onMapDestroyed()
|
|
{
|
|
// commit suicide
|
|
delete this;
|
|
} // bool ParticipantAggregationDialog::apply()
|
|
|