add more spacing
[personal-kdebase.git] / apps / dolphin / src / settings / statusbarsettingspage.cpp
blobc733c0b3ade8a99dd740e78141b78100d4dd7d27
1 /***************************************************************************
2 * Copyright (C) 2009 by Peter Penz <peter.penz@gmx.at> *
3 * *
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. *
8 * *
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. *
13 * *
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 "statusbarsettingspage.h"
21 #include "dolphinsettings.h"
22 #include "dolphin_generalsettings.h"
24 #include <kdialog.h>
25 #include <klocale.h>
26 #include <kvbox.h>
28 #include <QCheckBox>
29 #include <QVBoxLayout>
31 StatusBarSettingsPage::StatusBarSettingsPage(QWidget* parent) :
32 SettingsPageBase(parent),
33 m_showZoomSlider(0),
34 m_showSpaceInfo(0)
36 QVBoxLayout* topLayout = new QVBoxLayout(this);
37 KVBox* vBox = new KVBox(this);
38 vBox->setSpacing(KDialog::spacingHint());
40 m_showZoomSlider = new QCheckBox(i18nc("@option:check", "Show zoom slider"), vBox);
41 connect(m_showZoomSlider, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
43 m_showSpaceInfo = new QCheckBox(i18nc("@option:check", "Show space information"), vBox);
44 connect(m_showSpaceInfo, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
46 // Add a dummy widget with no restriction regarding
47 // a vertical resizing. This assures that the dialog layout
48 // is not stretched vertically.
49 new QWidget(vBox);
51 topLayout->addWidget(vBox);
53 loadSettings();
56 StatusBarSettingsPage::~StatusBarSettingsPage()
60 void StatusBarSettingsPage::applySettings()
62 GeneralSettings* settings = DolphinSettings::instance().generalSettings();
63 settings->setShowZoomSlider(m_showZoomSlider->isChecked());
64 settings->setShowSpaceInfo(m_showSpaceInfo->isChecked());
67 void StatusBarSettingsPage::restoreDefaults()
69 GeneralSettings* settings = DolphinSettings::instance().generalSettings();
70 settings->setDefaults();
71 loadSettings();
74 void StatusBarSettingsPage::loadSettings()
76 GeneralSettings* settings = DolphinSettings::instance().generalSettings();
77 m_showZoomSlider->setChecked(settings->showZoomSlider());
78 m_showSpaceInfo->setChecked(settings->showSpaceInfo());
81 #include "statusbarsettingspage.moc"