-
Notifications
You must be signed in to change notification settings - Fork 57
/
ext2copyfile.h
93 lines (76 loc) · 2.35 KB
/
ext2copyfile.h
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
81
82
83
84
85
86
87
88
89
90
91
92
93
/**
* Copyright (C) 2010 by Manish Regmi (regmi dot manish at gmail.com)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* 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.
**/
#ifndef EXT2COPYFILE_H
#define EXT2COPYFILE_H
#include <QDialog>
#include <QFile>
#include <QThread>
#include <QTextCodec>
#include "ui_ext2progress.h"
#include "ext2read.h"
class Ext2CopyProcess : public QThread
{
Q_OBJECT
private:
QString filename;
Ext2File *file;
QFile *filetosave;
char *buffer;
int blksize;
bool cancelOperation;
QTextCodec *codec;
bool copy_folder(QString &path, Ext2File *file);
bool copy_file(QString &destfile, Ext2File *srcfile);
protected:
void run();
public:
Ext2CopyProcess(Ext2File *parent, QString &dest);
~Ext2CopyProcess();
public slots:
void slot_cancelprocess();
signals:
void sig_updateui(QString &file, QString &from, QString &to, int copied, int total);
void sig_copydone();
};
class Ext2CopyFile : public QDialog
{
Q_OBJECT
Ui::ProgressDialog *progress;
QString filename;
Ext2File *file;
bool cancelOperation;
Ext2CopyProcess *proc;
public:
Ext2CopyFile(Ext2File *parent, QString &dest);
Ext2CopyFile();
~Ext2CopyFile();
void set_file(Ext2File *sfile) { file = sfile; }
void set_name(QString &name) { filename = name; }
void start_copy();
private:
bool showMessageBox();
private slots:
void on_buttonBox_clicked(QAbstractButton* button);
public slots:
void slot_updateui(QString &file, QString &from, QString &to, int copied, int total);
void slot_copydone();
signals:
void signal_cancelprocess();
};
#endif // EXT2COPYFILE_H