diff widgets/ListResultGeneralItemWidget.cpp @ 126:c26c73ca6d37

the result list is better now. it's not the final version. the final version.... is coming soon
author benoitrigolleau
date Tue, 23 Oct 2007 15:24:06 +0000
parents 1c638a8e9897
children be6d31baecb9
line wrap: on
line diff
--- a/widgets/ListResultGeneralItemWidget.cpp	Mon Oct 22 13:59:27 2007 +0000
+++ b/widgets/ListResultGeneralItemWidget.cpp	Tue Oct 23 15:24:06 2007 +0000
@@ -31,9 +31,9 @@
 	m_labelRank = new QLabel();
 	m_labelIcon = new QLabel();
 	m_labelTitleArtist = new QLabel();
-	label4 = new QLabel("4");
-	label5 = new QLabel("le super mega truc des options que même que c'est trop bien");
-
+	label4 = new QLabel(""); // for the icons
+	label5 = new QLabel(""); // for the options
+ 
 	m_buttonPrev = new QPushButton();
 	m_buttonSimilar = new QPushButton();
 
@@ -160,11 +160,26 @@
 	hLayout3->addWidget(m_buttonSimilar);
 
 	connect(m_buttonSimilar, SIGNAL(clicked()), this, SLOT(displayCriteria()));
+	connect(m_labelTitleArtist, SIGNAL(linkActivated(QString)), this, SIGNAL(linkActivated(QString)));
 
 }
 
-void ListResultGeneralItemWidget::setTitleAndAuthorName(QString author,QString title){
-	m_labelTitleArtist->setText(author+" - \""+title+"\"");	
+void ListResultGeneralItemWidget::setTitleAndAuthorName(QString author,QString title, QString uri){
+	QString aux = title;
+	if(aux.length() > 50){
+		aux.truncate(47);
+		aux+="...";
+	}
+	
+	QString label;
+	label = author+" - \"";
+	label += "<a href=\"";
+	label += uri;
+	label += "\">";
+	label += aux;
+	label += "</a>";
+	m_labelTitleArtist->setText(label);
+	m_labelTitleArtist->setToolTip(title);
 }
 
 void ListResultGeneralItemWidget::setRank(int rank){