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());
|
2012-06-24 20:58:09 +02:00
|
|
|
this->show();
|
2012-06-20 16:01:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
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();
|
|
|
|
}
|