]>
cloud.milkyroute.net Git - dolphin.git/blob - src/generalviewsettingspage.cpp
1 /***************************************************************************
2 * Copyright (C) 2006 by Peter Penz *
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. *
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. *
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 ***************************************************************************/
21 #include "generalviewsettingspage.h"
22 #include "dolphinsettings.h"
23 #include "generalsettings.h"
28 #include <QRadioButton>
29 #include <QVBoxLayout>
35 GeneralViewSettingsPage::GeneralViewSettingsPage(QWidget
* parent
) :
40 GeneralSettings
* settings
= DolphinSettings::instance().generalSettings();
41 assert(settings
!= 0);
43 const int spacing
= KDialog::spacingHint();
44 const int margin
= KDialog::marginHint();
45 const QSizePolicy
sizePolicy(QSizePolicy::Preferred
, QSizePolicy::Fixed
);
50 QGroupBox
* propsBox
= new QGroupBox(i18n("View Properties"), this);
52 m_localProps
= new QRadioButton(i18n("Remember view properties for each folder."), propsBox
);
53 m_globalProps
= new QRadioButton(i18n("Use common view properties for all folders."), propsBox
);
54 if (settings
->globalViewProps()) {
55 m_globalProps
->setChecked(true);
58 m_localProps
->setChecked(true);
61 QVBoxLayout
* propsBoxLayout
= new QVBoxLayout(propsBox
);
62 propsBoxLayout
->addWidget(m_localProps
);
63 propsBoxLayout
->addWidget(m_globalProps
);
65 QGroupBox
* previewBox
= new QGroupBox(i18n("File Previews"), this);
67 // Add a dummy widget with no restriction regarding
68 // a vertical resizing. This assures that the dialog layout
69 // is not stretched vertically.
74 GeneralViewSettingsPage::~GeneralViewSettingsPage()
78 void GeneralViewSettingsPage::applySettings()
80 GeneralSettings
* settings
= DolphinSettings::instance().generalSettings();
81 assert(settings
!= 0);
82 settings
->setGlobalViewProps(m_globalProps
->isChecked());
85 #include "generalviewsettingspage.moc"