-rw-r--r-- | noncore/settings/aqpkg/installdlgimpl.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/noncore/settings/aqpkg/installdlgimpl.cpp b/noncore/settings/aqpkg/installdlgimpl.cpp index d4f751c..b92a245 100644 --- a/noncore/settings/aqpkg/installdlgimpl.cpp +++ b/noncore/settings/aqpkg/installdlgimpl.cpp @@ -34,8 +34,9 @@ InstallDlgImpl::InstallDlgImpl( vector<QString> &packageList, DataManager *dataManager, QWidget * parent, const char* name, bool modal, WFlags fl ) : InstallDlg( parent, name, modal, fl ) { + upgradePackages = false; dataMgr = dataManager; vector<Destination>::iterator dit; QString defaultDest = "root"; @@ -98,8 +99,17 @@ InstallDlgImpl::InstallDlgImpl( vector<QString> &packageList, DataManager *dataM connect( &ipkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &))); } +InstallDlgImpl::InstallDlgImpl( QWidget *parent, const char *name, bool modal, WFlags fl ) + : InstallDlg( parent, name, modal, fl ) +{ + upgradePackages = true; + output->setText( "Upgrading installed packages" ); + connect( &ipkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &))); +} + + InstallDlgImpl::~InstallDlgImpl() { } @@ -145,8 +155,19 @@ void InstallDlgImpl :: installSelected() } btnInstall->setEnabled( false ); + if ( upgradePackages ) + { + output->setText( "" ); + + Ipkg ipkg; + connect( &ipkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &))); + ipkg.setOption( "upgrade" ); + ipkg.runIpkg(); + } + else + { output->setText( "" ); Destination *d = dataMgr->getDestination( destination->currentText() ); QString dest = d->getDestinationName(); QString destDir = d->getDestinationPath(); @@ -183,8 +204,9 @@ void InstallDlgImpl :: installSelected() { ipkg.setPackage( *it ); ipkg.runIpkg(); } + } btnInstall->setEnabled( true ); btnInstall->setText( tr( "Close" ) ); } |