1 /***************************************************************************
2 * Copyright (C) 2007 by Peter Penz (peter.penz@gmx.at) *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18 ***************************************************************************/
20 #include "additionalinfodialog.h"
27 AdditionalInfoDialog::AdditionalInfoDialog(QWidget
* parent
,
28 KFileItemDelegate::InformationList info
) :
38 setCaption(i18nc("@title:window", "Additional Information"));
39 setButtons(Ok
| Cancel
);
42 KVBox
* box
= new KVBox(this);
44 m_size
= new QCheckBox(i18nc("@option:check Additional Information", "Size"), box
);
45 m_date
= new QCheckBox(i18nc("@option:check Additional Information", "Date"), box
);
46 m_permissions
= new QCheckBox(i18nc("@option:check Additional Information", "Permissions"), box
);
47 m_owner
= new QCheckBox(i18nc("@option:check Additional Information", "Owner"), box
);
48 m_group
= new QCheckBox(i18nc("@option:check Additional Information", "Group"), box
);
49 m_type
= new QCheckBox(i18nc("@option:check Additional Information", "Type"), box
);
50 connect(this, SIGNAL(okClicked()), this, SLOT(slotOk()));
52 m_size
->setChecked(info
.contains(KFileItemDelegate::Size
));
53 m_date
->setChecked(info
.contains(KFileItemDelegate::ModificationTime
));
54 m_permissions
->setChecked(info
.contains(KFileItemDelegate::Permissions
));
55 m_owner
->setChecked(info
.contains(KFileItemDelegate::Owner
));
56 m_group
->setChecked(info
.contains(KFileItemDelegate::OwnerAndGroup
));
57 m_type
->setChecked(info
.contains(KFileItemDelegate::FriendlyMimeType
));
61 const KConfigGroup
dialogConfig(KSharedConfig::openConfig("dolphinrc"),
62 "AdditionalInfoDialog");
63 restoreDialogSize(dialogConfig
);
66 AdditionalInfoDialog::~AdditionalInfoDialog()
68 KConfigGroup
dialogConfig(KSharedConfig::openConfig("dolphinrc"),
69 "AdditionalInfoDialog");
70 saveDialogSize(dialogConfig
, KConfigBase::Persistent
);
73 KFileItemDelegate::InformationList
AdditionalInfoDialog::additionalInfo() const
78 void AdditionalInfoDialog::slotOk()
82 if (m_size
->isChecked()) {
83 m_info
.append(KFileItemDelegate::Size
);
85 if (m_date
->isChecked()) {
86 m_info
.append(KFileItemDelegate::ModificationTime
);
88 if (m_permissions
->isChecked()) {
89 m_info
.append(KFileItemDelegate::Permissions
);
91 if (m_owner
->isChecked()) {
92 m_info
.append(KFileItemDelegate::Owner
);
94 if (m_group
->isChecked()) {
95 m_info
.append(KFileItemDelegate::OwnerAndGroup
);
97 if (m_type
->isChecked()) {
98 m_info
.append(KFileItemDelegate::FriendlyMimeType
);
102 #include "additionalinfodialog.moc"