mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-30 22:51:16 +01:00
Nicer multiple links display
This commit is contained in:
parent
9905de67bd
commit
c29ed0a2ca
@ -17,10 +17,16 @@ QString RouteItem::info() const
|
|||||||
tt.insert(tr("Description"), _desc);
|
tt.insert(tr("Description"), _desc);
|
||||||
tt.insert(tr("Distance"), Format::distance(path().last().last().distance(),
|
tt.insert(tr("Distance"), Format::distance(path().last().last().distance(),
|
||||||
_units));
|
_units));
|
||||||
for (int i = 0; i < _links.size(); i++) {
|
if (!_links.isEmpty()) {
|
||||||
const Link &link = _links.at(i);
|
QString links;
|
||||||
tt.insert(tr("Link"), QString("<a href=\"%0\">%1</a>").arg(
|
for (int i = 0; i < _links.size(); i++) {
|
||||||
link.URL(), link.text().isEmpty() ? link.URL() : link.text()));
|
const Link &link = _links.at(i);
|
||||||
|
links.append(QString("<a href=\"%0\">%1</a>").arg(link.URL(),
|
||||||
|
link.text().isEmpty() ? link.URL() : link.text()));
|
||||||
|
if (i != _links.size() - 1)
|
||||||
|
links.append("<br/>");
|
||||||
|
}
|
||||||
|
tt.insert(tr("Links"), links);
|
||||||
}
|
}
|
||||||
|
|
||||||
return tt.toString();
|
return tt.toString();
|
||||||
|
@ -21,10 +21,16 @@ QString TrackItem::info() const
|
|||||||
tt.insert(tr("Moving time"), Format::timeSpan(_movingTime));
|
tt.insert(tr("Moving time"), Format::timeSpan(_movingTime));
|
||||||
if (!_date.isNull())
|
if (!_date.isNull())
|
||||||
tt.insert(tr("Date"), _date.toString(Qt::SystemLocaleShortDate));
|
tt.insert(tr("Date"), _date.toString(Qt::SystemLocaleShortDate));
|
||||||
for (int i = 0; i < _links.size(); i++) {
|
if (!_links.isEmpty()) {
|
||||||
const Link &link = _links.at(i);
|
QString links;
|
||||||
tt.insert(tr("Link"), QString("<a href=\"%0\">%1</a>").arg(
|
for (int i = 0; i < _links.size(); i++) {
|
||||||
link.URL(), link.text().isEmpty() ? link.URL() : link.text()));
|
const Link &link = _links.at(i);
|
||||||
|
links.append(QString("<a href=\"%0\">%1</a>").arg(link.URL(),
|
||||||
|
link.text().isEmpty() ? link.URL() : link.text()));
|
||||||
|
if (i != _links.size() - 1)
|
||||||
|
links.append("<br/>");
|
||||||
|
}
|
||||||
|
tt.insert(tr("Links"), links);
|
||||||
}
|
}
|
||||||
|
|
||||||
return tt.toString();
|
return tt.toString();
|
||||||
|
@ -30,11 +30,16 @@ QString WaypointItem::info() const
|
|||||||
if (!_waypoint.description().isEmpty())
|
if (!_waypoint.description().isEmpty())
|
||||||
tt.insert(qApp->translate("WaypointItem", "Description"),
|
tt.insert(qApp->translate("WaypointItem", "Description"),
|
||||||
_waypoint.description());
|
_waypoint.description());
|
||||||
for (int i = 0; i < _waypoint.links().size(); i++) {
|
if (!_waypoint.links().isEmpty()) {
|
||||||
const Link &link = _waypoint.links().at(i);
|
QString links;
|
||||||
tt.insert(qApp->translate("WaypointItem", "Link"),
|
for (int i = 0; i < _waypoint.links().size(); i++) {
|
||||||
QString("<a href=\"%0\">%1</a>").arg(link.URL(),
|
const Link &link = _waypoint.links().at(i);
|
||||||
link.text().isEmpty() ? link.URL() : link.text()));
|
links.append(QString("<a href=\"%0\">%1</a>").arg(link.URL(),
|
||||||
|
link.text().isEmpty() ? link.URL() : link.text()));
|
||||||
|
if (i != _waypoint.links().size() - 1)
|
||||||
|
links.append("<br/>");
|
||||||
|
}
|
||||||
|
tt.insert(qApp->translate("WaypointItem", "Links"), links);
|
||||||
}
|
}
|
||||||
tt.setImage(_waypoint.image());
|
tt.setImage(_waypoint.image());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user