mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Stop clicks on the globe from changing dive list selection while editing
This caused us to get royally confused when manually adding a dive and trying to set the location through the marble widget. Fixes # 229 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
f41651439c
commit
9ead871d64
3 changed files with 10 additions and 0 deletions
|
@ -71,6 +71,10 @@ GlobeGPS::GlobeGPS(QWidget* parent) : MarbleWidget(parent), loadedDives(0)
|
||||||
|
|
||||||
void GlobeGPS::mouseClicked(qreal lon, qreal lat, GeoDataCoordinates::Unit unit)
|
void GlobeGPS::mouseClicked(qreal lon, qreal lat, GeoDataCoordinates::Unit unit)
|
||||||
{
|
{
|
||||||
|
// don't mess with the selection while the user is editing a dive
|
||||||
|
if (mainWindow()->information()->isEditing())
|
||||||
|
return;
|
||||||
|
|
||||||
GeoDataCoordinates here(lon, lat, unit);
|
GeoDataCoordinates here(lon, lat, unit);
|
||||||
long lon_udeg = rint(1000000 * here.longitude(GeoDataCoordinates::Degree));
|
long lon_udeg = rint(1000000 * here.longitude(GeoDataCoordinates::Degree));
|
||||||
long lat_udeg = rint(1000000 * here.latitude(GeoDataCoordinates::Degree));
|
long lat_udeg = rint(1000000 * here.latitude(GeoDataCoordinates::Degree));
|
||||||
|
|
|
@ -253,6 +253,11 @@ void MainTab::clearStats()
|
||||||
else \
|
else \
|
||||||
ui.field->setText(get_temperature_string(d->field, TRUE))
|
ui.field->setText(get_temperature_string(d->field, TRUE))
|
||||||
|
|
||||||
|
bool MainTab::isEditing()
|
||||||
|
{
|
||||||
|
return editMode != NONE;
|
||||||
|
}
|
||||||
|
|
||||||
void MainTab::updateDiveInfo(int dive)
|
void MainTab::updateDiveInfo(int dive)
|
||||||
{
|
{
|
||||||
if (!isEnabled() && dive != -1)
|
if (!isEnabled() && dive != -1)
|
||||||
|
|
|
@ -58,6 +58,7 @@ public:
|
||||||
bool eventFilter(QObject* , QEvent*);
|
bool eventFilter(QObject* , QEvent*);
|
||||||
void initialUiSetup();
|
void initialUiSetup();
|
||||||
void equipmentPlusUpdate();
|
void equipmentPlusUpdate();
|
||||||
|
bool isEditing();
|
||||||
public slots:
|
public slots:
|
||||||
void addCylinder_clicked();
|
void addCylinder_clicked();
|
||||||
void addWeight_clicked();
|
void addWeight_clicked();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue