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

Added callable phone number to Marble Maps

parent 82fab374
......@@ -88,5 +88,6 @@
<file alias="konqi/books.png">konqi/konqi-books.png</file>
<file>RouteProfileRadioButton.qml</file>
<file>MarbleScrollBar.qml</file>
<file alias="material/phone.svg">material-icons/ic_phone_black_48px.svg</file>
</qresource>
</RCC>
......@@ -100,6 +100,16 @@ Item {
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 {
width: parent.width
visible: url.length > 0
......
......@@ -4,6 +4,7 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<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">
<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>
......
......@@ -39,6 +39,7 @@ void Placemark::setGeoDataPlacemark( const Marble::GeoDataPlacemark &placemark )
m_openingHours = QString();
m_wheelchairInfo = QString();
m_wifiAvailable = QString();
m_phone = QString();
updateTags();
updateRelations(placemark);
emit coordinatesChanged();
......@@ -50,6 +51,7 @@ void Placemark::setGeoDataPlacemark( const Marble::GeoDataPlacemark &placemark )
emit openingHoursChanged();
emit wheelchairInfoChanged();
emit wifiAvailabilityChanged();
emit phoneChanged();
emit tagsChanged();
}
......@@ -585,6 +587,16 @@ QString Placemark::wifiAvailable() const
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)
{
if (m_placemark.displayName() == name) {
......
......@@ -36,6 +36,7 @@ class Placemark : public QObject
Q_PROPERTY(QString coordinates READ coordinates NOTIFY coordinatesChanged)
Q_PROPERTY(QString wheelchairInfo READ wheelchairInfo NOTIFY wheelchairInfoChanged)
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 latitude READ latitude NOTIFY coordinatesChanged)
Q_PROPERTY(QStringList tags READ tags NOTIFY tagsChanged)
......@@ -60,6 +61,7 @@ public:
QString coordinates() const;
QString wheelchairInfo() const;
QString wifiAvailable() const;
QString phone() const;
double longitude() const;
double latitude() const;
const QStringList & tags() const;
......@@ -79,6 +81,7 @@ Q_SIGNALS:
void openingHoursChanged();
void wheelchairInfoChanged();
void wifiAvailabilityChanged();
void phoneChanged();
void tagsChanged();
void routeRelationModelChanged();
......@@ -101,6 +104,7 @@ private:
mutable QString m_openingHours;
mutable QString m_wheelchairInfo;
mutable QString m_wifiAvailable;
mutable QString m_phone;
QStringList m_tags;
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