~ubuntu-branches/ubuntu/natty/kdeadmin/natty-proposed

« back to all changes in this revision

Viewing changes to kdat/BackupDlg.h

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2010-02-27 21:36:45 UTC
  • mfrom: (1.2.40 upstream)
  • Revision ID: james.westby@ubuntu.com-20100227213645-ronst6mahkgf6j9w
Tags: 4:4.4.1-0ubuntu1
* New upstream release
  - Bump build-depends
  - Update kcron.install

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// KDat - a tar-based DAT archiver
2
 
// Copyright (C) 1998-2000  Sean Vyain, svyain@mail.tds.net
3
 
// Copyright (C) 2001-2002  Lawrence Widman, kdat@cardiothink.com
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 Free Software
17
 
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
18
 
 
19
 
#ifndef _BackupDlg_h_
20
 
#define _BackupDlg_h_
21
 
 
22
 
#include <qdialog.h>
23
 
//Added by qt3to4:
24
 
#include <QLabel>
25
 
#include <QTimerEvent>
26
 
 
27
 
class QLabel;
28
 
class QPushButton;
29
 
 
30
 
class K3Process;
31
 
 
32
 
class Archive;
33
 
class File;
34
 
class LoggerWidget;
35
 
class Tape;
36
 
class TarParser;
37
 
 
38
 
/**
39
 
 * @short Status dialog for backing up files.
40
 
 */
41
 
class BackupDlg : public QDialog {
42
 
    Q_OBJECT
43
 
    K3Process*       _proc;
44
 
    TarParser*      _tarParser;
45
 
    QString         _archiveName;
46
 
    QString         _workingDir;
47
 
    QStringList        _files;
48
 
    bool            _oneFilesystem;
49
 
    bool            _incremental;
50
 
    QString         _snapshot;
51
 
    bool            _removeSnapshot;
52
 
    int             _archiveSize;
53
 
    Tape*           _tape;
54
 
    float           _totalKBytes;
55
 
    uint            _totalRecords;
56
 
    QLabel*         _elapsedTime;
57
 
    QLabel*         _timeRemaining;
58
 
    QLabel*         _kbytesWritten;
59
 
    QLabel*         _transferRate;
60
 
    QLabel*         _fileCount;
61
 
    LoggerWidget*   _log;
62
 
    QPushButton*    _ok;
63
 
    QPushButton*    _save;
64
 
    QPushButton*    _abort;
65
 
    int             _startTime;
66
 
    Archive*        _archive;
67
 
    bool            _aborted;
68
 
    int             _numFiles;
69
 
 
70
 
    int     _fileSize;
71
 
    int     _fileMTime;
72
 
    int     _fileStartRecord;
73
 
    QString _fileName;
74
 
 
75
 
    void updateStats();
76
 
private slots:
77
 
    void slotProcessExited( K3Process* proc );
78
 
    void slotStdout( K3Process* proc, char* buf, int len );
79
 
    void slotOK();
80
 
    void slotAbort();
81
 
    void slotEntry( const QString& name, int size, int mtime, int record );
82
 
protected:
83
 
    void show();
84
 
    void timerEvent( QTimerEvent* e );
85
 
public:
86
 
    /**
87
 
     * Create a backup dialog.
88
 
     *
89
 
     * @param archiveName    The name for the new archive.
90
 
     * @param workingDir     The directory to backup from.
91
 
     * @param files          The list of files to backup.
92
 
     * @param oneFilesystem  TRUE means do not follow symbolic links across filesystems.
93
 
     * @param incremental    TRUE mean do a GNU listed incremental backup.
94
 
     * @param snapshot       The name of the snapshot file for an incremental backup.
95
 
     * @param removeSnapshot Remove the snapshot before backing up.
96
 
     * @param archiveSize    The estimate size of the archive in kilobytes.
97
 
     * @param tape           The tape index to add the archive to.
98
 
     * @param parent         The parent widget for this dialog.
99
 
     * @param name           The name of this widget.
100
 
     */
101
 
    BackupDlg( const QString & archiveName, const QString & workingDir, const QStringList& files, bool oneFilesystem, bool incremental,
102
 
               const QString & snapshot, bool removeSnapshot, int archiveSize, Tape* tape,
103
 
               QWidget* parent = 0, const char* name = 0 );
104
 
 
105
 
    /**
106
 
     * Destroy the backup dialog.
107
 
     */
108
 
    ~BackupDlg();
109
 
};
110
 
 
111
 
#endif