summaryrefslogtreecommitdiff
path: root/noncore/settings/aqpkg/networkpkgmgr.cpp
authorandyq <andyq>2002-11-09 15:39:15 (UTC)
committer andyq <andyq>2002-11-09 15:39:15 (UTC)
commit5ab7af2bb5d98aef639cbc2ca14f630813fd4fe9 (patch) (side-by-side diff)
tree3a43ab203aa57960151ba11a091aefaebbf1a566 /noncore/settings/aqpkg/networkpkgmgr.cpp
parenta121ae6e8e6f16ba355e8c86eba2b98792c93091 (diff)
downloadopie-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.cpp51
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
@@ -58,3 +58,8 @@ 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,5 +225,22 @@ void NetworkPackageManager :: serverSelected( int )
- // 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;
+
@@ -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 );
+}