author | andyq <andyq> | 2002-11-09 15:39:15 (UTC) |
---|---|---|
committer | andyq <andyq> | 2002-11-09 15:39:15 (UTC) |
commit | 5ab7af2bb5d98aef639cbc2ca14f630813fd4fe9 (patch) (side-by-side diff) | |
tree | 3a43ab203aa57960151ba11a091aefaebbf1a566 /noncore/settings/aqpkg/networkpkgmgr.cpp | |
parent | a121ae6e8e6f16ba355e8c86eba2b98792c93091 (diff) | |
download | opie-5ab7af2bb5d98aef639cbc2ca14f630813fd4fe9.zip opie-5ab7af2bb5d98aef639cbc2ca14f630813fd4fe9.tar.gz opie-5ab7af2bb5d98aef639cbc2ca14f630813fd4fe9.tar.bz2 |
Added filter menu - contains 3 filters - show uninstalled packages,
show installed packages and show upgraded packages
Diffstat (limited to 'noncore/settings/aqpkg/networkpkgmgr.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/aqpkg/networkpkgmgr.cpp | 45 |
1 files changed, 40 insertions, 5 deletions
diff --git a/noncore/settings/aqpkg/networkpkgmgr.cpp b/noncore/settings/aqpkg/networkpkgmgr.cpp index 76c7a9c..d43c6ac 100644 --- a/noncore/settings/aqpkg/networkpkgmgr.cpp +++ b/noncore/settings/aqpkg/networkpkgmgr.cpp @@ -58,4 +58,9 @@ NetworkPackageManager::NetworkPackageManager( DataManager *dataManager, QWidget showJumpTo = cfg.readBoolEntry( "showJumpTo", "true" ); + #endif + showUninstalledPkgs = false; + showInstalledPkgs = false; + showUpgradedPkgs = false; + @@ -65,4 +70,2 @@ NetworkPackageManager::NetworkPackageManager( DataManager *dataManager, QWidget updateData(); -// progressDlg = 0; -// timerId = startTimer( 100 ); } @@ -77,7 +80,4 @@ void NetworkPackageManager :: timerEvent ( QTimerEvent * ) -// showProgressDialog(); // Add server names to listbox updateData(); - -// progressDlg->hide(); } @@ -225,2 +225,18 @@ void NetworkPackageManager :: serverSelected( int ) + // Apply show only uninstalled packages filter + if ( showUninstalledPkgs && it->isInstalled() ) + continue; + + // Apply show only installed packages filter + if ( showInstalledPkgs && !it->isInstalled() ) + continue; + + // Apply show only new installed packages filter + if ( showUpgradedPkgs ) + { + if ( !it->isInstalled() || + compareVersions( it->getInstalledVersion(), it->getVersion() ) != 1 ) + continue; + } + // If the local server, only display installed packages @@ -229,2 +245,3 @@ void NetworkPackageManager :: serverSelected( int ) + text += it->getPackageName(); @@ -771 +788,19 @@ void NetworkPackageManager :: searchForPackage( bool findNext ) } + +void NetworkPackageManager :: showOnlyUninstalledPackages( bool val ) +{ + showUninstalledPkgs = val; + serverSelected( -1 ); +} + +void NetworkPackageManager :: showOnlyInstalledPackages( bool val ) +{ + showInstalledPkgs = val; + serverSelected( -1 ); +} + +void NetworkPackageManager :: showUpgradedPackages( bool val ) +{ + showUpgradedPkgs = val; + serverSelected( -1 ); +} |