mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Globe: assume that we are looking at the current_dive
As in commit 3870bdafee53 ("Globe: we always center on the current dive") passing in a specific dive here makes no sense - it's always about the current dive. Fixes #513 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
2bc76beb65
commit
fb82da58a2
3 changed files with 5 additions and 5 deletions
|
@ -224,7 +224,7 @@ void GlobeGPS::centerOnCurrentDive()
|
||||||
|
|
||||||
if ((!dive_has_gps_location(dive) || MainWindow::instance()->information()->isEditing())
|
if ((!dive_has_gps_location(dive) || MainWindow::instance()->information()->isEditing())
|
||||||
&& amount_selected == 1) {
|
&& amount_selected == 1) {
|
||||||
prepareForGetDiveCoordinates(dive);
|
prepareForGetDiveCoordinates();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!dive_has_gps_location(dive)) {
|
if (!dive_has_gps_location(dive)) {
|
||||||
|
@ -270,7 +270,7 @@ void GlobeGPS::zoomOutForNoGPS()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GlobeGPS::prepareForGetDiveCoordinates(struct dive *dive)
|
void GlobeGPS::prepareForGetDiveCoordinates()
|
||||||
{
|
{
|
||||||
if (!messageWidget->isVisible()) {
|
if (!messageWidget->isVisible()) {
|
||||||
messageWidget->setMessageType(KMessageWidget::Warning);
|
messageWidget->setMessageType(KMessageWidget::Warning);
|
||||||
|
@ -278,7 +278,7 @@ void GlobeGPS::prepareForGetDiveCoordinates(struct dive *dive)
|
||||||
messageWidget->setWordWrap(true);
|
messageWidget->setWordWrap(true);
|
||||||
messageWidget->animatedShow();
|
messageWidget->animatedShow();
|
||||||
editingDiveLocation = true;
|
editingDiveLocation = true;
|
||||||
if (!dive_has_gps_location(dive))
|
if (!dive_has_gps_location(current_dive))
|
||||||
zoomOutForNoGPS();
|
zoomOutForNoGPS();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ slots:
|
||||||
void mouseClicked(qreal lon, qreal lat, GeoDataCoordinates::Unit);
|
void mouseClicked(qreal lon, qreal lat, GeoDataCoordinates::Unit);
|
||||||
void fixZoom();
|
void fixZoom();
|
||||||
void zoomOutForNoGPS();
|
void zoomOutForNoGPS();
|
||||||
void prepareForGetDiveCoordinates(struct dive *dive);
|
void prepareForGetDiveCoordinates();
|
||||||
};
|
};
|
||||||
|
|
||||||
#else // NO_MARBLE
|
#else // NO_MARBLE
|
||||||
|
|
|
@ -252,7 +252,7 @@ void MainTab::enableEdition(EditMode newEditMode)
|
||||||
}
|
}
|
||||||
MainWindow::instance()->dive_list()->setEnabled(false);
|
MainWindow::instance()->dive_list()->setEnabled(false);
|
||||||
if (amount_selected == 1)
|
if (amount_selected == 1)
|
||||||
MainWindow::instance()->globe()->prepareForGetDiveCoordinates(current_dive);
|
MainWindow::instance()->globe()->prepareForGetDiveCoordinates();
|
||||||
// We may be editing one or more dives here. backup everything.
|
// We may be editing one or more dives here. backup everything.
|
||||||
notesBackup.clear();
|
notesBackup.clear();
|
||||||
if (MainWindow::instance() && MainWindow::instance()->dive_list()->selectedTrips().count() == 1) {
|
if (MainWindow::instance() && MainWindow::instance()->dive_list()->selectedTrips().count() == 1) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue