author | andyq <andyq> | 2002-10-21 15:52:50 (UTC) |
---|---|---|
committer | andyq <andyq> | 2002-10-21 15:52:50 (UTC) |
commit | d9ddcd0eb7608321eb2b94ad427868948ea627c2 (patch) (side-by-side diff) | |
tree | 636b771af85cf0b03699fee767d209fadbbd16d3 /noncore/settings/aqpkg | |
parent | 5e2e1e70e6cc7cadce96e42f83951b87e3f2209e (diff) | |
download | opie-d9ddcd0eb7608321eb2b94ad427868948ea627c2.zip opie-d9ddcd0eb7608321eb2b94ad427868948ea627c2.tar.gz opie-d9ddcd0eb7608321eb2b94ad427868948ea627c2.tar.bz2 |
If no packages selected and Apply button pushed, displays message - Nothing to do' and doesn't display Install dialog
-rw-r--r-- | noncore/settings/aqpkg/networkpkgmgr.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/noncore/settings/aqpkg/networkpkgmgr.cpp b/noncore/settings/aqpkg/networkpkgmgr.cpp index d84fb4b..9acaaf1 100644 --- a/noncore/settings/aqpkg/networkpkgmgr.cpp +++ b/noncore/settings/aqpkg/networkpkgmgr.cpp @@ -421,24 +421,33 @@ void NetworkPackageManager :: applyChanges() vector<InstallData> workingPackages; for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild(); item != 0 ; item = (QCheckListItem *)item->nextSibling() ) { if ( item->isOn() ) { InstallData data = dealWithItem( item ); workingPackages.push_back( data ); } } + if ( workingPackages.size() == 0 ) + { + // Nothing to do + QMessageBox::information( this, "Nothing to do", + "No packages selected", "OK" ); + + return; + } + // do the stuff InstallDlgImpl dlg( workingPackages, dataMgr, this, "Install", true ); dlg.showDlg(); // Reload data dataMgr->reloadServerData( LOCAL_SERVER ); dataMgr->reloadServerData( serversList->currentText() ); serverSelected(-1); #ifdef QWS // Finally let the main system update itself |