]> cloud.milkyroute.net Git - dolphin.git/blob - src/generalviewsettingspage.cpp
Reanimate drag and drop support for the URL navigator.
[dolphin.git] / src / generalviewsettingspage.cpp
1 /***************************************************************************
2 * Copyright (C) 2006 by Peter Penz *
3 * peter.penz@gmx.at *
4 * *
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. *
9 * *
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. *
14 * *
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 ***************************************************************************/
20
21 #include "generalviewsettingspage.h"
22 #include "dolphinsettings.h"
23 #include "generalsettings.h"
24
25 #include <assert.h>
26
27 #include <QGroupBox>
28 #include <QRadioButton>
29 #include <QVBoxLayout>
30
31 #include <kdialog.h>
32 #include <klocale.h>
33 #include <kvbox.h>
34
35 GeneralViewSettingsPage::GeneralViewSettingsPage(QWidget* parent) :
36 KVBox(parent),
37 m_localProps(0),
38 m_globalProps(0)
39 {
40 GeneralSettings* settings = DolphinSettings::instance().generalSettings();
41 assert(settings != 0);
42
43 const int spacing = KDialog::spacingHint();
44 const int margin = KDialog::marginHint();
45 const QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
46
47 setSpacing(spacing);
48 setMargin(margin);
49
50 QGroupBox* propsBox = new QGroupBox(i18n("View Properties"), this);
51
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);
56 }
57 else {
58 m_localProps->setChecked(true);
59 }
60
61 QVBoxLayout* propsBoxLayout = new QVBoxLayout(propsBox);
62 propsBoxLayout->addWidget(m_localProps);
63 propsBoxLayout->addWidget(m_globalProps);
64
65 QGroupBox* previewBox = new QGroupBox(i18n("File Previews"), this);
66
67 // Add a dummy widget with no restriction regarding
68 // a vertical resizing. This assures that the dialog layout
69 // is not stretched vertically.
70 new QWidget(this);
71 }
72
73
74 GeneralViewSettingsPage::~GeneralViewSettingsPage()
75 {
76 }
77
78 void GeneralViewSettingsPage::applySettings()
79 {
80 GeneralSettings* settings = DolphinSettings::instance().generalSettings();
81 assert(settings != 0);
82 settings->setGlobalViewProps(m_globalProps->isChecked());
83 }
84
85 #include "generalviewsettingspage.moc"