-rw-r--r-- | noncore/settings/aqpkg/networkpkgmgr.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/noncore/settings/aqpkg/networkpkgmgr.cpp b/noncore/settings/aqpkg/networkpkgmgr.cpp index dee834e..ccce401 100644 --- a/noncore/settings/aqpkg/networkpkgmgr.cpp +++ b/noncore/settings/aqpkg/networkpkgmgr.cpp @@ -363,4 +363,5 @@ void NetworkPackageManager :: upgradePackages() void NetworkPackageManager :: downloadPackage() { + bool doUpdate = true; if ( download->text() == "Download" ) { @@ -421,4 +422,5 @@ void NetworkPackageManager :: downloadPackage() else if ( download->text() == "Remove" ) { + doUpdate = false; for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild(); item != 0 ; @@ -437,12 +439,23 @@ void NetworkPackageManager :: downloadPackage() Package *p = dataMgr->getServer( serversList->currentText() )->getPackage( name ); - QFile f( p->getFilename() ); - f.remove(); + + QString msgtext; + msgtext.sprintf( "Are you sure you wish to delete\n%s?", (const char *)p->getPackageName() ); + if ( QMessageBox::information( this, "Are you sure?", + msgtext, "No", "Yes" ) == 1 ) + { + doUpdate = true; + QFile f( p->getFilename() ); + f.remove(); + } } } } - dataMgr->reloadServerData(); - serverSelected( -1 ); + if ( doUpdate ) + { + dataMgr->reloadServerData(); + serverSelected( -1 ); + } } |