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/filemetadataconfigurationdialog.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/filemetadataconfigurationdialog.cpp')
| -rw-r--r-- | src/panels/information/filemetadataconfigurationdialog.cpp | 102 |
1 files changed, 0 insertions, 102 deletions
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 <[email protected]> * - * * - * 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 <Baloo/FileMetaDataConfigWidget> -#include <KConfigGroup> -#include <KLocalizedString> -#include <KSharedConfig> -#include <KWindowConfig> - -#include <QDialogButtonBox> -#include <QLabel> -#include <QPushButton> -#include <QVBoxLayout> - -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(); -} - |
