* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
#ifndef VIEWPROPSPROGRESSINFO_H
#define VIEWPROPSPROGRESSINFO_H
#include <kdialog.h>
+#include <kio/directorysizejob.h>
+#include <kurl.h>
-class KDirSize;
-class KJob;
-class KUrl;
+class ApplyViewPropsJob;
class QLabel;
class QProgressBar;
class QTimer;
class ViewProperties;
/**
- * @brief Shows the progress when applying view properties recursively to
- * sub directories.
+ * @brief Shows the progress information when applying view properties
+ * recursively to a given directory.
+ *
+ * It is possible to cancel the applying. In this case the already applied
+ * view properties won't get reverted.
*/
class ViewPropsProgressInfo : public KDialog
{
*/
ViewPropsProgressInfo(QWidget* parent,
const KUrl& dir,
- const ViewProperties* viewProps);
+ const ViewProperties& viewProps);
virtual ~ViewPropsProgressInfo();
+protected:
+ virtual void closeEvent(QCloseEvent* event);
+
private slots:
- void countDirs(const KUrl& dir, int count);
- //void updateDirCounter();
- //void slotResult(KJob* job);
+ void updateProgress();
void applyViewProperties();
- void showProgress(const KUrl& url, int count);
+ void cancelApplying();
private:
- int m_dirCount;
- int m_applyCount;
- const KUrl& m_dir;
- const ViewProperties* m_viewProps;
+ KUrl m_dir;
+ ViewProperties* m_viewProps;
+
QLabel* m_label;
QProgressBar* m_progressBar;
- KDirSize* m_dirSizeJob;
+
+ KIO::DirectorySizeJob* m_dirSizeJob;
+ ApplyViewPropsJob* m_applyViewPropsJob;
QTimer* m_timer;
};