diff options
| author | Stefan Brüns <[email protected]> | 2019-04-14 02:44:01 +0200 |
|---|---|---|
| committer | Stefan Brüns <[email protected]> | 2019-04-23 12:36:14 +0200 |
| commit | ecf1ae6d0b1691bfe36fc0ff64500f111f3abc32 (patch) | |
| tree | 34b793728e69071b1a27f6bc83b420a5661d302e /src/panels/information/informationpanel.cpp | |
| parent | 8dc5c7a199ae69a37fb423860897b312bc4a11ba (diff) | |
[InformationPanel] Use the new inline configuration mode
Summary:
The current external configuration dialog has some issues:
- its layout is suboptimal, as its initial size is typically to small
- it is quite disassociated with the actual widget it configures, properties
have a different order, and the property names can be quite abstract
without the corresponding value.
Doing the visibility selection inline typically avoids the sizing problem,
as the containing application (dolphin) is often vertically maximized.
The selection becomes more obvious, as the item order is kept,
and the values are shown.
Depends on D20524
CCBUG: 389571
Reviewers: #dolphin, #baloo, #frameworks, ngraham, astippich, #vdg, elvisangelaccio
Reviewed By: #dolphin, elvisangelaccio
Subscribers: elvisangelaccio, meven, kfm-devel
Tags: #dolphin
Differential Revision: https://phabricator.kde.org/D20525
Diffstat (limited to 'src/panels/information/informationpanel.cpp')
| -rw-r--r-- | src/panels/information/informationpanel.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/panels/information/informationpanel.cpp b/src/panels/information/informationpanel.cpp index 051134c64..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), @@ -179,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"))); @@ -203,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); @@ -412,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); |
