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 @@ ...@@ -53,6 +53,7 @@
<file alias="material/directions-car.svg">material-icons/ic_directions_car_48px.svg</file> <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/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/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>RouteProfileRadioButton.qml</file>
<file>ScrollBar.qml</file> <file>ScrollBar.qml</file>
</qresource> </qresource>
......
...@@ -95,6 +95,13 @@ Item { ...@@ -95,6 +95,13 @@ Item {
text: placemark === null ? "" : placemark.fuelDetails text: placemark === null ? "" : placemark.fuelDetails
icon: "qrc:/material/gas_station.svg" 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() { 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 ) ...@@ -33,6 +33,9 @@ void Placemark::setGeoDataPlacemark( const Marble::GeoDataPlacemark &placemark )
emit nameChanged(); emit nameChanged();
emit descriptionChanged(); emit descriptionChanged();
emit addressChanged(); emit addressChanged();
emit websiteChanged();
emit wikipediaChanged();
emit openingHoursChanged();
if (m_placemark.visualCategory() == GeoDataFeature::TransportFuel) { if (m_placemark.visualCategory() == GeoDataFeature::TransportFuel) {
emit fuelDetailsChanged(); emit fuelDetailsChanged();
} }
...@@ -149,6 +152,16 @@ QString Placemark::wikipedia() const ...@@ -149,6 +152,16 @@ QString Placemark::wikipedia() const
return m_wikipedia; 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) void Placemark::setName(const QString & name)
{ {
if (m_placemark.name() == name) { if (m_placemark.name() == name) {
......
...@@ -34,6 +34,7 @@ class Placemark : public QObject ...@@ -34,6 +34,7 @@ class Placemark : public QObject
Q_PROPERTY( QString website READ website NOTIFY websiteChanged) Q_PROPERTY( QString website READ website NOTIFY websiteChanged)
Q_PROPERTY( QString wikipedia READ wikipedia NOTIFY wikipediaChanged) Q_PROPERTY( QString wikipedia READ wikipedia NOTIFY wikipediaChanged)
Q_PROPERTY( QString fuelDetails READ fuelDetails NOTIFY fuelDetailsChanged) Q_PROPERTY( QString fuelDetails READ fuelDetails NOTIFY fuelDetailsChanged)
Q_PROPERTY( QString openingHours READ openingHours NOTIFY openingHoursChanged)
public: public:
/** Constructor */ /** Constructor */
...@@ -49,12 +50,12 @@ public: ...@@ -49,12 +50,12 @@ public:
QString website() const; QString website() const;
QString wikipedia() const; QString wikipedia() const;
QString fuelDetails() const; QString fuelDetails() const;
QString openingHours() const;
public Q_SLOTS: public Q_SLOTS:
void setName(const QString &name); void setName(const QString &name);
Q_SIGNALS: Q_SIGNALS:
void nameChanged(); void nameChanged();
void coordinatesChanged(); void coordinatesChanged();
void descriptionChanged(); void descriptionChanged();
...@@ -62,6 +63,7 @@ Q_SIGNALS: ...@@ -62,6 +63,7 @@ Q_SIGNALS:
void websiteChanged(); void websiteChanged();
void wikipediaChanged(); void wikipediaChanged();
void fuelDetailsChanged(); void fuelDetailsChanged();
void openingHoursChanged();
private: private:
QString categoryName(GeoDataFeature::GeoDataVisualCategory category) const; QString categoryName(GeoDataFeature::GeoDataVisualCategory category) const;
...@@ -77,6 +79,7 @@ private: ...@@ -77,6 +79,7 @@ private:
mutable QString m_fuelDetails; mutable QString m_fuelDetails;
mutable QString m_website; mutable QString m_website;
mutable QString m_wikipedia; 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