mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 23:03:23 +00:00
Change color / mark widget as changed correctly on LocationEdit
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
30c5a027ca
commit
986b6c509a
2 changed files with 39 additions and 5 deletions
|
@ -696,10 +696,14 @@ void LocationInformationWidget::setLocationId(uint32_t uuid)
|
|||
ui.diveSiteCoordinates->clear();
|
||||
}
|
||||
displayed_dive_site = *currentDs;
|
||||
ui.diveSiteName->setText(displayed_dive_site.name);
|
||||
ui.diveSiteDescription->setText(displayed_dive_site.description);
|
||||
ui.diveSiteNotes->setPlainText(displayed_dive_site.notes);
|
||||
ui.diveSiteCoordinates->setText(printGPSCoords(displayed_dive_site.latitude.udeg, displayed_dive_site.longitude.udeg));
|
||||
if (displayed_dive_site.name)
|
||||
ui.diveSiteName->setText(displayed_dive_site.name);
|
||||
if (displayed_dive_site.description)
|
||||
ui.diveSiteDescription->setText(displayed_dive_site.description);
|
||||
if (displayed_dive_site.notes)
|
||||
ui.diveSiteNotes->setPlainText(displayed_dive_site.notes);
|
||||
if (displayed_dive_site.latitude.udeg || displayed_dive_site.longitude.udeg)
|
||||
ui.diveSiteCoordinates->setText(printGPSCoords(displayed_dive_site.latitude.udeg, displayed_dive_site.longitude.udeg));
|
||||
}
|
||||
|
||||
void LocationInformationWidget::updateGpsCoordinates()
|
||||
|
@ -769,5 +773,30 @@ void LocationInformationWidget::markChangedWidget(QWidget *w)
|
|||
|
||||
void LocationInformationWidget::enableEdition()
|
||||
{
|
||||
|
||||
MainWindow::instance()->dive_list()->setEnabled(false);
|
||||
MainWindow::instance()->setEnabledToolbar(false);
|
||||
ui.diveSiteMessage->show();
|
||||
}
|
||||
|
||||
void LocationInformationWidget::on_diveSiteCoordinates_textChanged(const QString& text)
|
||||
{
|
||||
markChangedWidget(ui.diveSiteCoordinates);
|
||||
}
|
||||
|
||||
void LocationInformationWidget::on_diveSiteDescription_textChanged(const QString& text)
|
||||
{
|
||||
if (!same_string(qPrintable(text), currentDs->description))
|
||||
markChangedWidget(ui.diveSiteDescription);
|
||||
}
|
||||
|
||||
void LocationInformationWidget::on_diveSiteName_textChanged(const QString& text)
|
||||
{
|
||||
if (!same_string(qPrintable(text), currentDs->name))
|
||||
markChangedWidget(ui.diveSiteName);
|
||||
}
|
||||
|
||||
void LocationInformationWidget::on_diveSiteNotes_textChanged()
|
||||
{
|
||||
if (!same_string(qPrintable(ui.diveSiteNotes->toPlainText()), currentDs->notes))
|
||||
markChangedWidget(ui.diveSiteNotes);
|
||||
}
|
||||
|
|
|
@ -232,6 +232,11 @@ public slots:
|
|||
void updateGpsCoordinates(void);
|
||||
void markChangedWidget(QWidget *w);
|
||||
void enableEdition();
|
||||
|
||||
void on_diveSiteCoordinates_textChanged(const QString& text);
|
||||
void on_diveSiteDescription_textChanged(const QString& text);
|
||||
void on_diveSiteName_textChanged(const QString& text);
|
||||
void on_diveSiteNotes_textChanged();
|
||||
signals:
|
||||
void informationManagementEnded();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue