]>
cloud.milkyroute.net Git - dolphin.git/blob - src/settings/general/statusbarsettingspage.cpp
1 /***************************************************************************
2 * Copyright (C) 2009 by Peter Penz <peter.penz19@gmail.com> *
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>
25 #include <KLocalizedString>
28 #include <QVBoxLayout>
30 StatusBarSettingsPage::StatusBarSettingsPage(QWidget
* parent
) :
31 SettingsPageBase(parent
),
35 m_showZoomSlider
= new QCheckBox(i18nc("@option:check", "Show zoom slider"), this);
36 m_showSpaceInfo
= new QCheckBox(i18nc("@option:check", "Show space information"), this);
38 QVBoxLayout
* topLayout
= new QVBoxLayout(this);
39 topLayout
->addSpacing(KDialog::spacingHint());
40 topLayout
->addWidget(m_showZoomSlider
);
41 topLayout
->addWidget(m_showSpaceInfo
);
42 topLayout
->addStretch();
46 connect(m_showZoomSlider
, &QCheckBox::toggled
, this, &StatusBarSettingsPage::changed
);
47 connect(m_showSpaceInfo
, &QCheckBox::toggled
, this, &StatusBarSettingsPage::changed
);
50 StatusBarSettingsPage::~StatusBarSettingsPage()
54 void StatusBarSettingsPage::applySettings()
56 GeneralSettings
* settings
= GeneralSettings::self();
57 settings
->setShowZoomSlider(m_showZoomSlider
->isChecked());
58 settings
->setShowSpaceInfo(m_showSpaceInfo
->isChecked());
59 settings
->writeConfig();
62 void StatusBarSettingsPage::restoreDefaults()
64 GeneralSettings
* settings
= GeneralSettings::self();
65 settings
->useDefaults(true);
67 settings
->useDefaults(false);
70 void StatusBarSettingsPage::loadSettings()
72 m_showZoomSlider
->setChecked(GeneralSettings::showZoomSlider());
73 m_showSpaceInfo
->setChecked(GeneralSettings::showSpaceInfo());