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) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/aqpkg/networkpkgmgr.cpp | 51 |
1 files changed, 43 insertions, 8 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 @@ -55,17 +55,20 @@ NetworkPackageManager::NetworkPackageManager( DataManager *dataManager, QWidget Config cfg( "aqpkg" ); cfg.setGroup( "settings" ); currentlySelectedServer = cfg.readEntry( "selectedServer", "local" ); showJumpTo = cfg.readBoolEntry( "showJumpTo", "true" ); + #endif + + showUninstalledPkgs = false; + showInstalledPkgs = false; + showUpgradedPkgs = false; initGui(); setupConnections(); updateData(); -// progressDlg = 0; -// timerId = startTimer( 100 ); } NetworkPackageManager::~NetworkPackageManager() { @@ -74,13 +77,10 @@ NetworkPackageManager::~NetworkPackageManager() void NetworkPackageManager :: timerEvent ( QTimerEvent * ) { killTimer( timerId ); -// showProgressDialog(); // Add server names to listbox updateData(); - -// progressDlg->hide(); } void NetworkPackageManager :: updateData() { @@ -222,11 +222,28 @@ void NetworkPackageManager :: serverSelected( int ) { QString text = ""; - // If the local server, only display installed packages - if ( serverName == LOCAL_SERVER && !it->isInstalled() ) - continue; + // 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 + if ( serverName == LOCAL_SERVER && !it->isInstalled() ) + continue; + text += it->getPackageName(); if ( it->isInstalled() ) { @@ -768,4 +785,22 @@ 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 ); +} |