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

« back to all changes in this revision

Viewing changes to kdat/VerifyDlg.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 _VerifyDlg_h_
20
 
#define _VerifyDlg_h_
21
 
 
22
 
#include <qdialog.h>
23
 
#include <q3ptrlist.h>
24
 
//Added by qt3to4:
25
 
#include <QLabel>
26
 
#include <QTimerEvent>
27
 
 
28
 
#include "Range.h"
29
 
 
30
 
class QLabel;
31
 
class QPushButton;
32
 
 
33
 
class K3Process;
34
 
 
35
 
class LoggerWidget;
36
 
class TapeDrive;
37
 
 
38
 
/**
39
 
 * @short Status dialog for verifying/restoring parts of an archive.
40
 
 */
41
 
class VerifyDlg : public QDialog {
42
 
    Q_OBJECT
43
 
    bool                _restore;
44
 
    K3Process*           _proc;
45
 
    QString             _workingDir;
46
 
    int                 _fileno;
47
 
    const RangeList&    _ranges;
48
 
    QString             _leftover;
49
 
    QLabel*             _elapsedTime;
50
 
    QLabel*             _timeRemaining;
51
 
    QLabel*             _kbytesRead;
52
 
    QLabel*             _transferRate;
53
 
    QLabel*             _files;
54
 
    LoggerWidget*       _log;
55
 
    QPushButton*        _ok;
56
 
    QPushButton*        _save;
57
 
    QPushButton*        _abort;
58
 
    int                 _startTime;
59
 
    float               _totalKBytes;
60
 
    int                 _fileCount;
61
 
    int                 _archiveSize;
62
 
    bool                _wroteStdin;
63
 
    bool                _aborted;
64
 
    bool                _done;
65
 
    QString             _lastFileName;
66
 
 
67
 
    void updateStats();
68
 
private slots:
69
 
    void slotProcessExited( K3Process* proc );
70
 
    void slotStdout( K3Process* proc, char* buf, int len );
71
 
    void slotWroteStdin( K3Process* proc );
72
 
    void slotOK();
73
 
    void slotAbort();
74
 
protected:
75
 
    void show();
76
 
    void timerEvent( QTimerEvent* e );
77
 
public:
78
 
    /**
79
 
     * Create a new verify/restore dialog.
80
 
     *
81
 
     * @param workingDir The directory to restore files to or verify files against.
82
 
     * @param fileno     The tape file number of the archive to verify/restore.
83
 
     * @param ranges     A list of tar block ranges to read.
84
 
     * @param restore    TRUE means restore, FALSE means verify.
85
 
     * @param parent     The parent widget for the dialog.
86
 
     * @param name       The name of this widget.
87
 
     */
88
 
    VerifyDlg( const QString & workingDir, int fileno, const RangeList& ranges,
89
 
               bool restore = FALSE, QWidget* parent = 0, const char* name = 0 );
90
 
 
91
 
    /**
92
 
     * Destroy the verify/restore dialog.
93
 
     */
94
 
    ~VerifyDlg();
95
 
};
96
 
 
97
 
#endif