--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE kcfg SYSTEM "http://www.kde.org/standards/kcfg/1.0/kcfg.dtd">
+<kcfg>
+ <kcfgfile name="dolphinrc"/>
+ <group name="InformationPanel">
+ <entry name="showRating" type="Bool">
+ <label context="@label">Show rating</label>
+ <default>true</default>
+ </entry>
+ <entry name="showComment" type="Bool">
+ <label context="@label">Show comment</label>
+ <default>true</default>
+ </entry>
+ <entry name="showTags" type="Bool">
+ <label context="@label">Show tags</label>
+ <default>true</default>
+ </entry>
+ </group>
+</kcfg>
#include <QScrollBar>
#include <QVBoxLayout>
+#include "dolphin_informationpanelsettings.h"
#include "settings/dolphinsettings.h"
#include "metadatawidget.h"
#include "metatextlabel.h"
}
KMenu popup(this);
- popup.addTitle(i18nc("@title:menu", "Shown Information"));
+
+ QAction* ratingAction = popup.addAction(i18nc("@action:inmenu", "Rating"));
+ ratingAction->setCheckable(true);
+ ratingAction->setChecked(InformationPanelSettings::showRating());
+
+ QAction* commentAction = popup.addAction(i18nc("@action:inmenu", "Comment"));
+ commentAction->setCheckable(true);
+ commentAction->setChecked(InformationPanelSettings::showComment());
+
+ QAction* tagsAction = popup.addAction(i18nc("@action:inmenu", "Tags"));
+ tagsAction->setCheckable(true);
+ tagsAction->setChecked(InformationPanelSettings::showTags());
KConfig config("kmetainformationrc", KConfig::NoGlobals);
KConfigGroup settings = config.group("Show");
++it;
}
- if (actions.count() == 0) {
- return;
- }
+ if (actions.count() > 0) {
+ popup.addSeparator();
- // add all items alphabetically sorted to the popup
- qSort(actions.begin(), actions.end(), lessThan);
- foreach (QAction* action, actions) {
- popup.addAction(action);
+ // add all items alphabetically sorted to the popup
+ qSort(actions.begin(), actions.end(), lessThan);
+ foreach (QAction* action, actions) {
+ popup.addAction(action);
+ }
}
// Open the popup and adjust the settings for the
// selected action.
QAction* action = popup.exec(QCursor::pos());
- if (action != 0) {
+ if (action == 0) {
+ return;
+ }
+
+ if (action == ratingAction) {
+ // TODO
+ } else if (action == commentAction) {
+ // TODO
+ } else if (action == tagsAction) {
+ // TODO
+ } else {
settings.writeEntry(action->data().toString(), action->isChecked());
settings.sync();
showMetaInfo();