From ecf1ae6d0b1691bfe36fc0ff64500f111f3abc32 Mon Sep 17 00:00:00 2001 From: Stefan BrĂ¼ns Date: Sun, 14 Apr 2019 02:44:01 +0200 Subject: [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 --- .../filemetadataconfigurationdialog.cpp | 102 --------------------- 1 file changed, 102 deletions(-) delete mode 100644 src/panels/information/filemetadataconfigurationdialog.cpp (limited to 'src/panels/information/filemetadataconfigurationdialog.cpp') diff --git a/src/panels/information/filemetadataconfigurationdialog.cpp b/src/panels/information/filemetadataconfigurationdialog.cpp deleted file mode 100644 index f3ca819b7..000000000 --- a/src/panels/information/filemetadataconfigurationdialog.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2010 by Peter Penz * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - ***************************************************************************/ - -#include "filemetadataconfigurationdialog.h" - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -FileMetaDataConfigurationDialog::FileMetaDataConfigurationDialog(QWidget* parent) : - QDialog(parent), - m_descriptionLabel(nullptr), - m_configWidget(nullptr) - -{ - setWindowTitle(i18nc("@title:window", "Configure Shown Data")); - QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel); - QVBoxLayout *mainLayout = new QVBoxLayout; - setLayout(mainLayout); - QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok); - okButton->setDefault(true); - okButton->setShortcut(Qt::CTRL + Qt::Key_Return); - connect(buttonBox, &QDialogButtonBox::accepted, this, &FileMetaDataConfigurationDialog::slotAccepted); - connect(buttonBox, &QDialogButtonBox::rejected, this, &FileMetaDataConfigurationDialog::reject); - buttonBox->button(QDialogButtonBox::Ok)->setDefault(true); - - m_descriptionLabel = new QLabel(i18nc("@label::textbox", - "Select which data should " - "be shown:"), this); - m_descriptionLabel->setWordWrap(true); - - m_configWidget = new Baloo::FileMetaDataConfigWidget(this); - - QWidget* mainWidget = new QWidget(this); - QVBoxLayout* topLayout = new QVBoxLayout(mainWidget); - topLayout->addWidget(m_descriptionLabel); - topLayout->addWidget(m_configWidget); - mainLayout->addWidget(mainWidget); - mainLayout->addWidget(buttonBox); - - - const KConfigGroup dialogConfig(KSharedConfig::openConfig(QStringLiteral("dolphinrc")), - "FileMetaDataConfigurationDialog"); - KWindowConfig::restoreWindowSize(windowHandle(), dialogConfig); -} - -FileMetaDataConfigurationDialog::~FileMetaDataConfigurationDialog() -{ - KConfigGroup dialogConfig(KSharedConfig::openConfig(QStringLiteral("dolphinrc")), - "FileMetaDataConfigurationDialog"); - KWindowConfig::saveWindowSize(windowHandle(), dialogConfig); -} - -void FileMetaDataConfigurationDialog::setItems(const KFileItemList& items) -{ - m_configWidget->setItems(items); -} - -KFileItemList FileMetaDataConfigurationDialog::items() const -{ - return m_configWidget->items(); -} - -void FileMetaDataConfigurationDialog::slotAccepted() -{ - m_configWidget->save(); - accept(); -} - -void FileMetaDataConfigurationDialog::setDescription(const QString& description) -{ - m_descriptionLabel->setText(description); -} - -QString FileMetaDataConfigurationDialog::description() const -{ - return m_descriptionLabel->text(); -} - -- cgit v1.3