mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 15:25:35 +08:00
68 lines
2.0 KiB
C++
68 lines
2.0 KiB
C++
// SPDX-FileCopyrightText: Copyright (C) 2018 swift Project Community / Contributors
|
|
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
|
|
|
|
#include "coordinatedialog.h"
|
|
#include "ui_coordinatedialog.h"
|
|
#include <QPushButton>
|
|
|
|
using namespace BlackMisc;
|
|
using namespace BlackMisc::Geo;
|
|
using namespace BlackGui::Editors;
|
|
|
|
namespace BlackGui::Components
|
|
{
|
|
CCoordinateDialog::CCoordinateDialog(QWidget *parent) : QDialog(parent),
|
|
ui(new Ui::CCoordinateDialog)
|
|
{
|
|
ui->setupUi(this);
|
|
ui->editor_Coordinate->showSetButton(false);
|
|
this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
|
this->noDefaultButtons();
|
|
connect(this, &QDialog::accepted, this, &CCoordinateDialog::changedCoordinate);
|
|
}
|
|
|
|
CCoordinateDialog::~CCoordinateDialog()
|
|
{}
|
|
|
|
CCoordinateGeodetic CCoordinateDialog::getCoordinate() const
|
|
{
|
|
return ui->editor_Coordinate->getCoordinate();
|
|
}
|
|
|
|
void CCoordinateDialog::setCoordinate(const ICoordinateGeodetic &coordinate)
|
|
{
|
|
ui->editor_Coordinate->setCoordinate(coordinate);
|
|
}
|
|
|
|
void CCoordinateDialog::setReadOnly(bool readonly)
|
|
{
|
|
ui->editor_Coordinate->setReadOnly(readonly);
|
|
}
|
|
|
|
void CCoordinateDialog::setSelectOnly()
|
|
{
|
|
ui->editor_Coordinate->setSelectOnly();
|
|
}
|
|
|
|
void CCoordinateDialog::showElevation(bool show)
|
|
{
|
|
ui->editor_Coordinate->showElevation(show);
|
|
}
|
|
|
|
CStatusMessageList CCoordinateDialog::validate(bool nested) const
|
|
{
|
|
return ui->editor_Coordinate->validate(nested);
|
|
}
|
|
|
|
void CCoordinateDialog::noDefaultButtons()
|
|
{
|
|
QPushButton *okBtn = ui->bb_CoordinateDialog->button(QDialogButtonBox::Ok);
|
|
okBtn->setAutoDefault(true);
|
|
okBtn->setDefault(true);
|
|
|
|
QPushButton *caBtn = ui->bb_CoordinateDialog->button(QDialogButtonBox::Cancel);
|
|
caBtn->setAutoDefault(false);
|
|
caBtn->setDefault(false);
|
|
}
|
|
} // ns
|