Commit 10df71c2 authored by Sanjiban Bairagya's avatar Sanjiban Bairagya Committed by Sanjiban Bairagya

Add opening-hours information to the Placemark dialog

parent 2ec7ca6a
......@@ -53,6 +53,7 @@
<file alias="material/directions-car.svg">material-icons/ic_directions_car_48px.svg</file>
<file alias="material/directions-walk.svg">material-icons/ic_directions_walk_48px.svg</file>
<file alias="material/navigation.svg">material-icons/ic_navigation_48px.svg</file>
<file alias="material/access_time.svg">material-icons/ic_access_time_48px.svg</file>
<file>RouteProfileRadioButton.qml</file>
<file>ScrollBar.qml</file>
</qresource>
......
......@@ -95,6 +95,13 @@ Item {
text: placemark === null ? "" : placemark.fuelDetails
icon: "qrc:/material/gas_station.svg"
}
IconText {
width: parent.width
visible: placemark !== null && placemark.openingHours !== ""
text: placemark === null ? "" : placemark.openingHours
icon: "qrc:/material/access_time.svg"
}
}
function ensureRouteHasDeparture() {
......
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M23.99 4C12.94 4 4 12.95 4 24s8.94 20 19.99 20C35.04 44 44 35.05 44 24S35.04 4 23.99 4zM24 40c-8.84 0-16-7.16-16-16S15.16 8 24 8s16 7.16 16 16-7.16 16-16 16zm1-26h-3v12l10.49 6.3L34 29.84l-9-5.34z"/></svg>
\ No newline at end of file
......@@ -33,6 +33,9 @@ void Placemark::setGeoDataPlacemark( const Marble::GeoDataPlacemark &placemark )
emit nameChanged();
emit descriptionChanged();
emit addressChanged();
emit websiteChanged();
emit wikipediaChanged();
emit openingHoursChanged();
if (m_placemark.visualCategory() == GeoDataFeature::TransportFuel) {
emit fuelDetailsChanged();
}
......@@ -149,6 +152,16 @@ QString Placemark::wikipedia() const
return m_wikipedia;
}
QString Placemark::openingHours() const
{
if (!m_openingHours.isEmpty()) {
return m_openingHours;
}
m_openingHours = m_placemark.osmData().tagValue("opening_hours");
return m_openingHours;
}
void Placemark::setName(const QString & name)
{
if (m_placemark.name() == name) {
......
......@@ -34,6 +34,7 @@ class Placemark : public QObject
Q_PROPERTY( QString website READ website NOTIFY websiteChanged)
Q_PROPERTY( QString wikipedia READ wikipedia NOTIFY wikipediaChanged)
Q_PROPERTY( QString fuelDetails READ fuelDetails NOTIFY fuelDetailsChanged)
Q_PROPERTY( QString openingHours READ openingHours NOTIFY openingHoursChanged)
public:
/** Constructor */
......@@ -49,12 +50,12 @@ public:
QString website() const;
QString wikipedia() const;
QString fuelDetails() const;
QString openingHours() const;
public Q_SLOTS:
void setName(const QString &name);
Q_SIGNALS:
void nameChanged();
void coordinatesChanged();
void descriptionChanged();
......@@ -62,6 +63,7 @@ Q_SIGNALS:
void websiteChanged();
void wikipediaChanged();
void fuelDetailsChanged();
void openingHoursChanged();
private:
QString categoryName(GeoDataFeature::GeoDataVisualCategory category) const;
......@@ -77,6 +79,7 @@ private:
mutable QString m_fuelDetails;
mutable QString m_website;
mutable QString m_wikipedia;
mutable QString m_openingHours;
};
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment