]> cloud.milkyroute.net Git - dolphin.git/blob - src/iconsviewsettingspage.h
Remove not necessary "class classname;"
[dolphin.git] / src / iconsviewsettingspage.h
1 /***************************************************************************
2 * Copyright (C) 2006 by Peter Penz <peter.penz@gmx.at> *
3 * *
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. *
8 * *
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. *
13 * *
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 ***************************************************************************/
19
20 #ifndef ICONSVIEWSETTINGSPAGE_H
21 #define ICONSVIEWSETTINGSPAGE_H
22
23 #include <dolphiniconsview.h>
24 #include <kvbox.h>
25
26 class DolphinMainWindow;
27 class KFontRequester;
28 class QComboBox;
29 class QPushButton;
30 class QSpinBox;
31
32 /**
33 * @brief Tab page for the 'Icons Mode' and 'Previews Mode' settings
34 * of the Dolphin settings dialog.
35 *
36 * Allows to set:
37 * - icon size
38 * - preview size
39 * - text width
40 * - grid spacing
41 * - font
42 * - number of text lines
43 * - arrangement
44 *
45 * @see DolphinIconsViewSettings
46 */
47 class IconsViewSettingsPage : public KVBox
48 {
49 Q_OBJECT
50
51 public:
52 IconsViewSettingsPage(DolphinMainWindow* mainWindow, QWidget* parent);
53 virtual ~IconsViewSettingsPage();
54
55 /**
56 * Applies the settings for the icons view.
57 * The settings are persisted automatically when
58 * closing Dolphin.
59 */
60 void applySettings();
61
62 /** Restores the settings to default values. */
63 void restoreDefaults();
64
65 private slots:
66 void openIconSizeDialog();
67
68 private:
69 void loadSettings();
70
71 private:
72 enum
73 {
74 GridSpacingBase = 8,
75 GridSpacingInc = 24,
76 LeftToRightBase = 128,
77 LeftToRightInc = 64,
78 TopToBottomBase = 64,
79 TopToBottomInc = 32
80 };
81
82 DolphinMainWindow* m_mainWindow;
83 int m_iconSize;
84 int m_previewSize;
85
86 QPushButton* m_iconSizeButton;
87 QComboBox* m_textWidthBox;
88 KFontRequester* m_fontRequester;
89 QSpinBox* m_textlinesCountBox;
90
91 QComboBox* m_arrangementBox;
92 QComboBox* m_gridSpacingBox;
93 };
94
95 #endif