Mercurial > hg > easaier-soundaccess
changeset 142:c1ea7af931e7
new result display
author | benoitrigolleau |
---|---|
date | Mon, 12 Nov 2007 14:50:15 +0000 |
parents | 51d1551c40fd |
children | 97fd6148fb8e |
files | sv/icons/addToLayer.png sv/sound-access.qrc widgets/InfoWidget.cpp |
diffstat | 3 files changed, 45 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/sv/sound-access.qrc Fri Nov 09 16:06:44 2007 +0000 +++ b/sv/sound-access.qrc Mon Nov 12 14:50:15 2007 +0000 @@ -78,8 +78,9 @@ <file>icons/speechIcon.png</file> <file>icons/prev.png</file> <file>icons/similar.png</file> + <file>icons/addToLayer.png</file> - <file>samples/bass.wav</file> + <file>samples/bass.wav</file> <file>samples/beep.wav</file> <file>samples/bounce.wav</file> <file>samples/clap.wav</file>
--- a/widgets/InfoWidget.cpp Fri Nov 09 16:06:44 2007 +0000 +++ b/widgets/InfoWidget.cpp Mon Nov 12 14:50:15 2007 +0000 @@ -54,55 +54,79 @@ std::map<QString, QString> info = model->getInfo(); std::map<QString, QString>::iterator iterInfo; QLabel* proper; + QLabel* icon; QLabel* value; int row = 0; + m_infoLayout->setColumnMinimumWidth(1,20); + m_infoLayout->setColumnMinimumWidth(3,20); + //display author and title at first iterInfo = info.find("title"); if (iterInfo!= info.end()) { - proper = new QLabel(iterInfo->first); + proper = new QLabel(iterInfo->first.toUpper()); value = new QLabel(iterInfo->second); - m_infoLayout->addWidget(proper, row, 0); - m_infoLayout->addWidget(value, row, 1); + m_infoLayout->addWidget(proper, row, 0,1,3); + m_infoLayout->addWidget(value, row, 4,1,1); row++; } iterInfo = info.find("author"); if (iterInfo!= info.end()) { - proper = new QLabel(iterInfo->first); + proper = new QLabel(iterInfo->first.toUpper()); value = new QLabel(iterInfo->second); - m_infoLayout->addWidget(proper, row, 0); - m_infoLayout->addWidget(value, row, 1); + m_infoLayout->addWidget(proper, row, 0,1,3); + m_infoLayout->addWidget(value, row, 4,1,1); row++; } - + m_infoLayout->setRowMinimumHeight(row,25); + row++; + + //display other info for (iterInfo = info.begin(); iterInfo != info.end(); iterInfo++) { - if ((iterInfo->first != "title") && (iterInfo->first != "author")) + if ((iterInfo->first != "title") && (iterInfo->first != "author") && (iterInfo->first.contains("http://purl.org/ontology/mo"))) { - proper = new QLabel(iterInfo->first); + QString properName; + properName = iterInfo->first.split("#").last(); + proper = new QLabel(properName); + icon = new QLabel(); + if(properName == "beats"){ + icon->setPixmap(QPixmap(":icons/instants.png")); + }else if(properName == "chromagram"){ + icon->setPixmap(QPixmap(":icons/colour3d.png")); + }else if(properName == "instruments"){ + icon->setPixmap(QPixmap(":icons/notes.png")); + }else if(properName == "key"){ + icon->setPixmap(QPixmap(":icons/values.png")); + }else if(properName == "tempo"){ + icon->setPixmap(QPixmap(":icons/values.png")); + }else{ + //nothing + } QString valueText(iterInfo->second); if (valueText.right(4) == ".xml") { value = new QLabel(); - value->setText("<a href=\"" + iterInfo->second + "\">" + iterInfo->second + "</a>"); + //value->setIcon(QIcon(":icons/redo.png")); + value->setText("<html><header><style type=\"text/css\">a {text-decoration: none;}</style></header><body><a href=\"" + iterInfo->second + "\"><img src=\":icons/addToLayer.png\"> </a></body></html>"); + value->setToolTip(tr("Add this layer to the layer list")); //connect the main window to the linkActivated signal connect(value, SIGNAL(linkActivated(QString)), MainWindow::instance(), SLOT(importEasaierLayer(QString))); - - } else { - value = new QLabel(iterInfo->second); - } - - m_infoLayout->addWidget(proper, row, 0); - m_infoLayout->addWidget(value, row, 1); - row++; + + m_infoLayout->addWidget(icon,row,0,1,1); + m_infoLayout->addWidget(proper, row, 2,1,1); + m_infoLayout->addWidget(value, row, 4,1,1); + row++; + } } } - m_infoLayout->setColumnStretch( 1, 1); + m_infoLayout->setColumnStretch( 4, 1); + m_infoLayout->setRowStretch( row+1, 1); }