summaryrefslogtreecommitdiffstats
path: root/kdat/KDatMainWindow.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:25:18 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:25:18 +0000
commitaa3a1ca934bc541bddd3fa136a85f106f7da266e (patch)
tree9ad0b795aed8fa4ac30c2fe0fd1aacb8175714c0 /kdat/KDatMainWindow.cpp
parentb10cf7066791a2f362495890cd50c984e8025412 (diff)
downloadtdeadmin-aa3a1ca934bc541bddd3fa136a85f106f7da266e.tar.gz
tdeadmin-aa3a1ca934bc541bddd3fa136a85f106f7da266e.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeadmin@1157635 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdat/KDatMainWindow.cpp')
-rw-r--r--kdat/KDatMainWindow.cpp280
1 files changed, 140 insertions, 140 deletions
diff --git a/kdat/KDatMainWindow.cpp b/kdat/KDatMainWindow.cpp
index 925ad92..bd14b8e 100644
--- a/kdat/KDatMainWindow.cpp
+++ b/kdat/KDatMainWindow.cpp
@@ -22,12 +22,12 @@
#include <sys/stat.h>
#include <stdlib.h>
-#include <qdatetime.h>
-#include <qdir.h>
-#include <qfileinfo.h>
-#include <qkeycode.h>
-#include <qlayout.h>
-#include <qtextstream.h>
+#include <tqdatetime.h>
+#include <tqdir.h>
+#include <tqfileinfo.h>
+#include <tqkeycode.h>
+#include <tqlayout.h>
+#include <tqtextstream.h>
#include <kapplication.h>
#include <kiconloader.h>
@@ -68,7 +68,7 @@
#include "kdat.h"
#include "ktreeview.h"
#include <klocale.h>
-#include <qsplitter.h>
+#include <tqsplitter.h>
#include <kstatusbar.h>
#include "KDatMainWindow.moc"
@@ -97,75 +97,75 @@ KDatMainWindow::KDatMainWindow()
setCaption( i18n( "KDat: <no tape>" ) );
// Create object popup menus.
- _tapeDriveMenu = new QPopupMenu();
- _tapeDriveMenu->insertItem( i18n( "Mount Tape" ) , this, SLOT( fileMountTape() ) );
- _tapeDriveMenu->insertItem( i18n( "Recreate Tape Index" ), this, SLOT( fileIndexTape() ) );
+ _tapeDriveMenu = new TQPopupMenu();
+ _tapeDriveMenu->insertItem( i18n( "Mount Tape" ) , this, TQT_SLOT( fileMountTape() ) );
+ _tapeDriveMenu->insertItem( i18n( "Recreate Tape Index" ), this, TQT_SLOT( fileIndexTape() ) );
_tapeDriveMenu->insertSeparator();
- _tapeDriveMenu->insertItem( i18n( "Format Tape..." ), this, SLOT( fileFormatTape() ) );
+ _tapeDriveMenu->insertItem( i18n( "Format Tape..." ), this, TQT_SLOT( fileFormatTape() ) );
- _archiveMenu = new QPopupMenu();
- _archiveMenu->insertItem( i18n( "Delete Archive" ), this, SLOT( fileDeleteArchive() ) );
+ _archiveMenu = new TQPopupMenu();
+ _archiveMenu->insertItem( i18n( "Delete Archive" ), this, TQT_SLOT( fileDeleteArchive() ) );
- _mountedArchiveMenu = new QPopupMenu();
- _mountedArchiveMenu->insertItem( i18n( "Verify..." ) , this, SLOT( fileVerify() ) );
- _mountedArchiveMenu->insertItem( i18n( "Restore..." ) , this, SLOT( fileRestore() ) );
+ _mountedArchiveMenu = new TQPopupMenu();
+ _mountedArchiveMenu->insertItem( i18n( "Verify..." ) , this, TQT_SLOT( fileVerify() ) );
+ _mountedArchiveMenu->insertItem( i18n( "Restore..." ) , this, TQT_SLOT( fileRestore() ) );
_mountedArchiveMenu->insertSeparator();
- _mountedArchiveMenu->insertItem( i18n( "Delete Archive" ), this, SLOT( fileDeleteArchive() ) );
+ _mountedArchiveMenu->insertItem( i18n( "Delete Archive" ), this, TQT_SLOT( fileDeleteArchive() ) );
- _mountedTapeFileMenu = new QPopupMenu();
- _mountedTapeFileMenu->insertItem( i18n( "Verify..." ) , this, SLOT( fileVerify() ) );
- _mountedTapeFileMenu->insertItem( i18n( "Restore..." ), this, SLOT( fileRestore() ) );
+ _mountedTapeFileMenu = new TQPopupMenu();
+ _mountedTapeFileMenu->insertItem( i18n( "Verify..." ) , this, TQT_SLOT( fileVerify() ) );
+ _mountedTapeFileMenu->insertItem( i18n( "Restore..." ), this, TQT_SLOT( fileRestore() ) );
- _localFileMenu = new QPopupMenu();
- _localFileMenu->insertItem( i18n( "Backup..." ), this, SLOT( fileBackup() ) );
+ _localFileMenu = new TQPopupMenu();
+ _localFileMenu->insertItem( i18n( "Backup..." ), this, TQT_SLOT( fileBackup() ) );
- _tapeMenu = new QPopupMenu();
- _tapeMenu->insertItem( i18n( "Delete Tape Index" ), this, SLOT( fileDeleteIndex() ) );
+ _tapeMenu = new TQPopupMenu();
+ _tapeMenu->insertItem( i18n( "Delete Tape Index" ), this, TQT_SLOT( fileDeleteIndex() ) );
- _backupProfileRootMenu = new QPopupMenu();
- _backupProfileRootMenu->insertItem( i18n( "Create Backup Profile" ), this, SLOT( fileNewBackupProfile() ) );
+ _backupProfileRootMenu = new TQPopupMenu();
+ _backupProfileRootMenu->insertItem( i18n( "Create Backup Profile" ), this, TQT_SLOT( fileNewBackupProfile() ) );
- _backupProfileMenu = new QPopupMenu();
- _backupProfileMenu->insertItem( i18n( "Backup..." ), this, SLOT( fileBackup() ) );
+ _backupProfileMenu = new TQPopupMenu();
+ _backupProfileMenu->insertItem( i18n( "Backup..." ), this, TQT_SLOT( fileBackup() ) );
_backupProfileMenu->insertSeparator();
- _backupProfileMenu->insertItem( i18n( "Delete Backup Profile" ), this, SLOT( fileDeleteBackupProfile() ) );
+ _backupProfileMenu->insertItem( i18n( "Delete Backup Profile" ), this, TQT_SLOT( fileDeleteBackupProfile() ) );
_fileMenu = new QPopupMenu;
- _fileMenu->insertItem( i18n( "Backup..." ) , this, SLOT( fileBackup() ) );
- _fileMenu->insertItem( i18n( "Restore..." ) , this, SLOT( fileRestore() ) );
- _fileMenu->insertItem( i18n( "Verify..." ) , this, SLOT( fileVerify() ) );
- _fileMenu->insertItem( i18n( "Mount Tape" ) , this, SLOT( fileMountTape() ) );
- _fileMenu->insertItem( i18n( "Recreate Tape Index" ) , this, SLOT( fileIndexTape() ) );
- _fileMenu->insertItem( i18n( "Create Backup Profile" ), this, SLOT( fileNewBackupProfile() ) );
+ _fileMenu->insertItem( i18n( "Backup..." ) , this, TQT_SLOT( fileBackup() ) );
+ _fileMenu->insertItem( i18n( "Restore..." ) , this, TQT_SLOT( fileRestore() ) );
+ _fileMenu->insertItem( i18n( "Verify..." ) , this, TQT_SLOT( fileVerify() ) );
+ _fileMenu->insertItem( i18n( "Mount Tape" ) , this, TQT_SLOT( fileMountTape() ) );
+ _fileMenu->insertItem( i18n( "Recreate Tape Index" ) , this, TQT_SLOT( fileIndexTape() ) );
+ _fileMenu->insertItem( i18n( "Create Backup Profile" ), this, TQT_SLOT( fileNewBackupProfile() ) );
_fileMenu->insertSeparator();
- _fileMenu->insertItem( i18n( "Delete Archive" ) , this, SLOT( fileDeleteArchive() ) );
- _fileMenu->insertItem( i18n( "Delete Index" ) , this, SLOT( fileDeleteIndex() ) );
- _fileMenu->insertItem( i18n( "Delete Backup Profile" ), this, SLOT( fileDeleteBackupProfile() ) );
- _fileMenu->insertItem( i18n( "Format Tape..." ) , this, SLOT( fileFormatTape() ) );
+ _fileMenu->insertItem( i18n( "Delete Archive" ) , this, TQT_SLOT( fileDeleteArchive() ) );
+ _fileMenu->insertItem( i18n( "Delete Index" ) , this, TQT_SLOT( fileDeleteIndex() ) );
+ _fileMenu->insertItem( i18n( "Delete Backup Profile" ), this, TQT_SLOT( fileDeleteBackupProfile() ) );
+ _fileMenu->insertItem( i18n( "Format Tape..." ) , this, TQT_SLOT( fileFormatTape() ) );
_fileMenu->insertSeparator();
- _fileMenu->insertItem( SmallIcon("exit"), i18n( "&Quit" ) , this, SLOT( fileQuit() ), CTRL + Key_Q );
+ _fileMenu->insertItem( SmallIcon("exit"), i18n( "&Quit" ) , this, TQT_SLOT( fileQuit() ), CTRL + Key_Q );
_editMenu = new QPopupMenu;
- _editMenu->insertItem( SmallIcon("configure"), i18n( "Configure KDat..." ) , this, SLOT( editPreferences() ) );
+ _editMenu->insertItem( SmallIcon("configure"), i18n( "Configure KDat..." ) , this, TQT_SLOT( editPreferences() ) );
_menu = new KMenuBar( this );
_menu->insertItem( i18n( "&File" ), _fileMenu );
_menu->insertItem( i18n( "&Settings" ), _editMenu );
_menu->insertSeparator();
- QString 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" ).arg( KDAT_VERSION );
_menu->insertItem( i18n( "&Help" ), helpMenu( about ) );
_toolbar = new KToolBar( this );
- _toolbar->insertButton( *ImageCache::instance()->getTapeUnmounted(), 0, SIGNAL( clicked( int ) ), this, SLOT( fileMountTape() ), TRUE, i18n( "Mount/unmount tape" ) );
+ _toolbar->insertButton( *ImageCache::instance()->getTapeUnmounted(), 0, TQT_SIGNAL( clicked( int ) ), this, TQT_SLOT( fileMountTape() ), TRUE, i18n( "Mount/unmount tape" ) );
_toolbar->insertSeparator();
- _toolbar->insertButton( *ImageCache::instance()->getBackup() , 1, SIGNAL( clicked( int ) ), this, SLOT( fileBackup() ) , TRUE, i18n( "Backup" ) );
+ _toolbar->insertButton( *ImageCache::instance()->getBackup() , 1, TQT_SIGNAL( clicked( int ) ), this, TQT_SLOT( fileBackup() ) , TRUE, i18n( "Backup" ) );
_toolbar->setButtonIconSet( 1, BarIconSet("kdat_backup"));
- _toolbar->insertButton( *ImageCache::instance()->getRestore(), 2, SIGNAL( clicked( int ) ), this, SLOT( fileRestore() ), TRUE, i18n( "Restore" ) );
+ _toolbar->insertButton( *ImageCache::instance()->getRestore(), 2, TQT_SIGNAL( clicked( int ) ), this, TQT_SLOT( fileRestore() ), TRUE, i18n( "Restore" ) );
_toolbar->setButtonIconSet( 2, BarIconSet("kdat_restore"));
- _toolbar->insertButton( *ImageCache::instance()->getVerify() , 3, SIGNAL( clicked( int ) ), this, SLOT( fileVerify() ) , TRUE, i18n( "Verify" ) );
+ _toolbar->insertButton( *ImageCache::instance()->getVerify() , 3, TQT_SIGNAL( clicked( int ) ), 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 QSplitter( QSplitter::Horizontal, this, "panner");
+ _panner = new TQSplitter( TQSplitter::Horizontal, this, "panner");
#else
- _panner = new QSplitter( QSplitter::Vertical, this, "panner");
+ _panner = new TQSplitter( TQSplitter::Vertical, this, "panner");
#endif /* KDAT_HORIZONTAL_LAYOUT */
// Create info viewers.
@@ -197,12 +197,12 @@ KDatMainWindow::KDatMainWindow()
_tree->setMinimumHeight( 300 );
#endif /* KDAT_HORIZONTAL_LAYOUT */
- connect( _tree, SIGNAL( expanding( KTreeViewItem*, bool& ) ), this, SLOT( localExpanding( KTreeViewItem*, bool& ) ) );
- connect( _tree, SIGNAL( expanded( int ) ), this, SLOT( localExpanded( int ) ) );
- connect( _tree, SIGNAL( collapsed( int ) ), this, SLOT( localCollapsed( int ) ) );
- connect( _tree, SIGNAL( selected( int ) ), this, SLOT( localSelected( int ) ) );
- connect( _tree, SIGNAL( highlighted( int ) ), this, SLOT( localHighlighted( int ) ) );
- connect( _tree, SIGNAL( popupMenu( int, const QPoint& ) ), this, SLOT( localPopupMenu( int, const QPoint& ) ) );
+ connect( _tree, TQT_SIGNAL( expanding( KTreeViewItem*, bool& ) ), this, TQT_SLOT( localExpanding( KTreeViewItem*, bool& ) ) );
+ connect( _tree, TQT_SIGNAL( expanded( int ) ), this, TQT_SLOT( localExpanded( int ) ) );
+ connect( _tree, TQT_SIGNAL( collapsed( int ) ), this, TQT_SLOT( localCollapsed( int ) ) );
+ connect( _tree, TQT_SIGNAL( selected( int ) ), this, TQT_SLOT( localSelected( int ) ) );
+ connect( _tree, TQT_SIGNAL( highlighted( int ) ), this, TQT_SLOT( localHighlighted( int ) ) );
+ connect( _tree, TQT_SIGNAL( popupMenu( int, const TQPoint& ) ), this, TQT_SLOT( localPopupMenu( int, const TQPoint& ) ) );
setCentralWidget( _panner );
@@ -211,14 +211,14 @@ KDatMainWindow::KDatMainWindow()
_tree->insertItem( _backupProfileRootNode = new BackupProfileRootNode() );
_tree->insertItem( new TapeIndexRootNode() );
- connect( TapeDrive::instance(), SIGNAL( sigStatus( const QString & ) ), this, SLOT( status( const QString & ) ) );
+ connect( TapeDrive::instance(), TQT_SIGNAL( sigStatus( const TQString & ) ), this, TQT_SLOT( status( const TQString & ) ) );
setTapePresent( FALSE );
- connect( Options::instance(), SIGNAL( sigTapeDevice() ), this, SLOT( slotTapeDevice() ) );
+ connect( Options::instance(), TQT_SIGNAL( sigTapeDevice() ), this, TQT_SLOT( slotTapeDevice() ) );
- connect( TapeManager::instance(), SIGNAL( sigTapeMounted() ) , this, SLOT( slotTapeMounted() ) );
- connect( TapeManager::instance(), SIGNAL( sigTapeUnmounted() ), this, SLOT( slotTapeUnmounted() ) );
+ connect( TapeManager::instance(), TQT_SIGNAL( sigTapeMounted() ) , this, TQT_SLOT( slotTapeMounted() ) );
+ connect( TapeManager::instance(), TQT_SIGNAL( sigTapeUnmounted() ), this, TQT_SLOT( slotTapeUnmounted() ) );
configureUI( 0 );
}
@@ -241,7 +241,7 @@ KDatMainWindow::~KDatMainWindow()
}
-void KDatMainWindow::popupTapeDriveMenu( const QPoint& p )
+void KDatMainWindow::popupTapeDriveMenu( const TQPoint& p )
{
// Configure menu before popping up.
if ( TapeManager::instance()->getMountedTape() ) {
@@ -255,22 +255,22 @@ void KDatMainWindow::popupTapeDriveMenu( const QPoint& p )
_tapeDriveMenu->popup( p );
}
-void KDatMainWindow::popupArchiveMenu( const QPoint& p )
+void KDatMainWindow::popupArchiveMenu( const TQPoint& p )
{
_archiveMenu->popup( p );
}
-void KDatMainWindow::popupMountedArchiveMenu( const QPoint& p )
+void KDatMainWindow::popupMountedArchiveMenu( const TQPoint& p )
{
_mountedArchiveMenu->popup( p );
}
-void KDatMainWindow::popupMountedTapeFileMenu( const QPoint& p )
+void KDatMainWindow::popupMountedTapeFileMenu( const TQPoint& p )
{
_mountedTapeFileMenu->popup( p );
}
-void KDatMainWindow::popupLocalFileMenu( const QPoint& p )
+void KDatMainWindow::popupLocalFileMenu( const TQPoint& p )
{
// Configure menu before popping up.
_localFileMenu->setItemEnabled( _localFileMenu->idAt( 0 ), ( TapeManager::instance()->getMountedTape() != 0 ) && ( !TapeDrive::instance()->isReadOnly() ) );
@@ -278,17 +278,17 @@ void KDatMainWindow::popupLocalFileMenu( const QPoint& p )
_localFileMenu->popup( p );
}
-void KDatMainWindow::popupTapeMenu( const QPoint& p )
+void KDatMainWindow::popupTapeMenu( const TQPoint& p )
{
_tapeMenu->popup( p );
}
-void KDatMainWindow::popupBackupProfileRootMenu( const QPoint& p )
+void KDatMainWindow::popupBackupProfileRootMenu( const TQPoint& p )
{
_backupProfileRootMenu->popup( p );
}
-void KDatMainWindow::popupBackupProfileMenu( const QPoint& p )
+void KDatMainWindow::popupBackupProfileMenu( const TQPoint& p )
{
// Configure menu before popping up.
_backupProfileMenu->setItemEnabled( _backupProfileMenu->idAt( 0 ), ( TapeManager::instance()->getMountedTape() != 0 ) && ( !TapeDrive::instance()->isReadOnly() ) );
@@ -345,7 +345,7 @@ void KDatMainWindow::showTapeFileInfo( File* file )
_tapeFileInfo->show();
}
-void KDatMainWindow::showFileInfo( const QString & name )
+void KDatMainWindow::showFileInfo( const TQString & name )
{
assert( !name.isNull() );
@@ -402,7 +402,7 @@ void KDatMainWindow::localHighlighted( int index )
configureUI( TapeManager::instance()->getMountedTape() );
}
-void KDatMainWindow::localPopupMenu( int index, const QPoint& p )
+void KDatMainWindow::localPopupMenu( int index, const TQPoint& p )
{
Node* item = (Node*)_tree->itemAt( index );
item->popupMenu( p );
@@ -416,11 +416,11 @@ void KDatMainWindow::fileBackup()
// To the i18n translator: I apologize for this long text on the last day to submit
// i18n changes. But, the program isn't very usable without this information. Thanks. LEW
// (later today): now the program works correctly! Why? Beats me!
- QString msg = i18n("KDat will dump your files properly to tape, but may not be able\n"
+ 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());
- QString msg2 = i18n("For example, if your device is /dev/st0, the non-rewinding version\n"
+ 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"
"tape drive. Substitute that name for /dev/nst0 below.\n"
@@ -445,11 +445,11 @@ void KDatMainWindow::fileBackup()
backupProfile.setSnapshotFile( bp->getSnapshotFile() );
backupProfile.setRemoveSnapshot( bp->getRemoveSnapshot() );
} else {
- QString name;
- name = i18n( "Archive created on %1" ).arg( KGlobal::locale()->formatDate(QDate::currentDate(), true) );
+ TQString name;
+ name = i18n( "Archive created on %1" ).arg( KGlobal::locale()->formatDate(TQDate::currentDate(), true) );
name = name.stripWhiteSpace();
- QStringList files;
+ TQStringList files;
getBackupFiles( files );
backupProfile.setArchiveName( name );
@@ -462,7 +462,7 @@ void KDatMainWindow::fileBackup()
int ret = 0;
BackupOptDlg dlg( &backupProfile, this );
- if ( dlg.exec() == QDialog::Accepted ) {
+ if ( dlg.exec() == TQDialog::Accepted ) {
// Begin backup.
status( i18n( "Performing backup..." ) );
int size = calcBackupSize( dlg.getWorkingDirectory(), dlg.isOneFilesystem(), dlg.getRelativeFiles(), dlg.isIncremental(), dlg.getSnapshotFile(), dlg.getRemoveSnapshot() );
@@ -475,14 +475,14 @@ void KDatMainWindow::fileBackup()
// Make sure the archive will fit on the tape.
int tapeSize = 1;
- QPtrListIterator<Archive> i( TapeManager::instance()->getMountedTape()->getChildren() );
+ TQPtrListIterator<Archive> i( TapeManager::instance()->getMountedTape()->getChildren() );
if ( i.toLast() != NULL ) {
tapeSize = i.current()->getEndBlock();
tapeSize = (int)((float)tapeSize / 1024.0 * (float)Options::instance()->getTapeBlockSize()) + 1;
}
if ( tapeSize + size >= TapeManager::instance()->getMountedTape()->getSize() ) {
// Warn user that tape is probably too short.
- QString msg;
+ TQString msg;
msg = i18n( "WARNING: The estimated archive size is %1 KB but "
"the tape has only %2 KB of space!\n"
"Back up anyway?" )
@@ -531,7 +531,7 @@ void KDatMainWindow::fileBackup()
}
// All done.
- if ( ret == QDialog::Accepted ) {
+ if ( ret == TQDialog::Accepted ) {
status( i18n( "Backup complete." ) );
} else {
status( i18n( "Backup aborted." ) );
@@ -552,7 +552,7 @@ void KDatMainWindow::doVerify( bool restore )
{
RangeableNode* rangeableNode = 0;
MountedArchiveNode* archiveNode = 0;
- QStringList files;
+ TQStringList files;
Archive* archive = 0;
// Check for marked files first.
for ( int i = _tapeDriveNode->childCount() - 1; i >= 0; i-- ) {
@@ -586,7 +586,7 @@ void KDatMainWindow::doVerify( bool restore )
}
assert( archive );
- QPtrListIterator<Archive> it( archive->getTape()->getChildren() );
+ TQPtrListIterator<Archive> it( archive->getTape()->getChildren() );
int fileno;
for ( fileno = 1; ( it.current() ) && ( it.current() != archive ); ++it, fileno++ );
@@ -595,7 +595,7 @@ void KDatMainWindow::doVerify( bool restore )
RangeList ranges;
if ( rangeableNode ) {
- QPtrListIterator<Range> it( rangeableNode->getRanges() );
+ TQPtrListIterator<Range> it( rangeableNode->getRanges() );
for ( ; it.current(); ++it ) {
ranges.addRange( it.current()->getStart(), it.current()->getEnd() );
}
@@ -625,7 +625,7 @@ void KDatMainWindow::doVerify( bool restore )
}
} else {
// Compile a list of files to verify/restore.
- QPtrStack<RangeableNode> stack;
+ TQPtrStack<RangeableNode> stack;
// Make sure the mounted archive node has populated its children.
if ( archiveNode->childCount() == 0 ) {
@@ -640,7 +640,7 @@ void KDatMainWindow::doVerify( bool restore )
while ( stack.count() > 0 ) {
sel = stack.pop();
if ( sel->isSelected() ) {
- QPtrListIterator<Range> it( sel->getRanges() );
+ TQPtrListIterator<Range> it( sel->getRanges() );
for ( ; it.current(); ++it ) {
ranges.addRange( it.current()->getStart(), it.current()->getEnd() );
}
@@ -662,7 +662,7 @@ void KDatMainWindow::doVerify( bool restore )
char buf[1024];
VerifyOptDlg dlg( getcwd( buf, 1024 ), files, restore, this );
- if ( dlg.exec() == QDialog::Accepted ) {
+ if ( dlg.exec() == TQDialog::Accepted ) {
if ( restore ) {
status( i18n( "Restore in progress..." ) );
} else {
@@ -671,7 +671,7 @@ void KDatMainWindow::doVerify( bool restore )
VerifyDlg verifyDlg( dlg.getWorkingDirectory(), fileno, ranges, restore, this );
int ret = verifyDlg.exec();
- if ( ret == QDialog::Accepted ) {
+ if ( ret == TQDialog::Accepted ) {
if ( restore ) {
status( i18n( "Restore complete." ) );
} else {
@@ -689,7 +689,7 @@ void KDatMainWindow::doVerify( bool restore )
void KDatMainWindow::fileMountTape()
{
- static QString msg;
+ static TQString msg;
// construct helpful error message (same as in fileFormatTape())
msg = i18n("There appears to be no tape in the drive %1. Please\n"
@@ -725,8 +725,8 @@ void KDatMainWindow::fileIndexTape()
if ( result == KMessageBox::Continue) {
TapeManager::instance()->getMountedTape()->clear();
IndexDlg dlg( TapeManager::instance()->getMountedTape(), this );
- if ( dlg.exec() == QDialog::Accepted ) {
- QString title;
+ if ( dlg.exec() == TQDialog::Accepted ) {
+ TQString title;
title = i18n( "KDat: %1" ).arg( TapeManager::instance()->getMountedTape()->getName() );
setCaption( title );
setIconText( title );
@@ -758,7 +758,7 @@ void KDatMainWindow::fileDeleteArchive()
assert( archive );
Tape* tape = archive->getTape();
- QPtrListIterator<Archive> i( tape->getChildren() );
+ TQPtrListIterator<Archive> i( tape->getChildren() );
for ( ; i.current(); ++i ) {
if ( i.current() == archive ) {
break;
@@ -769,13 +769,13 @@ void KDatMainWindow::fileDeleteArchive()
++i;
if ( i.current() ) {
// There are other archives after this one on the tape.
- QString list;
+ TQString list;
for ( ; i.current(); ++i ) {
list.append( "\n " );
list.append( i.current()->getName() );
}
- QString msg =
+ 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);
int result = KMessageBox::warningContinueCancel( this,
msg, i18n("Delete Archive"), i18n("Delete All"));
@@ -789,7 +789,7 @@ void KDatMainWindow::fileDeleteArchive()
}
} else {
// This is the last (known) archive on the tape.
- QString msg =
+ TQString msg =
i18n( "Really delete the archive '%1'?" ).arg(archive->getName());
int result = KMessageBox::warningContinueCancel( this,
msg, i18n("Delete Archive"), i18n("Delete"));
@@ -823,7 +823,7 @@ void KDatMainWindow::fileDeleteIndex()
return;
}
- QString msg =
+ TQString msg =
i18n( "Really delete the index for '%1'?" ).arg(tape->getName());
int result = KMessageBox::warningContinueCancel( this,
msg, i18n("Delete Tape Index"), i18n("Delete"));
@@ -839,7 +839,7 @@ void KDatMainWindow::fileDeleteIndex()
void KDatMainWindow::fileFormatTape()
{
- static QString msg;
+ static TQString msg;
// construct helpful error message (same as in fileMountTape())
msg = i18n("There appears to be no tape in the drive %1. Please\n"
@@ -864,10 +864,10 @@ void KDatMainWindow::fileFormatTape()
"Are you sure you want to continue?" ),
i18n("Format Tape"), i18n("Format"));
if (result == KMessageBox::Continue ) {
- QString name;
- name = i18n( "Tape created on %1" ).arg( KGlobal::locale()->formatDate(QDate::currentDate(), true) );
+ TQString name;
+ name = i18n( "Tape created on %1" ).arg( KGlobal::locale()->formatDate(TQDate::currentDate(), true) );
FormatOptDlg dlg( name.stripWhiteSpace(), this );
- if ( dlg.exec() != QDialog::Accepted ) {
+ if ( dlg.exec() != TQDialog::Accepted ) {
return;
}
@@ -896,11 +896,11 @@ void KDatMainWindow::fileNewBackupProfile()
BackupProfile* backupProfile = new BackupProfile();
// Pick a unique name.
- QString name;
+ TQString name;
for ( int i = 1; ; i++ ) {
name = i18n( "Backup Profile %1").arg( i );
- QStringList list = BackupProfileManager::instance()->getBackupProfileNames();
- QStringList::Iterator it = list.begin();
+ TQStringList list = BackupProfileManager::instance()->getBackupProfileNames();
+ TQStringList::Iterator it = list.begin();
for ( ; it != list.end(); ++it ) {
if ( name == *it ) {
break;
@@ -912,7 +912,7 @@ void KDatMainWindow::fileNewBackupProfile()
}
}
- QStringList files;
+ TQStringList files;
getBackupFiles( files );
backupProfile->setName( name );
@@ -945,7 +945,7 @@ void KDatMainWindow::fileDeleteBackupProfile()
BackupProfile* backupProfile = ((BackupProfileNode*)sel)->getBackupProfile();
assert( backupProfile );
- QString msg =
+ TQString msg =
i18n("Really delete backup profile '%1'?").arg(backupProfile->getName());
int result = KMessageBox::warningContinueCancel( this,
msg, i18n("Delete Backup Profile"), i18n("Delete"));
@@ -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?" ), QString::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::null, i18n("Format"), i18n("Do Not Format"));
if (result == KMessageBox::Yes) {
fileFormatTape();
return;
@@ -1020,7 +1020,7 @@ void KDatMainWindow::setTapePresent( bool tapePresent, bool eject )
}
}
-void KDatMainWindow::status( const QString & msg )
+void KDatMainWindow::status( const TQString & msg )
{
_statusBar->changeItem( msg, 0 );
KApplication::kApplication()->processEvents();
@@ -1035,26 +1035,26 @@ void KDatMainWindow::show()
// 2002-01-21 LEW: returns backup size in KB, or -1 if user chose
// to abort the backup.
-int KDatMainWindow::calcBackupSize( const QString& workingDir, bool local, const QStringList& files,
- bool incremental, const QString& snapshot, bool removeSnapshot )
+int KDatMainWindow::calcBackupSize( const TQString& workingDir, bool local, const TQStringList& files,
+ bool incremental, const TQString& snapshot, bool removeSnapshot )
{
int return_value;
- chdir( QFile::encodeName(workingDir) );
+ chdir( TQFile::encodeName(workingDir) );
bool useSnapshot = !snapshot.isEmpty() && !removeSnapshot;
int tmp = 0;
if ( incremental && !removeSnapshot ) {
- QFile snap( snapshot );
+ TQFile snap( snapshot );
if ( snap.exists() && snap.open( IO_ReadOnly ) ) {
- QTextStream t( &snap );
+ TQTextStream t( &snap );
t >> tmp;
} else {
useSnapshot = FALSE;
}
}
- QDateTime mtime;
+ TQDateTime mtime;
mtime.setTime_t( tmp );
int size = 0;
@@ -1065,12 +1065,12 @@ int KDatMainWindow::calcBackupSize( const QString& workingDir, bool local, const
// cancelled the backup via the dialog.
/* 2002-01-24 LEW: end of backup-cancel dialog */
- QStringList filesTmp = files;
- QStringList::Iterator ii = filesTmp.begin();
+ TQStringList filesTmp = files;
+ TQStringList::Iterator ii = filesTmp.begin();
for ( ; ii != filesTmp.end(); ++ii ) {
// Is this a normal file, or a directory?
- QFileInfo finfo( *ii );
+ TQFileInfo finfo( *ii );
if ( !finfo.isDir() ) {
if ( ( !useSnapshot ) || ( finfo.lastModified() > mtime ) ) {
size += finfo.size() / 512;
@@ -1081,34 +1081,34 @@ int KDatMainWindow::calcBackupSize( const QString& workingDir, bool local, const
continue;
}
- QPtrStack<QString> dirStack;
- dirStack.push( new QString( *ii ) );
+ TQPtrStack<TQString> dirStack;
+ dirStack.push( new TQString( *ii ) );
// If stay on one file system, get device of starting directory.
dev_t device = 0;
struct stat info;
if ( local ) {
- if ( lstat( QFile::encodeName(*ii), &info ) != 0 ) {
+ if ( lstat( TQFile::encodeName(*ii), &info ) != 0 ) {
device = 0;
} else {
device = info.st_dev;
}
}
- QString msg;
+ TQString msg;
// msg.truncate( 4095 );
- QDir dir;
+ TQDir dir;
const QFileInfoList* infoList;
while ( !dirStack.isEmpty() ) {
if( stop_flag == TRUE ) break;
- QString* path = dirStack.pop();
+ TQString* path = dirStack.pop();
msg = i18n("Estimating backup size: %1, %2" )
.arg(Util::kbytesToString( size / 2 ))
.arg(KStringHandler::csqueeze(*path, 60));
status( msg );
KApplication::kApplication()->processEvents();
dir.setPath( *path );
- infoList = dir.entryInfoList( QDir::Hidden | QDir::Files | QDir::Dirs, 0 );
+ infoList = dir.entryInfoList( TQDir::Hidden | TQDir::Files | TQDir::Dirs, 0 );
if ( infoList ) {
QFileInfoListIterator i( *infoList );
for ( ; i.current(); ++i ) {
@@ -1117,13 +1117,13 @@ int KDatMainWindow::calcBackupSize( const QString& workingDir, bool local, const
if ( i.current()->isSymLink() ) {
} else if ( i.current()->isDir() ) {
if ( local ) {
- if ( lstat( QFile::encodeName(i.current()->absFilePath()), &info ) == 0 ) {
+ if ( lstat( TQFile::encodeName(i.current()->absFilePath()), &info ) == 0 ) {
if ( device == info.st_dev ) {
- dirStack.push( new QString( i.current()->absFilePath() ) );
+ dirStack.push( new TQString( i.current()->absFilePath() ) );
}
}
} else {
- dirStack.push( new QString( i.current()->absFilePath() ) );
+ dirStack.push( new TQString( i.current()->absFilePath() ) );
}
} else if ( ( !useSnapshot ) || ( i.current()->lastModified() > mtime ) ) {
size += i.current()->size() / 512;
@@ -1147,7 +1147,7 @@ int KDatMainWindow::calcBackupSize( const QString& workingDir, bool local, const
return return_value;
}
-void KDatMainWindow::getBackupFiles( QStringList& files )
+void KDatMainWindow::getBackupFiles( TQStringList& files )
{
if ( !_rootNode->isSelected() && !_rootNode->hasSelectedChildren() ) {
// Backup the entire subtree.
@@ -1156,7 +1156,7 @@ void KDatMainWindow::getBackupFiles( QStringList& files )
}
} else {
// Compile a list of files to backup.
- QPtrStack<ArchiveableNode> stack;
+ TQPtrStack<ArchiveableNode> stack;
stack.push( _rootNode );
ArchiveableNode* sel = 0;
while ( stack.count() > 0 ) {
@@ -1172,13 +1172,13 @@ void KDatMainWindow::getBackupFiles( QStringList& files )
}
}
-void KDatMainWindow::setBackupFiles( const QStringList& files )
+void KDatMainWindow::setBackupFiles( const TQStringList& files )
{
_rootNode->setSelected( FALSE );
- QString tmp;
- QStringList filesTmp = files;
- QStringList::Iterator it = filesTmp.begin();
+ TQString tmp;
+ TQStringList filesTmp = files;
+ TQStringList::Iterator it = filesTmp.begin();
for ( ; it != filesTmp.end(); ++it ) {
ArchiveableNode* n = _rootNode;
while ( n ) {
@@ -1231,7 +1231,7 @@ void KDatMainWindow::configureUI( Tape* tape )
// Title bar
if ( tape ) {
- QString title;
+ TQString title;
title = i18n( "KDat: %1" ).arg(tape->getName());
setCaption( title );
setIconText( title );
@@ -1311,7 +1311,7 @@ void KDatMainWindow::configureUI( Tape* tape )
void KDatMainWindow::readProperties( KConfig* config )
{
- QValueList<int> sizes;
+ TQValueList<int> sizes;
sizes << config->readNumEntry( "panner", 50 );
_panner->setSizes( sizes );
}
@@ -1325,7 +1325,7 @@ void KDatMainWindow::saveProperties( KConfig* config )
void KDatMainWindow::create_backup_dialog()
{
/* 2002-01-24 LEW: start of backup-cancel dialog */
- static QString stop_button_text, stop_button_caption;
+ static TQString stop_button_text, stop_button_caption;
stop_button_text =
i18n("Click \"CANCEL\" to stop the backup process.\n"
"For example, you may quickly see that the size of\n"
@@ -1343,26 +1343,26 @@ void KDatMainWindow::create_backup_dialog()
// _backupdialog->resize(370,200); /* 2002-01-28 LEW */
_backupdialog->resize(370,260);
- _lbl = new QLabel( stop_button_text, _backupdialog );
- // _lbl->setGeometry( QRect( 30, 20, 350, 140 ) ); /* 2002-01-28 LEW */
- _lbl->setGeometry( QRect( 30, 20, 350, 200 ) );
+ _lbl = new TQLabel( stop_button_text, _backupdialog );
+ // _lbl->setGeometry( TQRect( 30, 20, 350, 140 ) ); /* 2002-01-28 LEW */
+ _lbl->setGeometry( TQRect( 30, 20, 350, 200 ) );
_cancel = new KPushButton( KStdGuiItem::cancel(), _backupdialog );
_cancel->setFixedSize( 80, _cancel->sizeHint().height() );
_cancel->setEnabled( TRUE );
/* 2002-01-24 LEW: looks like we can't increase the button width
to accomodate a wider message :( */
- // _cancel->setGeometry( QRect( 50, 170, 0, 0 ) ); /* 2002-01-28 LEW */
- _cancel->setGeometry( QRect( 50, 230, 0, 0 ) );
- connect( _cancel, SIGNAL( clicked() ), this, SLOT( backupCancel() ) );
+ // _cancel->setGeometry( TQRect( 50, 170, 0, 0 ) ); /* 2002-01-28 LEW */
+ _cancel->setGeometry( TQRect( 50, 230, 0, 0 ) );
+ connect( _cancel, TQT_SIGNAL( clicked() ), this, TQT_SLOT( backupCancel() ) );
_continue = new KPushButton( KStdGuiItem::cont(), _backupdialog );
_continue->setFixedSize( 80, _continue->sizeHint().height() );
_continue->setEnabled( TRUE );
_continue->setDefault( TRUE );
- // _continue->setGeometry( QRect( 200, 170, 0, 0 ) ); /* 2002-01-28 LEW */
- _continue->setGeometry( QRect( 200, 230, 0, 0 ) );
- connect( _continue, SIGNAL( clicked() ), this, SLOT( backupContinue() ) );
+ // _continue->setGeometry( TQRect( 200, 170, 0, 0 ) ); /* 2002-01-28 LEW */
+ _continue->setGeometry( TQRect( 200, 230, 0, 0 ) );
+ connect( _continue, TQT_SIGNAL( clicked() ), this, TQT_SLOT( backupContinue() ) );
_backupdialog->show();
}