Mercurial > hg > easaier-soundaccess
comparison widgets/RelatedMediaWidget.cpp @ 258:14e8a46d506d
support "file://"
author | lbajardsilogic |
---|---|
date | Fri, 20 Jun 2008 07:26:03 +0000 |
parents | 057856cf81a2 |
children |
comparison
equal
deleted
inserted
replaced
257:057856cf81a2 | 258:14e8a46d506d |
---|---|
79 "\"><img src=\"" + imageSource + "\" width=\"" + QString::number(width) + "\" height=\"" + QString::number(height) + "\"> </a></body></html>"); | 79 "\"><img src=\"" + imageSource + "\" width=\"" + QString::number(width) + "\" height=\"" + QString::number(height) + "\"> </a></body></html>"); |
80 | 80 |
81 connect(mediaLabel, SIGNAL(linkActivated(QString)), MainWindow::instance(), SLOT(runExternProcess(QString))); | 81 connect(mediaLabel, SIGNAL(linkActivated(QString)), MainWindow::instance(), SLOT(runExternProcess(QString))); |
82 | 82 |
83 QLabel *textLabel = new QLabel(); | 83 QLabel *textLabel = new QLabel(); |
84 QString uri = "file:" + filename.right(filename.length() - filename.lastIndexOf("/data")); | 84 QString uri = "file:/" + filename.right(filename.length() - filename.lastIndexOf("/data")); |
85 std::map<QString, QString>::iterator iter = relMediaList.find(uri); | 85 std::map<QString, QString>::iterator iter = relMediaList.find(uri); |
86 if (iter != relMediaList.end()) | 86 if (iter != relMediaList.end()) |
87 { | 87 { |
88 //textLabel->setText(iter->second); | |
89 textLabel->setText("<html><a >" + (iter->second).left(50) + "</a><a href=\"" + iter->second + "\">...</a></html>"); | 88 textLabel->setText("<html><a >" + (iter->second).left(50) + "</a><a href=\"" + iter->second + "\">...</a></html>"); |
90 connect(textLabel, SIGNAL(linkActivated(QString)), this, SLOT(showLabel(QString))); | 89 connect(textLabel, SIGNAL(linkActivated(QString)), this, SLOT(showLabel(QString))); |
91 } else { | 90 } else { |
92 textLabel->setText("<html><a >Info may be added here</a><a href=\"" + filename + "\">...</a></html>"); | 91 textLabel->setText("<html><a >Info may be added here</a><a href=\"" + filename + "\">...</a></html>"); |
93 } | 92 } |
107 void RelatedMediaWidget::showLabel(QString label) | 106 void RelatedMediaWidget::showLabel(QString label) |
108 { | 107 { |
109 QTextEdit *showLabel = new QTextEdit; | 108 QTextEdit *showLabel = new QTextEdit; |
110 showLabel->setReadOnly(true); | 109 showLabel->setReadOnly(true); |
111 showLabel->setHtml("<html><br><br>" + label + "</br></br></html>"); | 110 showLabel->setHtml("<html><br><br>" + label + "</br></br></html>"); |
112 //showLabel->setText("<html><br><br>" + label + "</br></br></html>"); | |
113 //showLabel->setText(label); | |
114 showLabel->show(); | 111 showLabel->show(); |
115 } | 112 } |