diff options
Diffstat (limited to 'kdat/VerifyDlg.cpp')
-rw-r--r-- | kdat/VerifyDlg.cpp | 106 |
1 files changed, 53 insertions, 53 deletions
diff --git a/kdat/VerifyDlg.cpp b/kdat/VerifyDlg.cpp index 6714322..92fe9cf 100644 --- a/kdat/VerifyDlg.cpp +++ b/kdat/VerifyDlg.cpp @@ -24,9 +24,9 @@ #include <time.h> #include <stdio.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qfile.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqfile.h> #include <kapplication.h> #include <kprocess.h> @@ -44,9 +44,9 @@ #include "VerifyDlg.moc" -VerifyDlg::VerifyDlg( const QString & workingDir, int fileno, const RangeList& ranges, - bool restore, QWidget* parent, const char* name ) - : QDialog( parent, name, TRUE ), +VerifyDlg::VerifyDlg( const TQString & workingDir, int fileno, const RangeList& ranges, + bool restore, TQWidget* parent, const char* name ) + : TQDialog( parent, name, TRUE ), _restore( restore ), _proc( NULL ), _workingDir( workingDir ), @@ -59,7 +59,7 @@ VerifyDlg::VerifyDlg( const QString & workingDir, int fileno, const RangeList& r _done( FALSE ) { // Calculate size of verify. - QPtrListIterator<Range> i( _ranges.getRanges() ); + TQPtrListIterator<Range> i( _ranges.getRanges() ); _archiveSize = 0; for ( ; i.current(); ++i ) { _archiveSize += i.current()->getEnd() - i.current()->getStart(); @@ -82,52 +82,52 @@ VerifyDlg::VerifyDlg( const QString & workingDir, int fileno, const RangeList& r // const int labelWidth = 96; const int labelWidth = 110; - QFrame* f1 = new QFrame( this ); - f1->setFrameStyle( QFrame::Panel | QFrame::Sunken ); + TQFrame* f1 = new TQFrame( this ); + f1->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); - QFrame* f2 = new QFrame( this ); - f2->setFrameStyle( QFrame::Panel | QFrame::Sunken ); + TQFrame* f2 = new TQFrame( this ); + f2->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); - QLabel* lbl1 = new QLabel( i18n( "Elapsed time:" ), f1 ); + TQLabel* lbl1 = new TQLabel( i18n( "Elapsed time:" ), f1 ); lbl1->setFixedSize( labelWidth, lbl1->sizeHint().height() ); - _elapsedTime = new QLabel( i18n( "00:00:00" ), f1 ); + _elapsedTime = new TQLabel( i18n( "00:00:00" ), f1 ); _elapsedTime->setFixedHeight( _elapsedTime->sizeHint().height() ); - QLabel* lbl2 = new QLabel( i18n( "Time remaining:" ), f2 ); + TQLabel* lbl2 = new TQLabel( i18n( "Time remaining:" ), f2 ); lbl2->setFixedSize( labelWidth, lbl2->sizeHint().height() ); - _timeRemaining = new QLabel( i18n( "00:00:00" ), f2 ); + _timeRemaining = new TQLabel( i18n( "00:00:00" ), f2 ); _timeRemaining->setFixedHeight( _timeRemaining->sizeHint().height() ); - QLabel* lbl3 = new QLabel( i18n( "Total KB:" ), f1 ); + TQLabel* lbl3 = new TQLabel( i18n( "Total KB:" ), f1 ); lbl3->setFixedSize( labelWidth, lbl3->sizeHint().height() ); - QLabel* totalKbytes = new QLabel( Util::kbytesToString( _archiveSize ), f1 ); + TQLabel* totalKbytes = new TQLabel( Util::kbytesToString( _archiveSize ), f1 ); totalKbytes->setFixedHeight( totalKbytes->sizeHint().height() ); - QLabel* lbl4 = new QLabel( i18n( "KB read:" ), f2 ); + TQLabel* lbl4 = new TQLabel( i18n( "KB read:" ), f2 ); lbl4->setFixedSize( labelWidth, lbl4->sizeHint().height() ); - _kbytesRead = new QLabel( i18n( "0KB" ), f2 ); + _kbytesRead = new TQLabel( i18n( "0KB" ), f2 ); _kbytesRead->setFixedHeight( _kbytesRead->sizeHint().height() ); - QLabel* lbl5 = new QLabel( i18n( "Transfer rate:" ), f1 ); + TQLabel* lbl5 = new TQLabel( i18n( "Transfer rate:" ), f1 ); lbl5->setFixedSize( labelWidth, lbl5->sizeHint().height() ); - _transferRate = new QLabel( i18n( "0KB/min" ), f1 ); + _transferRate = new TQLabel( i18n( "0KB/min" ), f1 ); _transferRate->setFixedHeight( _transferRate->sizeHint().height() ); - QLabel* lbl6; + TQLabel* lbl6; if ( _restore ) { - lbl6 = new QLabel( i18n( "Files:" ), f2 ); + lbl6 = new TQLabel( i18n( "Files:" ), f2 ); lbl6->setFixedSize( labelWidth, lbl6->sizeHint().height() ); } else { - lbl6 = new QLabel( i18n( "Differences:" ), f2 ); + lbl6 = new TQLabel( i18n( "Differences:" ), f2 ); lbl6->setFixedSize( labelWidth, lbl6->sizeHint().height() ); } - _files = new QLabel( "0", f2 ); + _files = new TQLabel( "0", f2 ); _files->setFixedHeight( _files->sizeHint().height() ); if ( _restore ) { @@ -138,63 +138,63 @@ VerifyDlg::VerifyDlg( const QString & workingDir, int fileno, const RangeList& r _ok = new KPushButton( KStdGuiItem::ok(), this ); _ok->setFixedSize( 80, _ok->sizeHint().height() ); - connect( _ok, SIGNAL( clicked() ), this, SLOT( slotOK() ) ); + connect( _ok, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotOK() ) ); _ok->setEnabled( FALSE ); - _save = new QPushButton( i18n( "&Save Log..." ), this ); + _save = new TQPushButton( i18n( "&Save Log..." ), this ); _save->setFixedSize( 80, _save->sizeHint().height() ); - connect( _save, SIGNAL( clicked() ), _log, SLOT( save() ) ); + connect( _save, TQT_SIGNAL( clicked() ), _log, TQT_SLOT( save() ) ); _save->setEnabled( FALSE ); - _abort = new QPushButton( i18n( "&Abort" ), this ); + _abort = new TQPushButton( i18n( "&Abort" ), this ); _abort->setFixedSize( 80, _abort->sizeHint().height() ); - connect( _abort, SIGNAL( clicked() ), this, SLOT( slotAbort() ) ); + connect( _abort, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotAbort() ) ); - QVBoxLayout* l1 = new QVBoxLayout( this, 8, 4 ); + TQVBoxLayout* l1 = new TQVBoxLayout( this, 8, 4 ); - QHBoxLayout* l1_1 = new QHBoxLayout(); + TQHBoxLayout* l1_1 = new TQHBoxLayout(); l1->addLayout( l1_1 ); l1_1->addStrut( 3 * lbl1->height() + 16 ); l1_1->addWidget( f1 ); l1_1->addWidget( f2 ); - QVBoxLayout* l1_1_1 = new QVBoxLayout( f1, 4, 4 ); + TQVBoxLayout* l1_1_1 = new TQVBoxLayout( f1, 4, 4 ); - QHBoxLayout* l1_1_1_1 = new QHBoxLayout(); + TQHBoxLayout* l1_1_1_1 = new TQHBoxLayout(); l1_1_1->addLayout( l1_1_1_1 ); l1_1_1_1->addWidget( lbl1 ); l1_1_1_1->addWidget( _elapsedTime, 1 ); - QHBoxLayout* l1_1_1_2 = new QHBoxLayout(); + TQHBoxLayout* l1_1_1_2 = new TQHBoxLayout(); l1_1_1->addLayout( l1_1_1_2 ); l1_1_1_2->addWidget( lbl3 ); l1_1_1_2->addWidget( totalKbytes, 1 ); - QHBoxLayout* l1_1_1_3 = new QHBoxLayout(); + TQHBoxLayout* l1_1_1_3 = new TQHBoxLayout(); l1_1_1->addLayout( l1_1_1_3 ); l1_1_1_3->addWidget( lbl5 ); l1_1_1_3->addWidget( _transferRate, 1 ); - QVBoxLayout* l1_1_2 = new QVBoxLayout( f2, 4, 4 ); + TQVBoxLayout* l1_1_2 = new TQVBoxLayout( f2, 4, 4 ); - QHBoxLayout* l1_1_2_1 = new QHBoxLayout(); + TQHBoxLayout* l1_1_2_1 = new TQHBoxLayout(); l1_1_2->addLayout( l1_1_2_1 ); l1_1_2_1->addWidget( lbl2 ); l1_1_2_1->addWidget( _timeRemaining, 1 ); - QHBoxLayout* l1_1_2_2 = new QHBoxLayout(); + TQHBoxLayout* l1_1_2_2 = new TQHBoxLayout(); l1_1_2->addLayout( l1_1_2_2 ); l1_1_2_2->addWidget( lbl4 ); l1_1_2_2->addWidget( _kbytesRead, 1 ); - QHBoxLayout* l1_1_2_3 = new QHBoxLayout(); + TQHBoxLayout* l1_1_2_3 = new TQHBoxLayout(); l1_1_2->addLayout( l1_1_2_3 ); l1_1_2_3->addWidget( lbl6 ); l1_1_2_3->addWidget( _files, 1 ); l1->addWidget( _log, 1 ); - QHBoxLayout* l1_2 = new QHBoxLayout(); + TQHBoxLayout* l1_2 = new TQHBoxLayout(); l1->addLayout( l1_2 ); l1_2->addStretch( 1 ); l1_2->addWidget( _ok ); @@ -208,7 +208,7 @@ VerifyDlg::~VerifyDlg() void VerifyDlg::show() { - chdir( QFile::encodeName(_workingDir) ); + chdir( TQFile::encodeName(_workingDir) ); _proc = new KProcess(); //_proc->setExecutable( Options::instance()->getTarCommand() ); @@ -219,16 +219,16 @@ void VerifyDlg::show() *_proc << "-dvf" << "-"; } - connect( _proc, SIGNAL( processExited( KProcess* ) ), this, SLOT( slotProcessExited( KProcess* ) ) ); - connect( _proc, SIGNAL( receivedStdout( KProcess*, char*, int ) ), this, SLOT( slotStdout( KProcess*, char*, int ) ) ); - connect( _proc, SIGNAL( wroteStdin( KProcess* ) ), this, SLOT( slotWroteStdin( KProcess* ) ) ); + connect( _proc, TQT_SIGNAL( processExited( KProcess* ) ), this, TQT_SLOT( slotProcessExited( KProcess* ) ) ); + connect( _proc, TQT_SIGNAL( receivedStdout( KProcess*, char*, int ) ), this, TQT_SLOT( slotStdout( KProcess*, char*, int ) ) ); + connect( _proc, TQT_SIGNAL( wroteStdin( KProcess* ) ), this, TQT_SLOT( slotWroteStdin( KProcess* ) ) ); _startTime = time( NULL ); startTimer( 100 ); _proc->start( KProcess::NotifyOnExit, KProcess::All ); - QDialog::show(); + TQDialog::show(); } void VerifyDlg::slotProcessExited( KProcess* ) @@ -247,7 +247,7 @@ void VerifyDlg::slotProcessExited( KProcess* ) void VerifyDlg::slotStdout( KProcess*, char* buf, int len ) { - QString data; + TQString data; data.replace( 0, len, buf ); /* 2002-02-23 RG */ // data[len] = '\0'; @@ -280,7 +280,7 @@ void VerifyDlg::slotStdout( KProcess*, char* buf, int len ) } _leftover.remove( 0, newlineIndex + 1 ); - QString tmp; + TQString tmp; tmp.setNum( _fileCount ); _files->setText( tmp ); } @@ -305,7 +305,7 @@ void VerifyDlg::slotAbort() _aborted = TRUE; } -void VerifyDlg::timerEvent( QTimerEvent* ) +void VerifyDlg::timerEvent( TQTimerEvent* ) { killTimers(); @@ -314,7 +314,7 @@ void VerifyDlg::timerEvent( QTimerEvent* ) int bytesToRead; int count; char *buf = new char[Options::instance()->getTapeBlockSize()]; - QPtrListIterator<Range> i( _ranges.getRanges() ); + TQPtrListIterator<Range> i( _ranges.getRanges() ); for ( ; ( !_done ) && ( !_aborted ) && ( i.current() ); ++i ) { // Move to the beginning of the next range. TapeDrive::instance()->seek( _fileno, i.current()->getStart() ); @@ -389,10 +389,10 @@ void VerifyDlg::timerEvent( QTimerEvent* ) void VerifyDlg::updateStats() { - QString str; + TQString str; int elapsed = time( NULL ) - _startTime; - str= QString::fromUtf8( QCString().sprintf( i18n( "%02d:%02d:%02d" ).utf8(), elapsed / 3600, elapsed / 60 % 60, elapsed % 60 ) ); + str= TQString::fromUtf8( TQCString().sprintf( i18n( "%02d:%02d:%02d" ).utf8(), elapsed / 3600, elapsed / 60 % 60, elapsed % 60 ) ); _elapsedTime->setText( str ); int remain = 0; @@ -402,7 +402,7 @@ void VerifyDlg::updateStats() if ( remain < 0 ) { remain = 0; } - str = QString::fromUtf8( QCString().sprintf( i18n( "%02d:%02d:%02d" ).utf8(), remain / 3600, remain / 60 % 60, remain % 60 ) ); + str = TQString::fromUtf8( TQCString().sprintf( i18n( "%02d:%02d:%02d" ).utf8(), remain / 3600, remain / 60 % 60, remain % 60 ) ); _timeRemaining->setText( str ); str = Util::kbytesToString( (int)_totalKBytes ); |