]> cloud.milkyroute.net Git - dolphin.git/blob - src/viewsettingspage.cpp
use "fileview-icon" instead of "view-icon" (thanks to David Vignoni for the update!)
[dolphin.git] / src / viewsettingspage.cpp
1 /***************************************************************************
2 * Copyright (C) 2006 by Peter Penz *
3 * peter.penz@gmx.at *
4 * *
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. *
9 * *
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. *
14 * *
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 ***************************************************************************/
20
21 #include "viewsettingspage.h"
22
23 #include "columnviewsettingspage.h"
24 #include "detailsviewsettingspage.h"
25 #include "generalviewsettingspage.h"
26 #include "iconsviewsettingspage.h"
27
28 #include <QtGui/QBoxLayout>
29 #include <QtGui/QTabWidget>
30 #include <QtGui/QLayout>
31 #include <QtGui/QLabel>
32
33 #include <kdialog.h>
34 #include <klocale.h>
35 #include <kiconloader.h>
36
37 ViewSettingsPage::ViewSettingsPage(DolphinMainWindow* mainWindow,
38 QWidget* parent) :
39 SettingsPageBase(parent),
40 m_generalPage(0),
41 m_iconsPage(0),
42 m_detailsPage(0),
43 m_columnPage(0)
44 {
45 QVBoxLayout* topLayout = new QVBoxLayout(this);
46 topLayout->setMargin(0);
47 topLayout->setSpacing(KDialog::spacingHint());
48
49 QTabWidget* tabWidget = new QTabWidget(this);
50
51 // initialize 'General' tab
52 m_generalPage = new GeneralViewSettingsPage(mainWindow, tabWidget);
53 tabWidget->addTab(m_generalPage, KIcon("view-choose"), i18n("General"));
54
55 // initialize 'Icons' tab
56 m_iconsPage = new IconsViewSettingsPage(mainWindow, tabWidget);
57 tabWidget->addTab(m_iconsPage, KIcon("fileview-icon"), i18n("Icons"));
58
59 // initialize 'Details' tab
60 m_detailsPage = new DetailsViewSettingsPage(mainWindow, tabWidget);
61 tabWidget->addTab(m_detailsPage, KIcon("fileview-text"), i18n("Details"));
62
63 // initialize 'Column' tab
64 m_columnPage = new ColumnViewSettingsPage(mainWindow, tabWidget);
65 tabWidget->addTab(m_columnPage, KIcon("fileview-column"), i18n("Column"));
66
67 topLayout->addWidget(tabWidget, 0, 0);
68 }
69
70 ViewSettingsPage::~ViewSettingsPage()
71 {
72 }
73
74 void ViewSettingsPage::applySettings()
75 {
76 m_generalPage->applySettings();
77 m_iconsPage->applySettings();
78 m_detailsPage->applySettings();
79 m_columnPage->applySettings();
80 }
81
82 void ViewSettingsPage::restoreDefaults()
83 {
84 m_generalPage->restoreDefaults();
85 m_iconsPage->restoreDefaults();
86 m_detailsPage->restoreDefaults();
87 m_columnPage->restoreDefaults();
88 }
89
90 #include "viewsettingspage.moc"