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
@@ -56,15 +56,18 @@ NetworkPackageManager::NetworkPackageManager( DataManager *dataManager, QWidget
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()
@@ -75,11 +78,8 @@ void NetworkPackageManager :: timerEvent ( QTimerEvent * )
{
killTimer( timerId );
-// showProgressDialog();
// Add server names to listbox
updateData();
-
-// progressDlg->hide();
}
void NetworkPackageManager :: updateData()
@@ -223,9 +223,26 @@ 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() )
@@ -769,3 +786,21 @@ 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 );
+}