author | andyq <andyq> | 2002-10-21 15:52:50 (UTC) |
---|---|---|
committer | andyq <andyq> | 2002-10-21 15:52:50 (UTC) |
commit | d9ddcd0eb7608321eb2b94ad427868948ea627c2 (patch) (unidiff) | |
tree | 636b771af85cf0b03699fee767d209fadbbd16d3 | |
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 | |||
@@ -417,32 +417,41 @@ void NetworkPackageManager :: applyChanges() | |||
417 | 417 | ||
418 | // Now for each selected item | 418 | // Now for each selected item |
419 | // deal with it | 419 | // deal with it |
420 | 420 | ||
421 | vector<InstallData> workingPackages; | 421 | vector<InstallData> workingPackages; |
422 | for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild(); | 422 | for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild(); |
423 | item != 0 ; | 423 | item != 0 ; |
424 | item = (QCheckListItem *)item->nextSibling() ) | 424 | item = (QCheckListItem *)item->nextSibling() ) |
425 | { | 425 | { |
426 | if ( item->isOn() ) | 426 | if ( item->isOn() ) |
427 | { | 427 | { |
428 | InstallData data = dealWithItem( item ); | 428 | InstallData data = dealWithItem( item ); |
429 | workingPackages.push_back( data ); | 429 | workingPackages.push_back( data ); |
430 | } | 430 | } |
431 | } | 431 | } |
432 | 432 | ||
433 | if ( workingPackages.size() == 0 ) | ||
434 | { | ||
435 | // Nothing to do | ||
436 | QMessageBox::information( this, "Nothing to do", | ||
437 | "No packages selected", "OK" ); | ||
438 | |||
439 | return; | ||
440 | } | ||
441 | |||
433 | // do the stuff | 442 | // do the stuff |
434 | InstallDlgImpl dlg( workingPackages, dataMgr, this, "Install", true ); | 443 | InstallDlgImpl dlg( workingPackages, dataMgr, this, "Install", true ); |
435 | dlg.showDlg(); | 444 | dlg.showDlg(); |
436 | 445 | ||
437 | // Reload data | 446 | // Reload data |
438 | dataMgr->reloadServerData( LOCAL_SERVER ); | 447 | dataMgr->reloadServerData( LOCAL_SERVER ); |
439 | 448 | ||
440 | dataMgr->reloadServerData( serversList->currentText() ); | 449 | dataMgr->reloadServerData( serversList->currentText() ); |
441 | serverSelected(-1); | 450 | serverSelected(-1); |
442 | 451 | ||
443 | #ifdef QWS | 452 | #ifdef QWS |
444 | // Finally let the main system update itself | 453 | // Finally let the main system update itself |
445 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); | 454 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); |
446 | QString lf = QString::null; | 455 | QString lf = QString::null; |
447 | e << lf; | 456 | e << lf; |
448 | #endif | 457 | #endif |