- connect(m_infoTimer, SIGNAL(timeout()),
- this, SLOT(slotInfoTimeout()));
-
- // Initialize timer for disabling an outdated preview with a small
- // delay. This prevents flickering if the new preview can be generated
- // within a very small timeframe.
- m_outdatedPreviewTimer = new QTimer(this);
- m_outdatedPreviewTimer->setInterval(300);
- m_outdatedPreviewTimer->setSingleShot(true);
- connect(m_outdatedPreviewTimer, SIGNAL(timeout()),
- this, SLOT(markOutdatedPreview()));
-
- QVBoxLayout* layout = new QVBoxLayout;
- layout->setSpacing(KDialog::spacingHint());
-
- // name
- m_nameLabel = new QLabel(this);
- QFont font = m_nameLabel->font();
- font.setBold(true);
- m_nameLabel->setFont(font);
- m_nameLabel->setAlignment(Qt::AlignHCenter);
- m_nameLabel->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
- m_nameLabel->setMaximumWidth(KIconLoader::SizeEnormous);
-
- // preview
- const int minPreviewWidth = KIconLoader::SizeEnormous + KIconLoader::SizeMedium;
-
- m_preview = new PixmapViewer(this);
- m_preview->setMinimumWidth(minPreviewWidth);
- m_preview->setMinimumHeight(KIconLoader::SizeEnormous);
-
- m_phononWidget = new PhononWidget(this);
- m_phononWidget->setMinimumWidth(minPreviewWidth);
- connect(m_phononWidget, SIGNAL(playingStarted()),
- this, SLOT(slotPlayingStarted()));
- connect(m_phononWidget, SIGNAL(playingStopped()),
- this, SLOT(slotPlayingStopped()));
-
- m_previewSeparator = new KSeparator(this);
-
- const bool showPreview = InformationPanelSettings::showPreview();
- m_preview->setVisible(showPreview);
- m_previewSeparator->setVisible(showPreview);
-
- if (MetaDataWidget::metaDataAvailable()) {
- // rating, comment and tags
- m_metaDataWidget = new MetaDataWidget(this);
- m_metaDataWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
-
- const bool showRating = InformationPanelSettings::showRating();
- const bool showComment = InformationPanelSettings::showComment();
- const bool showTags = InformationPanelSettings::showTags();
-
- m_metaDataWidget->setRatingVisible(showRating);
- m_metaDataWidget->setCommentVisible(showComment);
- m_metaDataWidget->setTagsVisible(showTags);
-
- m_metaDataSeparator = new KSeparator(this);
- m_metaDataSeparator->setVisible(showRating || showComment || showTags);
- }