|
|
@ -58,7 +58,7 @@ void Node::insertNode( Node* child )
|
|
|
|
if ( lastParent != this ) {
|
|
|
|
if ( lastParent != this ) {
|
|
|
|
// Recompute lastDirIndex.
|
|
|
|
// Recompute lastDirIndex.
|
|
|
|
for ( lastDirIndex = 0;
|
|
|
|
for ( lastDirIndex = 0;
|
|
|
|
( lastDirIndex < childCount() ) && ( ((Node*)tqchildAt( lastDirIndex ))->getType() == TapeDirectoryNodeType );
|
|
|
|
( lastDirIndex < childCount() ) && ( ((Node*)childAt( lastDirIndex ))->getType() == TapeDirectoryNodeType );
|
|
|
|
lastDirIndex++ );
|
|
|
|
lastDirIndex++ );
|
|
|
|
lastParent = this;
|
|
|
|
lastParent = this;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -83,7 +83,7 @@ void Node::insertNode( Node* child )
|
|
|
|
while ( min < max ) {
|
|
|
|
while ( min < max ) {
|
|
|
|
mid = ( max - min ) / 2 + min;
|
|
|
|
mid = ( max - min ) / 2 + min;
|
|
|
|
//mid = ( min + max ) / 2;
|
|
|
|
//mid = ( min + max ) / 2;
|
|
|
|
if ( child->getText().compare( tqchildAt( mid )->getText() ) < 0 ) {
|
|
|
|
if ( child->getText().compare( childAt( mid )->getText() ) < 0 ) {
|
|
|
|
max = mid - 1;
|
|
|
|
max = mid - 1;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
min = mid + 1;
|
|
|
|
min = mid + 1;
|
|
|
@ -94,8 +94,8 @@ void Node::insertNode( Node* child )
|
|
|
|
// KLUDGE!
|
|
|
|
// KLUDGE!
|
|
|
|
mid -= 5;
|
|
|
|
mid -= 5;
|
|
|
|
if ( mid < smin ) mid = smin;
|
|
|
|
if ( mid < smin ) mid = smin;
|
|
|
|
if ( ((Node*)tqchildAt( mid ))->getType() != child->getType() ) mid++;
|
|
|
|
if ( ((Node*)childAt( mid ))->getType() != child->getType() ) mid++;
|
|
|
|
for ( ; ( mid <= smax ) && ( child->getText().compare( tqchildAt( mid )->getText() ) > 0 ); mid++ );
|
|
|
|
for ( ; ( mid <= smax ) && ( child->getText().compare( childAt( mid )->getText() ) > 0 ); mid++ );
|
|
|
|
//printf( "index = %d, text = '%s'\n", mid, child->getText().data() );
|
|
|
|
//printf( "index = %d, text = '%s'\n", mid, child->getText().data() );
|
|
|
|
insertChild( mid, child );
|
|
|
|
insertChild( mid, child );
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -181,14 +181,14 @@ bool TapeNode::validate()
|
|
|
|
// Remove deleted archives.
|
|
|
|
// Remove deleted archives.
|
|
|
|
Archive* a;
|
|
|
|
Archive* a;
|
|
|
|
for ( uint j = 0; j < childCount(); ) {
|
|
|
|
for ( uint j = 0; j < childCount(); ) {
|
|
|
|
a = ((ArchiveNode*)tqchildAt( j ))->getArchive();
|
|
|
|
a = ((ArchiveNode*)childAt( j ))->getArchive();
|
|
|
|
for ( i.toFirst(); i.current(); ++i ) {
|
|
|
|
for ( i.toFirst(); i.current(); ++i ) {
|
|
|
|
if ( i.current() == a ) {
|
|
|
|
if ( i.current() == a ) {
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( !i.current() ) {
|
|
|
|
if ( !i.current() ) {
|
|
|
|
removeChild( tqchildAt( j ) );
|
|
|
|
removeChild( childAt( j ) );
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
j++;
|
|
|
|
j++;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -235,8 +235,8 @@ ArchiveNode* TapeNode::findArchiveNode( Archive* archive )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ArchiveNode* n = 0;
|
|
|
|
ArchiveNode* n = 0;
|
|
|
|
for ( uint i = 0; i < childCount(); i++ ) {
|
|
|
|
for ( uint i = 0; i < childCount(); i++ ) {
|
|
|
|
if ( ((ArchiveNode*)tqchildAt( i ))->getArchive() == archive ) {
|
|
|
|
if ( ((ArchiveNode*)childAt( i ))->getArchive() == archive ) {
|
|
|
|
n = (ArchiveNode*)tqchildAt( i );
|
|
|
|
n = (ArchiveNode*)childAt( i );
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -411,7 +411,7 @@ void SelectableNode::doUpdateState()
|
|
|
|
bool hasSelected = FALSE;
|
|
|
|
bool hasSelected = FALSE;
|
|
|
|
bool allSelected = TRUE;
|
|
|
|
bool allSelected = TRUE;
|
|
|
|
for ( uint i = 0; i < childCount(); i++ ) {
|
|
|
|
for ( uint i = 0; i < childCount(); i++ ) {
|
|
|
|
switch ( ((SelectableNode*)tqchildAt( i ))->_state ) {
|
|
|
|
switch ( ((SelectableNode*)childAt( i ))->_state ) {
|
|
|
|
case SelAll:
|
|
|
|
case SelAll:
|
|
|
|
oneSelected = TRUE;
|
|
|
|
oneSelected = TRUE;
|
|
|
|
hasSelected = TRUE;
|
|
|
|
hasSelected = TRUE;
|
|
|
@ -446,12 +446,12 @@ void SelectableNode::doSetSelected( bool select )
|
|
|
|
// All my tqchildren get the same selection state.
|
|
|
|
// All my tqchildren get the same selection state.
|
|
|
|
for ( uint i = 0; i < childCount(); i++ ) {
|
|
|
|
for ( uint i = 0; i < childCount(); i++ ) {
|
|
|
|
if ( select ) {
|
|
|
|
if ( select ) {
|
|
|
|
if ( !((SelectableNode*)tqchildAt( i ))->isSelected() ) {
|
|
|
|
if ( !((SelectableNode*)childAt( i ))->isSelected() ) {
|
|
|
|
((SelectableNode*)tqchildAt( i ))->doSetSelected( TRUE );
|
|
|
|
((SelectableNode*)childAt( i ))->doSetSelected( TRUE );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if ( ((SelectableNode*)tqchildAt( i ))->isSelected() || ((SelectableNode*)tqchildAt( i ))->hasSelectedChildren() ) {
|
|
|
|
if ( ((SelectableNode*)childAt( i ))->isSelected() || ((SelectableNode*)childAt( i ))->hasSelectedChildren() ) {
|
|
|
|
((SelectableNode*)tqchildAt( i ))->doSetSelected( FALSE );
|
|
|
|
((SelectableNode*)childAt( i ))->doSetSelected( FALSE );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -549,7 +549,7 @@ void SelectableNode::paintText( TQPainter* p, int indent, int cellHeight,
|
|
|
|
p->fontMetrics().leading()) / 2);
|
|
|
|
p->fontMetrics().leading()) / 2);
|
|
|
|
if (highlighted) {
|
|
|
|
if (highlighted) {
|
|
|
|
paintHighlight(p, indent, cg, owner->hasFocus(),
|
|
|
|
paintHighlight(p, indent, cg, owner->hasFocus(),
|
|
|
|
(TQt::GUIStyle)owner->tqstyle().tqstyleHint(TQStyle::SH_GUIStyle)); // TQt3 doesn't make this easy ;)
|
|
|
|
(TQt::GUIStyle)owner->tqstyle().styleHint(TQStyle::SH_GUIStyle)); // TQt3 doesn't make this easy ;)
|
|
|
|
p->setPen(cg.base());
|
|
|
|
p->setPen(cg.base());
|
|
|
|
p->setBackgroundColor(cg.text());
|
|
|
|
p->setBackgroundColor(cg.text());
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -657,8 +657,8 @@ void MountedArchiveNode::setSelected( bool select )
|
|
|
|
// Deselect all other archives.
|
|
|
|
// Deselect all other archives.
|
|
|
|
Node* parent = (Node*)getParent();
|
|
|
|
Node* parent = (Node*)getParent();
|
|
|
|
for ( int i = parent->childCount() - 1; i >= 0; i-- ) {
|
|
|
|
for ( int i = parent->childCount() - 1; i >= 0; i-- ) {
|
|
|
|
if ( parent->tqchildAt( i ) != this ) {
|
|
|
|
if ( parent->childAt( i ) != this ) {
|
|
|
|
((SelectableNode*)parent->tqchildAt( i ))->setSelected( FALSE );
|
|
|
|
((SelectableNode*)parent->childAt( i ))->setSelected( FALSE );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -757,8 +757,8 @@ void MountedTapeDirectoryNode::setSelected( bool select )
|
|
|
|
parent = (Node*)parent->getParent();
|
|
|
|
parent = (Node*)parent->getParent();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for ( int i = parent->childCount() - 1; i >= 0; i-- ) {
|
|
|
|
for ( int i = parent->childCount() - 1; i >= 0; i-- ) {
|
|
|
|
if ( parent->tqchildAt( i ) != arcNode ) {
|
|
|
|
if ( parent->childAt( i ) != arcNode ) {
|
|
|
|
((SelectableNode*)parent->tqchildAt( i ))->setSelected( FALSE );
|
|
|
|
((SelectableNode*)parent->childAt( i ))->setSelected( FALSE );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -863,8 +863,8 @@ void MountedTapeFileNode::setSelected( bool select )
|
|
|
|
parent = (Node*)parent->getParent();
|
|
|
|
parent = (Node*)parent->getParent();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for ( int i = parent->childCount() - 1; i >= 0; i-- ) {
|
|
|
|
for ( int i = parent->childCount() - 1; i >= 0; i-- ) {
|
|
|
|
if ( parent->tqchildAt( i ) != arcNode ) {
|
|
|
|
if ( parent->childAt( i ) != arcNode ) {
|
|
|
|
((SelectableNode*)parent->tqchildAt( i ))->setSelected( FALSE );
|
|
|
|
((SelectableNode*)parent->childAt( i ))->setSelected( FALSE );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1304,14 +1304,14 @@ void TapeDriveNode::slotTapeModified( Tape* tape )
|
|
|
|
// Remove deleted archives.
|
|
|
|
// Remove deleted archives.
|
|
|
|
Archive* a;
|
|
|
|
Archive* a;
|
|
|
|
for ( uint j = 0; j < childCount(); ) {
|
|
|
|
for ( uint j = 0; j < childCount(); ) {
|
|
|
|
a = ((MountedArchiveNode*)tqchildAt( j ))->getArchive();
|
|
|
|
a = ((MountedArchiveNode*)childAt( j ))->getArchive();
|
|
|
|
for ( i.toFirst(); i.current(); ++i ) {
|
|
|
|
for ( i.toFirst(); i.current(); ++i ) {
|
|
|
|
if ( i.current() == a ) {
|
|
|
|
if ( i.current() == a ) {
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( !i.current() ) {
|
|
|
|
if ( !i.current() ) {
|
|
|
|
Node::removeChild( tqchildAt( j ) );
|
|
|
|
Node::removeChild( childAt( j ) );
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
j++;
|
|
|
|
j++;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1322,8 +1322,8 @@ MountedArchiveNode* TapeDriveNode::findArchiveNode( Archive* archive )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
MountedArchiveNode* n = 0;
|
|
|
|
MountedArchiveNode* n = 0;
|
|
|
|
for ( uint i = 0; i < childCount(); i++ ) {
|
|
|
|
for ( uint i = 0; i < childCount(); i++ ) {
|
|
|
|
if ( ((MountedArchiveNode*)tqchildAt( i ))->getArchive() == archive ) {
|
|
|
|
if ( ((MountedArchiveNode*)childAt( i ))->getArchive() == archive ) {
|
|
|
|
n = (MountedArchiveNode*)tqchildAt( i );
|
|
|
|
n = (MountedArchiveNode*)childAt( i );
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1417,7 +1417,7 @@ TapeNode* TapeIndexRootNode::findTapeNode( Tape* tape )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TapeNode* n = 0;
|
|
|
|
TapeNode* n = 0;
|
|
|
|
for ( uint i = 0; i < childCount(); i++ ) {
|
|
|
|
for ( uint i = 0; i < childCount(); i++ ) {
|
|
|
|
n = (TapeNode*)tqchildAt( i );
|
|
|
|
n = (TapeNode*)childAt( i );
|
|
|
|
if ( n->getTape() == tape ) {
|
|
|
|
if ( n->getTape() == tape ) {
|
|
|
|
return n;
|
|
|
|
return n;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1575,7 +1575,7 @@ BackupProfileNode* BackupProfileRootNode::findBackupProfileNode( BackupProfile*
|
|
|
|
{
|
|
|
|
{
|
|
|
|
BackupProfileNode* n = 0;
|
|
|
|
BackupProfileNode* n = 0;
|
|
|
|
for ( uint i = 0; i < childCount(); i++ ) {
|
|
|
|
for ( uint i = 0; i < childCount(); i++ ) {
|
|
|
|
n = (BackupProfileNode*)tqchildAt( i );
|
|
|
|
n = (BackupProfileNode*)childAt( i );
|
|
|
|
if ( n->getBackupProfile() == backupProfile ) {
|
|
|
|
if ( n->getBackupProfile() == backupProfile ) {
|
|
|
|
return n;
|
|
|
|
return n;
|
|
|
|
}
|
|
|
|
}
|
|
|
|