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 "viewsettingspage.h"
23
#include "columnviewsettingspage.h"
24
#include "iconsviewsettingspage.h"
25
#include "detailsviewsettingspage.h"
27
#include <QVBoxLayout>
31
#include <kiconloader.h>
32
#include <ktabwidget.h>
34
ViewSettingsPage::ViewSettingsPage(QWidget* parent) :
35
SettingsPageBase(parent),
38
QVBoxLayout* topLayout = new QVBoxLayout(this);
39
topLayout->setMargin(0);
40
topLayout->setSpacing(KDialog::spacingHint());
42
KTabWidget* tabWidget = new KTabWidget(this);
44
// initialize 'Icons' tab
45
IconsViewSettingsPage* iconsPage = new IconsViewSettingsPage(tabWidget);
46
tabWidget->addTab(iconsPage, KIcon("view-list-icons"), i18nc("@title:tab", "Icons"));
47
connect(iconsPage, SIGNAL(changed()), this, SIGNAL(changed()));
49
// initialize 'Details' tab
50
DetailsViewSettingsPage* detailsPage = new DetailsViewSettingsPage(tabWidget);
51
tabWidget->addTab(detailsPage, KIcon("view-list-details"), i18nc("@title:tab", "Details"));
52
connect(detailsPage, SIGNAL(changed()), this, SIGNAL(changed()));
54
// initialize 'Column' tab
55
ColumnViewSettingsPage* columnPage = new ColumnViewSettingsPage(tabWidget);
56
tabWidget->addTab(columnPage, KIcon("view-file-columns"), i18nc("@title:tab", "Column"));
57
connect(columnPage, SIGNAL(changed()), this, SIGNAL(changed()));
59
m_pages.append(iconsPage);
60
m_pages.append(detailsPage);
61
m_pages.append(columnPage);
63
topLayout->addWidget(tabWidget, 0, 0);
66
ViewSettingsPage::~ViewSettingsPage()
70
void ViewSettingsPage::applySettings()
72
foreach (ViewSettingsPageBase* page, m_pages) {
73
page->applySettings();
77
void ViewSettingsPage::restoreDefaults()
79
foreach (ViewSettingsPageBase* page, m_pages) {
80
page->restoreDefaults();
84
#include "viewsettingspage.moc"