summaryrefslogtreecommitdiffstats
path: root/kdat/KDatMainWindow.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-18 20:34:22 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-18 20:34:22 +0000
commitb09bffed6b43262948018dfb0f11890850ddf7c1 (patch)
tree138696bfcc7ac01070d0e8ecaa1cdf94611a2bd8 /kdat/KDatMainWindow.cpp
parent6d43944a7130b9d1b4ae3fba37b774aced8612cf (diff)
downloadtdeadmin-b09bffed6b43262948018dfb0f11890850ddf7c1.tar.gz
tdeadmin-b09bffed6b43262948018dfb0f11890850ddf7c1.zip
TQt4 port kdeadmin
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeadmin@1237416 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdat/KDatMainWindow.cpp')
-rw-r--r--kdat/KDatMainWindow.cpp112
1 files changed, 56 insertions, 56 deletions
diff --git a/kdat/KDatMainWindow.cpp b/kdat/KDatMainWindow.cpp
index 5ead8c9..d3cf265 100644
--- a/kdat/KDatMainWindow.cpp
+++ b/kdat/KDatMainWindow.cpp
@@ -152,20 +152,20 @@ KDatMainWindow::KDatMainWindow()
_menu->insertItem( i18n( "&File" ), _fileMenu );
_menu->insertItem( i18n( "&Settings" ), _editMenu );
_menu->insertSeparator();
- TQString about = i18n( "KDat Version %1\n\nKDat is a tar-based tape archiver.\n\nCopyright (c) 1998-2000 Sean Vyain\nCopyright (c) 2001-2002 Lawrence Widman\nkdat@cardiothink.com" ).arg( KDAT_VERSION );
+ TQString about = i18n( "KDat Version %1\n\nKDat is a tar-based tape archiver.\n\nCopyright (c) 1998-2000 Sean Vyain\nCopyright (c) 2001-2002 Lawrence Widman\nkdat@cardiothink.com" ).tqarg( KDAT_VERSION );
_menu->insertItem( i18n( "&Help" ), helpMenu( about ) );
_toolbar = new KToolBar( this );
- _toolbar->insertButton( *ImageCache::instance()->getTapeUnmounted(), 0, TQT_SIGNAL( clicked( int ) ), this, TQT_SLOT( fileMountTape() ), TRUE, i18n( "Mount/unmount tape" ) );
+ _toolbar->insertButton( *ImageCache::instance()->getTapeUnmounted(), 0, TQT_SIGNAL( clicked( int ) ), TQT_TQOBJECT(this), TQT_SLOT( fileMountTape() ), TRUE, i18n( "Mount/unmount tape" ) );
_toolbar->insertSeparator();
- _toolbar->insertButton( *ImageCache::instance()->getBackup() , 1, TQT_SIGNAL( clicked( int ) ), this, TQT_SLOT( fileBackup() ) , TRUE, i18n( "Backup" ) );
+ _toolbar->insertButton( *ImageCache::instance()->getBackup() , 1, TQT_SIGNAL( clicked( int ) ), TQT_TQOBJECT(this), TQT_SLOT( fileBackup() ) , TRUE, i18n( "Backup" ) );
_toolbar->setButtonIconSet( 1, BarIconSet("kdat_backup"));
- _toolbar->insertButton( *ImageCache::instance()->getRestore(), 2, TQT_SIGNAL( clicked( int ) ), this, TQT_SLOT( fileRestore() ), TRUE, i18n( "Restore" ) );
+ _toolbar->insertButton( *ImageCache::instance()->getRestore(), 2, TQT_SIGNAL( clicked( int ) ), TQT_TQOBJECT(this), TQT_SLOT( fileRestore() ), TRUE, i18n( "Restore" ) );
_toolbar->setButtonIconSet( 2, BarIconSet("kdat_restore"));
- _toolbar->insertButton( *ImageCache::instance()->getVerify() , 3, TQT_SIGNAL( clicked( int ) ), this, TQT_SLOT( fileVerify() ) , TRUE, i18n( "Verify" ) );
+ _toolbar->insertButton( *ImageCache::instance()->getVerify() , 3, TQT_SIGNAL( clicked( int ) ), TQT_TQOBJECT(this), TQT_SLOT( fileVerify() ) , TRUE, i18n( "Verify" ) );
_toolbar->setButtonIconSet( 3, BarIconSet("kdat_verify"));
addToolBar( _toolbar );
@@ -173,9 +173,9 @@ KDatMainWindow::KDatMainWindow()
_statusBar->insertItem( i18n( "Ready." ), 0 );
#ifdef KDAT_HORIZONTAL_LAYOUT /* 2002-01-20 LEW */
- _panner = new TQSplitter( TQSplitter::Horizontal, this, "panner");
+ _panner = new TQSplitter( Qt::Horizontal, this, "panner");
#else
- _panner = new TQSplitter( TQSplitter::Vertical, this, "panner");
+ _panner = new TQSplitter( Qt::Vertical, this, "panner");
#endif /* KDAT_HORIZONTAL_LAYOUT */
// Create info viewers.
@@ -211,7 +211,7 @@ KDatMainWindow::KDatMainWindow()
_tree->insertItem( _backupProfileRootNode = new BackupProfileRootNode() );
_tree->insertItem( new TapeIndexRootNode() );
- connect( TapeDrive::instance(), TQT_SIGNAL( sigStatus( const TQString & ) ), this, TQT_SLOT( status( const TQString & ) ) );
+ connect( TapeDrive::instance(), TQT_SIGNAL( sigtqStatus( const TQString & ) ), this, TQT_SLOT( status( const TQString & ) ) );
setTapePresent( FALSE );
@@ -387,7 +387,7 @@ void KDatMainWindow::localSelected( int index )
_tree->expandItem( index );
_tree->collapseItem( index ); // 2002-01-30 LEW
}
- // repaint(); // this doesn't work 2002-01-30 LEW
+ // tqrepaint(); // this doesn't work 2002-01-30 LEW
/* 2002-01-30 LEW: RG and I don't like this behavior */
}
@@ -419,7 +419,7 @@ void KDatMainWindow::fileBackup()
TQString msg = i18n("KDat will dump your files properly to tape, but may not be able\n"
"to restore them. To restore your files by hand, you need to know\n"
"the name of the *non-rewinding* version of your tape device %1.\n"
- ).arg(Options::instance()->getTapeDevice());
+ ).tqarg(Options::instance()->getTapeDevice());
TQString msg2 = i18n("For example, if your device is /dev/st0, the non-rewinding version\n"
"is /dev/nst0. If your device name doesn't look like that, type\n"
"\"ls -l %2\" in a terminal window to see the real name of your\n"
@@ -430,7 +430,7 @@ void KDatMainWindow::fileBackup()
"The third call to \"tar\" will retrieve your data into your\n"
"current directory. Please let us know if this happens to you!\n"
" - KDat Maintenance Team\n"
- ).arg(Options::instance()->getTapeDevice());
+ ).tqarg(Options::instance()->getTapeDevice());
msg = msg.append(msg2);
KMessageBox::sorry( this, msg);
/* 2002-01-28 LEW */
@@ -446,7 +446,7 @@ void KDatMainWindow::fileBackup()
backupProfile.setRemoveSnapshot( bp->getRemoveSnapshot() );
} else {
TQString name;
- name = i18n( "Archive created on %1" ).arg( KGlobal::locale()->formatDate(TQDate::currentDate(), true) );
+ name = i18n( "Archive created on %1" ).tqarg( KGlobal::locale()->formatDate(TQDate::tqcurrentDate(), true) );
name = name.stripWhiteSpace();
TQStringList files;
@@ -486,8 +486,8 @@ void KDatMainWindow::fileBackup()
msg = i18n( "WARNING: The estimated archive size is %1 KB but "
"the tape has only %2 KB of space!\n"
"Back up anyway?" )
- .arg(KGlobal::locale()->formatNumber(size, 0))
- .arg(KGlobal::locale()->formatNumber(TapeManager::instance()->getMountedTape()->getSize() - tapeSize, 0 ));
+ .tqarg(KGlobal::locale()->formatNumber(size, 0))
+ .tqarg(KGlobal::locale()->formatNumber(TapeManager::instance()->getMountedTape()->getSize() - tapeSize, 0 ));
int result = KMessageBox::warningContinueCancel( this,
msg, i18n("Backup"), i18n("Backup") );
if ( result != KMessageBox::Continue) {
@@ -556,15 +556,15 @@ void KDatMainWindow::doVerify( bool restore )
Archive* archive = 0;
// Check for marked files first.
for ( int i = _tapeDriveNode->childCount() - 1; i >= 0; i-- ) {
- if ( ( ((SelectableNode*)_tapeDriveNode->childAt( i ))->isSelected() ) ||
- ( ((SelectableNode*)_tapeDriveNode->childAt( i ))->hasSelectedChildren() )) {
- archiveNode = (MountedArchiveNode*)_tapeDriveNode->childAt( i );
+ if ( ( ((SelectableNode*)_tapeDriveNode->tqchildAt( i ))->isSelected() ) ||
+ ( ((SelectableNode*)_tapeDriveNode->tqchildAt( i ))->hasSelectedChildren() )) {
+ archiveNode = (MountedArchiveNode*)_tapeDriveNode->tqchildAt( i );
archive = archiveNode->getArchive();
/* 2002-01-30 LEW */
#ifdef DEBUG
printf("KDatMainWindow::doVerify: %d node of %s: ", i,
(SelectableNode*)_tapeDriveNode->getText().latin1() );
- if( ((SelectableNode*)_tapeDriveNode->childAt( i ))->isSelected() ){
+ if( ((SelectableNode*)_tapeDriveNode->tqchildAt( i ))->isSelected() ){
printf("is completely selected\n");
} else {
printf("is partially selected\n");
@@ -578,10 +578,10 @@ void KDatMainWindow::doVerify( bool restore )
if ( !archiveNode ) {
if ( ((Node*)_tree->getCurrentItem())->isType( Node::RangeableNodeType ) ) {
rangeableNode = (RangeableNode*)_tree->getCurrentItem();
- Node* parent = rangeableNode;
- for ( ; !parent->isType( Node::MountedArchiveNodeType ); parent = (Node*)parent->getParent() );
- assert( parent );
- archive = ((MountedArchiveNode*)parent)->getArchive();
+ Node* tqparent = rangeableNode;
+ for ( ; !tqparent->isType( Node::MountedArchiveNodeType ); tqparent = (Node*)tqparent->getParent() );
+ assert( tqparent );
+ archive = ((MountedArchiveNode*)tqparent)->getArchive();
}
}
@@ -600,7 +600,7 @@ void KDatMainWindow::doVerify( bool restore )
ranges.addRange( it.current()->getStart(), it.current()->getEnd() );
}
if ( rangeableNode->isType( Node::MountedArchiveNodeType ) ) {
- // Make sure the mounted archive node has populated its children.
+ // Make sure the mounted archive node has populated its tqchildren.
archiveNode = (MountedArchiveNode*)rangeableNode;
if ( archiveNode->childCount() == 0 ) {
bool dummy = TRUE;
@@ -608,10 +608,10 @@ void KDatMainWindow::doVerify( bool restore )
}
for ( int i = rangeableNode->childCount() - 1; i >= 0; i-- ) {
- if ( ((Node*)rangeableNode->childAt( i ))->isType( Node::MountedTapeDirectoryNodeType ) ) {
- files.append( ((MountedTapeDirectoryNode*)rangeableNode->childAt( i ))->getFullPath() );
- } else if ( ((Node*)rangeableNode->childAt( i ))->isType( Node::MountedTapeFileNodeType ) ) {
- files.append( ((MountedTapeFileNode*)rangeableNode->childAt( i ))->getFullPath() );
+ if ( ((Node*)rangeableNode->tqchildAt( i ))->isType( Node::MountedTapeDirectoryNodeType ) ) {
+ files.append( ((MountedTapeDirectoryNode*)rangeableNode->tqchildAt( i ))->getFullPath() );
+ } else if ( ((Node*)rangeableNode->tqchildAt( i ))->isType( Node::MountedTapeFileNodeType ) ) {
+ files.append( ((MountedTapeFileNode*)rangeableNode->tqchildAt( i ))->getFullPath() );
} else {
assert( FALSE );
}
@@ -627,14 +627,14 @@ void KDatMainWindow::doVerify( bool restore )
// Compile a list of files to verify/restore.
TQPtrStack<RangeableNode> stack;
- // Make sure the mounted archive node has populated its children.
+ // Make sure the mounted archive node has populated its tqchildren.
if ( archiveNode->childCount() == 0 ) {
bool dummy = TRUE;
archiveNode->expanding( dummy );
}
for ( int i = archiveNode->childCount() - 1; i >= 0; i-- ) {
- stack.push( (RangeableNode*)archiveNode->childAt( i ) );
+ stack.push( (RangeableNode*)archiveNode->tqchildAt( i ) );
}
RangeableNode* sel = 0;
while ( stack.count() > 0 ) {
@@ -654,7 +654,7 @@ void KDatMainWindow::doVerify( bool restore )
}
} else if ( sel->hasSelectedChildren() ) {
for ( int i = sel->childCount() - 1; i >= 0; i-- ) {
- stack.push( (RangeableNode*)sel->childAt( i ) );
+ stack.push( (RangeableNode*)sel->tqchildAt( i ) );
}
}
}
@@ -697,7 +697,7 @@ void KDatMainWindow::fileMountTape()
"correct device is selected as the tape drive (e.g.\n"
"/dev/st0). If you hear the tape drive moving, wait\n"
"until it stops and then try mounting it again.")
- .arg(Options::instance()->getTapeDevice());
+ .tqarg(Options::instance()->getTapeDevice());
if ( !TapeManager::instance()->getMountedTape() ) {
if ( Options::instance()->getLoadOnMount() ) {
@@ -727,7 +727,7 @@ void KDatMainWindow::fileIndexTape()
IndexDlg dlg( TapeManager::instance()->getMountedTape(), this );
if ( dlg.exec() == TQDialog::Accepted ) {
TQString title;
- title = i18n( "KDat: %1" ).arg( TapeManager::instance()->getMountedTape()->getName() );
+ title = i18n( "KDat: %1" ).tqarg( TapeManager::instance()->getMountedTape()->getName() );
setCaption( title );
setIconText( title );
@@ -776,7 +776,7 @@ void KDatMainWindow::fileDeleteArchive()
}
TQString msg =
- i18n( "An archive cannot be removed from the middle of the tape. If\nthe archive '%1' is deleted then\nthe following archives will also be deleted:\n%2\n\nDelete all listed archives?" ).arg(archive->getName()).arg(list);
+ i18n( "An archive cannot be removed from the middle of the tape. If\nthe archive '%1' is deleted then\nthe following archives will also be deleted:\n%2\n\nDelete all listed archives?" ).tqarg(archive->getName()).tqarg(list);
int result = KMessageBox::warningContinueCancel( this,
msg, i18n("Delete Archive"), i18n("Delete All"));
if (result == KMessageBox::Continue) {
@@ -790,7 +790,7 @@ void KDatMainWindow::fileDeleteArchive()
} else {
// This is the last (known) archive on the tape.
TQString msg =
- i18n( "Really delete the archive '%1'?" ).arg(archive->getName());
+ i18n( "Really delete the archive '%1'?" ).tqarg(archive->getName());
int result = KMessageBox::warningContinueCancel( this,
msg, i18n("Delete Archive"), i18n("Delete"));
if (result == KMessageBox::Continue) {
@@ -824,7 +824,7 @@ void KDatMainWindow::fileDeleteIndex()
}
TQString msg =
- i18n( "Really delete the index for '%1'?" ).arg(tape->getName());
+ i18n( "Really delete the index for '%1'?" ).tqarg(tape->getName());
int result = KMessageBox::warningContinueCancel( this,
msg, i18n("Delete Tape Index"), i18n("Delete"));
if (result == KMessageBox::Continue) {
@@ -847,7 +847,7 @@ void KDatMainWindow::fileFormatTape()
"correct device is selected as the tape drive (e.g.\n"
"/dev/st0). If you hear the tape drive moving, wait\n"
"until it stops and then try mounting it again.")
- .arg(Options::instance()->getTapeDevice());
+ .tqarg(Options::instance()->getTapeDevice());
if ( !TapeDrive::instance()->isTapePresent() ) {
KMessageBox::sorry( this, msg );
@@ -865,7 +865,7 @@ void KDatMainWindow::fileFormatTape()
i18n("Format Tape"), i18n("Format"));
if (result == KMessageBox::Continue ) {
TQString name;
- name = i18n( "Tape created on %1" ).arg( KGlobal::locale()->formatDate(TQDate::currentDate(), true) );
+ name = i18n( "Tape created on %1" ).tqarg( KGlobal::locale()->formatDate(TQDate::tqcurrentDate(), true) );
FormatOptDlg dlg( name.stripWhiteSpace(), this );
if ( dlg.exec() != TQDialog::Accepted ) {
return;
@@ -898,7 +898,7 @@ void KDatMainWindow::fileNewBackupProfile()
// Pick a unique name.
TQString name;
for ( int i = 1; ; i++ ) {
- name = i18n( "Backup Profile %1").arg( i );
+ name = i18n( "Backup Profile %1").tqarg( i );
TQStringList list = BackupProfileManager::instance()->getBackupProfileNames();
TQStringList::Iterator it = list.begin();
for ( ; it != list.end(); ++it ) {
@@ -946,7 +946,7 @@ void KDatMainWindow::fileDeleteBackupProfile()
assert( backupProfile );
TQString msg =
- i18n("Really delete backup profile '%1'?").arg(backupProfile->getName());
+ i18n("Really delete backup profile '%1'?").tqarg(backupProfile->getName());
int result = KMessageBox::warningContinueCancel( this,
msg, i18n("Delete Backup Profile"), i18n("Delete"));
if (result == KMessageBox::Continue) {
@@ -1003,7 +1003,7 @@ void KDatMainWindow::setTapePresent( bool tapePresent, bool eject )
KMessageBox::sorry( this, i18n( "This tape has not been formatted by KDat." ));
} else {
int result = KMessageBox::questionYesNo( this,
- i18n( "This tape has not been formatted by KDat.\n\nWould you like to format it now?" ), TQString::null, i18n("Format"), i18n("Do Not Format"));
+ i18n( "This tape has not been formatted by KDat.\n\nWould you like to format it now?" ), TQString(), i18n("Format"), i18n("Do Not Format"));
if (result == KMessageBox::Yes) {
fileFormatTape();
return;
@@ -1098,19 +1098,19 @@ int KDatMainWindow::calcBackupSize( const TQString& workingDir, bool local, cons
TQString msg;
// msg.truncate( 4095 );
TQDir dir;
- const QFileInfoList* infoList;
+ const TQFileInfoList* infoList;
while ( !dirStack.isEmpty() ) {
if( stop_flag == TRUE ) break;
TQString* path = dirStack.pop();
msg = i18n("Estimating backup size: %1, %2" )
- .arg(Util::kbytesToString( size / 2 ))
- .arg(KStringHandler::csqueeze(*path, 60));
+ .tqarg(Util::kbytesToString( size / 2 ))
+ .tqarg(KStringHandler::csqueeze(*path, 60));
status( msg );
KApplication::kApplication()->processEvents();
dir.setPath( *path );
infoList = dir.entryInfoList( TQDir::Hidden | TQDir::Files | TQDir::Dirs, 0 );
if ( infoList ) {
- QFileInfoListIterator i( *infoList );
+ TQFileInfoListIterator i( *infoList );
for ( ; i.current(); ++i ) {
if ( ( i.current()->fileName() != "." ) && ( i.current()->fileName() != ".." ) ) {
size++;
@@ -1165,7 +1165,7 @@ void KDatMainWindow::getBackupFiles( TQStringList& files )
files.append( sel->getFullPath() );
} else if ( sel->hasSelectedChildren() ) {
for ( int i = sel->childCount() - 1; i >= 0; i-- ) {
- stack.push( (ArchiveableNode*)sel->childAt( i ) );
+ stack.push( (ArchiveableNode*)sel->tqchildAt( i ) );
}
}
}
@@ -1192,9 +1192,9 @@ void KDatMainWindow::setBackupFiles( const TQStringList& files )
}
int i;
for ( i = n->childCount() - 1; i >=0; i-- ) {
- tmp = ((ArchiveableNode*)n->childAt( i ))->getFullPath();
+ tmp = ((ArchiveableNode*)n->tqchildAt( i ))->getFullPath();
if ( tmp == (*it).left( tmp.length() ) ) {
- n = (ArchiveableNode*)n->childAt( i );
+ n = (ArchiveableNode*)n->tqchildAt( i );
break;
}
}
@@ -1232,7 +1232,7 @@ void KDatMainWindow::configureUI( Tape* tape )
// Title bar
if ( tape ) {
TQString title;
- title = i18n( "KDat: %1" ).arg(tape->getName());
+ title = i18n( "KDat: %1" ).tqarg(tape->getName());
setCaption( title );
setIconText( title );
} else {
@@ -1251,8 +1251,8 @@ void KDatMainWindow::configureUI( Tape* tape )
bool canRestore = ( tape ) && ( sel ) && sel->isType( Node::RangeableNodeType );
if ( !canRestore ) {
for ( int i = _tapeDriveNode->childCount() - 1; i >= 0; i-- ) {
- if ( ( ((SelectableNode*)_tapeDriveNode->childAt( i ))->isSelected() ) ||
- ( ((SelectableNode*)_tapeDriveNode->childAt( i ))->hasSelectedChildren() )) {
+ if ( ( ((SelectableNode*)_tapeDriveNode->tqchildAt( i ))->isSelected() ) ||
+ ( ((SelectableNode*)_tapeDriveNode->tqchildAt( i ))->hasSelectedChildren() )) {
canRestore = TRUE;
break;
}
@@ -1263,10 +1263,10 @@ void KDatMainWindow::configureUI( Tape* tape )
// even if sel==NULL when a child is selected (see loop above).
if( sel != (Node *)0x0 )
{
- for ( Node* parent = (Node*)sel->getParent();
- ( parent ) && ( parent->getParent() );
- parent = (Node*)parent->getParent() ) {
- if ( parent->isType( Node::TapeNodeType ) ) {
+ for ( Node* tqparent = (Node*)sel->getParent();
+ ( tqparent ) && ( tqparent->getParent() );
+ tqparent = (Node*)tqparent->getParent() ) {
+ if ( tqparent->isType( Node::TapeNodeType ) ) {
canRestore = FALSE;
}
}
@@ -1348,7 +1348,7 @@ void KDatMainWindow::create_backup_dialog()
_lbl->setGeometry( TQRect( 30, 20, 350, 200 ) );
_cancel = new KPushButton( KStdGuiItem::cancel(), _backupdialog );
- _cancel->setFixedSize( 80, _cancel->sizeHint().height() );
+ _cancel->setFixedSize( 80, _cancel->tqsizeHint().height() );
_cancel->setEnabled( TRUE );
/* 2002-01-24 LEW: looks like we can't increase the button width
to accomodate a wider message :( */
@@ -1357,7 +1357,7 @@ void KDatMainWindow::create_backup_dialog()
connect( _cancel, TQT_SIGNAL( clicked() ), this, TQT_SLOT( backupCancel() ) );
_continue = new KPushButton( KStdGuiItem::cont(), _backupdialog );
- _continue->setFixedSize( 80, _continue->sizeHint().height() );
+ _continue->setFixedSize( 80, _continue->tqsizeHint().height() );
_continue->setEnabled( TRUE );
_continue->setDefault( TRUE );
// _continue->setGeometry( TQRect( 200, 170, 0, 0 ) ); /* 2002-01-28 LEW */