mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
[Divesite] Hook location information interface for country
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
e1bd006cd6
commit
516527e1bd
2 changed files with 17 additions and 0 deletions
|
@ -93,6 +93,10 @@ void LocationInformationWidget::updateLabels()
|
|||
ui.diveSiteName->setText(displayed_dive_site.name);
|
||||
else
|
||||
ui.diveSiteName->clear();
|
||||
if (displayed_dive_site.country)
|
||||
ui.diveSiteCountry->setText(displayed_dive_site.country);
|
||||
else
|
||||
ui.diveSiteCountry->clear();
|
||||
if (displayed_dive_site.description)
|
||||
ui.diveSiteDescription->setText(displayed_dive_site.description);
|
||||
else
|
||||
|
@ -147,6 +151,11 @@ void LocationInformationWidget::acceptChanges()
|
|||
free(currentDs->description);
|
||||
currentDs->description = copy_string(uiString);
|
||||
}
|
||||
uiString = ui.diveSiteCountry->text().toUtf8().data();
|
||||
if (!same_string(uiString, currentDs->country)) {
|
||||
free(currentDs->country);
|
||||
currentDs->country = copy_string(uiString);
|
||||
}
|
||||
uiString = ui.diveSiteNotes->document()->toPlainText().toUtf8().data();
|
||||
if (!same_string(uiString, currentDs->notes)) {
|
||||
free(currentDs->notes);
|
||||
|
@ -243,6 +252,12 @@ void LocationInformationWidget::on_diveSiteCoordinates_textChanged(const QString
|
|||
free((void *)coords);
|
||||
}
|
||||
|
||||
void LocationInformationWidget::on_diveSiteCountry_textChanged(const QString& text)
|
||||
{
|
||||
if (!same_string(qPrintable(text), displayed_dive_site.country))
|
||||
markChangedWidget(ui.diveSiteCountry);
|
||||
}
|
||||
|
||||
void LocationInformationWidget::on_diveSiteDescription_textChanged(const QString &text)
|
||||
{
|
||||
if (!same_string(qPrintable(text), displayed_dive_site.description))
|
||||
|
@ -266,6 +281,7 @@ void LocationInformationWidget::resetPallete()
|
|||
QPalette p;
|
||||
ui.diveSiteCoordinates->setPalette(p);
|
||||
ui.diveSiteDescription->setPalette(p);
|
||||
ui.diveSiteCountry->setPalette(p);
|
||||
ui.diveSiteName->setPalette(p);
|
||||
ui.diveSiteNotes->setPalette(p);
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@ public slots:
|
|||
void enableEdition();
|
||||
void resetState();
|
||||
void resetPallete();
|
||||
void on_diveSiteCountry_textChanged(const QString& text);
|
||||
void on_diveSiteCoordinates_textChanged(const QString& text);
|
||||
void on_diveSiteDescription_textChanged(const QString& text);
|
||||
void on_diveSiteName_textChanged(const QString& text);
|
||||
|
|
Loading…
Reference in a new issue