┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/panels/information/informationpanel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/panels/information/informationpanel.cpp')
-rw-r--r--src/panels/information/informationpanel.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/panels/information/informationpanel.cpp b/src/panels/information/informationpanel.cpp
index cd8b6b38d..9a0358df0 100644
--- a/src/panels/information/informationpanel.cpp
+++ b/src/panels/information/informationpanel.cpp
@@ -36,7 +36,6 @@
#include <QMenu>
#include "dolphin_informationpanelsettings.h"
-#include "filemetadataconfigurationdialog.h"
InformationPanel::InformationPanel(QWidget* parent) :
Panel(parent),
@@ -168,7 +167,8 @@ void InformationPanel::contextMenuEvent(QContextMenuEvent* event)
Panel::contextMenuEvent(event);
}
-void InformationPanel::showContextMenu(const QPoint &pos) {
+void InformationPanel::showContextMenu(const QPoint &pos)
+{
QMenu popup(this);
QAction* previewAction = popup.addAction(i18nc("@action:inmenu", "Preview"));
@@ -178,6 +178,9 @@ void InformationPanel::showContextMenu(const QPoint &pos) {
QAction* configureAction = popup.addAction(i18nc("@action:inmenu", "Configure..."));
configureAction->setIcon(QIcon::fromTheme(QStringLiteral("configure")));
+ if (m_inConfigurationMode) {
+ configureAction->setEnabled(false);
+ }
QAction* dateformatAction = popup.addAction(i18nc("@action:inmenu", "Condensed Date"));
dateformatAction->setIcon(QIcon::fromTheme(QStringLiteral("change-date-symbolic")));
@@ -185,7 +188,8 @@ void InformationPanel::showContextMenu(const QPoint &pos) {
dateformatAction->setChecked(InformationPanelSettings::dateFormat() == static_cast<int>(Baloo::DateFormats::ShortFormat));
popup.addSeparator();
- foreach (QAction* action, customContextMenuActions()) {
+ const auto actions = customContextMenuActions();
+ for (QAction *action : actions) {
popup.addAction(action);
}
@@ -201,13 +205,8 @@ void InformationPanel::showContextMenu(const QPoint &pos) {
InformationPanelSettings::setPreviewsShown(isChecked);
m_content->refreshPreview();
} else if (action == configureAction) {
- FileMetaDataConfigurationDialog* dialog = new FileMetaDataConfigurationDialog(this);
- dialog->setDescription(i18nc("@label::textbox",
- "Select which data should be shown in the information panel:"));
- dialog->setItems(m_content->items());
- dialog->setAttribute(Qt::WA_DeleteOnClose);
- dialog->show();
- connect(dialog, &FileMetaDataConfigurationDialog::destroyed, m_content, &InformationPanelContent::refreshMetaData);
+ m_inConfigurationMode = true;
+ m_content->configureShownProperties();
}
if (action == dateformatAction) {
int dateFormat = static_cast<int>(isChecked ? Baloo::DateFormats::ShortFormat : Baloo::DateFormats::LongFormat);
@@ -311,7 +310,7 @@ void InformationPanel::slotFilesAdded(const QString& directory)
void InformationPanel::slotFilesChanged(const QStringList& files)
{
- foreach (const QString& fileName, files) {
+ for (const QString& fileName : files) {
if (m_shownUrl == QUrl::fromLocalFile(fileName)) {
showItemInfo();
break;
@@ -321,7 +320,7 @@ void InformationPanel::slotFilesChanged(const QStringList& files)
void InformationPanel::slotFilesRemoved(const QStringList& files)
{
- foreach (const QString& fileName, files) {
+ for (const QString& fileName : files) {
if (m_shownUrl == QUrl::fromLocalFile(fileName)) {
// the currently shown item has been removed, show
// the parent directory as fallback
@@ -410,6 +409,7 @@ void InformationPanel::init()
m_content = new InformationPanelContent(this);
connect(m_content, &InformationPanelContent::urlActivated, this, &InformationPanel::urlActivated);
+ connect(m_content, &InformationPanelContent::configurationFinished, this, [this]() { m_inConfigurationMode = false; });
QVBoxLayout* layout = new QVBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0);