- 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);
- m_metaDataWidget->setMaximumWidth(KIconLoader::SizeEnormous);
-
- 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);
- }
-
- // general meta text information
- m_metaTextLabel = new MetaTextLabel(this);
- m_metaTextLabel->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
-
- m_metaTextArea = new QScrollArea(this);
- m_metaTextArea->setWidget(m_metaTextLabel);
- m_metaTextArea->setWidgetResizable(true);
- m_metaTextArea->setFrameShape(QFrame::NoFrame);
-
- QWidget* viewport = m_metaTextArea->viewport();
- viewport->installEventFilter(this);
-
- QPalette palette = viewport->palette();
- palette.setColor(viewport->backgroundRole(), QColor(Qt::transparent));
- viewport->setPalette(palette);
-
- layout->addWidget(m_nameLabel);
- layout->addWidget(new KSeparator(this));
- layout->addWidget(m_preview);
- layout->addWidget(m_phononWidget);
- layout->addWidget(m_previewSeparator);
- if (m_metaDataWidget != 0) {
- layout->addWidget(m_metaDataWidget);
- layout->addWidget(m_metaDataSeparator);
- }
- layout->addWidget(m_metaTextArea);
- setLayout(layout);
-
- org::kde::KDirNotify* dirNotify = new org::kde::KDirNotify(QString(), QString(),
- QDBusConnection::sessionBus(), this);
- connect(dirNotify, SIGNAL(FileRenamed(QString, QString)), SLOT(slotFileRenamed(QString, QString)));
- connect(dirNotify, SIGNAL(FilesAdded(QString)), SLOT(slotFilesAdded(QString)));
- connect(dirNotify, SIGNAL(FilesChanged(QStringList)), SLOT(slotFilesChanged(QStringList)));
- connect(dirNotify, SIGNAL(FilesRemoved(QStringList)), SLOT(slotFilesRemoved(QStringList)));
- connect(dirNotify, SIGNAL(enteredDirectory(QString)), SLOT(slotEnteredDirectory(QString)));
- connect(dirNotify, SIGNAL(leftDirectory(QString)), SLOT(slotLeftDirectory(QString)));
+ connect(m_infoTimer, &QTimer::timeout, this, &InformationPanel::slotInfoTimeout);
+
+ m_urlChangedTimer = new QTimer(this);
+ m_urlChangedTimer->setInterval(200);
+ m_urlChangedTimer->setSingleShot(true);
+ connect(m_urlChangedTimer, &QTimer::timeout, this, &InformationPanel::showItemInfo);
+
+ m_resetUrlTimer = new QTimer(this);
+ m_resetUrlTimer->setInterval(1000);
+ m_resetUrlTimer->setSingleShot(true);
+ connect(m_resetUrlTimer, &QTimer::timeout, this, &InformationPanel::reset);
+
+ Q_ASSERT(m_urlChangedTimer->interval() < m_infoTimer->interval());
+ Q_ASSERT(m_urlChangedTimer->interval() < m_resetUrlTimer->interval());
+
+ org::kde::KDirNotify *dirNotify = new org::kde::KDirNotify(QString(), QString(), QDBusConnection::sessionBus(), this);
+ connect(dirNotify, &OrgKdeKDirNotifyInterface::FileRenamed, this, &InformationPanel::slotFileRenamed);
+ connect(dirNotify, &OrgKdeKDirNotifyInterface::FilesAdded, this, &InformationPanel::slotFilesAdded);
+ connect(dirNotify, &OrgKdeKDirNotifyInterface::FilesChanged, this, &InformationPanel::slotFilesChanged);
+ connect(dirNotify, &OrgKdeKDirNotifyInterface::FilesRemoved, this, &InformationPanel::slotFilesRemoved);
+ connect(dirNotify, &OrgKdeKDirNotifyInterface::enteredDirectory, this, &InformationPanel::slotEnteredDirectory);
+ connect(dirNotify, &OrgKdeKDirNotifyInterface::leftDirectory, this, &InformationPanel::slotLeftDirectory);
+
+ m_content = new InformationPanelContent(this);
+ connect(m_content, &InformationPanelContent::urlActivated, this, &InformationPanel::urlActivated);
+ connect(m_content, &InformationPanelContent::configurationFinished, this, [this]() {
+ m_inConfigurationMode = false;
+ });
+ connect(m_content, &InformationPanelContent::contextMenuRequested, this, &InformationPanel::showContextMenu);
+
+ QVBoxLayout *layout = new QVBoxLayout(this);
+ layout->setContentsMargins(0, 0, 0, 0);
+ layout->addWidget(m_content);