]>
cloud.milkyroute.net Git - dolphin.git/blob - src/settings/navigation/navigationsettingspage.cpp
2 * SPDX-FileCopyrightText: 2009 Peter Penz <peter.penz19@gmail.com>
4 * SPDX-License-Identifier: GPL-2.0-or-later
7 #include "navigationsettingspage.h"
9 #include "dolphin_generalsettings.h"
11 #include <KLocalizedString>
14 #include <QVBoxLayout>
16 NavigationSettingsPage::NavigationSettingsPage(QWidget
* parent
) :
17 SettingsPageBase(parent
),
18 m_openArchivesAsFolder(nullptr),
19 m_autoExpandFolders(nullptr)
21 QVBoxLayout
* topLayout
= new QVBoxLayout(this);
22 QWidget
* vBox
= new QWidget(this);
23 QVBoxLayout
*vBoxLayout
= new QVBoxLayout(vBox
);
24 vBoxLayout
->setContentsMargins(0, 0, 0, 0);
25 vBoxLayout
->setAlignment(Qt::AlignTop
);
27 m_openArchivesAsFolder
= new QCheckBox(i18nc("@option:check", "Open archives as folder"), vBox
);
28 vBoxLayout
->addWidget(m_openArchivesAsFolder
);
30 m_autoExpandFolders
= new QCheckBox(i18nc("option:check", "Open folders during drag operations"), vBox
);
31 vBoxLayout
->addWidget(m_autoExpandFolders
);
33 topLayout
->addWidget(vBox
);
37 connect(m_openArchivesAsFolder
, &QCheckBox::toggled
, this, &NavigationSettingsPage::changed
);
38 connect(m_autoExpandFolders
, &QCheckBox::toggled
, this, &NavigationSettingsPage::changed
);
41 NavigationSettingsPage::~NavigationSettingsPage()
45 void NavigationSettingsPage::applySettings()
47 GeneralSettings
* settings
= GeneralSettings::self();
48 settings
->setBrowseThroughArchives(m_openArchivesAsFolder
->isChecked());
49 settings
->setAutoExpandFolders(m_autoExpandFolders
->isChecked());
54 void NavigationSettingsPage::restoreDefaults()
56 GeneralSettings
* settings
= GeneralSettings::self();
57 settings
->useDefaults(true);
59 settings
->useDefaults(false);
62 void NavigationSettingsPage::loadSettings()
64 m_openArchivesAsFolder
->setChecked(GeneralSettings::browseThroughArchives());
65 m_autoExpandFolders
->setChecked(GeneralSettings::autoExpandFolders());