private final QComboBox geoBox;\r
public final TagLineEdit tagEdit;\r
public final QLabel tagLabel;\r
- private final QLabel urlLabel;\r
+ private final QPushButton urlLabel;\r
private final QLabel alteredLabel;\r
private final QDateEdit alteredDate;\r
private final QTimeEdit alteredTime;\r
urlText = new QLineEdit();\r
authorText = new QLineEdit();\r
geoBox = new QComboBox();\r
- urlLabel = new QLabel();\r
+ urlLabel = new QPushButton();\r
+ urlLabel.clicked.connect(this, "sourceUrlClicked()");\r
authorLabel = new QLabel();\r
conn = c;\r
\r
urlText.setText(t);\r
}\r
\r
+ // The user want's to launch a web browser on the source of the URL\r
+ public void sourceUrlClicked() {\r
+ // Make sure we have a valid URL\r
+ if (urlText.text().trim().equals(""))\r
+ return;\r
+ \r
+ String url = urlText.text();\r
+ if (!url.toLowerCase().startsWith(tr("http://")))\r
+ url = tr("http://") +url;\r
+ \r
+ if (!QDesktopServices.openUrl(new QUrl(url))) {\r
+ logger.log(logger.LOW, "Error opening file :" +url);\r
+ }\r
+ }\r
+ \r
public void setAuthor(String t) {\r
authorLabel.setText(tr("Author:\t"));\r
authorText.setText(t);\r