~ubuntu-branches/ubuntu/wily/kdebase/wily

« back to all changes in this revision

Viewing changes to apps/dolphin/src/settings/viewsettingspage.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2010-11-25 16:00:47 UTC
  • mfrom: (1.1.53 upstream)
  • Revision ID: james.westby@ubuntu.com-20101125160047-bsycodsp50o8su5s
Tags: 4:4.5.80-0ubuntu1
* New upstream beta release
* Drop kubuntu_06_simple_aboutpage.diff, didn't apply and no point
  keeping a distro patch to an app we don't ship by default
* Drop kubuntu_23_konqueror_spinner_in_toolbar.diff now upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
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 "iconsviewsettingspage.h"
25
 
#include "detailsviewsettingspage.h"
26
 
 
27
 
#include <QVBoxLayout>
28
 
 
29
 
#include <kdialog.h>
30
 
#include <klocale.h>
31
 
#include <kiconloader.h>
32
 
#include <ktabwidget.h>
33
 
 
34
 
ViewSettingsPage::ViewSettingsPage(QWidget* parent) :
35
 
    SettingsPageBase(parent),
36
 
    m_pages()
37
 
{
38
 
    QVBoxLayout* topLayout = new QVBoxLayout(this);
39
 
    topLayout->setMargin(0);
40
 
    topLayout->setSpacing(KDialog::spacingHint());
41
 
 
42
 
    KTabWidget* tabWidget = new KTabWidget(this);
43
 
 
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()));
48
 
 
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()));
53
 
 
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()));
58
 
 
59
 
    m_pages.append(iconsPage);
60
 
    m_pages.append(detailsPage);
61
 
    m_pages.append(columnPage);
62
 
 
63
 
    topLayout->addWidget(tabWidget, 0, 0);
64
 
}
65
 
 
66
 
ViewSettingsPage::~ViewSettingsPage()
67
 
{
68
 
}
69
 
 
70
 
void ViewSettingsPage::applySettings()
71
 
{
72
 
    foreach (ViewSettingsPageBase* page, m_pages) {
73
 
        page->applySettings();
74
 
    }
75
 
}
76
 
 
77
 
void ViewSettingsPage::restoreDefaults()
78
 
{
79
 
    foreach (ViewSettingsPageBase* page, m_pages) {
80
 
        page->restoreDefaults();
81
 
    }
82
 
}
83
 
 
84
 
#include "viewsettingspage.moc"