1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-06 17:46:07 +01:00
LibrePilot/ground/openpilotgcs/src/plugins/opmap/homeeditor.cpp

36 lines
761 B
C++
Raw Normal View History

2012-06-20 16:01:03 +02:00
#include "homeeditor.h"
#include "ui_homeeditor.h"
homeEditor::homeEditor(HomeItem *home, QWidget *parent) :
QDialog(parent),
ui(new Ui::homeEditor),
myhome(home)
{
if(!home)
{
deleteLater();
return;
}
ui->setupUi(this);
this->setAttribute(Qt::WA_DeleteOnClose,true);
ui->altitude->setValue(home->Altitude());
ui->latitude->setValue(home->Coord().Lat());
ui->longitude->setValue(home->Coord().Lng());
}
homeEditor::~homeEditor()
{
delete ui;
}
void homeEditor::on_buttonBox_accepted()
{
myhome->SetCoord(internals::PointLatLng(ui->latitude->value(),ui->longitude->value()));
myhome->SetAltitude(ui->altitude->value());
}
void homeEditor::on_buttonBox_rejected()
{
this->close();
}