summaryrefslogtreecommitdiff
path: root/noncore/settings/aqpkg/installdlgimpl.cpp
Side-by-side diff
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 {
-InstallDlgImpl::InstallDlgImpl( QList<InstallData> &packageList, DataManager *dataManager, const char *title )
+InstallDlgImpl::InstallDlgImpl( const QList<InstallData> &packageList, DataManager *dataManager, const char *title )
: QWidget( 0, 0, 0 )
@@ -108,2 +108,3 @@ InstallDlgImpl::InstallDlgImpl( QList<InstallData> &packageList, DataManager *da
newitem->recreateLinks = item->recreateLinks;
+ packages.append( newitem );
@@ -111,3 +112,2 @@ InstallDlgImpl::InstallDlgImpl( QList<InstallData> &packageList, DataManager *da
{
- installList.append( newitem );
install.append( QString( " %1\n" ).arg( item->packageName ) );
@@ -116,3 +116,2 @@ InstallDlgImpl::InstallDlgImpl( QList<InstallData> &packageList, DataManager *da
{
- removeList.append( newitem );
remove.append( QString( " %1\n" ).arg( item->packageName ) );
@@ -121,3 +120,2 @@ InstallDlgImpl::InstallDlgImpl( QList<InstallData> &packageList, DataManager *da
{
- updateList.append( newitem );
QString type;
@@ -130,2 +128,3 @@ InstallDlgImpl::InstallDlgImpl( QList<InstallData> &packageList, DataManager *da
}
+
output->setText( QString( "%1\n%2\n%3\n" ).arg( remove ).arg( install ).arg( upgrade ) );
@@ -270,2 +269,3 @@ void InstallDlgImpl :: installSelected()
connect( pIpkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &)));
+ connect( pIpkg, SIGNAL(ipkgFinished()), this, SLOT(ipkgFinished()));
pIpkg->runIpkg();
@@ -291,4 +291,9 @@ void InstallDlgImpl :: installSelected()
connect( pIpkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &)));
+ connect( pIpkg, SIGNAL(ipkgFinished()), this, SLOT(ipkgFinished()));
+
+ firstPackage = TRUE;
+ ipkgFinished();
// First run through the remove list, then the install list then the upgrade list
+/*
pIpkg->setOption( "remove" );
@@ -344,14 +349,4 @@ void InstallDlgImpl :: installSelected()
pIpkg = 0;
+*/
}
-
- btnOptions->setEnabled( true );
-// btnInstall->setEnabled( true );
- btnInstall->setText( tr( "Close" ) );
- btnInstall->setIconSet( Resource::loadPixmap( "enter" ) );
-
- btnOptions->setText( tr( "Save output" ) );
- btnOptions->setIconSet( Resource::loadPixmap( "save" ) );
-
- if ( destination && destination->currentText() != 0 && destination->currentText() != "" )
- displayAvailableSpace( destination->currentText() );
}
@@ -402 +397,70 @@ void InstallDlgImpl :: displayAvailableSpace( const QString &text )
+void InstallDlgImpl :: ipkgFinished()
+{
+ InstallData *item;
+ if ( firstPackage )
+ item = packages.first();
+ else
+ {
+ // Create symlinks if necessary before moving on to next package
+ pIpkg->createSymLinks();
+
+ item = packages.next();
+ }
+
+ firstPackage = FALSE;
+ if ( item )
+ {
+ pIpkg->setPackage( item->packageName );
+ int tmpFlags = flags;
+
+ if ( item->option == "I" )
+ {
+ pIpkg->setOption( "install" );
+ Destination *d = dataMgr->getDestination( destination->currentText() );
+ pIpkg->setDestination( d->getDestinationName() );
+ pIpkg->setDestinationDir( d->getDestinationPath() );
+
+ if ( d->linkToRoot() )
+ tmpFlags |= MAKE_LINKS;
+ }
+ else if ( item->option == "D" )
+ {
+ pIpkg->setOption( "remove" );
+ pIpkg->setDestination( item->destination->getDestinationName() );
+ pIpkg->setDestinationDir( item->destination->getDestinationPath() );
+
+ if ( item->destination->linkToRoot() )
+ tmpFlags |= MAKE_LINKS;
+ }
+ else
+ {
+ if ( item->option == "R" )
+ pIpkg->setOption( "reinstall" );
+ else
+ pIpkg->setOption( "upgrade" );
+
+ pIpkg->setDestination( item->destination->getDestinationName() );
+ pIpkg->setDestinationDir( item->destination->getDestinationPath() );
+ pIpkg->setPackage( item->packageName );
+
+ tmpFlags |= FORCE_REINSTALL;
+ if ( item->destination->linkToRoot() && item->recreateLinks )
+ tmpFlags |= MAKE_LINKS;
+ }
+ pIpkg->setFlags( tmpFlags, infoLevel );
+ pIpkg->runIpkg();
+ }
+ else
+ {
+ btnOptions->setEnabled( true );
+ btnInstall->setText( tr( "Close" ) );
+ btnInstall->setIconSet( Resource::loadPixmap( "enter" ) );
+
+ btnOptions->setText( tr( "Save output" ) );
+ btnOptions->setIconSet( Resource::loadPixmap( "save" ) );
+
+ if ( destination && destination->currentText() != 0 && destination->currentText() != "" )
+ displayAvailableSpace( destination->currentText() );
+ }
+} \ No newline at end of file