mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Change the coordinates via globe.
Now when the user selects the dive site edit, the globe will enter in edit mode too. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
2faff7ceae
commit
f8b64da136
2 changed files with 16 additions and 7 deletions
|
@ -26,6 +26,14 @@ LocationInformationWidget::LocationInformationWidget(QWidget *parent) : QGroupBo
|
|||
|
||||
connect(this, SIGNAL(startFilterDiveSite(uint32_t)), MultiFilterSortModel::instance(), SLOT(startFilterDiveSite(uint32_t)));
|
||||
connect(this, SIGNAL(stopFilterDiveSite()), MultiFilterSortModel::instance(), SLOT(stopFilterDiveSite()));
|
||||
|
||||
// Globe Management Code.
|
||||
connect(this, &LocationInformationWidget::requestCoordinates,
|
||||
GlobeGPS::instance(), &GlobeGPS::prepareForGetDiveCoordinates);
|
||||
connect(this, &LocationInformationWidget::endRequestCoordinates,
|
||||
GlobeGPS::instance(), &GlobeGPS::endGetDiveCoordinates);
|
||||
connect(GlobeGPS::instance(), &GlobeGPS::coordinatesChanged,
|
||||
this, &LocationInformationWidget::updateGpsCoordinates);
|
||||
}
|
||||
|
||||
void LocationInformationWidget::updateLabels()
|
||||
|
@ -85,18 +93,15 @@ void LocationInformationWidget::acceptChanges()
|
|||
|
||||
mark_divelist_changed(true);
|
||||
resetState();
|
||||
emit endRequestCoordinates();
|
||||
emit endEditDiveSite();
|
||||
emit coordinatesChanged();
|
||||
}
|
||||
|
||||
void LocationInformationWidget::on_btnPickCoordinates_clicked()
|
||||
{
|
||||
qDebug() << "Sim, Deve haver o perdao";
|
||||
}
|
||||
|
||||
void LocationInformationWidget::rejectChanges()
|
||||
{
|
||||
resetState();
|
||||
emit endRequestCoordinates();
|
||||
emit stopFilterDiveSite();
|
||||
emit endEditDiveSite();
|
||||
emit coordinatesChanged();
|
||||
|
@ -104,9 +109,12 @@ void LocationInformationWidget::rejectChanges()
|
|||
|
||||
void LocationInformationWidget::showEvent(QShowEvent *ev)
|
||||
{
|
||||
if (displayed_dive_site.uuid)
|
||||
if (displayed_dive_site.uuid) {
|
||||
updateLabels();
|
||||
emit startFilterDiveSite(displayed_dive_site.uuid);
|
||||
}
|
||||
emit requestCoordinates();
|
||||
|
||||
QGroupBox::showEvent(ev);
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,6 @@ public slots:
|
|||
void on_diveSiteDescription_textChanged(const QString& text);
|
||||
void on_diveSiteName_textChanged(const QString& text);
|
||||
void on_diveSiteNotes_textChanged();
|
||||
void on_btnPickCoordinates_clicked();
|
||||
private slots:
|
||||
void updateLabels();
|
||||
signals:
|
||||
|
@ -33,6 +32,8 @@ signals:
|
|||
void coordinatesChanged();
|
||||
void startFilterDiveSite(uint32_t uuid);
|
||||
void stopFilterDiveSite();
|
||||
void requestCoordinates();
|
||||
void endRequestCoordinates();
|
||||
private:
|
||||
Ui::LocationInformation ui;
|
||||
bool modified;
|
||||
|
|
Loading…
Reference in a new issue