mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-28 05:34:47 +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("Distance"), Format::distance(path().last().last().distance(),
|
||||
_units));
|
||||
for (int i = 0; i < _links.size(); i++) {
|
||||
const Link &link = _links.at(i);
|
||||
tt.insert(tr("Link"), QString("<a href=\"%0\">%1</a>").arg(
|
||||
link.URL(), link.text().isEmpty() ? link.URL() : link.text()));
|
||||
if (!_links.isEmpty()) {
|
||||
QString links;
|
||||
for (int i = 0; i < _links.size(); i++) {
|
||||
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();
|
||||
|
@ -21,10 +21,16 @@ QString TrackItem::info() const
|
||||
tt.insert(tr("Moving time"), Format::timeSpan(_movingTime));
|
||||
if (!_date.isNull())
|
||||
tt.insert(tr("Date"), _date.toString(Qt::SystemLocaleShortDate));
|
||||
for (int i = 0; i < _links.size(); i++) {
|
||||
const Link &link = _links.at(i);
|
||||
tt.insert(tr("Link"), QString("<a href=\"%0\">%1</a>").arg(
|
||||
link.URL(), link.text().isEmpty() ? link.URL() : link.text()));
|
||||
if (!_links.isEmpty()) {
|
||||
QString links;
|
||||
for (int i = 0; i < _links.size(); i++) {
|
||||
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();
|
||||
|
@ -30,11 +30,16 @@ QString WaypointItem::info() const
|
||||
if (!_waypoint.description().isEmpty())
|
||||
tt.insert(qApp->translate("WaypointItem", "Description"),
|
||||
_waypoint.description());
|
||||
for (int i = 0; i < _waypoint.links().size(); i++) {
|
||||
const Link &link = _waypoint.links().at(i);
|
||||
tt.insert(qApp->translate("WaypointItem", "Link"),
|
||||
QString("<a href=\"%0\">%1</a>").arg(link.URL(),
|
||||
link.text().isEmpty() ? link.URL() : link.text()));
|
||||
if (!_waypoint.links().isEmpty()) {
|
||||
QString links;
|
||||
for (int i = 0; i < _waypoint.links().size(); i++) {
|
||||
const Link &link = _waypoint.links().at(i);
|
||||
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());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user