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 | |||
@@ -56,15 +56,18 @@ NetworkPackageManager::NetworkPackageManager( DataManager *dataManager, QWidget | |||
56 | cfg.setGroup( "settings" ); | 56 | cfg.setGroup( "settings" ); |
57 | currentlySelectedServer = cfg.readEntry( "selectedServer", "local" ); | 57 | currentlySelectedServer = cfg.readEntry( "selectedServer", "local" ); |
58 | showJumpTo = cfg.readBoolEntry( "showJumpTo", "true" ); | 58 | showJumpTo = cfg.readBoolEntry( "showJumpTo", "true" ); |
59 | |||
59 | #endif | 60 | #endif |
60 | 61 | ||
62 | showUninstalledPkgs = false; | ||
63 | showInstalledPkgs = false; | ||
64 | showUpgradedPkgs = false; | ||
65 | |||
61 | 66 | ||
62 | initGui(); | 67 | initGui(); |
63 | setupConnections(); | 68 | setupConnections(); |
64 | 69 | ||
65 | updateData(); | 70 | updateData(); |
66 | // progressDlg = 0; | ||
67 | // timerId = startTimer( 100 ); | ||
68 | } | 71 | } |
69 | 72 | ||
70 | NetworkPackageManager::~NetworkPackageManager() | 73 | NetworkPackageManager::~NetworkPackageManager() |
@@ -75,11 +78,8 @@ void NetworkPackageManager :: timerEvent ( QTimerEvent * ) | |||
75 | { | 78 | { |
76 | killTimer( timerId ); | 79 | killTimer( timerId ); |
77 | 80 | ||
78 | // showProgressDialog(); | ||
79 | // Add server names to listbox | 81 | // Add server names to listbox |
80 | updateData(); | 82 | updateData(); |
81 | |||
82 | // progressDlg->hide(); | ||
83 | } | 83 | } |
84 | 84 | ||
85 | void NetworkPackageManager :: updateData() | 85 | void NetworkPackageManager :: updateData() |
@@ -223,10 +223,27 @@ void NetworkPackageManager :: serverSelected( int ) | |||
223 | 223 | ||
224 | QString text = ""; | 224 | QString text = ""; |
225 | 225 | ||
226 | // Apply show only uninstalled packages filter | ||
227 | if ( showUninstalledPkgs && it->isInstalled() ) | ||
228 | continue; | ||
229 | |||
230 | // Apply show only installed packages filter | ||
231 | if ( showInstalledPkgs && !it->isInstalled() ) | ||
232 | continue; | ||
233 | |||
234 | // Apply show only new installed packages filter | ||
235 | if ( showUpgradedPkgs ) | ||
236 | { | ||
237 | if ( !it->isInstalled() || | ||
238 | compareVersions( it->getInstalledVersion(), it->getVersion() ) != 1 ) | ||
239 | continue; | ||
240 | } | ||
241 | |||
226 | // If the local server, only display installed packages | 242 | // If the local server, only display installed packages |
227 | if ( serverName == LOCAL_SERVER && !it->isInstalled() ) | 243 | if ( serverName == LOCAL_SERVER && !it->isInstalled() ) |
228 | continue; | 244 | continue; |
229 | 245 | ||
246 | |||
230 | text += it->getPackageName(); | 247 | text += it->getPackageName(); |
231 | if ( it->isInstalled() ) | 248 | if ( it->isInstalled() ) |
232 | { | 249 | { |
@@ -769,3 +786,21 @@ void NetworkPackageManager :: searchForPackage( bool findNext ) | |||
769 | } | 786 | } |
770 | } | 787 | } |
771 | } | 788 | } |
789 | |||
790 | void NetworkPackageManager :: showOnlyUninstalledPackages( bool val ) | ||
791 | { | ||
792 | showUninstalledPkgs = val; | ||
793 | serverSelected( -1 ); | ||
794 | } | ||
795 | |||
796 | void NetworkPackageManager :: showOnlyInstalledPackages( bool val ) | ||
797 | { | ||
798 | showInstalledPkgs = val; | ||
799 | serverSelected( -1 ); | ||
800 | } | ||
801 | |||
802 | void NetworkPackageManager :: showUpgradedPackages( bool val ) | ||
803 | { | ||
804 | showUpgradedPkgs = val; | ||
805 | serverSelected( -1 ); | ||
806 | } | ||