1 /***************************************************************************
2 * Copyright (C) 2006 by Peter Penz *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
19 ***************************************************************************/
21 #include "generalsettingspage.h"
23 #include "behaviorsettingspage.h"
24 #include "contextmenusettingspage.h"
25 #include "previewssettingspage.h"
26 #include "settingspagebase.h"
27 #include "statusbarsettingspage.h"
31 #include <kiconloader.h>
32 #include <ktabwidget.h>
34 #include <QVBoxLayout>
36 GeneralSettingsPage::GeneralSettingsPage(const KUrl
& url
, QWidget
* parent
) :
37 SettingsPageBase(parent
),
40 QVBoxLayout
* topLayout
= new QVBoxLayout(this);
41 topLayout
->setMargin(0);
42 topLayout
->setSpacing(KDialog::spacingHint());
44 KTabWidget
* tabWidget
= new KTabWidget(this);
46 // initialize 'Behavior' tab
47 BehaviorSettingsPage
* behaviorPage
= new BehaviorSettingsPage(url
, tabWidget
);
48 tabWidget
->addTab(behaviorPage
, i18nc("@title:tab Behavior settings", "Behavior"));
49 connect(behaviorPage
, SIGNAL(changed()), this, SIGNAL(changed()));
51 // initialize 'Previews' tab
52 PreviewsSettingsPage
* previewsPage
= new PreviewsSettingsPage(tabWidget
);
53 tabWidget
->addTab(previewsPage
, i18nc("@title:tab Previews settings", "Previews"));
54 connect(previewsPage
, SIGNAL(changed()), this, SIGNAL(changed()));
56 // initialize 'Context Menu' tab
57 ContextMenuSettingsPage
* contextMenuPage
= new ContextMenuSettingsPage(tabWidget
);
58 tabWidget
->addTab(contextMenuPage
, i18nc("@title:tab Context Menu settings", "Context Menu"));
59 connect(contextMenuPage
, SIGNAL(changed()), this, SIGNAL(changed()));
61 // initialize 'Status Bar' tab
62 StatusBarSettingsPage
* statusBarPage
= new StatusBarSettingsPage(tabWidget
);
63 tabWidget
->addTab(statusBarPage
, i18nc("@title:tab Status Bar settings", "Status Bar"));
64 connect(statusBarPage
, SIGNAL(changed()), this, SIGNAL(changed()));
66 m_pages
.append(behaviorPage
);
67 m_pages
.append(previewsPage
);
68 m_pages
.append(contextMenuPage
);
69 m_pages
.append(statusBarPage
);
71 topLayout
->addWidget(tabWidget
, 0, 0);
74 GeneralSettingsPage::~GeneralSettingsPage()
78 void GeneralSettingsPage::applySettings()
80 foreach (SettingsPageBase
* page
, m_pages
) {
81 page
->applySettings();
85 void GeneralSettingsPage::restoreDefaults()
87 foreach (SettingsPageBase
* page
, m_pages
) {
88 page
->restoreDefaults();
92 #include "generalsettingspage.moc"