┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/settings/viewpropertiesdialog.h
blob: f07bb8088f00df2abe7465865d27923bd94d6822 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
 * SPDX-FileCopyrightText: 2006 Peter Penz <[email protected]>
 * SPDX-FileCopyrightText: 2018 Elvis Angelaccio <[email protected]>
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 */

#ifndef VIEWPROPERTIESDIALOG_H
#define VIEWPROPERTIESDIALOG_H

#include "dolphin_export.h"

#include <QDialog>

class QCheckBox;
class QListWidget;
class QListWidgetItem;
class QComboBox;
class QPushButton;
class QRadioButton;
class ViewProperties;
class DolphinView;

/**
 * @brief Dialog for changing the current view properties of a directory.
 *
 * It is possible to specify the view mode, the sorting order, whether hidden files
 * and previews should be shown. The properties can be assigned to the current folder,
 * or recursively to all sub folders.
 */
class DOLPHIN_EXPORT ViewPropertiesDialog : public QDialog
{
    Q_OBJECT

public:
    explicit ViewPropertiesDialog(DolphinView* dolphinView);
    ~ViewPropertiesDialog() override;

public Q_SLOTS:
    void accept() override;

private Q_SLOTS:
    void slotApply();
    void slotViewModeChanged(int index);
    void slotSortingChanged(int index);
    void slotSortOrderChanged(int index);
    void slotGroupedSortingChanged();
    void slotSortFoldersFirstChanged();
    void slotShowPreviewChanged();
    void slotShowHiddenFilesChanged();
    void slotItemChanged(QListWidgetItem *item);
    void markAsDirty(bool isDirty);

Q_SIGNALS:
    void isDirtyChanged(bool isDirty);

private:
    void applyViewProperties();
    void loadSettings();

private:
    bool m_isDirty;
    DolphinView* m_dolphinView;
    ViewProperties* m_viewProps;

    QComboBox* m_viewMode;
    QComboBox* m_sortOrder;
    QComboBox* m_sorting;
    QCheckBox* m_sortFoldersFirst;
    QCheckBox* m_previewsShown;
    QCheckBox* m_showInGroups;
    QCheckBox* m_showHiddenFiles;
    QRadioButton* m_applyToCurrentFolder;
    QRadioButton* m_applyToSubFolders;
    QRadioButton* m_applyToAllFolders;
    QCheckBox* m_useAsDefault;
    QListWidget* m_listWidget;
};

#endif