summaryrefslogtreecommitdiffstats
path: root/qt-ui/maintab.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@gmail.com>2015-05-29 23:05:32 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-05-29 20:59:30 -0700
commitb0d7d0f3b9beb25a523e5c4db396a859c4562a23 (patch)
tree7b1539326e7dff38ae93eafad0bce2ca365fa590 /qt-ui/maintab.cpp
parentac6a7ab24e087cc150a7eff0ff6e7e4f8c52ce9a (diff)
downloadsubsurface-b0d7d0f3b9beb25a523e5c4db396a859c4562a23.tar.gz
Fix the connections for the Location Edit
The LocationEdit now correctly connects to the QComboBox signals, not the QLineEdit signals. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/maintab.cpp')
-rw-r--r--qt-ui/maintab.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index 5b5c10115..01c342ad6 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -760,7 +760,6 @@ void MainTab::acceptChanges()
ui.dateEdit->setEnabled(true);
hideMessage();
ui.equipmentTab->setEnabled(true);
- on_location_editingFinished(); // complete coordinates *before* saving
if (editMode == ADD) {
// We need to add the dive we just created to the dive list and select it.
// Easy, right?
@@ -1255,7 +1254,13 @@ void MainTab::on_tagWidget_textChanged()
markChangedWidget(ui.tagWidget);
}
-void MainTab::on_location_textChanged(const QString &text)
+/* TODO: This seems wrong.
+ * The code here below should be triggered when the user changes
+ * the Location in the combobox (this was a LineEdit, but the code is
+ * mostly the same ). Check the currentTrip there to see if it`s being
+ * correctly triggered.
+ */
+void MainTab::on_location_currentTextChanged(const QString &text)
{
if (editMode == IGNORE || acceptingEdit == true)
return;
@@ -1263,9 +1268,13 @@ void MainTab::on_location_textChanged(const QString &text)
free(displayedTrip.location);
displayedTrip.location = strdup(qPrintable(ui.location->currentText()));
}
+ if (current_dive && text == QString(get_dive_site_by_uuid(current_dive->dive_site_uuid)->name))
+ return;
markChangedWidget(ui.location);
}
+/* TODO:
+ * Check if we need to move this to location management.
// If we have GPS data for the location entered, add it.
void MainTab::on_location_editingFinished()
{
@@ -1277,6 +1286,7 @@ void MainTab::on_location_editingFinished()
displayed_dive.dive_site_uuid = uuid;
free((void*)name);
}
+*/
void MainTab::on_suit_textChanged(const QString &text)
{