]> cloud.milkyroute.net Git - dolphin.git/blob - src/settings/viewpropsprogressinfo.h
Rewrite search integration
[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, const QUrl &dir, const ViewProperties &viewProps);
40
41 ~ViewPropsProgressInfo() override;
42
43 protected:
44 void closeEvent(QCloseEvent *event) override;
45
46 public Q_SLOTS:
47 void reject() override;
48
49 private Q_SLOTS:
50 void updateProgress();
51 void applyViewProperties();
52
53 private:
54 QUrl m_dir;
55 ViewProperties *m_viewProps;
56
57 QLabel *m_label;
58 QProgressBar *m_progressBar;
59
60 KIO::DirectorySizeJob *m_dirSizeJob;
61 ApplyViewPropsJob *m_applyViewPropsJob;
62 QTimer *m_timer;
63 };
64
65 #endif