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:
Dirk Hohndel 2013-11-11 06:23:18 +09:00
parent f41651439c
commit 9ead871d64
3 changed files with 10 additions and 0 deletions

View file

@ -71,6 +71,10 @@ GlobeGPS::GlobeGPS(QWidget* parent) : MarbleWidget(parent), loadedDives(0)
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);
long lon_udeg = rint(1000000 * here.longitude(GeoDataCoordinates::Degree));
long lat_udeg = rint(1000000 * here.latitude(GeoDataCoordinates::Degree));

View file

@ -253,6 +253,11 @@ void MainTab::clearStats()
else \
ui.field->setText(get_temperature_string(d->field, TRUE))
bool MainTab::isEditing()
{
return editMode != NONE;
}
void MainTab::updateDiveInfo(int dive)
{
if (!isEnabled() && dive != -1)

View file

@ -58,6 +58,7 @@ public:
bool eventFilter(QObject* , QEvent*);
void initialUiSetup();
void equipmentPlusUpdate();
bool isEditing();
public slots:
void addCylinder_clicked();
void addWeight_clicked();