summaryrefslogtreecommitdiff
authorandyq <andyq>2002-12-17 22:30:59 (UTC)
committer andyq <andyq>2002-12-17 22:30:59 (UTC)
commit01640bfdce16d2fd23722a59004a6efd4600c0cf (patch) (side-by-side diff)
tree399d5da7706ab89b41b7da0eb5fec025d0d3db05
parentf18839182d493a49e9411e3dbc070952da7dead9 (diff)
downloadopie-01640bfdce16d2fd23722a59004a6efd4600c0cf.zip
opie-01640bfdce16d2fd23722a59004a6efd4600c0cf.tar.gz
opie-01640bfdce16d2fd23722a59004a6efd4600c0cf.tar.bz2
When ipkg process is run - start/close button changes to abort
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/installdlgimpl.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/noncore/settings/aqpkg/installdlgimpl.cpp b/noncore/settings/aqpkg/installdlgimpl.cpp
index bfb4f62..80c06ba 100644
--- a/noncore/settings/aqpkg/installdlgimpl.cpp
+++ b/noncore/settings/aqpkg/installdlgimpl.cpp
@@ -124,58 +124,71 @@ bool InstallDlgImpl :: showDlg()
{
showMaximized();
bool ret = exec();
return ret;
}
void InstallDlgImpl :: optionsSelected()
{
InstallOptionsDlgImpl opt( flags, this, "Option", true );
opt.exec();
// set options selected from dialog
flags = opt.getFlags();
#ifdef QWS
Config cfg( "aqpkg" );
cfg.setGroup( "settings" );
cfg.writeEntry( "installFlags", flags );
#endif
}
void InstallDlgImpl :: installSelected()
{
-
- if ( btnInstall->text() == "Close" )
+ if ( btnInstall->text() == "Abort" )
+ {
+ if ( pIpkg )
+ {
+ displayText( "\n**** User Clicked ABORT ***" );
+ pIpkg->abort();
+ displayText( "**** Process Aborted ****" );
+ }
+
+ btnInstall->setText( tr( "Close" ) );
+ return;
+ }
+ else if ( btnInstall->text() == "Close" )
{
done( 1 );
return;
}
// Disable buttons
btnOptions->setEnabled( false );
- btnInstall->setEnabled( false );
+// btnInstall->setEnabled( false );
+
+ btnInstall->setText( "Abort" );
if ( pIpkg )
{
output->setText( "" );
connect( pIpkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &)));
pIpkg->runIpkg();
}
else
{
output->setText( "" );
vector<Destination>::iterator d = dataMgr->getDestination( destination->currentText() );
QString dest = d->getDestinationName();
QString destDir = d->getDestinationPath();
int instFlags = flags;
if ( d->linkToRoot() )
instFlags |= MAKE_LINKS;
#ifdef QWS
// Save settings
Config cfg( "aqpkg" );
cfg.setGroup( "settings" );
cfg.writeEntry( "dest", dest );
#endif
@@ -211,52 +224,53 @@ void InstallDlgImpl :: installSelected()
}
flags |= FORCE_REINSTALL;
for ( it = updateList.begin() ; it != updateList.end() ; ++it )
{
if ( it->option == "R" )
pIpkg->setOption( "reinstall" );
else
pIpkg->setOption( "upgrade" );
pIpkg->setDestination( it->destination->getDestinationName() );
pIpkg->setDestinationDir( it->destination->getDestinationPath() );
pIpkg->setPackage( it->packageName );
int tmpFlags = flags;
if ( it->destination->linkToRoot() && it->recreateLinks )
tmpFlags |= MAKE_LINKS;
pIpkg->setFlags( tmpFlags );
pIpkg->runIpkg();
}
delete pIpkg;
}
btnOptions->setEnabled( true );
- btnInstall->setEnabled( true );
+// btnInstall->setEnabled( true );
btnInstall->setText( tr( "Close" ) );
}
+
void InstallDlgImpl :: displayText(const QString &text )
{
QString t = output->text() + "\n" + text;
output->setText( t );
output->setCursorPosition( output->numLines(), 0 );
}
void InstallDlgImpl :: displayAvailableSpace( const QString &text )
{
vector<Destination>::iterator d = dataMgr->getDestination( text );
QString destDir = d->getDestinationPath();
long blockSize = 0;
long totalBlocks = 0;
long availBlocks = 0;
QString space;
if ( Utils::getStorageSpace( (const char *)destDir, &blockSize, &totalBlocks, &availBlocks ) )
{
long mult = blockSize / 1024;
long div = 1024 / blockSize;
if ( !mult ) mult = 1;
if ( !div ) div = 1;