From 73eceacaed02632365aae4568c7708a57c8d29b0 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Fri, 26 Jun 2015 15:12:37 -0300 Subject: Dive site rewrite: better member name Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/locationinformation.cpp | 12 ++++++------ qt-ui/locationinformation.h | 2 +- qt-ui/maintab.cpp | 5 ++++- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/qt-ui/locationinformation.cpp b/qt-ui/locationinformation.cpp index 9b4f48913..f50834660 100644 --- a/qt-ui/locationinformation.cpp +++ b/qt-ui/locationinformation.cpp @@ -229,7 +229,7 @@ void LocationInformationWidget::resetPallete() SimpleDiveSiteEditDialog::SimpleDiveSiteEditDialog(QWidget *parent) : QDialog(parent, Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::Popup), - ui(new Ui::SimpleDiveSiteEditDialog()), changed(false) + ui(new Ui::SimpleDiveSiteEditDialog()), changed_dive_site(false) { ui->setupUi(this); } @@ -263,7 +263,7 @@ void SimpleDiveSiteEditDialog::showEvent(QShowEvent *ev) ui->diveSiteCoordinates->setText(QString(gps_text)); free( (void*) gps_text); - changed = false; + changed_dive_site = false; } void SimpleDiveSiteEditDialog::on_diveSiteName_editingFinished() @@ -272,7 +272,7 @@ void SimpleDiveSiteEditDialog::on_diveSiteName_editingFinished() return; free(displayed_dive_site.name); displayed_dive_site.name = copy_string(qPrintable(ui->diveSiteName->text())); - changed = true; + changed_dive_site = true; } void SimpleDiveSiteEditDialog::on_diveSiteCoordinates_editingFinished() @@ -289,7 +289,7 @@ void SimpleDiveSiteEditDialog::on_diveSiteCoordinates_editingFinished() displayed_dive_site.latitude.udeg = uLat; displayed_dive_site.longitude.udeg = uLon; - changed = true; + changed_dive_site = true; } void SimpleDiveSiteEditDialog::on_diveSiteDescription_editingFinished() @@ -298,7 +298,7 @@ void SimpleDiveSiteEditDialog::on_diveSiteDescription_editingFinished() return; free(displayed_dive_site.description); displayed_dive_site.description = copy_string(qPrintable(ui->diveSiteDescription->text())); - changed = true; + changed_dive_site = true; } void SimpleDiveSiteEditDialog::on_diveSiteNotes_editingFinished() @@ -307,5 +307,5 @@ void SimpleDiveSiteEditDialog::on_diveSiteNotes_editingFinished() return; free(displayed_dive_site.notes); displayed_dive_site.notes = copy_string(qPrintable(ui->diveSiteNotes->text())); - changed = true; + changed_dive_site = true; } diff --git a/qt-ui/locationinformation.h b/qt-ui/locationinformation.h index 9a9f87b1e..d8b3c9d8a 100644 --- a/qt-ui/locationinformation.h +++ b/qt-ui/locationinformation.h @@ -51,7 +51,7 @@ Q_OBJECT public: SimpleDiveSiteEditDialog(QWidget *parent); virtual ~SimpleDiveSiteEditDialog(); - bool changed; + bool changed_dive_site; public slots: void on_diveSiteName_editingFinished(); void on_diveSiteCoordinates_editingFinished(); diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index c2eac0628..bf68601f1 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -241,7 +241,10 @@ void MainTab::setCurrentLocationIndex() void MainTab::showDiveSiteSimpleEdit() { SimpleDiveSiteEditDialog dlg(this); - int reason = dlg.exec(); + dlg.exec(); + if (dlg.changed_dive_site) { + qDebug() << "Changed the dive site, paint something yellow."; + } } void MainTab::enableGeoLookupEdition() -- cgit v1.2.3-70-g09d2