1 /***************************************************************************
2 * Copyright (C) 2006 by Peter Penz <peter.penz@gmx.at> *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18 ***************************************************************************/
20 #include "informationpanel.h"
22 #include <config-nepomuk.h>
25 #include <kdirnotify.h>
26 #include <kfileitem.h>
27 #include <kfilemetainfo.h>
28 #include <kfileplacesmodel.h>
29 #include <kglobalsettings.h>
30 #include <kio/previewjob.h>
31 #include <kiconeffect.h>
32 #include <kiconloader.h>
35 #include <kseparator.h>
38 #include <Nepomuk/Resource>
39 #include <Nepomuk/Types/Property>
40 #include <Nepomuk/Variant>
43 #include <Phonon/BackendCapabilities>
44 #include <Phonon/MediaObject>
45 #include <Phonon/SeekSlider>
48 #include <QInputDialog>
52 #include <QResizeEvent>
53 #include <QScrollArea>
54 #include <QTextLayout>
58 #include <QVBoxLayout>
60 #include "dolphin_informationpanelsettings.h"
61 #include "settings/dolphinsettings.h"
62 #include "metadatawidget.h"
63 #include "metatextlabel.h"
64 #include "phononwidget.h"
65 #include "pixmapviewer.h"
68 * Helper function for sorting items with qSort() in
69 * InformationPanel::contextMenu().
71 bool lessThan(const QAction
* action1
, const QAction
* action2
)
73 return action1
->text() < action2
->text();
77 InformationPanel::InformationPanel(QWidget
* parent
) :
80 m_pendingPreview(false),
82 m_outdatedPreviewTimer(0),
89 m_previewSeparator(0),
92 m_metaDataSeparator(0),
98 InformationPanel::~InformationPanel()
100 InformationPanelSettings::self()->writeConfig();
103 QSize
InformationPanel::sizeHint() const
105 QSize size
= Panel::sizeHint();
106 size
.setWidth(minimumSizeHint().width());
110 void InformationPanel::setUrl(const KUrl
& url
)
113 if (url
.isValid() && !isEqualToShownUrl(url
)) {
124 void InformationPanel::setSelection(const KFileItemList
& selection
)
130 if ((selection
.count() == 0) && (m_selection
.count() == 0)) {
131 // The selection has not really changed, only the current index.
132 // QItemSelectionModel emits a signal in this case and it is less
133 // expensive doing the check this way instead of patching
134 // DolphinView::emitSelectionChanged().
138 m_selection
= selection
;
140 const int count
= selection
.count();
142 if (!isEqualToShownUrl(url())) {
147 if ((count
== 1) && !selection
.first().url().isEmpty()) {
148 m_urlCandidate
= selection
.first().url();
150 m_infoTimer
->start();
154 void InformationPanel::requestDelayedItemInfo(const KFileItem
& item
)
162 m_fileItem
= KFileItem();
164 // The cursor is above the viewport. If files are selected,
165 // show information regarding the selection.
166 if (m_selection
.size() > 0) {
167 m_pendingPreview
= false;
168 m_infoTimer
->start();
171 const KUrl url
= item
.url();
172 if (url
.isValid() && !isEqualToShownUrl(url
)) {
173 m_urlCandidate
= item
.url();
175 m_infoTimer
->start();
180 void InformationPanel::showEvent(QShowEvent
* event
)
182 Panel::showEvent(event
);
183 if (!event
->spontaneous()) {
184 if (!m_initialized
) {
185 // do a delayed initialization so that no performance
186 // penalty is given when Dolphin is started with a closed
194 void InformationPanel::resizeEvent(QResizeEvent
* event
)
197 // If the text inside the name label or the info label cannot
198 // get wrapped, then the maximum width of the label is increased
199 // so that the width of the information panel gets increased.
200 // To prevent this, the maximum width is adjusted to
201 // the current width of the panel.
202 const int maxWidth
= event
->size().width() - KDialog::spacingHint() * 4;
203 m_nameLabel
->setMaximumWidth(maxWidth
);
205 // The metadata widget also contains a text widget which may return
206 // a large preferred width.
207 if (m_metaDataWidget
!= 0) {
208 m_metaDataWidget
->setMaximumWidth(maxWidth
);
211 // try to increase the preview as large as possible
212 m_preview
->setSizeHint(QSize(maxWidth
, maxWidth
));
213 m_urlCandidate
= m_shownUrl
; // reset the URL candidate if a resizing is done
214 m_infoTimer
->start();
216 if (m_phononWidget
->isVisible() && (m_phononWidget
->mode() == PhononWidget::Video
)) {
217 // assure that the size of the video player is the same as the preview size
218 m_phononWidget
->setVideoSize(QSize(maxWidth
, maxWidth
));
221 Panel::resizeEvent(event
);
224 bool InformationPanel::eventFilter(QObject
* obj
, QEvent
* event
)
226 // Check whether the size of the meta text area has changed and adjust
227 // the fixed width in a way that no horizontal scrollbar needs to be shown.
228 if ((obj
== m_metaTextArea
->viewport()) && (event
->type() == QEvent::Resize
)) {
229 QResizeEvent
* resizeEvent
= static_cast<QResizeEvent
*>(event
);
230 m_metaTextLabel
->setFixedWidth(resizeEvent
->size().width());
232 return Panel::eventFilter(obj
, event
);
235 void InformationPanel::contextMenuEvent(QContextMenuEvent
* event
)
237 Panel::contextMenuEvent(event
);
240 if (showMultipleSelectionInfo()) {
246 QAction
* previewAction
= popup
.addAction(i18nc("@action:inmenu", "Preview"));
247 previewAction
->setIcon(KIcon("view-preview"));
248 previewAction
->setCheckable(true);
249 previewAction
->setChecked(InformationPanelSettings::showPreview());
251 const bool metaDataAvailable
= MetaDataWidget::metaDataAvailable();
253 QAction
* ratingAction
= popup
.addAction(i18nc("@action:inmenu", "Rating"));
254 ratingAction
->setIcon(KIcon("rating"));
255 ratingAction
->setCheckable(true);
256 ratingAction
->setChecked(InformationPanelSettings::showRating());
257 ratingAction
->setEnabled(metaDataAvailable
);
259 QAction
* commentAction
= popup
.addAction(i18nc("@action:inmenu", "Comment"));
260 commentAction
->setIcon(KIcon("text-plain"));
261 commentAction
->setCheckable(true);
262 commentAction
->setChecked(InformationPanelSettings::showComment());
263 commentAction
->setEnabled(metaDataAvailable
);
265 QAction
* tagsAction
= popup
.addAction(i18nc("@action:inmenu", "Tags"));
266 tagsAction
->setCheckable(true);
267 tagsAction
->setChecked(InformationPanelSettings::showTags());
268 tagsAction
->setEnabled(metaDataAvailable
);
270 KConfig
config("kmetainformationrc", KConfig::NoGlobals
);
271 KConfigGroup settings
= config
.group("Show");
272 initMetaInfoSettings(settings
);
274 QList
<QAction
*> actions
;
276 // Get all meta information labels that are available for
277 // the currently shown file item and add them to the popup.
278 Nepomuk::Resource
res(fileItem().url());
279 QHash
<QUrl
, Nepomuk::Variant
> properties
= res
.properties();
280 QHash
<QUrl
, Nepomuk::Variant
>::const_iterator it
= properties
.constBegin();
281 while (it
!= properties
.constEnd()) {
282 Nepomuk::Types::Property
prop(it
.key());
283 const QString key
= prop
.label();
285 // Meta information provided by Nepomuk that is already
286 // available from KFileItem should not be configurable.
287 bool skip
= (key
== "fileExtension") ||
289 (key
== "sourceModified") ||
291 (key
== "mime type");
293 // Check whether there is already a meta information
294 // having the same label. In this case don't show it
295 // twice in the menu.
296 foreach (const QAction
* action
, actions
) {
297 if (action
->data().toString() == key
) {
305 const QString label
= key
; // TODO
306 QAction
* action
= new QAction(label
, &popup
);
307 action
->setCheckable(true);
308 action
->setChecked(settings
.readEntry(key
, true));
309 action
->setData(key
);
310 actions
.append(action
);
316 if (actions
.count() > 0) {
317 popup
.addSeparator();
319 // add all items alphabetically sorted to the popup
320 qSort(actions
.begin(), actions
.end(), lessThan
);
321 foreach (QAction
* action
, actions
) {
322 popup
.addAction(action
);
326 // Open the popup and adjust the settings for the
328 QAction
* action
= popup
.exec(QCursor::pos());
333 const bool isChecked
= action
->isChecked();
334 if (action
== previewAction
) {
335 m_preview
->setVisible(isChecked
);
336 m_previewSeparator
->setVisible(isChecked
);
337 InformationPanelSettings::setShowPreview(isChecked
);
338 updatePhononWidget();
339 } else if (action
== ratingAction
) {
340 m_metaDataWidget
->setRatingVisible(isChecked
);
341 InformationPanelSettings::setShowRating(isChecked
);
342 } else if (action
== commentAction
) {
343 m_metaDataWidget
->setCommentVisible(isChecked
);
344 InformationPanelSettings::setShowComment(isChecked
);
345 } else if (action
== tagsAction
) {
346 m_metaDataWidget
->setTagsVisible(isChecked
);
347 InformationPanelSettings::setShowTags(isChecked
);
349 settings
.writeEntry(action
->data().toString(), action
->isChecked());
354 if (m_metaDataWidget
!= 0) {
355 const bool visible
= m_metaDataWidget
->isRatingVisible() ||
356 m_metaDataWidget
->isCommentVisible() ||
357 m_metaDataWidget
->areTagsVisible();
358 m_metaDataSeparator
->setVisible(visible
);
363 void InformationPanel::showItemInfo()
371 if (showMultipleSelectionInfo()) {
372 KIconLoader iconLoader
;
373 QPixmap icon
= iconLoader
.loadIcon("dialog-information",
374 KIconLoader::NoGroup
,
375 KIconLoader::SizeEnormous
);
376 m_preview
->setPixmap(icon
);
377 setNameLabelText(i18ncp("@info", "%1 item selected", "%1 items selected", m_selection
.count()));
380 const KFileItem item
= fileItem();
381 const KUrl itemUrl
= item
.url();
382 if (!applyPlace(itemUrl
)) {
383 // try to get a preview pixmap from the item...
384 m_pendingPreview
= true;
386 // Mark the currently shown preview as outdated. This is done
387 // with a small delay to prevent a flickering when the next preview
388 // can be shown within a short timeframe.
389 m_outdatedPreviewTimer
->start();
391 KIO::PreviewJob
* job
= KIO::filePreview(KFileItemList() << item
,
399 connect(job
, SIGNAL(gotPreview(const KFileItem
&, const QPixmap
&)),
400 this, SLOT(showPreview(const KFileItem
&, const QPixmap
&)));
401 connect(job
, SIGNAL(failed(const KFileItem
&)),
402 this, SLOT(showIcon(const KFileItem
&)));
404 setNameLabelText(itemUrl
.fileName());
411 void InformationPanel::slotInfoTimeout()
413 m_shownUrl
= m_urlCandidate
;
417 void InformationPanel::markOutdatedPreview()
419 KIconEffect iconEffect
;
420 QPixmap disabledPixmap
= iconEffect
.apply(m_preview
->pixmap(),
421 KIconLoader::Desktop
,
422 KIconLoader::DisabledState
);
423 m_preview
->setPixmap(disabledPixmap
);
426 void InformationPanel::showIcon(const KFileItem
& item
)
428 m_outdatedPreviewTimer
->stop();
429 m_pendingPreview
= false;
430 if (!applyPlace(item
.url())) {
431 m_preview
->setPixmap(item
.pixmap(KIconLoader::SizeEnormous
));
435 void InformationPanel::showPreview(const KFileItem
& item
,
436 const QPixmap
& pixmap
)
438 m_outdatedPreviewTimer
->stop();
441 if (m_pendingPreview
) {
442 m_preview
->setPixmap(pixmap
);
443 m_pendingPreview
= false;
447 void InformationPanel::slotFileRenamed(const QString
& source
, const QString
& dest
)
449 if (m_shownUrl
== KUrl(source
)) {
450 m_shownUrl
= KUrl(dest
);
451 m_fileItem
= KFileItem(KFileItem::Unknown
, KFileItem::Unknown
, m_shownUrl
);
456 void InformationPanel::slotFilesAdded(const QString
& directory
)
458 if (m_shownUrl
== KUrl(directory
)) {
459 // If the 'trash' icon changes because the trash has been emptied or got filled,
460 // the signal filesAdded("trash:/") will be emitted.
461 KFileItem
item(KFileItem::Unknown
, KFileItem::Unknown
, KUrl(directory
));
462 requestDelayedItemInfo(item
);
466 void InformationPanel::slotFilesChanged(const QStringList
& files
)
468 foreach (const QString
& fileName
, files
) {
469 if (m_shownUrl
== KUrl(fileName
)) {
476 void InformationPanel::slotFilesRemoved(const QStringList
& files
)
478 foreach (const QString
& fileName
, files
) {
479 if (m_shownUrl
== KUrl(fileName
)) {
480 // the currently shown item has been removed, show
481 // the parent directory as fallback
488 void InformationPanel::slotEnteredDirectory(const QString
& directory
)
490 if (m_shownUrl
== KUrl(directory
)) {
491 KFileItem
item(KFileItem::Unknown
, KFileItem::Unknown
, KUrl(directory
));
492 requestDelayedItemInfo(item
);
496 void InformationPanel::slotLeftDirectory(const QString
& directory
)
498 if (m_shownUrl
== KUrl(directory
)) {
499 // The signal 'leftDirectory' is also emitted when a media
500 // has been unmounted. In this case no directory change will be
501 // done in Dolphin, but the Information Panel must be updated to
502 // indicate an invalid directory.
507 void InformationPanel::slotPlayingStarted()
509 m_preview
->setVisible(m_phononWidget
->mode() != PhononWidget::Video
);
512 void InformationPanel::slotPlayingStopped()
514 m_preview
->setVisible(true);
517 bool InformationPanel::applyPlace(const KUrl
& url
)
519 KFilePlacesModel
* placesModel
= DolphinSettings::instance().placesModel();
520 int count
= placesModel
->rowCount();
522 for (int i
= 0; i
< count
; ++i
) {
523 QModelIndex index
= placesModel
->index(i
, 0);
525 if (url
.equals(placesModel
->url(index
), KUrl::CompareWithoutTrailingSlash
)) {
526 setNameLabelText(placesModel
->text(index
));
527 m_preview
->setPixmap(placesModel
->icon(index
).pixmap(128, 128));
535 void InformationPanel::cancelRequest()
540 void InformationPanel::showMetaInfo()
542 m_metaTextLabel
->clear();
544 if (showMultipleSelectionInfo()) {
545 if (m_metaDataWidget
!= 0) {
547 foreach (const KFileItem
& item
, m_selection
) {
548 urls
.append(item
.targetUrl());
550 m_metaDataWidget
->setFiles(urls
);
553 quint64 totalSize
= 0;
554 foreach (const KFileItem
& item
, m_selection
) {
555 // Only count the size of files, not dirs to match what
556 // DolphinViewContainer::selectionStatusBarText() does.
557 if (!item
.isDir() && !item
.isLink()) {
558 totalSize
+= item
.size();
561 m_metaTextLabel
->add(i18nc("@label", "Total size:"), KIO::convertSize(totalSize
));
563 const KFileItem item
= fileItem();
565 m_metaTextLabel
->add(i18nc("@label", "Type:"), i18nc("@label", "Folder"));
566 m_metaTextLabel
->add(i18nc("@label", "Modified:"), item
.timeString());
568 m_metaTextLabel
->add(i18nc("@label", "Type:"), item
.mimeComment());
570 m_metaTextLabel
->add(i18nc("@label", "Size:"), KIO::convertSize(item
.size()));
571 m_metaTextLabel
->add(i18nc("@label", "Modified:"), item
.timeString());
574 KConfig
config("kmetainformationrc", KConfig::NoGlobals
);
575 KConfigGroup settings
= config
.group("Show");
576 initMetaInfoSettings(settings
);
578 Nepomuk::Resource
res(item
.url());
580 QHash
<QUrl
, Nepomuk::Variant
> properties
= res
.properties();
581 QHash
<QUrl
, Nepomuk::Variant
>::const_iterator it
= properties
.constBegin();
582 while (it
!= properties
.constEnd()) {
583 Nepomuk::Types::Property
prop(it
.key());
584 const QString label
= prop
.label();
585 if (settings
.readEntry(label
, true)) {
586 // TODO: use Nepomuk::formatValue(res, prop) if available
587 // instead of it.value().toString()
588 m_metaTextLabel
->add(label
, it
.value().toString());
595 if (m_metaDataWidget
!= 0) {
596 m_metaDataWidget
->setFile(item
.targetUrl());
600 updatePhononWidget();
603 KFileItem
InformationPanel::fileItem() const
605 if (!m_fileItem
.isNull()) {
609 if (!m_selection
.isEmpty()) {
610 Q_ASSERT(m_selection
.count() == 1);
611 return m_selection
.first();
614 // no item is hovered and no selection has been done: provide
615 // an item for the directory represented by m_shownUrl
616 KFileItem
item(KFileItem::Unknown
, KFileItem::Unknown
, m_shownUrl
);
621 bool InformationPanel::showMultipleSelectionInfo() const
623 return m_fileItem
.isNull() && (m_selection
.count() > 1);
626 bool InformationPanel::isEqualToShownUrl(const KUrl
& url
) const
628 return m_shownUrl
.equals(url
, KUrl::CompareWithoutTrailingSlash
);
631 void InformationPanel::setNameLabelText(const QString
& text
)
633 QTextOption textOption
;
634 textOption
.setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere
);
636 QTextLayout
textLayout(text
);
637 textLayout
.setFont(m_nameLabel
->font());
638 textLayout
.setTextOption(textOption
);
641 wrappedText
.reserve(text
.length());
643 // wrap the text to fit into the width of m_nameLabel
644 textLayout
.beginLayout();
645 QTextLine line
= textLayout
.createLine();
646 while (line
.isValid()) {
647 line
.setLineWidth(m_nameLabel
->width());
648 wrappedText
+= text
.mid(line
.textStart(), line
.textLength());
650 line
= textLayout
.createLine();
651 if (line
.isValid()) {
652 wrappedText
+= QChar::LineSeparator
;
655 textLayout
.endLayout();
657 m_nameLabel
->setText(wrappedText
);
660 void InformationPanel::reset()
664 m_fileItem
= KFileItem();
668 void InformationPanel::initMetaInfoSettings(KConfigGroup
& group
)
670 if (!group
.readEntry("initialized", false)) {
671 // The resource file is read the first time. Assure
672 // that some meta information is disabled per default.
673 group
.writeEntry("fileExtension", false);
674 group
.writeEntry("url", false);
675 group
.writeEntry("sourceModified", false);
676 group
.writeEntry("parentUrl", false);
677 group
.writeEntry("size", false);
678 group
.writeEntry("mime type", false);
679 group
.writeEntry("depth", false);
680 group
.writeEntry("name", false);
682 // mark the group as initialized
683 group
.writeEntry("initialized", true);
687 void InformationPanel::updatePhononWidget()
689 const bool multipleSelections
= showMultipleSelectionInfo();
690 const bool showPreview
= InformationPanelSettings::showPreview();
692 if (multipleSelections
|| !showPreview
) {
693 m_phononWidget
->hide();
694 } else if (!multipleSelections
&& showPreview
) {
695 const KFileItem item
= fileItem();
696 const QString mimeType
= item
.mimetype();
697 const bool usePhonon
= Phonon::BackendCapabilities::isMimeTypeAvailable(mimeType
) &&
698 (mimeType
!= "image/png"); // TODO: workaround, as Phonon
699 // thinks it supports PNG images
701 m_phononWidget
->show();
702 PhononWidget::Mode mode
= mimeType
.startsWith(QLatin1String("video"))
703 ? PhononWidget::Video
704 : PhononWidget::Audio
;
705 m_phononWidget
->setMode(mode
);
706 m_phononWidget
->setUrl(item
.url());
707 if ((mode
== PhononWidget::Video
) && m_preview
->isVisible()) {
708 m_phononWidget
->setVideoSize(m_preview
->size());
711 m_phononWidget
->hide();
712 m_preview
->setVisible(true);
717 void InformationPanel::init()
719 m_infoTimer
= new QTimer(this);
720 m_infoTimer
->setInterval(300);
721 m_infoTimer
->setSingleShot(true);
722 connect(m_infoTimer
, SIGNAL(timeout()),
723 this, SLOT(slotInfoTimeout()));
725 // Initialize timer for disabling an outdated preview with a small
726 // delay. This prevents flickering if the new preview can be generated
727 // within a very small timeframe.
728 m_outdatedPreviewTimer
= new QTimer(this);
729 m_outdatedPreviewTimer
->setInterval(300);
730 m_outdatedPreviewTimer
->setSingleShot(true);
731 connect(m_outdatedPreviewTimer
, SIGNAL(timeout()),
732 this, SLOT(markOutdatedPreview()));
734 QVBoxLayout
* layout
= new QVBoxLayout
;
735 layout
->setSpacing(KDialog::spacingHint());
738 m_nameLabel
= new QLabel(this);
739 QFont font
= m_nameLabel
->font();
741 m_nameLabel
->setFont(font
);
742 m_nameLabel
->setAlignment(Qt::AlignHCenter
);
743 m_nameLabel
->setSizePolicy(QSizePolicy::Preferred
, QSizePolicy::Fixed
);
744 m_nameLabel
->setMaximumWidth(KIconLoader::SizeEnormous
);
747 const int minPreviewWidth
= KIconLoader::SizeEnormous
+ KIconLoader::SizeMedium
;
749 m_preview
= new PixmapViewer(this);
750 m_preview
->setMinimumWidth(minPreviewWidth
);
751 m_preview
->setMinimumHeight(KIconLoader::SizeEnormous
);
753 m_phononWidget
= new PhononWidget(this);
754 m_phononWidget
->setMinimumWidth(minPreviewWidth
);
755 connect(m_phononWidget
, SIGNAL(playingStarted()),
756 this, SLOT(slotPlayingStarted()));
757 connect(m_phononWidget
, SIGNAL(playingStopped()),
758 this, SLOT(slotPlayingStopped()));
760 m_previewSeparator
= new KSeparator(this);
762 const bool showPreview
= InformationPanelSettings::showPreview();
763 m_preview
->setVisible(showPreview
);
764 m_previewSeparator
->setVisible(showPreview
);
766 if (MetaDataWidget::metaDataAvailable()) {
767 // rating, comment and tags
768 m_metaDataWidget
= new MetaDataWidget(this);
769 m_metaDataWidget
->setSizePolicy(QSizePolicy::Preferred
, QSizePolicy::Fixed
);
770 m_metaDataWidget
->setMaximumWidth(KIconLoader::SizeEnormous
);
772 const bool showRating
= InformationPanelSettings::showRating();
773 const bool showComment
= InformationPanelSettings::showComment();
774 const bool showTags
= InformationPanelSettings::showTags();
776 m_metaDataWidget
->setRatingVisible(showRating
);
777 m_metaDataWidget
->setCommentVisible(showComment
);
778 m_metaDataWidget
->setTagsVisible(showTags
);
780 m_metaDataSeparator
= new KSeparator(this);
781 m_metaDataSeparator
->setVisible(showRating
|| showComment
|| showTags
);
784 // general meta text information
785 m_metaTextLabel
= new MetaTextLabel(this);
786 m_metaTextLabel
->setSizePolicy(QSizePolicy::Preferred
, QSizePolicy::Fixed
);
788 m_metaTextArea
= new QScrollArea(this);
789 m_metaTextArea
->setWidget(m_metaTextLabel
);
790 m_metaTextArea
->setWidgetResizable(true);
791 m_metaTextArea
->setFrameShape(QFrame::NoFrame
);
793 QWidget
* viewport
= m_metaTextArea
->viewport();
794 viewport
->installEventFilter(this);
796 QPalette palette
= viewport
->palette();
797 palette
.setColor(viewport
->backgroundRole(), QColor(Qt::transparent
));
798 viewport
->setPalette(palette
);
800 layout
->addWidget(m_nameLabel
);
801 layout
->addWidget(new KSeparator(this));
802 layout
->addWidget(m_preview
);
803 layout
->addWidget(m_phononWidget
);
804 layout
->addWidget(m_previewSeparator
);
805 if (m_metaDataWidget
!= 0) {
806 layout
->addWidget(m_metaDataWidget
);
807 layout
->addWidget(m_metaDataSeparator
);
809 layout
->addWidget(m_metaTextArea
);
812 org::kde::KDirNotify
* dirNotify
= new org::kde::KDirNotify(QString(), QString(),
813 QDBusConnection::sessionBus(), this);
814 connect(dirNotify
, SIGNAL(FileRenamed(QString
, QString
)), SLOT(slotFileRenamed(QString
, QString
)));
815 connect(dirNotify
, SIGNAL(FilesAdded(QString
)), SLOT(slotFilesAdded(QString
)));
816 connect(dirNotify
, SIGNAL(FilesChanged(QStringList
)), SLOT(slotFilesChanged(QStringList
)));
817 connect(dirNotify
, SIGNAL(FilesRemoved(QStringList
)), SLOT(slotFilesRemoved(QStringList
)));
818 connect(dirNotify
, SIGNAL(enteredDirectory(QString
)), SLOT(slotEnteredDirectory(QString
)));
819 connect(dirNotify
, SIGNAL(leftDirectory(QString
)), SLOT(slotLeftDirectory(QString
)));
821 m_initialized
= true;
824 #include "informationpanel.moc"