]> cloud.milkyroute.net Git - dolphin.git/blob - src/settings/viewpropsprogressinfo.h
05eafa6f5dd98e5b2e5cf18fa5706f85cfef9975
[dolphin.git] / src / settings / viewpropsprogressinfo.h
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 #ifndef VIEWPROPSPROGRESSINFO_H
21 #define VIEWPROPSPROGRESSINFO_H
22
23 #include <kio/directorysizejob.h>
24
25 #include <QDialog>
26 #include <QUrl>
27
28 class ApplyViewPropsJob;
29 class QLabel;
30 class QProgressBar;
31 class QTimer;
32 class ViewProperties;
33
34 /**
35 * @brief Shows the progress information when applying view properties
36 * recursively to a given directory.
37 *
38 * It is possible to cancel the applying. In this case the already applied
39 * view properties won't get reverted.
40 */
41 class ViewPropsProgressInfo : public QDialog
42 {
43 Q_OBJECT
44
45 public:
46 /**
47 * @param parent Parent widget of the dialog.
48 * @param dir Directory where the view properties should be applied to
49 * (including sub directories).
50 * @param viewProps View properties for the directory \a dir including its
51 * sub directories.
52 */
53 ViewPropsProgressInfo(QWidget* parent,
54 const QUrl& dir,
55 const ViewProperties& viewProps);
56
57 ~ViewPropsProgressInfo() override;
58
59 protected:
60 void closeEvent(QCloseEvent* event) override;
61
62 public slots:
63 void reject() override;
64
65 private slots:
66 void updateProgress();
67 void applyViewProperties();
68
69 private:
70 QUrl m_dir;
71 ViewProperties* m_viewProps;
72
73 QLabel* m_label;
74 QProgressBar* m_progressBar;
75
76 KIO::DirectorySizeJob* m_dirSizeJob;
77 ApplyViewPropsJob* m_applyViewPropsJob;
78 QTimer* m_timer;
79 };
80
81 #endif