]> cloud.milkyroute.net Git - dolphin.git/blob - src/settings/viewpropsprogressinfo.h
Merge branch 'release/20.08'
[dolphin.git] / src / settings / viewpropsprogressinfo.h
1 /*
2 * SPDX-FileCopyrightText: 2006 Peter Penz <peter.penz@gmx.at>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 #ifndef VIEWPROPSPROGRESSINFO_H
7 #define VIEWPROPSPROGRESSINFO_H
8
9 #include <kio/directorysizejob.h>
10
11 #include <QDialog>
12 #include <QUrl>
13
14 class ApplyViewPropsJob;
15 class QLabel;
16 class QProgressBar;
17 class QTimer;
18 class ViewProperties;
19
20 /**
21 * @brief Shows the progress information when applying view properties
22 * recursively to a given directory.
23 *
24 * It is possible to cancel the applying. In this case the already applied
25 * view properties won't get reverted.
26 */
27 class ViewPropsProgressInfo : public QDialog
28 {
29 Q_OBJECT
30
31 public:
32 /**
33 * @param parent Parent widget of the dialog.
34 * @param dir Directory where the view properties should be applied to
35 * (including sub directories).
36 * @param viewProps View properties for the directory \a dir including its
37 * sub directories.
38 */
39 ViewPropsProgressInfo(QWidget* parent,
40 const QUrl& dir,
41 const ViewProperties& viewProps);
42
43 ~ViewPropsProgressInfo() override;
44
45 protected:
46 void closeEvent(QCloseEvent* event) override;
47
48 public slots:
49 void reject() override;
50
51 private slots:
52 void updateProgress();
53 void applyViewProperties();
54
55 private:
56 QUrl m_dir;
57 ViewProperties* m_viewProps;
58
59 QLabel* m_label;
60 QProgressBar* m_progressBar;
61
62 KIO::DirectorySizeJob* m_dirSizeJob;
63 ApplyViewPropsJob* m_applyViewPropsJob;
64 QTimer* m_timer;
65 };
66
67 #endif