author | andyq <andyq> | 2002-11-17 20:03:25 (UTC) |
---|---|---|
committer | andyq <andyq> | 2002-11-17 20:03:25 (UTC) |
commit | d94c9d39ab6e744f848a04c07eac03f20c91987c (patch) (unidiff) | |
tree | a9f32cca7c59ae565ab9caa3caf567100ed07cb4 /noncore/settings | |
parent | a94877f543bf0ebc2ec9c4c931cb5f21713b7872 (diff) | |
download | opie-d94c9d39ab6e744f848a04c07eac03f20c91987c.zip opie-d94c9d39ab6e744f848a04c07eac03f20c91987c.tar.gz opie-d94c9d39ab6e744f848a04c07eac03f20c91987c.tar.bz2 |
Added filter by category, and added extra fields to package display (Section and size)
-rw-r--r-- | noncore/settings/aqpkg/aqpkg.pro | 9 | ||||
-rw-r--r-- | noncore/settings/aqpkg/categoryfilter.ui | 118 | ||||
-rw-r--r-- | noncore/settings/aqpkg/categoryfilterimpl.cpp | 71 | ||||
-rw-r--r-- | noncore/settings/aqpkg/categoryfilterimpl.h | 40 | ||||
-rw-r--r-- | noncore/settings/aqpkg/datamgr.cpp | 10 | ||||
-rw-r--r-- | noncore/settings/aqpkg/datamgr.h | 5 | ||||
-rw-r--r-- | noncore/settings/aqpkg/global.h | 2 | ||||
-rw-r--r-- | noncore/settings/aqpkg/mainwin.cpp | 23 | ||||
-rw-r--r-- | noncore/settings/aqpkg/mainwin.h | 5 | ||||
-rw-r--r-- | noncore/settings/aqpkg/networkpkgmgr.cpp | 59 | ||||
-rw-r--r-- | noncore/settings/aqpkg/networkpkgmgr.h | 4 | ||||
-rw-r--r-- | noncore/settings/aqpkg/package.h | 6 | ||||
-rw-r--r-- | noncore/settings/aqpkg/server.cpp | 19 | ||||
-rw-r--r-- | noncore/settings/aqpkg/server.h | 1 |
14 files changed, 363 insertions, 9 deletions
diff --git a/noncore/settings/aqpkg/aqpkg.pro b/noncore/settings/aqpkg/aqpkg.pro index 301f4f2..6cc5a23 100644 --- a/noncore/settings/aqpkg/aqpkg.pro +++ b/noncore/settings/aqpkg/aqpkg.pro | |||
@@ -16,5 +16,6 @@ HEADERS = global.h \ | |||
16 | helpwindow.h \ | 16 | helpwindow.h \ |
17 | letterpushbutton.h \ | 17 | letterpushbutton.h \ |
18 | inputdlg.h | 18 | inputdlg.h \ |
19 | categoryfilterimpl.h | ||
19 | SOURCES = mainwin.cpp \ | 20 | SOURCES = mainwin.cpp \ |
20 | datamgr.cpp \ | 21 | datamgr.cpp \ |
@@ -34,8 +35,10 @@ SOURCES = mainwin.cpp \ | |||
34 | letterpushbutton.cpp \ | 35 | letterpushbutton.cpp \ |
35 | inputdlg.cpp \ | 36 | inputdlg.cpp \ |
36 | version.cpp | 37 | version.cpp \ |
38 | categoryfilterimpl.cpp | ||
37 | INTERFACES= settings.ui \ | 39 | INTERFACES= settings.ui \ |
38 | install.ui \ | 40 | install.ui \ |
39 | instoptions.ui | 41 | instoptions.ui \ |
42 | categoryfilter.ui | ||
40 | TARGET = aqpkg | 43 | TARGET = aqpkg |
41 | INCLUDEPATH += $(OPIEDIR)/include | 44 | INCLUDEPATH += $(OPIEDIR)/include |
diff --git a/noncore/settings/aqpkg/categoryfilter.ui b/noncore/settings/aqpkg/categoryfilter.ui new file mode 100644 index 0000000..3416243 --- a/dev/null +++ b/noncore/settings/aqpkg/categoryfilter.ui | |||
@@ -0,0 +1,118 @@ | |||
1 | <!DOCTYPE UI><UI> | ||
2 | <class>CategoryFilterDlg</class> | ||
3 | <widget> | ||
4 | <class>QDialog</class> | ||
5 | <property stdset="1"> | ||
6 | <name>name</name> | ||
7 | <cstring>CategoryFilterDlg</cstring> | ||
8 | </property> | ||
9 | <property stdset="1"> | ||
10 | <name>geometry</name> | ||
11 | <rect> | ||
12 | <x>0</x> | ||
13 | <y>0</y> | ||
14 | <width>215</width> | ||
15 | <height>295</height> | ||
16 | </rect> | ||
17 | </property> | ||
18 | <property stdset="1"> | ||
19 | <name>caption</name> | ||
20 | <string>Category Filter</string> | ||
21 | </property> | ||
22 | <grid> | ||
23 | <property stdset="1"> | ||
24 | <name>margin</name> | ||
25 | <number>11</number> | ||
26 | </property> | ||
27 | <property stdset="1"> | ||
28 | <name>spacing</name> | ||
29 | <number>6</number> | ||
30 | </property> | ||
31 | <widget row="1" column="0" > | ||
32 | <class>QLayoutWidget</class> | ||
33 | <property stdset="1"> | ||
34 | <name>name</name> | ||
35 | <cstring>Layout4</cstring> | ||
36 | </property> | ||
37 | <grid> | ||
38 | <property stdset="1"> | ||
39 | <name>margin</name> | ||
40 | <number>0</number> | ||
41 | </property> | ||
42 | <property stdset="1"> | ||
43 | <name>spacing</name> | ||
44 | <number>6</number> | ||
45 | </property> | ||
46 | <widget row="0" column="1" > | ||
47 | <class>QPushButton</class> | ||
48 | <property stdset="1"> | ||
49 | <name>name</name> | ||
50 | <cstring>btnOK</cstring> | ||
51 | </property> | ||
52 | <property stdset="1"> | ||
53 | <name>text</name> | ||
54 | <string>&OK</string> | ||
55 | </property> | ||
56 | </widget> | ||
57 | <widget row="0" column="0" > | ||
58 | <class>QPushButton</class> | ||
59 | <property stdset="1"> | ||
60 | <name>name</name> | ||
61 | <cstring>btnCancel</cstring> | ||
62 | </property> | ||
63 | <property stdset="1"> | ||
64 | <name>text</name> | ||
65 | <string>&Cancel</string> | ||
66 | </property> | ||
67 | </widget> | ||
68 | </grid> | ||
69 | </widget> | ||
70 | <widget row="0" column="0" > | ||
71 | <class>QGroupBox</class> | ||
72 | <property stdset="1"> | ||
73 | <name>name</name> | ||
74 | <cstring>GroupBox1</cstring> | ||
75 | </property> | ||
76 | <property stdset="1"> | ||
77 | <name>title</name> | ||
78 | <string>Select groups to show</string> | ||
79 | </property> | ||
80 | <grid> | ||
81 | <property stdset="1"> | ||
82 | <name>margin</name> | ||
83 | <number>11</number> | ||
84 | </property> | ||
85 | <property stdset="1"> | ||
86 | <name>spacing</name> | ||
87 | <number>6</number> | ||
88 | </property> | ||
89 | <widget row="0" column="0" > | ||
90 | <class>QListBox</class> | ||
91 | <property stdset="1"> | ||
92 | <name>name</name> | ||
93 | <cstring>lstCategories</cstring> | ||
94 | </property> | ||
95 | <property stdset="1"> | ||
96 | <name>selectionMode</name> | ||
97 | <enum>Multi</enum> | ||
98 | </property> | ||
99 | </widget> | ||
100 | </grid> | ||
101 | </widget> | ||
102 | </grid> | ||
103 | </widget> | ||
104 | <connections> | ||
105 | <connection> | ||
106 | <sender>btnCancel</sender> | ||
107 | <signal>clicked()</signal> | ||
108 | <receiver>CategoryFilterDlg</receiver> | ||
109 | <slot>reject()</slot> | ||
110 | </connection> | ||
111 | <connection> | ||
112 | <sender>btnOK</sender> | ||
113 | <signal>clicked()</signal> | ||
114 | <receiver>CategoryFilterDlg</receiver> | ||
115 | <slot>accept()</slot> | ||
116 | </connection> | ||
117 | </connections> | ||
118 | </UI> | ||
diff --git a/noncore/settings/aqpkg/categoryfilterimpl.cpp b/noncore/settings/aqpkg/categoryfilterimpl.cpp new file mode 100644 index 0000000..0746da6 --- a/dev/null +++ b/noncore/settings/aqpkg/categoryfilterimpl.cpp | |||
@@ -0,0 +1,71 @@ | |||
1 | /*************************************************************************** | ||
2 | categoryfilterimpl.cpp - description | ||
3 | ------------------- | ||
4 | begin : Sun Nov 17 2002 | ||
5 | copyright : (C) 2002 by Andy Qua | ||
6 | email : andy.qua@blueyonder.co.uk | ||
7 | ***************************************************************************/ | ||
8 | |||
9 | /*************************************************************************** | ||
10 | * * | ||
11 | * This program is free software; you can redistribute it and/or modify * | ||
12 | * it under the terms of the GNU General Public License as published by * | ||
13 | * the Free Software Foundation; either version 2 of the License, or * | ||
14 | * (at your option) any later version. * | ||
15 | * * | ||
16 | ***************************************************************************/ | ||
17 | #include <iostream> | ||
18 | using namespace std; | ||
19 | |||
20 | #include <qlistbox.h> | ||
21 | #include <qstring.h> | ||
22 | |||
23 | #include "categoryfilterimpl.h" | ||
24 | |||
25 | CategoryFilterImpl :: CategoryFilterImpl(const QString &categories, const QString &selectedCategories, QWidget *parent, const char *name ) | ||
26 | : CategoryFilterDlg(parent,name, true) | ||
27 | { | ||
28 | // Split up categories and add them to the listbox | ||
29 | int start = 1; | ||
30 | |||
31 | QString item; | ||
32 | int end; | ||
33 | do | ||
34 | { | ||
35 | end = categories.find( "#", start ); | ||
36 | item = categories.mid( start, end - start ); | ||
37 | if ( item != "" ) | ||
38 | { | ||
39 | lstCategories->insertItem( item ); | ||
40 | |||
41 | if ( selectedCategories.find( "#" + item + "#" ) != -1 ) | ||
42 | lstCategories->setSelected( lstCategories->count()-1, true ); | ||
43 | } | ||
44 | |||
45 | start = end + 1; | ||
46 | } while ( start < (int)categories.length() ); | ||
47 | |||
48 | lstCategories->sort( true ); | ||
49 | |||
50 | showMaximized(); | ||
51 | } | ||
52 | |||
53 | CategoryFilterImpl :: ~CategoryFilterImpl() | ||
54 | { | ||
55 | } | ||
56 | |||
57 | QString CategoryFilterImpl :: getSelectedFilter() | ||
58 | { | ||
59 | // Grab cetegories from listbox | ||
60 | QString ret = "#"; | ||
61 | |||
62 | for ( int i = 0 ; i < (int)lstCategories->count() ; ++i ) | ||
63 | { | ||
64 | if ( lstCategories->isSelected( i ) ) | ||
65 | ret += lstCategories->text( i ) + "#"; | ||
66 | } | ||
67 | |||
68 | if ( ret == "#" ) | ||
69 | ret = ""; | ||
70 | return ret; | ||
71 | } | ||
diff --git a/noncore/settings/aqpkg/categoryfilterimpl.h b/noncore/settings/aqpkg/categoryfilterimpl.h new file mode 100644 index 0000000..b6b4fd5 --- a/dev/null +++ b/noncore/settings/aqpkg/categoryfilterimpl.h | |||
@@ -0,0 +1,40 @@ | |||
1 | /*************************************************************************** | ||
2 | categoryfilterimpl.h - description | ||
3 | ------------------- | ||
4 | begin : Sun Nov 17 2002 | ||
5 | copyright : (C) 2002 by Andy Qua | ||
6 | email : andy.qua@blueyonder.co.uk | ||
7 | ***************************************************************************/ | ||
8 | |||
9 | /*************************************************************************** | ||
10 | * * | ||
11 | * This program is free software; you can redistribute it and/or modify * | ||
12 | * it under the terms of the GNU General Public License as published by * | ||
13 | * the Free Software Foundation; either version 2 of the License, or * | ||
14 | * (at your option) any later version. * | ||
15 | * * | ||
16 | ***************************************************************************/ | ||
17 | |||
18 | #ifndef CATEGORYFILTERIMPL_H | ||
19 | #define CATEGORYFILTERIMPL_H | ||
20 | |||
21 | #include <qwidget.h> | ||
22 | #include <qstring.h> | ||
23 | |||
24 | #include "categoryfilter.h" | ||
25 | |||
26 | /** | ||
27 | *@author Andy Qua | ||
28 | */ | ||
29 | |||
30 | class CategoryFilterImpl : public CategoryFilterDlg | ||
31 | { | ||
32 | Q_OBJECT | ||
33 | public: | ||
34 | CategoryFilterImpl(const QString &categories, const QString &selectedCategories, QWidget *parent=0, const char *name=0); | ||
35 | ~CategoryFilterImpl(); | ||
36 | |||
37 | QString getSelectedFilter(); | ||
38 | }; | ||
39 | |||
40 | #endif | ||
diff --git a/noncore/settings/aqpkg/datamgr.cpp b/noncore/settings/aqpkg/datamgr.cpp index f342aff..1420242 100644 --- a/noncore/settings/aqpkg/datamgr.cpp +++ b/noncore/settings/aqpkg/datamgr.cpp | |||
@@ -29,7 +29,9 @@ using namespace std; | |||
29 | 29 | ||
30 | 30 | ||
31 | QString DataManager::availableCategories = ""; | ||
31 | DataManager::DataManager() | 32 | DataManager::DataManager() |
32 | { | 33 | { |
33 | activeServer = ""; | 34 | activeServer = ""; |
35 | availableCategories = "#"; | ||
34 | } | 36 | } |
35 | 37 | ||
@@ -208,2 +210,10 @@ void DataManager :: writeOutIpkgConf() | |||
208 | out.close(); | 210 | out.close(); |
209 | } | 211 | } |
212 | |||
213 | |||
214 | void DataManager :: setAvailableCategories( QString section ) | ||
215 | { | ||
216 | section = section.lower(); | ||
217 | if ( availableCategories.find( "#" + section + "#" ) == -1 ) | ||
218 | availableCategories += section + "#"; | ||
219 | } | ||
diff --git a/noncore/settings/aqpkg/datamgr.h b/noncore/settings/aqpkg/datamgr.h index 8c6fb0d..3a64d92 100644 --- a/noncore/settings/aqpkg/datamgr.h +++ b/noncore/settings/aqpkg/datamgr.h | |||
@@ -22,4 +22,6 @@ | |||
22 | using namespace std; | 22 | using namespace std; |
23 | 23 | ||
24 | #include <qstring.h> | ||
25 | |||
24 | #include "server.h" | 26 | #include "server.h" |
25 | #include "destination.h" | 27 | #include "destination.h" |
@@ -54,6 +56,9 @@ public: | |||
54 | void writeOutIpkgConf(); | 56 | void writeOutIpkgConf(); |
55 | 57 | ||
58 | static QString getAvailableCategories() { return availableCategories; } | ||
59 | static void setAvailableCategories( QString section ); | ||
56 | 60 | ||
57 | private: | 61 | private: |
62 | static QString availableCategories; | ||
58 | QString activeServer; | 63 | QString activeServer; |
59 | 64 | ||
diff --git a/noncore/settings/aqpkg/global.h b/noncore/settings/aqpkg/global.h index e65e2a0..609e1e8 100644 --- a/noncore/settings/aqpkg/global.h +++ b/noncore/settings/aqpkg/global.h | |||
@@ -19,5 +19,5 @@ | |||
19 | #define __GLOBAL_H | 19 | #define __GLOBAL_H |
20 | 20 | ||
21 | #define VERSION_TEXT "AQPkg Version 1.0" | 21 | #define VERSION_TEXT "AQPkg Version 1.1" |
22 | 22 | ||
23 | // Uncomment the below line to run on a Linux box rather than a Zaurus | 23 | // Uncomment the below line to run on a Linux box rather than a Zaurus |
diff --git a/noncore/settings/aqpkg/mainwin.cpp b/noncore/settings/aqpkg/mainwin.cpp index 5ccd3c3..0141359 100644 --- a/noncore/settings/aqpkg/mainwin.cpp +++ b/noncore/settings/aqpkg/mainwin.cpp | |||
@@ -55,4 +55,7 @@ MainWindow :: MainWindow( QWidget *p, char *name ) | |||
55 | mnuShowInstalledPkgsId = filter->insertItem( "Show In&stalled Packages", this, SLOT(filterInstalledPackages()), Qt::CTRL+Qt::Key_S ); | 55 | mnuShowInstalledPkgsId = filter->insertItem( "Show In&stalled Packages", this, SLOT(filterInstalledPackages()), Qt::CTRL+Qt::Key_S ); |
56 | mnuShowUpgradedPkgsId = filter->insertItem( "Show U&pdated Packages", this, SLOT(filterUpgradedPackages()), Qt::CTRL+Qt::Key_P ); | 56 | mnuShowUpgradedPkgsId = filter->insertItem( "Show U&pdated Packages", this, SLOT(filterUpgradedPackages()), Qt::CTRL+Qt::Key_P ); |
57 | filter->insertSeparator(); | ||
58 | mnuFilterByCategory = filter->insertItem( "Filter By &Category", this, SLOT(filterCategory()), Qt::CTRL+Qt::Key_C ); | ||
59 | mnuSetFilterCategory = filter->insertItem( "Set Filter C&ategory", this, SLOT(setFilterCategory()), Qt::CTRL+Qt::Key_A ); | ||
57 | 60 | ||
58 | // Create the main menu | 61 | // Create the main menu |
@@ -185,2 +188,22 @@ void MainWindow :: filterUpgradedPackages() | |||
185 | networkPkgWindow->showUpgradedPackages( val ); | 188 | networkPkgWindow->showUpgradedPackages( val ); |
186 | } | 189 | } |
190 | |||
191 | void MainWindow :: setFilterCategory() | ||
192 | { | ||
193 | if ( networkPkgWindow->setFilterCategory( ) ) | ||
194 | filter->setItemChecked( mnuFilterByCategory, true ); | ||
195 | } | ||
196 | |||
197 | void MainWindow :: filterCategory() | ||
198 | { | ||
199 | if ( filter->isItemChecked( mnuFilterByCategory ) ) | ||
200 | { | ||
201 | networkPkgWindow->filterByCategory( false ); | ||
202 | filter->setItemChecked( mnuFilterByCategory, false ); | ||
203 | } | ||
204 | else | ||
205 | { | ||
206 | if ( networkPkgWindow->filterByCategory( true ) ) | ||
207 | filter->setItemChecked( mnuFilterByCategory, true ); | ||
208 | } | ||
209 | } \ No newline at end of file | ||
diff --git a/noncore/settings/aqpkg/mainwin.h b/noncore/settings/aqpkg/mainwin.h index 7b6e0ba..92aba4d 100644 --- a/noncore/settings/aqpkg/mainwin.h +++ b/noncore/settings/aqpkg/mainwin.h | |||
@@ -49,4 +49,6 @@ private: | |||
49 | int mnuShowInstalledPkgsId; | 49 | int mnuShowInstalledPkgsId; |
50 | int mnuShowUpgradedPkgsId; | 50 | int mnuShowUpgradedPkgsId; |
51 | int mnuFilterByCategory; | ||
52 | int mnuSetFilterCategory; | ||
51 | 53 | ||
52 | public slots: | 54 | public slots: |
@@ -60,4 +62,7 @@ public slots: | |||
60 | void filterInstalledPackages(); | 62 | void filterInstalledPackages(); |
61 | void filterUpgradedPackages(); | 63 | void filterUpgradedPackages(); |
64 | void filterCategory(); | ||
65 | void setFilterCategory(); | ||
66 | |||
62 | }; | 67 | }; |
63 | #endif | 68 | #endif |
diff --git a/noncore/settings/aqpkg/networkpkgmgr.cpp b/noncore/settings/aqpkg/networkpkgmgr.cpp index 188f90d..0814121 100644 --- a/noncore/settings/aqpkg/networkpkgmgr.cpp +++ b/noncore/settings/aqpkg/networkpkgmgr.cpp | |||
@@ -41,4 +41,5 @@ using namespace std; | |||
41 | #include "inputdlg.h" | 41 | #include "inputdlg.h" |
42 | #include "letterpushbutton.h" | 42 | #include "letterpushbutton.h" |
43 | #include "categoryfilterimpl.h" | ||
43 | 44 | ||
44 | #include "global.h" | 45 | #include "global.h" |
@@ -63,5 +64,5 @@ NetworkPackageManager::NetworkPackageManager( DataManager *dataManager, QWidget | |||
63 | showInstalledPkgs = false; | 64 | showInstalledPkgs = false; |
64 | showUpgradedPkgs = false; | 65 | showUpgradedPkgs = false; |
65 | 66 | categoryFilterEnabled = false; | |
66 | 67 | ||
67 | initGui(); | 68 | initGui(); |
@@ -240,4 +241,11 @@ void NetworkPackageManager :: serverSelected( int ) | |||
240 | } | 241 | } |
241 | 242 | ||
243 | // Apply the section filter | ||
244 | if ( categoryFilterEnabled && categoryFilter != "" ) | ||
245 | { | ||
246 | if ( it->getSection() == "" || categoryFilter.find( it->getSection().lower() ) == -1 ) | ||
247 | continue; | ||
248 | } | ||
249 | |||
242 | // If the local server, only display installed packages | 250 | // If the local server, only display installed packages |
243 | if ( serverName == LOCAL_SERVER && !it->isInstalled() ) | 251 | if ( serverName == LOCAL_SERVER && !it->isInstalled() ) |
@@ -296,4 +304,7 @@ void NetworkPackageManager :: serverSelected( int ) | |||
296 | } | 304 | } |
297 | } | 305 | } |
306 | |||
307 | new QCheckListItem( item, QString( "Size - " ) + it->getPackageSize() ); | ||
308 | new QCheckListItem( item, QString( "Section - " ) + it->getSection() ); | ||
298 | packagesList->insertItem( item ); | 309 | packagesList->insertItem( item ); |
299 | } | 310 | } |
@@ -326,8 +337,4 @@ void NetworkPackageManager :: updateServer() | |||
326 | // Update the current server | 337 | // Update the current server |
327 | // Display dialog | 338 | // Display dialog |
328 | // ProgressDlg *progDlg = new ProgressDlg( this ); | ||
329 | // QString status = "Updating package lists..."; | ||
330 | // progDlg->show(); | ||
331 | // progDlg->setText( status ); | ||
332 | 339 | ||
333 | // Disable buttons to stop silly people clicking lots on them :) | 340 | // Disable buttons to stop silly people clicking lots on them :) |
@@ -805,2 +812,44 @@ void NetworkPackageManager :: showUpgradedPackages( bool val ) | |||
805 | serverSelected( -1 ); | 812 | serverSelected( -1 ); |
806 | } | 813 | } |
814 | |||
815 | bool NetworkPackageManager :: filterByCategory( bool val ) | ||
816 | { | ||
817 | if ( val ) | ||
818 | { | ||
819 | if ( categoryFilter == "" ) | ||
820 | { | ||
821 | if ( !setFilterCategory() ) | ||
822 | return false; | ||
823 | } | ||
824 | |||
825 | categoryFilterEnabled = true; | ||
826 | serverSelected( -1 ); | ||
827 | return true; | ||
828 | } | ||
829 | else | ||
830 | { | ||
831 | // Turn off filter | ||
832 | categoryFilterEnabled = false; | ||
833 | serverSelected( -1 ); | ||
834 | return false; | ||
835 | } | ||
836 | } | ||
837 | |||
838 | bool NetworkPackageManager :: setFilterCategory( ) | ||
839 | { | ||
840 | // Get categories; | ||
841 | CategoryFilterImpl dlg( DataManager::getAvailableCategories(), categoryFilter, this ); | ||
842 | if ( dlg.exec() == QDialog::Accepted ) | ||
843 | { | ||
844 | categoryFilter = dlg.getSelectedFilter(); | ||
845 | |||
846 | if ( categoryFilter == "" ) | ||
847 | return false; | ||
848 | |||
849 | categoryFilterEnabled = true; | ||
850 | serverSelected( -1 ); | ||
851 | return true; | ||
852 | } | ||
853 | |||
854 | return false; | ||
855 | } | ||
diff --git a/noncore/settings/aqpkg/networkpkgmgr.h b/noncore/settings/aqpkg/networkpkgmgr.h index 937c9b4..46919d7 100644 --- a/noncore/settings/aqpkg/networkpkgmgr.h +++ b/noncore/settings/aqpkg/networkpkgmgr.h | |||
@@ -45,4 +45,6 @@ public: | |||
45 | void showOnlyInstalledPackages( bool val ); | 45 | void showOnlyInstalledPackages( bool val ); |
46 | void showUpgradedPackages( bool val ); | 46 | void showUpgradedPackages( bool val ); |
47 | bool filterByCategory( bool val ); | ||
48 | bool setFilterCategory(); | ||
47 | 49 | ||
48 | private: | 50 | private: |
@@ -59,5 +61,7 @@ private: | |||
59 | QString currentlySelectedServer; | 61 | QString currentlySelectedServer; |
60 | QString lastSearchText; | 62 | QString lastSearchText; |
63 | QString categoryFilter; | ||
61 | 64 | ||
65 | bool categoryFilterEnabled; | ||
62 | bool showJumpTo; | 66 | bool showJumpTo; |
63 | bool showUninstalledPkgs; | 67 | bool showUninstalledPkgs; |
diff --git a/noncore/settings/aqpkg/package.h b/noncore/settings/aqpkg/package.h index 56ef874..7545818 100644 --- a/noncore/settings/aqpkg/package.h +++ b/noncore/settings/aqpkg/package.h | |||
@@ -45,4 +45,6 @@ public: | |||
45 | void setInstalledTo( Destination *d ) { installedTo = d; } | 45 | void setInstalledTo( Destination *d ) { installedTo = d; } |
46 | void setDependancies( QString &deps ) { dependancies = deps; } | 46 | void setDependancies( QString &deps ) { dependancies = deps; } |
47 | void setPackageSize( QString size ) { packageSize = size; } | ||
48 | void setSection( QString sect) { section = sect; } | ||
47 | 49 | ||
48 | Package *getLocalPackage() { return localPackage; } | 50 | Package *getLocalPackage() { return localPackage; } |
@@ -53,4 +55,6 @@ public: | |||
53 | QString getFilename() { return filename; } | 55 | QString getFilename() { return filename; } |
54 | QString getDependancies() { return dependancies; } | 56 | QString getDependancies() { return dependancies; } |
57 | QString getPackageSize() { return packageSize; } | ||
58 | QString getSection() { return section; } | ||
55 | 59 | ||
56 | bool isInstalled(); | 60 | bool isInstalled(); |
@@ -77,4 +81,6 @@ private: | |||
77 | bool differentVersionAvailable; | 81 | bool differentVersionAvailable; |
78 | QString dependancies; | 82 | QString dependancies; |
83 | QString packageSize; | ||
84 | QString section; | ||
79 | 85 | ||
80 | Destination *installedTo; | 86 | Destination *installedTo; |
diff --git a/noncore/settings/aqpkg/server.cpp b/noncore/settings/aqpkg/server.cpp index 539ebf0..7c3257b 100644 --- a/noncore/settings/aqpkg/server.cpp +++ b/noncore/settings/aqpkg/server.cpp | |||
@@ -29,4 +29,5 @@ using namespace std; | |||
29 | 29 | ||
30 | #include "server.h" | 30 | #include "server.h" |
31 | #include "datamgr.h" | ||
31 | 32 | ||
32 | #ifdef QWS | 33 | #ifdef QWS |
@@ -212,4 +213,16 @@ void Server :: readPackageFile( Server *local, bool clearAll, bool installingToR | |||
212 | currPackage->setFilename( value ); | 213 | currPackage->setFilename( value ); |
213 | } | 214 | } |
215 | else if ( key == "Size" ) | ||
216 | { | ||
217 | if ( currPackage ) | ||
218 | currPackage->setPackageSize( value ); | ||
219 | } | ||
220 | else if ( key == "Section" ) | ||
221 | { | ||
222 | if ( currPackage ) | ||
223 | currPackage->setSection( value ); | ||
224 | |||
225 | DataManager::setAvailableCategories( value ); | ||
226 | } | ||
214 | else if ( key == "" ) | 227 | else if ( key == "" ) |
215 | { | 228 | { |
@@ -271,5 +284,11 @@ QString Server :: toString() | |||
271 | 284 | ||
272 | return ret; | 285 | return ret; |
286 | } /* | ||
287 | void addAvailableSection( QString section ) | ||
288 | { | ||
289 | if ( DataManager::availableCategories.find( value ) == -1 ) | ||
290 | // DataManager::availableCategories += "#" + value; | ||
273 | } | 291 | } |
292 | */ | ||
274 | 293 | ||
275 | vector<Package> &Server::getPackageList() | 294 | vector<Package> &Server::getPackageList() |
diff --git a/noncore/settings/aqpkg/server.h b/noncore/settings/aqpkg/server.h index e9f434c..f585b8f 100644 --- a/noncore/settings/aqpkg/server.h +++ b/noncore/settings/aqpkg/server.h | |||
@@ -60,4 +60,5 @@ private: | |||
60 | bool active; | 60 | bool active; |
61 | 61 | ||
62 | |||
62 | vector<Package> packageList; | 63 | vector<Package> packageList; |
63 | }; | 64 | }; |