mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Location management: reflect changes to the coordinates on the map
This is a bit aggressive as it changes the globe with every single character that's entered, but it's better than what we had before. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
b342730ec9
commit
d4b5854f82
5 changed files with 8 additions and 1 deletions
|
@ -231,6 +231,7 @@ void GlobeGPS::repopulateLabels()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
model()->treeModel()->addDocument(loadedDives);
|
model()->treeModel()->addDocument(loadedDives);
|
||||||
|
centerOn(displayed_dive_site.longitude.udeg / 1000000.0, displayed_dive_site.latitude.udeg / 1000000.0, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GlobeGPS::reload()
|
void GlobeGPS::reload()
|
||||||
|
|
|
@ -21,7 +21,6 @@ public:
|
||||||
using MarbleWidget::centerOn;
|
using MarbleWidget::centerOn;
|
||||||
GlobeGPS(QWidget *parent = 0);
|
GlobeGPS(QWidget *parent = 0);
|
||||||
void reload();
|
void reload();
|
||||||
void repopulateLabels();
|
|
||||||
void centerOnCurrentDive();
|
void centerOnCurrentDive();
|
||||||
bool eventFilter(QObject *, QEvent *);
|
bool eventFilter(QObject *, QEvent *);
|
||||||
|
|
||||||
|
@ -44,6 +43,7 @@ signals:
|
||||||
|
|
||||||
public
|
public
|
||||||
slots:
|
slots:
|
||||||
|
void repopulateLabels();
|
||||||
void changeDiveGeoPosition(qreal lon, qreal lat, GeoDataCoordinates::Unit);
|
void changeDiveGeoPosition(qreal lon, qreal lat, GeoDataCoordinates::Unit);
|
||||||
void mouseClicked(qreal lon, qreal lat, GeoDataCoordinates::Unit);
|
void mouseClicked(qreal lon, qreal lat, GeoDataCoordinates::Unit);
|
||||||
void fixZoom();
|
void fixZoom();
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "divelistview.h"
|
#include "divelistview.h"
|
||||||
#include "qthelper.h"
|
#include "qthelper.h"
|
||||||
|
#include "globe.h"
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QShowEvent>
|
#include <QShowEvent>
|
||||||
|
@ -146,6 +147,7 @@ void LocationInformationWidget::acceptChanges()
|
||||||
mark_divelist_changed(true);
|
mark_divelist_changed(true);
|
||||||
resetState();
|
resetState();
|
||||||
emit informationManagementEnded();
|
emit informationManagementEnded();
|
||||||
|
emit coordinatesChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LocationInformationWidget::rejectChanges()
|
void LocationInformationWidget::rejectChanges()
|
||||||
|
@ -160,6 +162,7 @@ void LocationInformationWidget::rejectChanges()
|
||||||
}
|
}
|
||||||
resetState();
|
resetState();
|
||||||
emit informationManagementEnded();
|
emit informationManagementEnded();
|
||||||
|
emit coordinatesChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LocationInformationWidget::showEvent(QShowEvent *ev)
|
void LocationInformationWidget::showEvent(QShowEvent *ev)
|
||||||
|
@ -217,6 +220,7 @@ void LocationInformationWidget::on_diveSiteCoordinates_textChanged(const QString
|
||||||
displayed_dive_site.latitude.udeg = latitude * 1000000;
|
displayed_dive_site.latitude.udeg = latitude * 1000000;
|
||||||
displayed_dive_site.longitude.udeg = longitude * 1000000;
|
displayed_dive_site.longitude.udeg = longitude * 1000000;
|
||||||
markChangedWidget(ui.diveSiteCoordinates);
|
markChangedWidget(ui.diveSiteCoordinates);
|
||||||
|
emit coordinatesChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,6 +39,7 @@ public slots:
|
||||||
void on_diveSiteNotes_textChanged();
|
void on_diveSiteNotes_textChanged();
|
||||||
signals:
|
signals:
|
||||||
void informationManagementEnded();
|
void informationManagementEnded();
|
||||||
|
void coordinatesChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct dive_site *currentDs;
|
struct dive_site *currentDs;
|
||||||
|
|
|
@ -133,6 +133,7 @@ MainWindow::MainWindow() : QMainWindow(),
|
||||||
connect(mainTab, SIGNAL(requestDiveSiteEdit(uint32_t)), this, SLOT(enableDiveSiteEdit(uint32_t)));
|
connect(mainTab, SIGNAL(requestDiveSiteEdit(uint32_t)), this, SLOT(enableDiveSiteEdit(uint32_t)));
|
||||||
connect(locationInformation, SIGNAL(informationManagementEnded()), this, SLOT(setDefaultState()));
|
connect(locationInformation, SIGNAL(informationManagementEnded()), this, SLOT(setDefaultState()));
|
||||||
connect(locationInformation, SIGNAL(informationManagementEnded()), information(), SLOT(showLocation()));
|
connect(locationInformation, SIGNAL(informationManagementEnded()), information(), SLOT(showLocation()));
|
||||||
|
connect(locationInformation, SIGNAL(coordinatesChanged()), globe(), SLOT(repopulateLabels()));
|
||||||
|
|
||||||
#ifdef NO_PRINTING
|
#ifdef NO_PRINTING
|
||||||
plannerDetails->printPlan()->hide();
|
plannerDetails->printPlan()->hide();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue