diff options
| author | Peter Penz <[email protected]> | 2009-10-16 13:01:11 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2009-10-16 13:01:11 +0000 |
| commit | 3852f31c30faea6c305d65e6756797184b3776d5 (patch) | |
| tree | 414e47b38fa9706e6ff9f21a355f9e3ed85b3f20 /src/panels/information/informationpanelcontent.cpp | |
| parent | ef54cdc957165d41cfbfa679835c32667a8cbed5 (diff) | |
* improved interface + documentation of MetaDataWidget
* provide a configuration dialog for adjusting the visibility of the meta data
svn path=/trunk/KDE/kdebase/apps/; revision=1036058
Diffstat (limited to 'src/panels/information/informationpanelcontent.cpp')
| -rw-r--r-- | src/panels/information/informationpanelcontent.cpp | 96 |
1 files changed, 4 insertions, 92 deletions
diff --git a/src/panels/information/informationpanelcontent.cpp b/src/panels/information/informationpanelcontent.cpp index 2b26c55a8..dfa88be17 100644 --- a/src/panels/information/informationpanelcontent.cpp +++ b/src/panels/information/informationpanelcontent.cpp @@ -290,79 +290,8 @@ void InformationPanelContent::configureSettings() previewAction->setCheckable(true); previewAction->setChecked(InformationPanelSettings::showPreview()); - const bool metaDataAvailable = true; // MetaDataWidget::metaDataAvailable(); TODO - - QAction* ratingAction = popup.addAction(i18nc("@action:inmenu", "Rating")); - ratingAction->setIcon(KIcon("rating")); - ratingAction->setCheckable(true); - ratingAction->setChecked(InformationPanelSettings::showRating()); - ratingAction->setEnabled(metaDataAvailable); - - QAction* commentAction = popup.addAction(i18nc("@action:inmenu", "Comment")); - commentAction->setIcon(KIcon("text-plain")); - commentAction->setCheckable(true); - commentAction->setChecked(InformationPanelSettings::showComment()); - commentAction->setEnabled(metaDataAvailable); - - QAction* tagsAction = popup.addAction(i18nc("@action:inmenu", "Tags")); - tagsAction->setCheckable(true); - tagsAction->setChecked(InformationPanelSettings::showTags()); - tagsAction->setEnabled(metaDataAvailable); - - KConfig config("kmetainformationrc", KConfig::NoGlobals); - KConfigGroup settings = config.group("Show"); - - QList<QAction*> actions; - - // Get all meta information labels that are available for - // the currently shown file item and add them to the popup. - /*Nepomuk::Resource res(m_item.url()); - QHash<QUrl, Nepomuk::Variant> properties = res.properties(); - QHash<QUrl, Nepomuk::Variant>::const_iterator it = properties.constBegin(); - while (it != properties.constEnd()) { - Nepomuk::Types::Property prop(it.key()); - const QString key = prop.name(); - - // Meta information provided by Nepomuk that is already - // available from KFileItem should not be configurable. - bool skip = (key == "fileExtension") || - (key == "name") || - (key == "sourceModified") || - (key == "size") || - (key == "mime type"); - if (!skip) { - // Check whether there is already a meta information - // having the same label. In this case don't show it - // twice in the menu. - foreach (const QAction* action, actions) { - if (action->data().toString() == key) { - skip = true; - break; - } - } - } - - if (!skip) { - const QString label = tunedLabel(prop.label()); - QAction* action = new QAction(label, &popup); - action->setCheckable(true); - action->setChecked(settings.readEntry(key, true)); - action->setData(key); - actions.append(action); - } - - ++it; - }*/ - - if (!actions.isEmpty()) { - popup.addSeparator(); - - // add all items alphabetically sorted to the popup - qSort(actions.begin(), actions.end(), lessThan); - foreach (QAction* action, actions) { - popup.addAction(action); - } - } + QAction* configureAction = popup.addAction(i18nc("@action:inmenu", "Configure...")); + configureAction->setIcon(KIcon("configure")); // Open the popup and adjust the settings for the // selected action. @@ -376,27 +305,10 @@ void InformationPanelContent::configureSettings() m_preview->setVisible(isChecked); m_previewSeparator->setVisible(isChecked); InformationPanelSettings::setShowPreview(isChecked); - } else if (action == ratingAction) { - //m_metaDataWidget->setRatingVisible(isChecked); - InformationPanelSettings::setShowRating(isChecked); - } else if (action == commentAction) { - //m_metaDataWidget->setCommentVisible(isChecked); - InformationPanelSettings::setShowComment(isChecked); - } else if (action == tagsAction) { - //m_metaDataWidget->setTagsVisible(isChecked); - InformationPanelSettings::setShowTags(isChecked); - } else { - settings.writeEntry(action->data().toString(), action->isChecked()); - settings.sync(); + } else if (action == configureAction) { + m_metaDataWidget->openConfigurationDialog(); } - /*if (m_metaDataWidget != 0) { - const bool visible = m_metaDataWidget->isRatingVisible() || - m_metaDataWidget->isCommentVisible() || - m_metaDataWidget->areTagsVisible(); - m_metaDataSeparator->setVisible(visible); - }*/ - showItem(m_item); } |
