summaryrefslogtreecommitdiff
path: root/noncore/settings/aqpkg/installdlgimpl.cpp
Unidiff
Diffstat (limited to 'noncore/settings/aqpkg/installdlgimpl.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/aqpkg/installdlgimpl.cpp94
1 files changed, 79 insertions, 15 deletions
diff --git a/noncore/settings/aqpkg/installdlgimpl.cpp b/noncore/settings/aqpkg/installdlgimpl.cpp
index 76d0a80..896e370 100644
--- a/noncore/settings/aqpkg/installdlgimpl.cpp
+++ b/noncore/settings/aqpkg/installdlgimpl.cpp
@@ -51,3 +51,3 @@ enum {
51 51
52InstallDlgImpl::InstallDlgImpl( QList<InstallData> &packageList, DataManager *dataManager, const char *title ) 52InstallDlgImpl::InstallDlgImpl( const QList<InstallData> &packageList, DataManager *dataManager, const char *title )
53 : QWidget( 0, 0, 0 ) 53 : QWidget( 0, 0, 0 )
@@ -108,2 +108,3 @@ InstallDlgImpl::InstallDlgImpl( QList<InstallData> &packageList, DataManager *da
108 newitem->recreateLinks = item->recreateLinks; 108 newitem->recreateLinks = item->recreateLinks;
109 packages.append( newitem );
109 110
@@ -111,3 +112,2 @@ InstallDlgImpl::InstallDlgImpl( QList<InstallData> &packageList, DataManager *da
111 { 112 {
112 installList.append( newitem );
113 install.append( QString( " %1\n" ).arg( item->packageName ) ); 113 install.append( QString( " %1\n" ).arg( item->packageName ) );
@@ -116,3 +116,2 @@ InstallDlgImpl::InstallDlgImpl( QList<InstallData> &packageList, DataManager *da
116 { 116 {
117 removeList.append( newitem );
118 remove.append( QString( " %1\n" ).arg( item->packageName ) ); 117 remove.append( QString( " %1\n" ).arg( item->packageName ) );
@@ -121,3 +120,2 @@ InstallDlgImpl::InstallDlgImpl( QList<InstallData> &packageList, DataManager *da
121 { 120 {
122 updateList.append( newitem );
123 QString type; 121 QString type;
@@ -130,2 +128,3 @@ InstallDlgImpl::InstallDlgImpl( QList<InstallData> &packageList, DataManager *da
130 } 128 }
129
131 output->setText( QString( "%1\n%2\n%3\n" ).arg( remove ).arg( install ).arg( upgrade ) ); 130 output->setText( QString( "%1\n%2\n%3\n" ).arg( remove ).arg( install ).arg( upgrade ) );
@@ -270,2 +269,3 @@ void InstallDlgImpl :: installSelected()
270 connect( pIpkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &))); 269 connect( pIpkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &)));
270 connect( pIpkg, SIGNAL(ipkgFinished()), this, SLOT(ipkgFinished()));
271 pIpkg->runIpkg(); 271 pIpkg->runIpkg();
@@ -291,4 +291,9 @@ void InstallDlgImpl :: installSelected()
291 connect( pIpkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &))); 291 connect( pIpkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &)));
292 connect( pIpkg, SIGNAL(ipkgFinished()), this, SLOT(ipkgFinished()));
293
294 firstPackage = TRUE;
295 ipkgFinished();
292 296
293 // First run through the remove list, then the install list then the upgrade list 297 // First run through the remove list, then the install list then the upgrade list
298/*
294 pIpkg->setOption( "remove" ); 299 pIpkg->setOption( "remove" );
@@ -344,14 +349,4 @@ void InstallDlgImpl :: installSelected()
344 pIpkg = 0; 349 pIpkg = 0;
350*/
345 } 351 }
346
347 btnOptions->setEnabled( true );
348// btnInstall->setEnabled( true );
349 btnInstall->setText( tr( "Close" ) );
350 btnInstall->setIconSet( Resource::loadPixmap( "enter" ) );
351
352 btnOptions->setText( tr( "Save output" ) );
353 btnOptions->setIconSet( Resource::loadPixmap( "save" ) );
354
355 if ( destination && destination->currentText() != 0 && destination->currentText() != "" )
356 displayAvailableSpace( destination->currentText() );
357} 352}
@@ -402 +397,70 @@ void InstallDlgImpl :: displayAvailableSpace( const QString &text )
402 397
398void InstallDlgImpl :: ipkgFinished()
399{
400 InstallData *item;
401 if ( firstPackage )
402 item = packages.first();
403 else
404 {
405 // Create symlinks if necessary before moving on to next package
406 pIpkg->createSymLinks();
407
408 item = packages.next();
409 }
410
411 firstPackage = FALSE;
412 if ( item )
413 {
414 pIpkg->setPackage( item->packageName );
415 int tmpFlags = flags;
416
417 if ( item->option == "I" )
418 {
419 pIpkg->setOption( "install" );
420 Destination *d = dataMgr->getDestination( destination->currentText() );
421 pIpkg->setDestination( d->getDestinationName() );
422 pIpkg->setDestinationDir( d->getDestinationPath() );
423
424 if ( d->linkToRoot() )
425 tmpFlags |= MAKE_LINKS;
426 }
427 else if ( item->option == "D" )
428 {
429 pIpkg->setOption( "remove" );
430 pIpkg->setDestination( item->destination->getDestinationName() );
431 pIpkg->setDestinationDir( item->destination->getDestinationPath() );
432
433 if ( item->destination->linkToRoot() )
434 tmpFlags |= MAKE_LINKS;
435 }
436 else
437 {
438 if ( item->option == "R" )
439 pIpkg->setOption( "reinstall" );
440 else
441 pIpkg->setOption( "upgrade" );
442
443 pIpkg->setDestination( item->destination->getDestinationName() );
444 pIpkg->setDestinationDir( item->destination->getDestinationPath() );
445 pIpkg->setPackage( item->packageName );
446
447 tmpFlags |= FORCE_REINSTALL;
448 if ( item->destination->linkToRoot() && item->recreateLinks )
449 tmpFlags |= MAKE_LINKS;
450 }
451 pIpkg->setFlags( tmpFlags, infoLevel );
452 pIpkg->runIpkg();
453 }
454 else
455 {
456 btnOptions->setEnabled( true );
457 btnInstall->setText( tr( "Close" ) );
458 btnInstall->setIconSet( Resource::loadPixmap( "enter" ) );
459
460 btnOptions->setText( tr( "Save output" ) );
461 btnOptions->setIconSet( Resource::loadPixmap( "save" ) );
462
463 if ( destination && destination->currentText() != 0 && destination->currentText() != "" )
464 displayAvailableSpace( destination->currentText() );
465 }
466} \ No newline at end of file