Skip to content

Commit

Permalink
Add 'report a problem' link (Fix #123).
Browse files Browse the repository at this point in the history
Fix service layout (Fix #116).
  • Loading branch information
alisovenko committed Feb 26, 2017
1 parent 057a15f commit 3dd725b
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 20 deletions.
4 changes: 3 additions & 1 deletion src/metadata.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name=QuickMapServices
qgisMinimumVersion=2.4
description=Collection of easy to add basemaps
version=0.18.2
version=0.18.3
author=NextGIS
[email protected]
about=Convenient list of services + search for finding datasets and basemaps. Please contribute new services via http://qms.nextgis.com!
Expand All @@ -14,6 +14,8 @@ about=Convenient list of services + search for finding datasets and basemaps. Pl

# Uncomment the following line and add your changelog:
changelog=
0.18.3
* Add report a problem link
0.18.2
* Use rediration url, if tms service return 301 http status
0.18.1
Expand Down
2 changes: 1 addition & 1 deletion src/qms_external_api_python
69 changes: 51 additions & 18 deletions src/qms_service_toolbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
QCursor,
QSizePolicy,
QListWidgetItem,
QGridLayout,
)

from PyQt4.QtCore import (
Expand Down Expand Up @@ -276,24 +277,56 @@ def __init__(self, geoservice, image_ba, parent=None):
self.service_icon.setPixmap(pixmap)
self.layout.addWidget(self.service_icon)

self.service_desc = QLabel(self)
self.service_desc.setTextFormat(Qt.RichText)
self.service_desc.setOpenExternalLinks(True)
self.service_desc.setWordWrap(True)

# geoservice_info = client.get_geoservice_info(geoservice)
# ds = DataSourceSerializer.read_from_json(geoservice_info)
# print "ds.icon_path: ", ds.icon_path

self.service_desc.setText(
u"<strong> {} </strong><div style=\"margin-top: 3px\">{}, <a href=\"{}\">details<a/><div/>".format(
# "{}<div style=\"margin-top: 3px\"> <em> {} </em>, <a href=\"{}\"> details <a/> <div/>".format(
geoservice.get('name', u""),
geoservice.get('type', u"").upper(),
Client().geoservice_info_url(geoservice.get('id', u""))
)
)
self.layout.addWidget(self.service_desc)
self.service_desc_layout = QGridLayout(self)
self.service_desc_layout.setSpacing(0)
self.layout.addLayout(self.service_desc_layout)

self.service_name = QLabel(self)
self.service_name.setTextFormat(Qt.RichText)
self.service_name.setWordWrap(True)
self.service_name.setText(u" <strong> {} </strong>".format(geoservice.get('name', u"")))
self.service_desc_layout.addWidget(self.service_name, 0, 0, 1, 3)

self.service_type = QLabel(self)
self.service_type.setTextFormat(Qt.RichText)
self.service_type.setWordWrap(True)
self.service_type.setText(geoservice.get('type', u"").upper() + " ")
self.service_desc_layout.addWidget(self.service_type, 1, 0)

self.service_deteils = QLabel(self)
self.service_deteils.setTextFormat(Qt.RichText)
self.service_deteils.setWordWrap(True)
self.service_deteils.setOpenExternalLinks(True)
self.service_deteils.setText(u"<a href=\"{}\">details</a>, ".format(
Client().geoservice_info_url(geoservice.get('id', u""))
))
self.service_desc_layout.addWidget(self.service_deteils, 1, 1)

self.service_report = QLabel(self)
self.service_report.setTextFormat(Qt.RichText)
self.service_report.setWordWrap(True)
self.service_report.setOpenExternalLinks(True)
self.service_report.setText(u"<a href=\"{}\">report a problem</a><div/>".format(
Client().geoservice_report_url(geoservice.get('id', u""))
))
self.service_desc_layout.addWidget(self.service_report, 1, 2)
self.service_desc_layout.setColumnStretch(2, 1)

# self.service_desc = QLabel(self)
# self.service_desc.setTextFormat(Qt.RichText)
# self.service_desc.setOpenExternalLinks(True)
# self.service_desc.setWordWrap(True)

# self.service_desc.setText(
# u"<strong> {} </strong><div style=\"margin-top: 3px\">{}, <a href=\"{}\">details</a>, <a href=\"{}\">report</a><div/>".format(
# # "{}<div style=\"margin-top: 3px\"> <em> {} </em>, <a href=\"{}\"> details <a/> <div/>".format(
# geoservice.get('name', u""),
# geoservice.get('type', u"").upper(),
# Client().geoservice_info_url(geoservice.get('id', u"")),
# Client().geoservice_report_url(geoservice.get('id', u""))
# )
# )
# self.layout.addWidget(self.service_desc)

self.addButton = QToolButton()
self.addButton.setText("Add")
Expand Down

0 comments on commit 3dd725b

Please sign in to comment.