summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/maintab.cpp15
-rw-r--r--qt-ui/maintab.h1
2 files changed, 16 insertions, 0 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index 2dbc662b6..f44d850c6 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -1304,6 +1304,21 @@ void MainTab::on_tagWidget_textChanged()
markChangedWidget(ui.tagWidget);
}
+void MainTab::on_location_textChanged()
+{
+ if (editMode == IGNORE)
+ return;
+
+ // we don't want to act on the edit until editing is finished,
+ // but we want to mark the field so it's obvious it is being edited
+ QString currentLocation;
+ struct dive_site *ds = get_dive_site_by_uuid(displayed_dive.dive_site_uuid);
+ if (ds)
+ currentLocation = ds->name;
+ if (ui.location->text() != currentLocation)
+ markChangedWidget(ui.location);
+}
+
void MainTab::on_location_editingFinished()
{
if (editMode == IGNORE || acceptingEdit == true)
diff --git a/qt-ui/maintab.h b/qt-ui/maintab.h
index 6193abaf7..844710954 100644
--- a/qt-ui/maintab.h
+++ b/qt-ui/maintab.h
@@ -65,6 +65,7 @@ slots:
void acceptChanges();
void rejectChanges();
void on_location_editingFinished();
+ void on_location_textChanged();
void on_divemaster_textChanged();
void on_buddy_textChanged();
void on_suit_textChanged(const QString &text);