]> cloud.milkyroute.net Git - dolphin.git/blob - src/panels/information/informationpaneldialog.cpp
added dialog to configure which meta data should be shown in the Information Panel
[dolphin.git] / src / panels / information / informationpaneldialog.cpp
1 /***************************************************************************
2 * Copyright (C) 2009 by Peter Penz <peter.penz@gmx.at> *
3 * *
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. *
8 * *
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. *
13 * *
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 ***************************************************************************/
19
20 #include "informationpaneldialog.h"
21
22 #include <klocale.h>
23 #include <kiconloader.h>
24
25 #include <QVBoxLayout>
26
27 InformationPanelDialog::InformationPanelDialog(QWidget* parent) :
28 KDialog(parent),
29 m_isDirty(false)
30 {
31 setCaption(i18nc("@title:window", "Information Panel"));
32 setButtons(KDialog::Ok | KDialog::Cancel | KDialog::Apply);
33
34 QWidget* main = new QWidget();
35 // ...
36 Q_UNUSED(main);
37 QVBoxLayout* topLayout = new QVBoxLayout();
38 // ...
39 Q_UNUSED(topLayout);
40
41 connect(this, SIGNAL(okClicked()), this, SLOT(slotOk()));
42 connect(this, SIGNAL(applyClicked()), this, SLOT(slotApply()));
43
44 main->setLayout(topLayout);
45 setMainWidget(main);
46
47 const KConfigGroup dialogConfig(KSharedConfig::openConfig("dolphinrc"),
48 "InformationPanelDialog");
49 restoreDialogSize(dialogConfig);
50
51 loadSettings();
52 }
53
54 InformationPanelDialog::~InformationPanelDialog()
55 {
56 KConfigGroup dialogConfig(KSharedConfig::openConfig("dolphinrc"),
57 "InformationPanelDialog");
58 saveDialogSize(dialogConfig, KConfigBase::Persistent);
59 }
60
61 void InformationPanelDialog::slotOk()
62 {
63 // ...
64 accept();
65 }
66
67 void InformationPanelDialog::slotApply()
68 {
69 // ...
70 markAsDirty(false);
71 }
72
73 void InformationPanelDialog::markAsDirty(bool isDirty)
74 {
75 m_isDirty = isDirty;
76 enableButtonApply(isDirty);
77 }
78
79 void InformationPanelDialog::loadSettings()
80 {
81 }
82
83 #include "informationpaneldialog.moc"