1 /***************************************************************************
2 * Copyright (C) 2009 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 "kcmdolphingeneral.h"
22 #include "settings/behaviorsettingspage.h"
23 #include "settings/previewssettingspage.h"
25 #include <ktabwidget.h>
28 #include <kpluginfactory.h>
29 #include <kpluginloader.h>
32 #include <QVBoxLayout>
34 K_PLUGIN_FACTORY(KCMDolphinGeneralConfigFactory
, registerPlugin
<DolphinGeneralConfigModule
>("dolphingeneral");)
35 K_EXPORT_PLUGIN(KCMDolphinGeneralConfigFactory("kcmdolphingeneral"))
37 DolphinGeneralConfigModule::DolphinGeneralConfigModule(QWidget
* parent
, const QVariantList
& args
) :
38 KCModule(KCMDolphinGeneralConfigFactory::componentData(), parent
),
43 KGlobal::locale()->insertCatalog("dolphingeneral");
45 setButtons(KCModule::Default
| KCModule::Help
);
47 QVBoxLayout
* topLayout
= new QVBoxLayout(this);
48 topLayout
->setMargin(0);
49 topLayout
->setSpacing(KDialog::spacingHint());
51 KTabWidget
* tabWidget
= new KTabWidget(this);
53 // initialize 'Behavior' tab
54 BehaviorSettingsPage
* behaviorPage
= new BehaviorSettingsPage(QDir::homePath(), tabWidget
);
55 tabWidget
->addTab(behaviorPage
, i18nc("@title:tab Behavior settings", "Behavior"));
56 connect(behaviorPage
, SIGNAL(changed()), this, SLOT(changed()));
58 // initialize 'Previews' tab
59 PreviewsSettingsPage
* previewsPage
= new PreviewsSettingsPage(tabWidget
);
60 tabWidget
->addTab(previewsPage
, i18nc("@title:tab Previews settings", "Previews"));
61 connect(previewsPage
, SIGNAL(changed()), this, SLOT(changed()));
63 m_pages
.append(behaviorPage
);
64 m_pages
.append(previewsPage
);
66 topLayout
->addWidget(tabWidget
, 0, 0);
69 DolphinGeneralConfigModule::~DolphinGeneralConfigModule()
73 void DolphinGeneralConfigModule::save()
75 foreach (SettingsPageBase
* page
, m_pages
) {
76 page
->applySettings();
80 void DolphinGeneralConfigModule::defaults()
82 foreach (SettingsPageBase
* page
, m_pages
) {
83 page
->applySettings();
87 #include "kcmdolphingeneral.moc"