-void InformationPanelContent::configureSettings()
-{
- KMenu popup(this);
-
- QAction* previewAction = popup.addAction(i18nc("@action:inmenu", "Preview"));
- previewAction->setIcon(KIcon("view-preview"));
- previewAction->setCheckable(true);
- previewAction->setChecked(InformationPanelSettings::showPreview());
-
- QAction* configureAction = popup.addAction(i18nc("@action:inmenu", "Configure..."));
- configureAction->setIcon(KIcon("configure"));
-
- // Open the popup and adjust the settings for the
- // selected action.
- QAction* action = popup.exec(QCursor::pos());
- if (action == 0) {
- return;
- }
-
- const bool isChecked = action->isChecked();
- if (action == previewAction) {
- m_preview->setVisible(isChecked);
- InformationPanelSettings::setShowPreview(isChecked);
- } else if (action == configureAction) {
- QPointer<KMetaDataConfigurationDialog> dialog = new KMetaDataConfigurationDialog(m_metaDataWidget, this, Qt::Dialog);
- dialog->setDescription(i18nc("@label::textbox",
- "Configure which data should be shown in the Information Panel."));
- dialog->exec();
- delete dialog;