]>
cloud.milkyroute.net Git - dolphin.git/blob - src/settings/general/statusbarsettingspage.cpp
5c2d34af80b7f3fb5523e0d7b6ba54f5286b2499
1 /***************************************************************************
2 * Copyright (C) 2009 by Peter Penz <peter.penz@gmx.at> *
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. *
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. *
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"
22 #include <dolphin_generalsettings.h>
28 #include <settings/dolphinsettings.h>
31 #include <QVBoxLayout>
33 StatusBarSettingsPage::StatusBarSettingsPage(QWidget
* parent
) :
34 SettingsPageBase(parent
),
38 QVBoxLayout
* topLayout
= new QVBoxLayout(this);
39 KVBox
* vBox
= new KVBox(this);
40 vBox
->setSpacing(KDialog::spacingHint());
42 m_showZoomSlider
= new QCheckBox(i18nc("@option:check", "Show zoom slider"), vBox
);
43 connect(m_showZoomSlider
, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
45 m_showSpaceInfo
= new QCheckBox(i18nc("@option:check", "Show space information"), vBox
);
46 connect(m_showSpaceInfo
, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
48 // Add a dummy widget with no restriction regarding
49 // a vertical resizing. This assures that the dialog layout
50 // is not stretched vertically.
53 topLayout
->addWidget(vBox
);
58 StatusBarSettingsPage::~StatusBarSettingsPage()
62 void StatusBarSettingsPage::applySettings()
64 GeneralSettings
* settings
= DolphinSettings::instance().generalSettings();
65 settings
->setShowZoomSlider(m_showZoomSlider
->isChecked());
66 settings
->setShowSpaceInfo(m_showSpaceInfo
->isChecked());
67 settings
->writeConfig();
70 void StatusBarSettingsPage::restoreDefaults()
72 GeneralSettings
* settings
= DolphinSettings::instance().generalSettings();
73 settings
->useDefaults(true);
75 settings
->useDefaults(false);
78 void StatusBarSettingsPage::loadSettings()
80 GeneralSettings
* settings
= DolphinSettings::instance().generalSettings();
81 m_showZoomSlider
->setChecked(settings
->showZoomSlider());
82 m_showSpaceInfo
->setChecked(settings
->showSpaceInfo());
85 #include "statusbarsettingspage.moc"