Commit 9a8a998d authored by Judit Bartha's avatar Judit Bartha

Added callable phone number to Marble Maps

parent 82fab374
...@@ -88,5 +88,6 @@ ...@@ -88,5 +88,6 @@
<file alias="konqi/books.png">konqi/konqi-books.png</file> <file alias="konqi/books.png">konqi/konqi-books.png</file>
<file>RouteProfileRadioButton.qml</file> <file>RouteProfileRadioButton.qml</file>
<file>MarbleScrollBar.qml</file> <file>MarbleScrollBar.qml</file>
<file alias="material/phone.svg">material-icons/ic_phone_black_48px.svg</file>
</qresource> </qresource>
</RCC> </RCC>
...@@ -100,6 +100,16 @@ Item { ...@@ -100,6 +100,16 @@ Item {
onLinkActivated: Qt.openUrlExternally(link) onLinkActivated: Qt.openUrlExternally(link)
} }
IconText {
width: parent.width
visible: phone.length > 0
property string phone: placemark === null ? "" : placemark.phone
text: "<a href=\"tel:" + phone + "\">" + phone + "</a>"
icon: "qrc:/material/phone.svg"
maximumLineCount: 1
onLinkActivated: Qt.openUrlExternally(link)
}
IconText { IconText {
width: parent.width width: parent.width
visible: url.length > 0 visible: url.length > 0
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.CALL_PHONE"/>
<application android:label="Marble Maps" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:icon="@drawable/marblelogo" android:theme="@android:style/Theme.Holo.Light"> <application android:label="Marble Maps" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:icon="@drawable/marblelogo" android:theme="@android:style/Theme.Holo.Light">
<activity android:label="Marble Maps" android:name="org.kde.marble.maps.TextToSpeechClient" android:screenOrientation="unspecified" android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation"> <activity android:label="Marble Maps" android:name="org.kde.marble.maps.TextToSpeechClient" android:screenOrientation="unspecified" android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation">
<intent-filter> <intent-filter>
......
...@@ -39,6 +39,7 @@ void Placemark::setGeoDataPlacemark( const Marble::GeoDataPlacemark &placemark ) ...@@ -39,6 +39,7 @@ void Placemark::setGeoDataPlacemark( const Marble::GeoDataPlacemark &placemark )
m_openingHours = QString(); m_openingHours = QString();
m_wheelchairInfo = QString(); m_wheelchairInfo = QString();
m_wifiAvailable = QString(); m_wifiAvailable = QString();
m_phone = QString();
updateTags(); updateTags();
updateRelations(placemark); updateRelations(placemark);
emit coordinatesChanged(); emit coordinatesChanged();
...@@ -50,6 +51,7 @@ void Placemark::setGeoDataPlacemark( const Marble::GeoDataPlacemark &placemark ) ...@@ -50,6 +51,7 @@ void Placemark::setGeoDataPlacemark( const Marble::GeoDataPlacemark &placemark )
emit openingHoursChanged(); emit openingHoursChanged();
emit wheelchairInfoChanged(); emit wheelchairInfoChanged();
emit wifiAvailabilityChanged(); emit wifiAvailabilityChanged();
emit phoneChanged();
emit tagsChanged(); emit tagsChanged();
} }
...@@ -585,6 +587,16 @@ QString Placemark::wifiAvailable() const ...@@ -585,6 +587,16 @@ QString Placemark::wifiAvailable() const
return m_wifiAvailable; return m_wifiAvailable;
} }
QString Placemark::phone() const
{
if (!m_phone.isEmpty()) {
return m_phone;
}
addTagValue(m_phone, "phone");
return m_phone;
}
void Placemark::setName(const QString & name) void Placemark::setName(const QString & name)
{ {
if (m_placemark.displayName() == name) { if (m_placemark.displayName() == name) {
......
...@@ -36,6 +36,7 @@ class Placemark : public QObject ...@@ -36,6 +36,7 @@ class Placemark : public QObject
Q_PROPERTY(QString coordinates READ coordinates NOTIFY coordinatesChanged) Q_PROPERTY(QString coordinates READ coordinates NOTIFY coordinatesChanged)
Q_PROPERTY(QString wheelchairInfo READ wheelchairInfo NOTIFY wheelchairInfoChanged) Q_PROPERTY(QString wheelchairInfo READ wheelchairInfo NOTIFY wheelchairInfoChanged)
Q_PROPERTY(QString wifiAvailable READ wifiAvailable NOTIFY wifiAvailabilityChanged) Q_PROPERTY(QString wifiAvailable READ wifiAvailable NOTIFY wifiAvailabilityChanged)
Q_PROPERTY(QString phone READ phone NOTIFY phoneChanged)
Q_PROPERTY(double longitude READ longitude NOTIFY coordinatesChanged) Q_PROPERTY(double longitude READ longitude NOTIFY coordinatesChanged)
Q_PROPERTY(double latitude READ latitude NOTIFY coordinatesChanged) Q_PROPERTY(double latitude READ latitude NOTIFY coordinatesChanged)
Q_PROPERTY(QStringList tags READ tags NOTIFY tagsChanged) Q_PROPERTY(QStringList tags READ tags NOTIFY tagsChanged)
...@@ -60,6 +61,7 @@ public: ...@@ -60,6 +61,7 @@ public:
QString coordinates() const; QString coordinates() const;
QString wheelchairInfo() const; QString wheelchairInfo() const;
QString wifiAvailable() const; QString wifiAvailable() const;
QString phone() const;
double longitude() const; double longitude() const;
double latitude() const; double latitude() const;
const QStringList & tags() const; const QStringList & tags() const;
...@@ -79,6 +81,7 @@ Q_SIGNALS: ...@@ -79,6 +81,7 @@ Q_SIGNALS:
void openingHoursChanged(); void openingHoursChanged();
void wheelchairInfoChanged(); void wheelchairInfoChanged();
void wifiAvailabilityChanged(); void wifiAvailabilityChanged();
void phoneChanged();
void tagsChanged(); void tagsChanged();
void routeRelationModelChanged(); void routeRelationModelChanged();
...@@ -101,6 +104,7 @@ private: ...@@ -101,6 +104,7 @@ private:
mutable QString m_openingHours; mutable QString m_openingHours;
mutable QString m_wheelchairInfo; mutable QString m_wheelchairInfo;
mutable QString m_wifiAvailable; mutable QString m_wifiAvailable;
mutable QString m_phone;
QStringList m_tags; QStringList m_tags;
RouteRelationModel m_relationModel; RouteRelationModel m_relationModel;
......
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